synthetos / g2

g2core - The Next Generation
Other
622 stars 296 forks source link

Edge: axis names in text mode position reports (contains patch) #489

Open prof7bit opened 3 years ago

prof7bit commented 3 years ago

To whom it may concern,

I have fixed the broken position reporting when in text mode. This has been forgotten when the additional axes were added. Below is a diff against the edge branch:


diff --git a/g2core/canonical_machine.cpp b/g2core/canonical_machine.cpp
index ab26d1b8..c2db78c3 100644
--- a/g2core/canonical_machine.cpp
+++ b/g2core/canonical_machine.cpp
@@ -2525,7 +2525,7 @@ static void _print_axis_coord_flt(nvObj_t *nv, const char *format)

 static void _print_pos(nvObj_t *nv, const char *format, uint8_t units)
 {
-    char axes[] = {"XYZABC"};
+    char axes[] = {"XYZUVWABC"};
     uint8_t axis = _axis(nv);
     if (axis >= AXIS_A) { units = DEGREES;}
     sprintf(cs.out_buf, format, axes[axis], nv->value_flt, GET_TEXT_ITEM(msg_units, units));
@@ -2534,7 +2534,7 @@ static void _print_pos(nvObj_t *nv, const char *format, uint8_t units)

 static void _print_hom(nvObj_t *nv, const char *format)
 {
-    char axes[] = {"XYZABC"};
+    char axes[] = {"XYZUVWABC"};
     uint8_t axis = _axis(nv);
     sprintf(cs.out_buf, format, axes[axis], nv->value_int);
     xio_writeline(cs.out_buf);