From 3abeb091817932926f11474730f05d3ef52b57a4 Mon Sep 17 00:00:00 2001 From: Michael Carpenter Date: Thu, 21 Nov 2013 19:01:51 -0500 Subject: [PATCH] Prevented ECU reset popup from coming up more than once upon detecting an ECU reset --- core/src/mainwindow.cpp | 5 ++++- core/src/mainwindow.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/mainwindow.cpp b/core/src/mainwindow.cpp index d3320b1..7de4d7a 100644 --- a/core/src/mainwindow.cpp +++ b/core/src/mainwindow.cpp @@ -40,6 +40,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) m_offlineMode = false; m_checkEmsDataInUse = false; m_currentEcuClock = -1; + m_EcuResetPopup = false; interrogateProgressMdiWindow=0; qRegisterMetaType("MemoryLocationInfo"); qRegisterMetaType("DataType"); @@ -1912,8 +1913,9 @@ void MainWindow::guiUpdateTimerTick() } void MainWindow::ecuResetDetected(int missedpackets) { - if (!m_interrogationInProgress) + if (!m_interrogationInProgress && !m_EcuResetPopup) { + m_EcuResetPopup = true; if (QMessageBox::question(this,"Error","ECU Reset detected with " + QString::number(missedpackets) + " missed packets! Would you like to reflash data? If you do not, then EMStudio will continue with an INVALID idea of ECU memory, and you will lose any changes made",QMessageBox::Yes,QMessageBox::No) == QMessageBox::Yes) { emsComms->writeAllRamToRam(); @@ -1922,6 +1924,7 @@ void MainWindow::ecuResetDetected(int missedpackets) { QMessageBox::information(this,"Warning","EMStudio will now continue with a corrupt version of ECU memory. The death of your engine is on your head now"); } + m_EcuResetPopup = false; } } diff --git a/core/src/mainwindow.h b/core/src/mainwindow.h index bc66c98..fc80303 100644 --- a/core/src/mainwindow.h +++ b/core/src/mainwindow.h @@ -165,6 +165,7 @@ class MainWindow : public QMainWindow //EmsData *checkEmsData; int m_currentEcuClock; QMap m_mdiSubWindowToActionMap; + bool m_EcuResetPopup; private slots: void windowHidden(QMdiSubWindow* window); void bringToFrontAndShow();