From cc27b982ff5dd620f1d07d54290720c9cb8bfbfa Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Wed, 23 Jul 2025 09:23:47 +0200 Subject: [PATCH] Add/Track: currentProgramMode --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 8 ++++++-- src/ATBAPP/ATBDeviceControllerPlugin.h | 12 ++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 2f7bce7..6ae0441 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -24,7 +24,8 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) - : isMaster(false) + : currentProgramMode(PROGRAM_MODE::INIT) + , isMaster(false) , pluginState(PLUGIN_STATE::NOT_INITIALIZED) , eventReceiver(nullptr) { @@ -290,12 +291,14 @@ void ATBDeviceControllerPlugin::onChangedProgramModeToSELL() hw->dc_autoRequest(true); hw->rtc_setDateTime(); hw->mdb_switchWake(0); // wakeup MDB components + this->currentProgramMode = PROGRAM_MODE::SELL; } void ATBDeviceControllerPlugin::onChangedProgramModeToSERVICE() { hw->dc_autoRequest(true); hw->mdb_switchWake(0); // wakeup MDB components + this->currentProgramMode = PROGRAM_MODE::SERVICE; } void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE() @@ -303,12 +306,13 @@ void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE() hw->dc_autoRequest(true); this->diag->diagRequest(); hw->mdb_switchWake(1); + this->currentProgramMode = PROGRAM_MODE::IDLE; } void ATBDeviceControllerPlugin::onChangedProgramModeToOOO() { - + this->currentProgramMode = PROGRAM_MODE::OOO; } diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index 649100a..111b5df 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -25,6 +25,16 @@ using namespace nsDeviceControllerInterface; class QSettings; +enum class PROGRAM_MODE { + INIT, + IDLE, + SELL, + SERVICE, + OOO, + NOT_DEFINED +}; + + class ATBDeviceControllerPlugin : public DeviceControllerInterface @@ -100,6 +110,8 @@ private: QString serialPortName; + PROGRAM_MODE currentProgramMode; + bool useDebug; bool isMaster;