ENH: add tpu exist flag in place holder
jira: NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Ieba35adde23e1ce1169b10955bafbbf2bc856663
This commit is contained in:
parent
21f91c3b1d
commit
5c6264cf9f
|
@ -2316,6 +2316,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
float outer_wall_volumetric_speed = get_outer_wall_volumetric_speed(m_config, print, initial_non_support_extruder_id, get_extruder_id(initial_non_support_extruder_id));
|
float outer_wall_volumetric_speed = get_outer_wall_volumetric_speed(m_config, print, initial_non_support_extruder_id, get_extruder_id(initial_non_support_extruder_id));
|
||||||
m_placeholder_parser.set("outer_wall_volumetric_speed", new ConfigOptionFloat(outer_wall_volumetric_speed));
|
m_placeholder_parser.set("outer_wall_volumetric_speed", new ConfigOptionFloat(outer_wall_volumetric_speed));
|
||||||
|
|
||||||
|
auto first_layer_filaments = print.get_slice_used_filaments(true);
|
||||||
|
bool has_tpu_in_first_layer = std::any_of(first_layer_filaments.begin(), first_layer_filaments.end(), [&](unsigned int idx) { return m_config.filament_type.values[idx] == "TPU"; });
|
||||||
|
m_placeholder_parser.set("has_tpu_in_first_layer", new ConfigOptionBool(has_tpu_in_first_layer));
|
||||||
|
|
||||||
if (print.calib_params().mode == CalibMode::Calib_PA_Line) {
|
if (print.calib_params().mode == CalibMode::Calib_PA_Line) {
|
||||||
m_placeholder_parser.set("scan_first_layer", new ConfigOptionBool(false));
|
m_placeholder_parser.set("scan_first_layer", new ConfigOptionBool(false));
|
||||||
}
|
}
|
||||||
|
@ -2350,7 +2354,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
DynamicConfig config;
|
DynamicConfig config;
|
||||||
config.set_key_value("filament_extruder_id", new ConfigOptionInt((int)(initial_non_support_extruder_id)));
|
config.set_key_value("filament_extruder_id", new ConfigOptionInt((int)(initial_non_support_extruder_id)));
|
||||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||||
std::string filament_start_gcode = this->placeholder_parser_process("filament_start_gcode", print.config().filament_start_gcode.values.at(initial_non_support_extruder_id), initial_non_support_extruder_id);
|
std::string filament_start_gcode = this->placeholder_parser_process("filament_start_gcode", print.config().filament_start_gcode.values.at(initial_non_support_extruder_id), initial_non_support_extruder_id,&config);
|
||||||
file.writeln(filament_start_gcode);
|
file.writeln(filament_start_gcode);
|
||||||
// mark the first filament used in print
|
// mark the first filament used in print
|
||||||
file.write_format(";VT%d\n", initial_extruder_id);
|
file.write_format(";VT%d\n", initial_extruder_id);
|
||||||
|
|
Loading…
Reference in New Issue