Skip to content

Commit

Permalink
Prevented ECU reset popup from coming up more than once upon detectin…
Browse files Browse the repository at this point in the history
…g an ECU reset
  • Loading branch information
malcom2073 committed Nov 22, 2013
1 parent fcd7b25 commit 3abeb09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>("MemoryLocationInfo");
qRegisterMetaType<DataType>("DataType");
Expand Down Expand Up @@ -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();
Expand All @@ -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;
}
}

Expand Down
1 change: 1 addition & 0 deletions core/src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class MainWindow : public QMainWindow
//EmsData *checkEmsData;
int m_currentEcuClock;
QMap<QMdiSubWindow*,QAction*> m_mdiSubWindowToActionMap;
bool m_EcuResetPopup;
private slots:
void windowHidden(QMdiSubWindow* window);
void bringToFrontAndShow();
Expand Down

0 comments on commit 3abeb09

Please sign in to comment.