FIX: hide fan when device not in fdm
JIRA: none Change-Id: I14a6e01b4e0950ca1bc3c805fe00313cfd7caf06
This commit is contained in:
parent
5bd6cf87e2
commit
c12b4f1391
|
@ -5906,7 +5906,8 @@ void MachineObject::parse_new_info(json print)
|
|||
}
|
||||
|
||||
if (device.contains("type")) {
|
||||
int type = device["type"]; //FDM:1<<0 Laser:1<< Cut:1<<2
|
||||
int type = device["type"].get<int>(); // FDM:1<<0 Laser:1<< Cut:1<<2
|
||||
is_fdm = type & 1;
|
||||
}
|
||||
|
||||
if (device.contains("bed_temp")) {
|
||||
|
|
|
@ -1020,6 +1020,9 @@ public:
|
|||
|
||||
bool is_makeworld_subtask();
|
||||
|
||||
/* device type */
|
||||
bool is_fdm{ true };
|
||||
inline bool is_fdm_type() const { return is_fdm; }
|
||||
|
||||
int m_plate_index { -1 };
|
||||
std::string m_gcode_file;
|
||||
|
|
|
@ -2861,12 +2861,21 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
|
|||
// update extruder icon
|
||||
update_extruder_status(obj);
|
||||
|
||||
bool is_suppt_part_fun = true;
|
||||
bool is_suppt_aux_fun = obj->is_support_aux_fan;
|
||||
bool is_suppt_cham_fun = obj->is_support_chamber_fan;
|
||||
if (m_fan_control_popup) {
|
||||
m_fan_control_popup->update_fan_data(obj);
|
||||
if (obj->is_fdm_type()) {
|
||||
if (!m_fan_panel->IsShown())
|
||||
m_fan_panel->Show();
|
||||
bool is_suppt_part_fun = true;
|
||||
bool is_suppt_aux_fun = obj->is_support_aux_fan;
|
||||
bool is_suppt_cham_fun = obj->is_support_chamber_fan;
|
||||
if (m_fan_control_popup) { m_fan_control_popup->update_fan_data(obj); }
|
||||
} else {
|
||||
if (m_fan_panel->IsShown()) {
|
||||
m_fan_panel->Hide();
|
||||
}
|
||||
if (m_fan_control_popup && m_fan_control_popup->Show())
|
||||
m_fan_control_popup->Hide();
|
||||
}
|
||||
|
||||
//update cham fan
|
||||
|
||||
/*other*/
|
||||
|
|
|
@ -563,8 +563,8 @@ void FanControlNew::post_event()
|
|||
Description:FanControlPopupNew
|
||||
**************************************************/
|
||||
static void nop_deleter_fan_control_popup(FanControlPopupNew *) {}
|
||||
FanControlPopupNew::FanControlPopupNew(wxWindow* parent, MachineObject* obj,AirDuctData data)
|
||||
:PopupWindow(parent, wxBORDER_NONE)
|
||||
FanControlPopupNew::FanControlPopupNew(wxWindow* parent, MachineObject* obj, const AirDuctData& data)
|
||||
: PopupWindow(parent, wxBORDER_NONE)
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
init_names();
|
||||
|
@ -573,8 +573,12 @@ FanControlPopupNew::FanControlPopupNew(wxWindow* parent, MachineObject* obj,AirD
|
|||
m_obj = obj;
|
||||
|
||||
m_sizer_main = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
int part_size = data.parts.size();
|
||||
int grid_column = part_size > 1 ? 2 : 1;
|
||||
|
||||
m_radio_btn_sizer = new wxGridSizer(0, 2, FromDIP(3), FromDIP(3));
|
||||
m_sizer_fanControl = new wxGridSizer(0, 2, FromDIP(3), FromDIP(10));
|
||||
m_sizer_fanControl = new wxGridSizer(0, grid_column, FromDIP(3), FromDIP(10));
|
||||
|
||||
m_mode_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ public:
|
|||
class FanControlPopupNew : public PopupWindow
|
||||
{
|
||||
public:
|
||||
FanControlPopupNew(wxWindow* parent, MachineObject* obj, AirDuctData data);
|
||||
FanControlPopupNew(wxWindow* parent, MachineObject* obj, const AirDuctData& data);
|
||||
~FanControlPopupNew() {};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue