timelapse gcode

This commit is contained in:
SoftFever 2023-10-26 13:16:47 +08:00
parent a6003cb20a
commit 9e93b51777
2 changed files with 23 additions and 10 deletions

View file

@ -3408,6 +3408,7 @@ LayerResult GCode::process_layer(
gcode += this->change_layer(print_z); // this will increase m_layer_index gcode += this->change_layer(print_z); // this will increase m_layer_index
m_layer = &layer; m_layer = &layer;
m_object_layer_over_raft = false; m_object_layer_over_raft = false;
if(is_BBL_Printer()){
if (printer_structure == PrinterStructure::psI3 && !need_insert_timelapse_gcode_for_traditional && !m_spiral_vase && print.config().print_sequence == PrintSequence::ByLayer) { if (printer_structure == PrinterStructure::psI3 && !need_insert_timelapse_gcode_for_traditional && !m_spiral_vase && print.config().print_sequence == PrintSequence::ByLayer) {
std::string timepals_gcode = insert_timelapse_gcode(); std::string timepals_gcode = insert_timelapse_gcode();
gcode += timepals_gcode; gcode += timepals_gcode;
@ -3420,6 +3421,17 @@ LayerResult GCode::process_layer(
m_writer.set_position(pos); m_writer.set_position(pos);
} }
} }
} else {
if (!print.config().time_lapse_gcode.value.empty()) {
DynamicConfig config;
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("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
gcode += this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.extruder()->id(),
&config) +
"\n";
}
}
if (! print.config().layer_change_gcode.value.empty()) { if (! print.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));

View file

@ -734,6 +734,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool allow_overhang_reverse = has_detect_overhang_wall && !has_spiral_vase; bool allow_overhang_reverse = has_detect_overhang_wall && !has_spiral_vase;
toggle_field("overhang_reverse", allow_overhang_reverse); toggle_field("overhang_reverse", allow_overhang_reverse);
toggle_line("overhang_reverse_threshold", allow_overhang_reverse && has_overhang_reverse); toggle_line("overhang_reverse_threshold", allow_overhang_reverse && has_overhang_reverse);
toggle_line("timelapse_type", is_BBL_Printer);
} }
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/) void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)