|
@ -224,6 +224,9 @@ public: |
|
|
|
|
|
|
|
|
#if ENABLED(INCH_MODE_SUPPORT) |
|
|
#if ENABLED(INCH_MODE_SUPPORT) |
|
|
|
|
|
|
|
|
|
|
|
static inline float mm_to_linear_unit(const float mm) { return mm / linear_unit_factor; } |
|
|
|
|
|
static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } |
|
|
|
|
|
|
|
|
// Init linear units by constructor
|
|
|
// Init linear units by constructor
|
|
|
GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } |
|
|
GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } |
|
|
|
|
|
|
|
@ -244,18 +247,28 @@ public: |
|
|
return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); |
|
|
return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static inline float value_linear_units() { return value_float() * linear_unit_factor; } |
|
|
FORCE_INLINE static float linear_value_to_mm(const float v) { return v * linear_unit_factor; } |
|
|
static inline float value_axis_units(const AxisEnum axis) { return value_float() * axis_unit_factor(axis); } |
|
|
FORCE_INLINE static float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } |
|
|
static inline float value_per_axis_unit(const AxisEnum axis) { return value_float() / axis_unit_factor(axis); } |
|
|
FORCE_INLINE static float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } |
|
|
|
|
|
|
|
|
#else |
|
|
#else |
|
|
|
|
|
|
|
|
FORCE_INLINE static float value_linear_units() { return value_float(); } |
|
|
FORCE_INLINE static float mm_to_linear_unit(const float mm) { return mm; } |
|
|
FORCE_INLINE static float value_axis_units(const AxisEnum a) { UNUSED(a); return value_float(); } |
|
|
FORCE_INLINE static float mm_to_volumetric_unit(const float mm) { return mm; } |
|
|
FORCE_INLINE static float value_per_axis_unit(const AxisEnum a) { UNUSED(a); return value_float(); } |
|
|
|
|
|
|
|
|
FORCE_INLINE static float linear_value_to_mm(const float v) { return v; } |
|
|
|
|
|
FORCE_INLINE static float axis_value_to_mm(const AxisEnum axis, const float v) { UNUSED(axis); return v; } |
|
|
|
|
|
FORCE_INLINE static float per_axis_value(const AxisEnum axis, const float v) { UNUSED(axis); return v; } |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#define LINEAR_UNIT(V) parser.mm_to_linear_unit(V) |
|
|
|
|
|
#define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V) |
|
|
|
|
|
|
|
|
|
|
|
static inline float value_linear_units() { return linear_value_to_mm(value_float()); } |
|
|
|
|
|
static inline float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } |
|
|
|
|
|
static inline float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } |
|
|
|
|
|
|
|
|
#if ENABLED(TEMPERATURE_UNITS_SUPPORT) |
|
|
#if ENABLED(TEMPERATURE_UNITS_SUPPORT) |
|
|
|
|
|
|
|
|
static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } |
|
|
static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } |
|
@ -306,11 +319,15 @@ public: |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#define TEMP_UNIT(N) parser.to_temp_units(N) |
|
|
|
|
|
|
|
|
#else // !TEMPERATURE_UNITS_SUPPORT
|
|
|
#else // !TEMPERATURE_UNITS_SUPPORT
|
|
|
|
|
|
|
|
|
FORCE_INLINE static float value_celsius() { return value_float(); } |
|
|
FORCE_INLINE static float value_celsius() { return value_float(); } |
|
|
FORCE_INLINE static float value_celsius_diff() { return value_float(); } |
|
|
FORCE_INLINE static float value_celsius_diff() { return value_float(); } |
|
|
|
|
|
|
|
|
|
|
|
#define TEMP_UNIT(N) (N) |
|
|
|
|
|
|
|
|
#endif // !TEMPERATURE_UNITS_SUPPORT
|
|
|
#endif // !TEMPERATURE_UNITS_SUPPORT
|
|
|
|
|
|
|
|
|
FORCE_INLINE static float value_feedrate() { return value_linear_units(); } |
|
|
FORCE_INLINE static float value_feedrate() { return value_linear_units(); } |
|
|