diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index 47c105162e..5262ab497d 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -1132,6 +1132,15 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt) return 0; }; + 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; @@ -1144,6 +1153,9 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt) std::vector 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); } diff --git a/src/slic3r/GUI/CaliHistoryDialog.cpp b/src/slic3r/GUI/CaliHistoryDialog.cpp index c34ba1aac6..4c29fd6874 100644 --- a/src/slic3r/GUI/CaliHistoryDialog.cpp +++ b/src/slic3r/GUI/CaliHistoryDialog.cpp @@ -849,7 +849,7 @@ void NewCalibrationHistoryDialog::on_ok(wxCommandEvent &event) } m_new_result.extruder_id = get_extruder_id(m_comboBox_extruder->GetSelection()); - m_new_result.nozzle_volume_type = NozzleVolumeType(m_comboBox_extruder->GetSelection()); + m_new_result.nozzle_volume_type = NozzleVolumeType(m_comboBox_nozzle_type->GetSelection()); } auto filament_item = map_filament_items[m_comboBox_filament->GetValue().ToStdString()]; diff --git a/src/slic3r/Utils/CalibUtils.hpp b/src/slic3r/Utils/CalibUtils.hpp index c6042a5955..2e229c109d 100644 --- a/src/slic3r/Utils/CalibUtils.hpp +++ b/src/slic3r/Utils/CalibUtils.hpp @@ -78,7 +78,7 @@ private: }; extern void get_default_k_n_value(const std::string &filament_id, float &k, float &n); - extern wxString get_nozzle_volume_type_name(NozzleVolumeType type); + } } \ No newline at end of file