From faf2a85311505fce74237ec97d183b1bbeb2b462 Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 27 Sep 2023 12:46:02 +0800 Subject: [PATCH] ENH:add check for flow cali Change-Id: Ic3c808b16a1a07e459323604f5db175e26dc41e1 --- src/slic3r/GUI/SelectMachine.cpp | 29 ++++++++++++++++++----------- src/slic3r/GUI/SelectMachine.hpp | 1 + 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 0070f17a6d..ad9a3e3f01 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -3046,6 +3046,8 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event) //reset print status + update_flow_cali_check(obj); + show_status(PrintDialogStatus::PrintStatusInit); reset_ams_material(); @@ -3053,6 +3055,21 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event) update_show_status(); } +void SelectMachineDialog::update_flow_cali_check(MachineObject* obj) +{ + auto bed_type = m_plater->get_partplate_list().get_curr_plate()->get_bed_type(true); + auto show_cali_tips = true; + + if (obj && obj->printer_type == "N1") { show_cali_tips = false; } + + if (bed_type == BedType::btPTE) { + set_flow_calibration_state(false, show_cali_tips); + } + else { + set_flow_calibration_state(true, show_cali_tips); + } +} + void SelectMachineDialog::update_ams_check(MachineObject* obj) { if (obj && obj->is_function_supported(FUNC_USE_AMS) @@ -3724,17 +3741,7 @@ void SelectMachineDialog::set_default_normal() m_scrollable_view->SetMaxSize(m_scrollable_region->GetSize()); //disable pei bed - auto bed_type = m_plater->get_partplate_list().get_curr_plate()->get_bed_type(true); - auto show_cali_tips = true; - - if (obj_ && obj_->printer_type == "N1") { show_cali_tips = false; } - - if (bed_type == BedType::btPTE) { - set_flow_calibration_state(false, show_cali_tips); - } - else { - set_flow_calibration_state(true, show_cali_tips); - } + update_flow_cali_check(obj_); wxSize screenSize = wxGetDisplaySize(); auto dialogSize = this->GetSize(); diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 9719891a14..e57ce40743 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -432,6 +432,7 @@ public: void update_page_turn_state(bool show); void on_timer(wxTimerEvent& event); void on_selection_changed(wxCommandEvent& event); + void update_flow_cali_check(MachineObject* obj); void Enable_Refresh_Button(bool en); void Enable_Send_Button(bool en); void on_dpi_changed(const wxRect& suggested_rect) override;