ENH:allow fan control when printing
jira:[STUDIO-9700] Change-Id: I3637705b8c9dfe1b35766bf35dab2a286ee1e7a1
This commit is contained in:
parent
44e056932f
commit
8f5887735a
|
@ -226,13 +226,20 @@ void FanOperate::set_fan_speeds(int g)
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FanOperate::add_fan_speeds()
|
bool FanOperate::check_printing_state()
|
||||||
{
|
{
|
||||||
if (m_obj && m_obj->is_in_printing()) {
|
if (m_obj && m_obj->is_in_printing()) {
|
||||||
MessageDialog msg_wingow(nullptr, _L("Changed fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
|
MessageDialog msg_wingow(nullptr, _L("Changed fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
|
||||||
if (msg_wingow.ShowModal() == wxID_CANCEL) {
|
msg_wingow.SetButtonLabel(wxID_OK, _L("Change Anyway"));
|
||||||
return;
|
if (msg_wingow.ShowModal() == wxID_CANCEL) { return false; }
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FanOperate::add_fan_speeds()
|
||||||
|
{
|
||||||
|
if (!check_printing_state()) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_current_speeds + 1 > m_max_speeds) return;
|
if (m_current_speeds + 1 > m_max_speeds) return;
|
||||||
|
@ -243,11 +250,8 @@ void FanOperate::add_fan_speeds()
|
||||||
|
|
||||||
void FanOperate::decrease_fan_speeds()
|
void FanOperate::decrease_fan_speeds()
|
||||||
{
|
{
|
||||||
if (m_obj && m_obj->is_in_printing()) {
|
if (!check_printing_state()) {
|
||||||
MessageDialog msg_wingow(nullptr, _L("Changed fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
|
return;
|
||||||
if (msg_wingow.ShowModal() == wxID_CANCEL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//turn off
|
//turn off
|
||||||
|
@ -444,13 +448,20 @@ void FanControlNew::command_control_fan()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FanControlNew::on_swith_fan(wxMouseEvent& evt)
|
bool FanControlNew::check_printing_state()
|
||||||
{
|
{
|
||||||
if (m_obj && m_obj->is_in_printing()) {
|
if (m_obj && m_obj->is_in_printing()) {
|
||||||
MessageDialog msg_wingow(nullptr, _L("Changed fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
|
MessageDialog msg_wingow(nullptr, _L("Changed fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
|
||||||
if (msg_wingow.ShowModal() == wxID_CANCEL) {
|
msg_wingow.SetButtonLabel(wxID_OK, _L("Change Anyway"));
|
||||||
return;
|
if (msg_wingow.ShowModal() == wxID_CANCEL) { return false; }
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FanControlNew::on_swith_fan(wxMouseEvent& evt)
|
||||||
|
{
|
||||||
|
if (!check_printing_state()) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int speed = 0;
|
int speed = 0;
|
||||||
|
|
|
@ -104,6 +104,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_fan_speeds(int g);
|
void set_fan_speeds(int g);
|
||||||
|
bool check_printing_state();
|
||||||
void add_fan_speeds();
|
void add_fan_speeds();
|
||||||
void decrease_fan_speeds();
|
void decrease_fan_speeds();
|
||||||
private:
|
private:
|
||||||
|
@ -157,7 +158,8 @@ public:
|
||||||
void update_obj_state(bool stat) { m_update_already = stat; };
|
void update_obj_state(bool stat) { m_update_already = stat; };
|
||||||
void update_fan_data(const AirDuctData& data) { m_fan_data = data; };
|
void update_fan_data(const AirDuctData& data) { m_fan_data = data; };
|
||||||
void command_control_fan();
|
void command_control_fan();
|
||||||
void set_machine_obj(MachineObject* obj);
|
bool check_printing_state();
|
||||||
|
void set_machine_obj(MachineObject *obj);
|
||||||
void set_name(wxString name);
|
void set_name(wxString name);
|
||||||
void set_part_id(int id){m_part_id = id;};
|
void set_part_id(int id){m_part_id = id;};
|
||||||
void set_fan_speed(int g);
|
void set_fan_speed(int g);
|
||||||
|
|
Loading…
Reference in New Issue