Handle door events (note)

This events come somtimes very unreliably.
This commit is contained in:
Siegfried Siegert 2023-06-20 13:23:36 +02:00
parent 2b71705c81
commit 7c3bc484af
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 16 additions and 4 deletions

View File

@ -41,7 +41,7 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) :
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorVaultDoorOpened()), this, SLOT(onVaultDoorOpened()), Qt::QueuedConnection); // Screen?? with message
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCoinBoxRemoved()), this, SLOT(onCoinBoxRemoved()), Qt::QueuedConnection); // Create/Send Account
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCoinBoxInserted()), this, SLOT(onCoinBoxInserted()), Qt::QueuedConnection);
//connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCBinAndAllDoorsClosed()), this, SLOT( ??? )), Qt::QueuedConnection);
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCBinAndAllDoorsClosed()), this, SLOT(onCBinAndAllDoorsClosed()), Qt::QueuedConnection);
connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorAllDoorsClosed()), this, SLOT(onAllDoorsClosed()), Qt::QueuedConnection); // check for errors, switch to mode IDLE
@ -242,6 +242,10 @@ void ATBDeviceControllerPlugin::onVaultDoorOpened()
// - show special screen / message on screen
// - create an HealthEvent (-> ISMAS-Event)
qCritical() << "ATBDeviceControllerPlugin::onVaultDoorOpened()";
// TODO: Start background task "ACCOUNT"
// do not: emit this->requestModeSERVICE();
}
void ATBDeviceControllerPlugin::onCoinBoxRemoved()
@ -256,11 +260,18 @@ void ATBDeviceControllerPlugin::onCoinBoxInserted()
qCritical() << "ATBDeviceControllerPlugin::onCoinBoxInserted()";
}
void ATBDeviceControllerPlugin::onCBinAndAllDoorsClosed()
{
qCritical() << "ATBDeviceControllerPlugin::onCBinAndAllDoorsClosed()";
// TODO: Stop background task "ACCOUNT"
QTimer::singleShot(2000, this, SIGNAL(requestModeIDLE()));
}
void ATBDeviceControllerPlugin::onAllDoorsClosed()
{
// TODO:
// - check for errors, switch to mode IDLE
qCritical() << "ATBDeviceControllerPlugin::onAllDoorsClosed()";
emit this->requestModeIDLE();

View File

@ -129,6 +129,7 @@ private slots:
void onCoinBoxRemoved();
void onCoinBoxInserted();
void onAllDoorsClosed();
void onCBinAndAllDoorsClosed();
// account handling
void private_startAccount();