5676 {
5677 std::string gcode;
5678
5679 bool single_filament_print = config.filament_diameter.size() == 1;
5680
5681 if (custom_gcode != nullptr) {
5682
5684
5688
5689 assert(!tool_change || single_filament_print);
5690
5691 std::string pause_print_msg;
5692 int m600_extruder_before_layer = -1;
5693 if (color_change && custom_gcode->
extruder > 0)
5694 m600_extruder_before_layer = custom_gcode->
extruder - 1;
5696 pause_print_msg = custom_gcode->
extra;
5697
5698#if 0
5699
5700 if (color_change || tool_change)
5701 {
5702 assert(m600_extruder_before_layer >= 0);
5703
5704
5706
5707 if (!single_filament_print && m600_extruder_before_layer >= 0 && first_extruder_id != (unsigned)m600_extruder_before_layer
5708
5709 ) {
5714 gcode += "\n";
5715 gcode += "M117 Change filament for Extruder " + std::to_string(m600_extruder_before_layer) + "\n";
5716 }
5717 else {
5719 gcode += "\n";
5720
5721
5722
5724 }
5725 }
5726 else {
5727#endif
5729 {
5730
5733
5734
5736 }
5737 else {
5738
5742 else
5744
5745 }
5747#if 0
5748 }
5749#endif
5750 }
5751
5753 }
Definition Config.hpp:1019
Definition Config.hpp:2910
bool set_key_value(const std::string &opt_key, ConfigOption *opt)
Definition Config.hpp:3022
static const std::string & reserved_tag(ETags tag)
Definition GCodeProcessor.hpp:636
@ Color_Change
Definition GCodeProcessor.hpp:610
@ Pause_Print
Definition GCodeProcessor.hpp:611
@ Custom_Code
Definition GCodeProcessor.hpp:612
std::string unretract(float extra_retract=0.f)
Definition GCodeWriter.cpp:1510
std::string placeholder_parser_process(const std::string &name, const std::string &templ, unsigned int current_filament_id, const DynamicConfig *config_override=nullptr)
Definition GCode.cpp:5319
GCodeWriter & writer()
Definition GCode.hpp:287
Type
Definition CustomGCode.hpp:18
@ PausePrint
Definition CustomGCode.hpp:20
@ ToolChange
Definition CustomGCode.hpp:21
@ Template
Definition CustomGCode.hpp:22
@ ColorChange
Definition CustomGCode.hpp:19
@ gcode
Definition Time.hpp:14
std::string extra
Definition CustomGCode.hpp:47
int extruder
Definition CustomGCode.hpp:42
Type type
Definition CustomGCode.hpp:41
std::string color
Definition CustomGCode.hpp:45