ENH: support close lamp check

jira: [STUDIO-11982]
Change-Id: Ic0211b9895f9a75c4bcbfd64772f99d81f510d56
This commit is contained in:
xin.zhang 2025-05-06 19:42:06 +08:00 committed by lane.wei
parent 15c7bb7290
commit 039d11ca88
3 changed files with 14 additions and 0 deletions

View File

@ -6301,6 +6301,7 @@ void MachineObject::parse_new_info(json print)
if (!stat.empty()) {
camera_recording = get_flag_bits(stat, 7);
m_lamp_close_recheck = (get_flag_bits(stat, 36) == 1);
}
/*device*/

View File

@ -958,6 +958,10 @@ public:
PrintingSpeedLevel _parse_printing_speed_lvl(int lvl);
int get_bed_temperature_limit();
bool is_filament_installed();
/*stat*/
bool m_lamp_close_recheck = false;
/* camera */
bool has_ipcam { false };
bool camera_recording { false };

View File

@ -4940,6 +4940,15 @@ void StatusPanel::on_lamp_switch(wxCommandEvent &event)
obj->command_set_chamber_light(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_ON);
obj->command_set_chamber_light2(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_ON);
} else {
if (obj->m_lamp_close_recheck) {
MessageDialog msg_dlg(nullptr, _L("Turning off the lights during the task will cause the failure of AI monitoring, like spaghetti dectection. Please choose carefully."), wxEmptyString, wxICON_WARNING | wxOK | wxCANCEL);
msg_dlg.SetButtonLabel(wxID_OK, _L("Turn it Off"));
msg_dlg.SetButtonLabel(wxID_CANCEL, _L("Keep it On"));
if (msg_dlg.ShowModal() != wxID_OK) {
return;
}
}
m_switch_lamp->SetValue(false);
set_hold_count(this->m_switch_lamp_timeout);
obj->command_set_chamber_light(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_OFF);