From: Jeff E. <gi...@gi...> - 2010-05-31 22:30:15
|
allow "conversion" of angular units since we only support one angular unit (degrees), this function is a do-nothing, but calling it is better future-proofing than not calling it. It's also better documentation, since there won't be "missing" convertLinearUnits calls for the ABC axes. http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=121d020 --- src/emc/usr_intf/shcom.cc | 33 ++------------------------------- src/emc/usr_intf/shcom.hh | 1 + 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/emc/usr_intf/shcom.cc b/src/emc/usr_intf/shcom.cc index 735a7fe..e51f81d 100644 --- a/src/emc/usr_intf/shcom.cc +++ b/src/emc/usr_intf/shcom.cc @@ -409,40 +409,11 @@ double convertLinearUnits(double u) return u; } -/*! \todo Another #if 0 */ -#if 0 -static double convertAngularUnits(double u) +double convertAngularUnits(double u) { - double in_deg; - - /* convert u to deg */ - in_deg = u / emcStatus->motion.traj.angularUnits; - - /* convert u to display units */ - switch (angularUnitConversion) { - case ANGULAR_UNITS_DEG: - return in_deg; - break; - case ANGULAR_UNITS_RAD: - return in_deg * RAD_PER_DEG; - break; - case ANGULAR_UNITS_GRAD: - return in_deg * GRAD_PER_DEG; - break; - case ANGULAR_UNITS_AUTO: - return in_deg; /*! \todo FIXME-- program units always degrees now */ - break; - - case ANGULAR_UNITS_CUSTOM: - return u; - break; - - } - - /* should never get here */ + // Angular units are always degrees return u; } -#endif // polarities for axis jogging, from ini file static int jogPol[EMC_AXIS_MAX]; diff --git a/src/emc/usr_intf/shcom.hh b/src/emc/usr_intf/shcom.hh index a6d5914..f3005cb 100644 --- a/src/emc/usr_intf/shcom.hh +++ b/src/emc/usr_intf/shcom.hh @@ -92,6 +92,7 @@ extern int updateError(); extern int emcCommandWaitReceived(int serial_number); extern int emcCommandWaitDone(int serial_number); extern double convertLinearUnits(double u); +extern double convertAngularUnits(double u); extern int sendDebug(int level); extern int sendEstop(); extern int sendEstopReset(); |