ENH: update hms panel and upgrade panel when disconnected

Change-Id: I75d724c99ec2029190641cd2cfa22b6337d0060d
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li authored and Lane.Wei committed 2022-12-15 04:38:15 -05:00
1 parent 42633fda28
commit e344f8b8b9
5 files changed
+46 -5

No files matched your search

+18 -1
View File
@@ -149,7 +149,7 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
StateColor btn_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled));
m_button_upgrade_firmware->SetBackgroundColor(btn_bg);
m_button_upgrade_firmware->SetBorderColor(btn_bd);
m_button_upgrade_firmware->SetTextColor(wxColour("#FFFFFE"));
m_button_upgrade_firmware->SetTextColor(btn_text);
m_button_upgrade_firmware->SetFont(Label::Body_10);
m_button_upgrade_firmware->SetMinSize(wxSize(FromDIP(-1), FromDIP(24)));
m_button_upgrade_firmware->SetCornerRadius(FromDIP(12));
@@ -856,6 +856,23 @@ void UpgradePanel::update(MachineObject *obj)
m_obj = obj;
}
void UpgradePanel::show_status(int status)
{
if (last_status == status) return;
last_status = status;
if (((status & (int)MonitorStatus::MONITOR_DISCONNECTED) != 0)
|| ((status & (int)MonitorStatus::MONITOR_DISCONNECTED_SERVER) != 0)
|| ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0)
|| ((status & (int)MonitorStatus::MONITOR_NO_PRINTER) != 0)
) {
;
}
else if ((status & (int)MonitorStatus::MONITOR_NORMAL) != 0) {
;
}
}
bool UpgradePanel::Show(bool show)
{
if (show) {