mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-16 15:32:09 +00:00
FIX: print warning when ams drying
jira: [STUDIO-16505] Change-Id: I47b98643a7d941c594eb4d90c08f48a7880c947e (cherry picked from commit bdc833d49440c73a56cf10b723fb02d33d1c3a98)
This commit is contained in:
@@ -1465,6 +1465,35 @@ bool SelectMachineDialog::is_ams_drying(MachineObject* obj)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::is_selected_ams_drying(MachineObject* obj)
|
||||
{
|
||||
if (!obj) return false;
|
||||
|
||||
// If a UI material is selected, only when that material is mapped to an AMS
|
||||
// and that AMS is currently drying.
|
||||
for (const auto &kv : m_materialList) {
|
||||
Material *mat = kv.second;
|
||||
if (!mat || !mat->item) continue;
|
||||
if (!mat->item->m_selected) continue;
|
||||
|
||||
// find mapping entry for this material id
|
||||
for (const FilamentInfo &f : m_ams_mapping_result) {
|
||||
if (f.id != mat->id) continue;
|
||||
|
||||
if (f.ams_id.empty()) return false;
|
||||
|
||||
auto fila_system = obj->GetFilaSystem();
|
||||
if (!fila_system) return false;
|
||||
DevAms* dev_ams = fila_system->GetAmsById(f.ams_id);
|
||||
return (dev_ams && dev_ams->AmsIsDrying());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SelectMachineDialog::prepare(int print_plate_idx)
|
||||
{
|
||||
m_print_plate_idx = print_plate_idx;
|
||||
@@ -3307,7 +3336,7 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
|
||||
m_check_ext_change_assist->Enable(false);
|
||||
}
|
||||
|
||||
if (is_ams_drying(obj_)) {
|
||||
if (is_selected_ams_drying(obj_)) {
|
||||
m_warn_when_drying_sizer->Show(true);
|
||||
} else {
|
||||
m_warn_when_drying_sizer->Show(false);
|
||||
|
||||
@@ -516,6 +516,7 @@ public:
|
||||
int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id) const;
|
||||
|
||||
bool is_ams_drying(MachineObject* obj);
|
||||
bool is_selected_ams_drying(MachineObject* obj);
|
||||
|
||||
PrintFromType get_print_type() {return m_print_type;};
|
||||
wxString format_steel_name(NozzleType type);
|
||||
|
||||
Reference in New Issue
Block a user