diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2018-02-22 10:59:47 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2018-02-22 10:59:47 +0300 |
commit | 81eff20ad193be012450f8f8d08f0e90fd5a62e8 (patch) | |
tree | 0f07cf0c87f77020b6bb42f0d88ffe51898fe8c9 /xs/src/libslic3r/GCode.cpp | |
parent | 36601723a208a34fd55ea34c67bd8548246d708d (diff) |
GCode Preview - Added Custom extrusion role + extended layers range for GCode preview
Diffstat (limited to 'xs/src/libslic3r/GCode.cpp')
-rw-r--r-- | xs/src/libslic3r/GCode.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 2c2df6ec3..28c03ba2c 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -587,6 +587,15 @@ void GCode::_do_export(Print &print, FILE *file, GCodePreviewData *preview_data) this->_print_first_layer_bed_temperature(file, print, start_gcode, initial_extruder_id, true); // Set extruder(s) temperature before and after start G-code. this->_print_first_layer_extruder_temperatures(file, print, start_gcode, initial_extruder_id, false); + + if (m_enable_analyzer) + { + // adds tag for analyzer + char buf[32]; + sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erCustom); + _writeln(file, buf); + } + // Write the custom start G-code _writeln(file, start_gcode); // Process filament-specific gcode in extruder order. @@ -770,6 +779,15 @@ void GCode::_do_export(Print &print, FILE *file, GCodePreviewData *preview_data) // Write end commands to file. _write(file, this->retract()); _write(file, m_writer.set_fan(false)); + + if (m_enable_analyzer) + { + // adds tag for analyzer + char buf[32]; + sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erCustom); + _writeln(file, buf); + } + // Process filament-specific gcode in extruder order. if (print.config.single_extruder_multi_material) { // Process the end_filament_gcode for the active filament only. |