ENH: check wethether filaments print on first layer

Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I1cc7cd9e9bbbcdf72112c0949196c09ef414cf91
(cherry picked from commit 67039a6f4d51482fe689a2aad0a900f3339a5c62)
This commit is contained in:
qing.zhang
2024-10-25 09:37:56 +08:00
committed by Noisyfox
parent c77be9cf3b
commit 1b70bd38f2
7 changed files with 28 additions and 28 deletions

View File

@@ -1609,23 +1609,16 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
m_processor.result().long_retraction_when_cut = activate_long_retraction_when_cut;
{ //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));
const ConfigOptionInts *bed_temp_opt = m_config.option<ConfigOptionInts>(get_bed_temp_1st_layer_key(m_config.curr_bed_type));
std::vector<int> conflict_filament;
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 (cur_bed_temp == 0) {
conflict_filament.push_back(extruder_id);
}
if (m_processor.result().bed_match_result.match == false)
break;
}
m_processor.result().filament_printable_reuslt = FilamentPrintableResult(conflict_filament, bed_type_to_gcode_string(m_config.curr_bed_type));
}
// check gcode is valid in multi_extruder printabele area
int extruder_size = m_print->config().nozzle_diameter.values.size();