From 039d11ca8862c7c799638f0bdbde0569326e15ad Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Tue, 6 May 2025 19:42:06 +0800 Subject: [PATCH] ENH: support close lamp check jira: [STUDIO-11982] Change-Id: Ic0211b9895f9a75c4bcbfd64772f99d81f510d56 --- src/slic3r/GUI/DeviceManager.cpp | 1 + src/slic3r/GUI/DeviceManager.hpp | 4 ++++ src/slic3r/GUI/StatusPanel.cpp | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 74c92ba3f..56b3f6cb0 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -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*/ diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 679caccce..e739f0d98 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -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 }; diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 6fe9dd90a..4b2a86f28 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -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);