mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 18:29:01 +08:00
Wrap in brackets to restrict scope of temporary variables.
This commit is contained in:
parent
f8e222c722
commit
d1446fe2af
@ -130,12 +130,13 @@ PrintGCode::output()
|
|||||||
|
|
||||||
// Apply gcode math to start gcode
|
// Apply gcode math to start gcode
|
||||||
fh << apply_math(gcodegen.placeholder_parser->process(config.start_gcode.value));
|
fh << apply_math(gcodegen.placeholder_parser->process(config.start_gcode.value));
|
||||||
|
{
|
||||||
auto filament_extruder {0U};
|
auto filament_extruder {0U};
|
||||||
for(const auto& start_gcode : config.start_filament_gcode.values) {
|
for(const auto& start_gcode : config.start_filament_gcode.values) {
|
||||||
gcodegen.placeholder_parser->set("filament_extruder_id", filament_extruder++);
|
gcodegen.placeholder_parser->set("filament_extruder_id", filament_extruder++);
|
||||||
fh << apply_math(gcodegen.placeholder_parser->process(start_gcode));
|
fh << apply_math(gcodegen.placeholder_parser->process(start_gcode));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (include_start_extruder_temp) this->_print_first_layer_temperature(1);
|
if (include_start_extruder_temp) this->_print_first_layer_temperature(1);
|
||||||
|
|
||||||
@ -281,11 +282,13 @@ PrintGCode::output()
|
|||||||
// Write end commands to file.
|
// Write end commands to file.
|
||||||
fh << gcodegen.retract(); // TODO: process this retract through PressureRegulator in order to discharge fully
|
fh << gcodegen.retract(); // TODO: process this retract through PressureRegulator in order to discharge fully
|
||||||
|
|
||||||
|
{
|
||||||
auto filament_extruder {0U};
|
auto filament_extruder {0U};
|
||||||
for(const auto& end_gcode : config.end_filament_gcode.values) {
|
for(const auto& end_gcode : config.end_filament_gcode.values) {
|
||||||
gcodegen.placeholder_parser->set("filament_extruder_id", filament_extruder++);
|
gcodegen.placeholder_parser->set("filament_extruder_id", filament_extruder++);
|
||||||
fh << apply_math(gcodegen.placeholder_parser->process(end_gcode));
|
fh << apply_math(gcodegen.placeholder_parser->process(end_gcode));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fh << apply_math(gcodegen.placeholder_parser->process(config.end_gcode));
|
fh << apply_math(gcodegen.placeholder_parser->process(config.end_gcode));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user