mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-30 14:22:07 +00:00
FIX: print warning when ams is drying
jira: [STUDIO-16558] Change-Id: I6313c4c02dce6853d48fd4b175a161bf116865a9 (cherry picked from commit 49609394cd92b7043f4f65debf585cbc37f382bd)
This commit is contained in:
@@ -3336,10 +3336,14 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
|
|||||||
m_check_ext_change_assist->Enable(false);
|
m_check_ext_change_assist->Enable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_selected_ams_drying(obj_)) {
|
{
|
||||||
m_warn_when_drying_sizer->Show(true);
|
const bool show_warn_when_drying = is_selected_ams_drying(obj_);
|
||||||
} else {
|
const bool is_currently_shown = (m_txt_warn_when_drying != nullptr) ? m_txt_warn_when_drying->IsShown() : false;
|
||||||
m_warn_when_drying_sizer->Show(false);
|
if (is_currently_shown != show_warn_when_drying) {
|
||||||
|
m_warn_when_drying_sizer->Show(show_warn_when_drying);
|
||||||
|
Layout();
|
||||||
|
Fit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*reading done*/
|
/*reading done*/
|
||||||
@@ -3941,6 +3945,10 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
|||||||
m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
|
m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool selected_any = false;
|
||||||
|
MaterialItem *first_enabled = nullptr;
|
||||||
|
int first_enabled_id = -1;
|
||||||
|
|
||||||
for (auto i = 0; i < extruders.size(); i++) {
|
for (auto i = 0; i < extruders.size(); i++) {
|
||||||
auto extruder = extruders[i] - 1;
|
auto extruder = extruders[i] - 1;
|
||||||
auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
|
auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
|
||||||
@@ -3970,7 +3978,20 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
|||||||
item = new MaterialItem(m_filament_panel, colour_rgb, _L(display_materials[extruder]));
|
item = new MaterialItem(m_filament_panel, colour_rgb, _L(display_materials[extruder]));
|
||||||
m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
|
m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!item) continue;
|
||||||
|
|
||||||
item->SetToolTip(m_ams_tooltip);
|
item->SetToolTip(m_ams_tooltip);
|
||||||
|
|
||||||
|
if (!selected_any && extruder == m_current_filament_id && item->m_enable) {
|
||||||
|
item->on_selected();
|
||||||
|
selected_any = true;
|
||||||
|
}
|
||||||
|
if (!first_enabled && item->m_enable) {
|
||||||
|
first_enabled = item;
|
||||||
|
first_enabled_id = extruder;
|
||||||
|
}
|
||||||
|
|
||||||
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
|
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
|
||||||
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
|
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
|
||||||
if (!item->m_enable) {return;}
|
if (!item->m_enable) {return;}
|
||||||
@@ -4049,6 +4070,11 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!selected_any && first_enabled) {
|
||||||
|
m_current_filament_id = first_enabled_id;
|
||||||
|
first_enabled->on_selected();
|
||||||
|
}
|
||||||
|
|
||||||
if (use_double_extruder)
|
if (use_double_extruder)
|
||||||
{
|
{
|
||||||
m_filament_left_panel->Show();
|
m_filament_left_panel->Show();
|
||||||
@@ -4459,6 +4485,10 @@ void SelectMachineDialog::set_default_from_sdcard()
|
|||||||
m_materialList.clear();
|
m_materialList.clear();
|
||||||
m_filaments.clear();
|
m_filaments.clear();
|
||||||
|
|
||||||
|
bool selected_any = false;
|
||||||
|
MaterialItem *first_enabled = nullptr;
|
||||||
|
int first_enabled_id = -1;
|
||||||
|
|
||||||
for (auto i = 0; i < m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size(); i++) {
|
for (auto i = 0; i < m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size(); i++) {
|
||||||
FilamentInfo fo = m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info[i];
|
FilamentInfo fo = m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info[i];
|
||||||
|
|
||||||
@@ -4481,6 +4511,17 @@ void SelectMachineDialog::set_default_from_sdcard()
|
|||||||
m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
|
m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!item) continue;
|
||||||
|
|
||||||
|
if (!selected_any && fo.id == m_current_filament_id && item->m_enable) {
|
||||||
|
item->on_selected();
|
||||||
|
selected_any = true;
|
||||||
|
}
|
||||||
|
if (!first_enabled && item->m_enable) {
|
||||||
|
first_enabled = item;
|
||||||
|
first_enabled_id = fo.id;
|
||||||
|
}
|
||||||
|
|
||||||
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
|
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
|
||||||
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, diameters_count, fo](wxMouseEvent& e) {
|
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, diameters_count, fo](wxMouseEvent& e) {
|
||||||
if (!item->m_enable) {return;}
|
if (!item->m_enable) {return;}
|
||||||
@@ -4557,6 +4598,11 @@ void SelectMachineDialog::set_default_from_sdcard()
|
|||||||
wxSize screenSize = wxGetDisplaySize();
|
wxSize screenSize = wxGetDisplaySize();
|
||||||
auto dialogSize = this->GetSize();
|
auto dialogSize = this->GetSize();
|
||||||
|
|
||||||
|
if (!selected_any && first_enabled) {
|
||||||
|
m_current_filament_id = first_enabled_id;
|
||||||
|
first_enabled->on_selected();
|
||||||
|
}
|
||||||
|
|
||||||
reset_ams_material();
|
reset_ams_material();
|
||||||
|
|
||||||
// basic info
|
// basic info
|
||||||
|
|||||||
Reference in New Issue
Block a user