ENH: add bed match result after gcode export

1. Add bed macth result after doing gcode export,according to filaments
used in first layer

jira: [NEW]

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Icf70fce0310b86fffc5276fb8fb3bf4cc14afcb0
This commit is contained in:
xun.zhang
2023-10-10 19:22:01 +08:00
committed by Lane.Wei
parent 76f876a3c6
commit 700c574224
4 changed files with 42 additions and 0 deletions

View File

@@ -1184,6 +1184,27 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
}
m_processor.result().timelapse_warning_code = m_timelapse_warning_code;
m_processor.result().support_traditional_timelapse = m_support_traditional_timelapse;
{ //BBS:check bed and filament compatible
const ConfigOptionDef *bed_type_def = print_config_def.get("curr_bed_type");
assert(bed_type_def != nullptr);
const t_config_enum_values *bed_type_keys_map = bed_type_def->enum_keys_map;
const ConfigOptionInts *bed_temp_opt = m_config.option<ConfigOptionInts>(get_bed_temp_key(m_config.curr_bed_type));
for(auto extruder_id : m_initial_layer_extruders){
int cur_bed_temp = bed_temp_opt->get_at(extruder_id);
if (cur_bed_temp == 0 && bed_type_keys_map != nullptr) {
for (auto item : *bed_type_keys_map) {
if (item.second == m_config.curr_bed_type) {
m_processor.result().bed_match_result = BedMatchResult(false, item.first, extruder_id);
break;
}
}
}
if (m_processor.result().bed_match_result.match == false)
break;
}
}
m_processor.finalize(true);
// DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics);
@@ -3548,6 +3569,12 @@ GCode::LayerResult GCode::process_layer(
}
}
}
if (first_layer) {
for (auto iter = by_extruder.begin(); iter != by_extruder.end(); ++iter) {
if (!iter->second.empty())
m_initial_layer_extruders.insert(iter->first);
}
}
#if 0
// Apply spiral vase post-processing if this layer contains suitable geometry