Add handling door events

This commit is contained in:
Siegfried Siegert 2023-06-13 17:00:17 +02:00
parent 9d686ae48d
commit d5d2b8917a
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 71 additions and 11 deletions

View File

@ -30,6 +30,14 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject(
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_payStopByError()), this, SLOT(onCashPayStopByError())); connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_payStopByError()), this, SLOT(onCashPayStopByError()));
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_payStopByTimeout()), this, SLOT(onCashPayStopByTimeout())); connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_payStopByTimeout()), this, SLOT(onCashPayStopByTimeout()));
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorServiceDoorOpened()), this, SLOT(onServiceDoorOpened())); // switch to ModeSERVICE
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorVaultDoorOpened()), this, SLOT(onVaultDoorOpened())); // Screen?? with message
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCoinBoxRemoved()), this, SLOT(onCoinBoxRemoved())); // Create/Send Account
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCoinBoxInserted()), this, SLOT(onCoinBoxInserted()));
//connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCBinAndAllDoorsClosed()), this, SLOT( ??? )));
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorAllDoorsClosed()), this, SLOT(onAllDoorsClosed())); // check for errors, switch to mode IDLE
this->currentSelectedTicketType = 0; this->currentSelectedTicketType = 0;
} }
@ -65,22 +73,19 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *healthEventReceive
void ATBDeviceControllerPlugin::onChangedProgramModeToSELL() void ATBDeviceControllerPlugin::onChangedProgramModeToSELL()
{ {
hw->dc_autoRequest(true); hw->dc_autoRequest(true);
} }
void ATBDeviceControllerPlugin::changedProgramModeToSERVICE() void ATBDeviceControllerPlugin::onChangedProgramModeToSERVICE()
{ {
hw->dc_autoRequest(true); hw->dc_autoRequest(true);
} }
void ATBDeviceControllerPlugin::changedProgramModeToIDLE() void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE()
{ {
hw->dc_autoRequest(false); hw->dc_autoRequest(false);
} }
void ATBDeviceControllerPlugin::changedProgramModeToOOO() void ATBDeviceControllerPlugin::onChangedProgramModeToOOO()
{ {
} }
@ -117,12 +122,57 @@ void ATBDeviceControllerPlugin::cashAbort()
} }
// TASKS: Account ------------------------------------------------------------- // TASKS: Account -------------------------------------------------------------
// for an external account request, e.g. by an ui-button:
void ATBDeviceControllerPlugin::requestAccount() void ATBDeviceControllerPlugin::requestAccount()
{ {
qCritical() << "TODO: implement ATBDeviceControllerPlugin::requestAccount()"; qCritical() << "TODO: implement ATBDeviceControllerPlugin::requestAccount()";
} }
// Door Events / Hardware contacts --------------------------------------------
void ATBDeviceControllerPlugin::onServiceDoorOpened()
{
qCritical() << "ATBDeviceControllerPlugin::onServiceDoorOpened()";
// switch to mode service
emit this->requestModeSERVICE();
// TODO:
// - create an HealthEvent (-> ISMAS-Event)
}
void ATBDeviceControllerPlugin::onVaultDoorOpened()
{
// TODO:
// - show special screen / message on screen
// - create an HealthEvent (-> ISMAS-Event)
qCritical() << "TODO: implement ATBDeviceControllerPlugin::onVaultDoorOpened()";
}
void ATBDeviceControllerPlugin::onCoinBoxRemoved()
{
// TODO:
// - create and send account (-> requestAccountResponse())
qCritical() << "TODO: implement ATBDeviceControllerPlugin::onCoinBoxRemoved()";
}
void ATBDeviceControllerPlugin::onCoinBoxInserted()
{
qCritical() << "TODO: implement ATBDeviceControllerPlugin::onCoinBoxInserted()";
}
void ATBDeviceControllerPlugin::onAllDoorsClosed()
{
// TODO:
// - check for errors, switch to mode IDLE
qCritical() << "TODO: implement ATBDeviceControllerPlugin::onAllDoorsClosed()";
emit this->requestModeIDLE();
}
// TASKS: printing ------------------------------------------------------------ // TASKS: printing ------------------------------------------------------------
void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant> & printingData) void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant> & printingData)
{ {

View File

@ -65,10 +65,10 @@ public:
const QString getString(nsDeviceControllerInterface::RESULT_STATE resultState);; const QString getString(nsDeviceControllerInterface::RESULT_STATE resultState);;
public slots: public slots:
virtual void onChangedProgramModeToSELL(); void onChangedProgramModeToSELL();
virtual void changedProgramModeToSERVICE(); void onChangedProgramModeToSERVICE();
virtual void changedProgramModeToIDLE(); void onChangedProgramModeToIDLE();
virtual void changedProgramModeToOOO(); void onChangedProgramModeToOOO();
@ -90,11 +90,14 @@ signals:
const QString & errorCode, const QString & errorCode,
const QString & errorDescription); const QString & errorDescription);
void requestServiceMode(); void requestModeSERVICE();
void requestModeIDLE();
void requestModeOOO();
void requestAccountResponse(const QHash<QString, QVariant> & accountData); void requestAccountResponse(const QHash<QString, QVariant> & accountData);
void Error( void Error(
const QString & errorCode, const QString & errorCode,
const QString & errorDescription); const QString & errorDescription);
@ -140,6 +143,13 @@ private slots:
void onCashPayStopByEscrow(); void onCashPayStopByEscrow();
void onCashPayStopByError(); void onCashPayStopByError();
void onCashPayStopByTimeout(); void onCashPayStopByTimeout();
// doors and hardware contacts
void onServiceDoorOpened();
void onVaultDoorOpened();
void onCoinBoxRemoved();
void onCoinBoxInserted();
void onAllDoorsClosed();
}; };
#endif // ATBDEVICECONTROLLERPLUGIN_H #endif // ATBDEVICECONTROLLERPLUGIN_H