mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
ENH:When the AMS option is turned on or off, update the correct thumbnail
jira: none Change-Id: Ia001e4baa7de72ab077cf0fb76c45d4cb8bac088 (cherry picked from commit 89aa62f8b4cd11fa10a898956f1c57ae1ef64a70)
This commit is contained in:
@@ -116,24 +116,6 @@ void SyncAmsInfoDialog::updata_ui_data_after_connected_printer() {
|
||||
m_button_cancel->Show();
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::update_ams_check(MachineObject *obj)
|
||||
{
|
||||
if (!obj) { return; }
|
||||
|
||||
if (!obj->is_enable_np) {
|
||||
if (obj->has_ams()) {
|
||||
//m_checkbox_list["use_ams"]->Show();
|
||||
m_checkbox_list["use_ams"]->setValue("on");
|
||||
} else {
|
||||
m_checkbox_list["use_ams"]->Hide();
|
||||
//m_checkbox_list["use_ams"]->setValue("off");
|
||||
}
|
||||
} else {
|
||||
m_checkbox_list["use_ams"]->Hide();
|
||||
m_checkbox_list["use_ams"]->setValue("on");
|
||||
}
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::update_select_layout(MachineObject *obj)
|
||||
{
|
||||
m_checkbox_list["timelapse"]->Hide();
|
||||
@@ -923,11 +905,6 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
|
||||
|
||||
auto option_use_ams = new PrintOption(m_options_other, _L("Use AMS"), wxEmptyString, ops_no_auto);
|
||||
|
||||
option_use_ams->Bind(EVT_SWITCH_PRINT_OPTION, [this](auto &e) {
|
||||
m_ams_mapping_result.clear();
|
||||
sync_ams_mapping_result(m_ams_mapping_result);
|
||||
});
|
||||
|
||||
option_use_ams->setValue("on");
|
||||
m_sizer_options_timelapse->Add(option_timelapse, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_use_ams, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
@@ -2375,7 +2352,6 @@ void SyncAmsInfoDialog::on_timer(wxTimerEvent &event)
|
||||
|
||||
if (!m_check_flag && obj_->is_info_ready()) {
|
||||
update_select_layout(obj_);
|
||||
update_ams_check(obj_);
|
||||
m_check_flag = true;
|
||||
}
|
||||
|
||||
@@ -2410,7 +2386,6 @@ void SyncAmsInfoDialog::update_show_status()
|
||||
NetworkAgent * agent = Slic3r::GUI::wxGetApp().getAgent();
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!agent) {
|
||||
update_ams_check(nullptr);
|
||||
return;
|
||||
}
|
||||
if (!dev) return;
|
||||
@@ -2419,7 +2394,6 @@ void SyncAmsInfoDialog::update_show_status()
|
||||
if (is_must_finish_slice_then_connected_printer()) { return; }
|
||||
MachineObject * obj_ = dev->get_selected_machine();
|
||||
if (!obj_) {
|
||||
update_ams_check(nullptr);
|
||||
if (agent) {
|
||||
if (agent->is_user_login()) {
|
||||
show_status(PrintDialogStatus::PrintStatusInvalidPrinter);
|
||||
@@ -2462,19 +2436,10 @@ void SyncAmsInfoDialog::update_show_status()
|
||||
}
|
||||
|
||||
// do ams mapping if no ams result
|
||||
bool clean_ams_mapping = false;
|
||||
if (m_ams_mapping_result.empty()) {
|
||||
if (m_checkbox_list.find("use_ams") != m_checkbox_list.end() && m_checkbox_list["use_ams"]->getValue() == "on") {
|
||||
do_ams_mapping(obj_);
|
||||
} else {
|
||||
clean_ams_mapping = true;
|
||||
}
|
||||
do_ams_mapping(obj_);
|
||||
}
|
||||
|
||||
if (clean_ams_mapping) {
|
||||
m_ams_mapping_result.clear();
|
||||
sync_ams_mapping_result(m_ams_mapping_result);
|
||||
}
|
||||
|
||||
// reading done
|
||||
if (wxGetApp().app_config && wxGetApp().app_config->get("internal_debug").empty()) {
|
||||
@@ -2529,19 +2494,6 @@ void SyncAmsInfoDialog::update_show_status()
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_checkbox_list["use_ams"]->getValue() != "on") {
|
||||
m_ams_mapping_result.clear();
|
||||
sync_ams_mapping_result(m_ams_mapping_result);
|
||||
|
||||
if (has_timelapse_warning()) {
|
||||
show_status(PrintDialogStatus::PrintStatusTimelapseWarning);
|
||||
} else {
|
||||
show_status(PrintDialogStatus::PrintStatusDisableAms);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// do ams mapping if no ams result
|
||||
if (m_ams_mapping_result.empty()) { do_ams_mapping(obj_); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user