From 4f1ad8016e11d5440127b45c48854c1ed2cf75aa Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Tue, 14 Jan 2025 17:20:44 +0800 Subject: [PATCH] FIX: add a warning dialog jira: [STUDIO-9715] Change-Id: I376235de8a8569e63530eca914dc977a670a769c --- resources/printers/O1D.json | 1 + resources/printers/version.txt | 2 +- src/slic3r/GUI/DeviceManager.cpp | 9 +++++++++ src/slic3r/GUI/DeviceManager.hpp | 1 + src/slic3r/GUI/StatusPanel.cpp | 12 ++++++++++++ src/slic3r/GUI/StatusPanel.hpp | 4 ++++ 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/resources/printers/O1D.json b/resources/printers/O1D.json index a365ae85b..aaf4c31d3 100644 --- a/resources/printers/O1D.json +++ b/resources/printers/O1D.json @@ -48,6 +48,7 @@ "support_first_layer_inspect": false, "support_chamber_temp_edit": true, "support_chamber_temp_edit_range": [ 20, 65 ], + "support_chamber_temp_switch_heating": 40, "support_extrusion_cali": false, "support_user_preset": false }, diff --git a/resources/printers/version.txt b/resources/printers/version.txt index 43119ba0f..196e043ac 100644 --- a/resources/printers/version.txt +++ b/resources/printers/version.txt @@ -1 +1 @@ -02.00.00.01 \ No newline at end of file +02.00.00.02 \ No newline at end of file diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 07dce2397..03cdd3928 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -3300,6 +3300,15 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) chamber_temp_edit_min = support_champer_range[0]; chamber_temp_edit_max = support_champer_range[1]; } + + if (jj.contains("support_chamber_temp_switch_heating")) + { + const auto& support_chamber_temp_switch_heating = jj["support_chamber_temp_switch_heating"]; + if (support_chamber_temp_switch_heating.is_number()) + { + chamber_temp_switch_heat = support_chamber_temp_switch_heating.get(); + } + } } if (jj.contains("support_extrusion_cali")) { diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 4c3b11a6e..d593e2364 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -732,6 +732,7 @@ public: float chamber_temp_target; float chamber_temp_edit_min = 0; float chamber_temp_edit_max = 60; + long chamber_temp_switch_heat = LONG_MAX;/*default to LONG_MAX*/ float frame_temp; /* cooling */ diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 359fdc706..ef9914140 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -3874,6 +3874,18 @@ void StatusPanel::on_set_chamber_temp() m_tempCtrl_chamber->SetTagTemp(wxString::Format("%d", chamber_temp)); m_tempCtrl_chamber->Warning(false); } + + if (chamber_temp > obj->chamber_temp_switch_heat) + { + delete champer_switch_head_dlg; + champer_switch_head_dlg = new MessageDialog(nullptr, _L("If the chamber temperature exceeds 40\u2103, the system will automatically switch to heating mode. Please confirm whether to switch."), wxEmptyString, wxICON_WARNING | wxOK | wxCANCEL); + + if (champer_switch_head_dlg->ShowModal() != wxID_OK) + { + return; + } + } + obj->command_set_chamber(chamber_temp); } } diff --git a/src/slic3r/GUI/StatusPanel.hpp b/src/slic3r/GUI/StatusPanel.hpp index e6e855c92..ac8fc7930 100644 --- a/src/slic3r/GUI/StatusPanel.hpp +++ b/src/slic3r/GUI/StatusPanel.hpp @@ -40,6 +40,9 @@ class StepIndicator; namespace Slic3r { namespace GUI { +// Previous definitions +class MessageDialog; + enum CameraRecordingStatus { RECORDING_NONE, RECORDING_OFF_NORMAL, @@ -569,6 +572,7 @@ protected: SecondaryCheckDialog* ctrl_e_hint_dlg = nullptr; SecondaryCheckDialog* sdcard_hint_dlg = nullptr; SecondaryCheckDialog* axis_go_home_dlg = nullptr; + MessageDialog* champer_switch_head_dlg = nullptr; FanControlPopupNew* m_fan_control_popup{nullptr};