Add/Track: currentProgramMode

This commit is contained in:
Siegfried Siegert 2025-07-23 09:23:47 +02:00
parent a87a4e6c14
commit cc27b982ff
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 18 additions and 2 deletions

View File

@ -24,7 +24,8 @@
ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent)
: isMaster(false) : currentProgramMode(PROGRAM_MODE::INIT)
, isMaster(false)
, pluginState(PLUGIN_STATE::NOT_INITIALIZED) , pluginState(PLUGIN_STATE::NOT_INITIALIZED)
, eventReceiver(nullptr) , eventReceiver(nullptr)
{ {
@ -290,12 +291,14 @@ void ATBDeviceControllerPlugin::onChangedProgramModeToSELL()
hw->dc_autoRequest(true); hw->dc_autoRequest(true);
hw->rtc_setDateTime(); hw->rtc_setDateTime();
hw->mdb_switchWake(0); // wakeup MDB components hw->mdb_switchWake(0); // wakeup MDB components
this->currentProgramMode = PROGRAM_MODE::SELL;
} }
void ATBDeviceControllerPlugin::onChangedProgramModeToSERVICE() void ATBDeviceControllerPlugin::onChangedProgramModeToSERVICE()
{ {
hw->dc_autoRequest(true); hw->dc_autoRequest(true);
hw->mdb_switchWake(0); // wakeup MDB components hw->mdb_switchWake(0); // wakeup MDB components
this->currentProgramMode = PROGRAM_MODE::SERVICE;
} }
void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE() void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE()
@ -303,12 +306,13 @@ void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE()
hw->dc_autoRequest(true); hw->dc_autoRequest(true);
this->diag->diagRequest(); this->diag->diagRequest();
hw->mdb_switchWake(1); hw->mdb_switchWake(1);
this->currentProgramMode = PROGRAM_MODE::IDLE;
} }
void ATBDeviceControllerPlugin::onChangedProgramModeToOOO() void ATBDeviceControllerPlugin::onChangedProgramModeToOOO()
{ {
this->currentProgramMode = PROGRAM_MODE::OOO;
} }

View File

@ -25,6 +25,16 @@ using namespace nsDeviceControllerInterface;
class QSettings; class QSettings;
enum class PROGRAM_MODE {
INIT,
IDLE,
SELL,
SERVICE,
OOO,
NOT_DEFINED
};
class ATBDeviceControllerPlugin : class ATBDeviceControllerPlugin :
public DeviceControllerInterface public DeviceControllerInterface
@ -100,6 +110,8 @@ private:
QString serialPortName; QString serialPortName;
PROGRAM_MODE currentProgramMode;
bool useDebug; bool useDebug;
bool isMaster; bool isMaster;