ENH: support auto pa cali for multi_extruder printer

jira: none
Change-Id: I835a0e20de81f9af7c40983e00bdb37ea6c95a68
(cherry picked from commit 4e387d4ace4332a7c2b6c0ab695b80a51597d0c7)
This commit is contained in:
zhimin.zeng
2024-11-05 20:14:57 +08:00
committed by Noisyfox
parent 2db5cae51f
commit 7c5dee1eda
10 changed files with 322 additions and 26 deletions

View File

@@ -1155,6 +1155,15 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
m_pa_profile_items.clear();
m_comboBox_cali_result->SetValue(wxEmptyString);
int extruder_id = obj->get_extruder_id_by_ams_id(std::to_string(ams_id));
NozzleVolumeType nozzle_volume_type = NozzleVolumeType::nvtNormal;
if (obj->m_extder_data.extders[extruder_id].current_nozzle_flow_type == NozzleFlowType::NONE_FLOWTYPE) {
MessageDialog dlg(nullptr, _L("There are unset nozzle types. Please set the nozzle types of all extruders before synchronizing."), _L("Warning"), wxICON_WARNING | wxOK);
dlg.ShowModal();
}
else {
nozzle_volume_type = NozzleVolumeType(obj->m_extder_data.extders[extruder_id].current_nozzle_flow_type - 1);
}
if (obj->cali_version >= 0) {
// add default item
PACalibResult default_item;
@@ -1169,6 +1178,9 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
std::vector<PACalibResult> cali_history = this->obj->pa_calib_tab;
for (auto cali_item : cali_history) {
if (cali_item.filament_id == ams_filament_id) {
if (obj->is_multi_extruders() && (cali_item.extruder_id != extruder_id || cali_item.nozzle_volume_type != nozzle_volume_type)) {
continue;
}
items.push_back(from_u8(cali_item.name));
m_pa_profile_items.push_back(cali_item);
}