FIX: champer_switch_head_dlg->ShowModal() may wake up another wxCUSTOMEVT_SET_TEMP_FINISH, break the chain

jira: [STUDIO-10386]
Change-Id: I2debe9eebf455e4adbe9161945ce84508f594f9d
(cherry picked from commit 26881072a44d755335931a3f800bc7548744acc5)
This commit is contained in:
xin.zhang
2025-02-13 18:06:06 +08:00
committed by Noisyfox
parent f17f0a6e22
commit b368483aaa

View File

@@ -3925,6 +3925,7 @@ void StatusPanel::on_set_nozzle_temp(int nozzle_id)
void StatusPanel::on_set_chamber_temp()
{
if (!obj) {return;}
if (champer_switch_head_dlg && champer_switch_head_dlg->IsShown()) { return; } /*STUDIO-10386 champer_switch_head_dlg->ShowModal() could wake up another wxCUSTOMEVT_SET_TEMP_FINISH*/
wxString str = m_tempCtrl_chamber->GetTextCtrl()->GetValue();
try {
@@ -3939,8 +3940,11 @@ void StatusPanel::on_set_chamber_temp()
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)
{
champer_switch_head_dlg = new MessageDialog(this, _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)
{