FIX:The plate type in dialog of the plate settings does not match the machine

jira: STUDIO-12181
Change-Id: I1d055e3530f19946073c30647c12fbab2be97d50
(cherry picked from commit 54b6cc3c41319ddfc0e3d78f41b903508f0f4c15)
This commit is contained in:
zhou.xu
2025-05-14 11:26:14 +08:00
committed by Noisyfox
parent 0ad5ff27eb
commit 32ca001701
6 changed files with 91 additions and 23 deletions

View File

@@ -4219,6 +4219,32 @@ void PartPlateList::delete_selected_plate()
delete_plate(m_current_plate);
}
bool PartPlateList::check_all_plate_local_bed_type(const std::vector<BedType> &cur_bed_types)
{
std::string bed_type_key = "curr_bed_type";
bool is_ok = true;
for (int i = 0; i < m_plate_list.size(); i++) {
PartPlate *plate = m_plate_list[i];
if (plate->config() && plate->config()->has(bed_type_key)) {
BedType bed_type = plate->config()->opt_enum<BedType>(bed_type_key);
if (bed_type == BedType::btDefault)
continue;
bool find = false;
for (auto tmp_type : cur_bed_types) {
if (bed_type == tmp_type) {
find = true;
break;
}
}
if (!find) {
plate->set_bed_type(BedType::btDefault);
is_ok = false;
}
}
}
return is_ok;
}
//get a plate pointer by index
PartPlate* PartPlateList::get_plate(int index)
{