Move volumetric flag to GCodeParser
This commit is contained in:
@ -37,8 +37,8 @@ void GcodeSuite::M200() {
|
||||
// setting any extruder filament size disables volumetric on the assumption that
|
||||
// slicers either generate in extruder values as cubic mm or as as filament feeds
|
||||
// for all extruders
|
||||
volumetric_enabled = (parser.value_linear_units() != 0.0);
|
||||
if (volumetric_enabled) {
|
||||
parser.volumetric_enabled = (parser.value_linear_units() != 0.0);
|
||||
if (parser.volumetric_enabled) {
|
||||
filament_size[target_extruder] = parser.value_linear_units();
|
||||
// make sure all extruders have some sane value for the filament size
|
||||
for (uint8_t i = 0; i < COUNT(filament_size); i++)
|
||||
|
@ -35,6 +35,8 @@
|
||||
// Must be declared for allocation and to satisfy the linker
|
||||
// Zero values need no initialization.
|
||||
|
||||
bool GCodeParser::volumetric_enabled;
|
||||
|
||||
#if ENABLED(INCH_MODE_SUPPORT)
|
||||
float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor;
|
||||
#endif
|
||||
|
@ -33,10 +33,6 @@
|
||||
|
||||
//#define DEBUG_GCODE_PARSER
|
||||
|
||||
#if ENABLED(INCH_MODE_SUPPORT)
|
||||
extern bool volumetric_enabled;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GCode parser
|
||||
*
|
||||
@ -65,6 +61,8 @@ public:
|
||||
|
||||
// Global states for GCode-level units features
|
||||
|
||||
static bool volumetric_enabled;
|
||||
|
||||
#if ENABLED(INCH_MODE_SUPPORT)
|
||||
static float linear_unit_factor, volumetric_unit_factor;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user