Add interface for programmode switch

This commit is contained in:
Siegfried Siegert 2023-06-12 08:31:17 +02:00
parent 596cf3ed25
commit 668b10e55d
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
3 changed files with 38 additions and 4 deletions

View File

@ -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)
{

View File

@ -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();

View File

@ -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,