mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
Use proper config when checking for custom gcode
make sure that the local copy of the config is being used when checking if there is custom gcode otherwise it would be possible it doesn't get run during testing
This commit is contained in:
parent
066e2f6062
commit
529f14d64b
1 changed files with 4 additions and 4 deletions
|
@ -3558,7 +3558,7 @@ LayerResult GCode::process_layer(
|
||||||
m_last_height = height;
|
m_last_height = height;
|
||||||
|
|
||||||
// Set new layer - this will change Z and force a retraction if retract_when_changing_layer is enabled.
|
// Set new layer - this will change Z and force a retraction if retract_when_changing_layer is enabled.
|
||||||
if (! print.config().before_layer_change_gcode.value.empty()) {
|
if (! m_config.before_layer_change_gcode.value.empty()) {
|
||||||
DynamicConfig config;
|
DynamicConfig config;
|
||||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1));
|
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1));
|
||||||
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
||||||
|
@ -3581,7 +3581,7 @@ LayerResult GCode::process_layer(
|
||||||
|
|
||||||
auto insert_timelapse_gcode = [this, print_z, &print]() -> std::string {
|
auto insert_timelapse_gcode = [this, print_z, &print]() -> std::string {
|
||||||
std::string gcode_res;
|
std::string gcode_res;
|
||||||
if (!print.config().time_lapse_gcode.value.empty()) {
|
if (!m_config.time_lapse_gcode.value.empty()) {
|
||||||
DynamicConfig config;
|
DynamicConfig config;
|
||||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||||
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
||||||
|
@ -3609,7 +3609,7 @@ LayerResult GCode::process_layer(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!print.config().time_lapse_gcode.value.empty()) {
|
if (!m_config.time_lapse_gcode.value.empty()) {
|
||||||
DynamicConfig config;
|
DynamicConfig config;
|
||||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||||
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
||||||
|
@ -3619,7 +3619,7 @@ LayerResult GCode::process_layer(
|
||||||
"\n";
|
"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! print.config().layer_change_gcode.value.empty()) {
|
if (! m_config.layer_change_gcode.value.empty()) {
|
||||||
DynamicConfig config;
|
DynamicConfig config;
|
||||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||||
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue