ENH:dynamic display of AUX fan

Change-Id: Ib2b5578567eaa6fde15fdb54bdf24063b627d2d7
This commit is contained in:
tao wang
2023-08-14 19:46:43 +08:00
committed by Lane.Wei
parent 7a7a9f4296
commit 23dc1ec960
6 changed files with 72 additions and 17 deletions

View File

@@ -535,7 +535,7 @@ FanControlPopup::FanControlPopup(wxWindow* parent)
SetBackgroundColour(*wxWHITE);
}
void FanControlPopup::update_show_mode(bool support_cham_fun)
void FanControlPopup::show_cham_fan(bool support_cham_fun)
{
if (support_cham_fun && !m_is_suppt_cham_fun) {
@@ -554,10 +554,30 @@ void FanControlPopup::update_show_mode(bool support_cham_fun)
m_is_suppt_cham_fun = support_cham_fun;
}
void FanControlPopup::show_aux_fan(bool support_aux_fun)
{
if (support_aux_fun && !m_is_suppt_aux_fun) {
m_aux_fan->Show();
m_line_bottom->Show();
Layout();
Fit();
}
if (!support_aux_fun && m_is_suppt_aux_fun) {
m_aux_fan->Hide();
m_line_bottom->Hide();
Layout();
Fit();
}
m_is_suppt_aux_fun = support_aux_fun;
}
void FanControlPopup::update_fan_data(MachineObject::FanType type, MachineObject* obj)
{
m_is_suppt_cham_fun = obj->is_function_supported(PrinterFunction::FUNC_CHAMBER_FAN);
update_show_mode(m_is_suppt_cham_fun);
show_cham_fan(m_is_suppt_cham_fun);
if (type == MachineObject::FanType::COOLING_FAN && obj->cooling_fan_speed >= 0) {
m_part_fan->set_fan_speed(obj->cooling_fan_speed);

View File

@@ -154,9 +154,11 @@ private:
wxWindow* m_line_top;
wxWindow* m_line_bottom;
bool m_is_suppt_cham_fun{true};
bool m_is_suppt_aux_fun{true};
public:
void update_show_mode(bool support_cham_fun);
void show_cham_fan(bool support_cham_fun);
void show_aux_fan(bool support_aux_fun);
void update_fan_data(MachineObject::FanType type, MachineObject* obj);
void on_left_down(wxMouseEvent& evt);
void paintEvent(wxPaintEvent& evt);