From 668b10e55d7113ba3d5371ea07aede5ae85cf936 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Mon, 12 Jun 2023 08:31:17 +0200 Subject: [PATCH] Add interface for programmode switch --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 29 +++++++++++++++++++++--- src/ATBAPP/ATBDeviceControllerPlugin.h | 8 ++++++- src/ATBAPP/DeviceControllerInterface.h | 5 ++++ 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 986a038..542046c 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -43,9 +43,6 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *healthEventReceive QString serialPort = settings.value("DEVICE_CONTROLLER/serialPort", "ttymxc2").toString(); QByteArray printerEncoding = settings.value("DEVICE_CONTROLLER/printerEnconding", "ISO 8859-2").toString().toLatin1(); - - hw->dc_autoRequest(true); - // open serial port hw->dc_openSerial(5, "115200", serialPort, 1); @@ -61,6 +58,32 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *healthEventReceive } +// Handle Mode-Changes -------------------------------------------------------- + +void ATBDeviceControllerPlugin::onChangedProgramModeToSELL() +{ + hw->dc_autoRequest(true); + +} + +void ATBDeviceControllerPlugin::changedProgramModeToSERVICE() +{ + hw->dc_autoRequest(true); + +} + +void ATBDeviceControllerPlugin::changedProgramModeToIDLE() +{ + hw->dc_autoRequest(false); + +} + +void ATBDeviceControllerPlugin::changedProgramModeToOOO() +{ + +} + + // TASKS: Cash handling ------------------------------------------------------- void ATBDeviceControllerPlugin::requestStartCashInput(const QString & amount) { diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index cc7eb83..14aca65 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -62,7 +62,13 @@ public: const QString & getPluginInfo(); // helpers e.g. for debug / log - const QString getString(nsDeviceControllerInterface::RESULT_STATE resultState); + const QString getString(nsDeviceControllerInterface::RESULT_STATE resultState);; + +public slots: + virtual void onChangedProgramModeToSELL(); + virtual void changedProgramModeToSERVICE(); + virtual void changedProgramModeToIDLE(); + virtual void changedProgramModeToOOO(); diff --git a/src/ATBAPP/DeviceControllerInterface.h b/src/ATBAPP/DeviceControllerInterface.h index ac760bc..3dcda78 100644 --- a/src/ATBAPP/DeviceControllerInterface.h +++ b/src/ATBAPP/DeviceControllerInterface.h @@ -64,6 +64,11 @@ public: // helpers e.g. for debug / log virtual const QString getString(nsDeviceControllerInterface::RESULT_STATE resultState) = 0; +public slots: + virtual void onChangedProgramModeToSELL() = 0; + virtual void changedProgramModeToSERVICE() = 0; + virtual void changedProgramModeToIDLE() = 0; + virtual void changedProgramModeToOOO() = 0; signals: virtual void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState,