ENH:reduce the refresh times of sending printed pages

jira:[none]

Change-Id: Iaa4864afa09e71a7b8fd09baf289ee17fa07eafc
This commit is contained in:
tao wang 2024-11-27 20:55:09 +08:00 committed by lane.wei
parent 97314db430
commit a0c9fad052
2 changed files with 12 additions and 4 deletions

View File

@ -914,6 +914,10 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
m_checkbox_list["flow_cali"]->Hide();
m_checkbox_list["nozzle_offset_cali"]->Hide();
if (!obj) {
return;
}
if (obj->is_enable_np) {
m_checkbox_list["nozzle_offset_cali"]->Show();
m_checkbox_list["nozzle_offset_cali"]->update_options(ops_auto);
@ -956,7 +960,6 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
m_checkbox_list["timelapse"]->setValue("on");
}
update_ams_check(obj);
update_flow_cali_check(obj);
Layout();
Fit();
@ -2767,8 +2770,12 @@ void SelectMachineDialog::on_timer(wxTimerEvent &event)
MachineObject* obj_ = dev->get_selected_machine();
if(!obj_) return;
update_select_layout(obj_);
update_ams_check(obj_);
if (!m_check_flag && obj_->is_info_ready()) {
update_select_layout(obj_);
update_ams_check(obj_);
m_check_flag = true;
}
if (!obj_
|| obj_->amsList.empty()
@ -2848,7 +2855,7 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
// Has changed machine unrecoverably
GUI::wxGetApp().sidebar().load_ams_list(obj->dev_id, obj);
update_select_layout(obj);
m_check_flag = false;
} else {
BOOST_LOG_TRIVIAL(error) << "on_selection_changed dev_id not found";
return;

View File

@ -238,6 +238,7 @@ private:
bool m_export_3mf_cancel{ false };
bool m_is_canceled{ false };
bool m_is_rename_mode{ false };
bool m_check_flag {false};
PrintPageMode m_print_page_mode{PrintPageMode::PrintPageModePrepare};
std::string m_print_error_msg;
std::string m_print_error_extra;