From 6fbde29cad3222bd6c923884cff7688e847b5a52 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Tue, 10 Oct 2023 08:17:21 +0200 Subject: [PATCH] Use new background task "DOOR_OPENED" while a door is open --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 014cece..7e9e102 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -362,6 +362,7 @@ void ATBDeviceControllerPlugin::onVaultDoorOpened() // this is started here because we want to keep ptu awake in order to get // coin box removed / inserted etc. // BackgroundTask("ACCOUNT") is finished, if account message is sent to ISMAS! + this->dbus->startBackgroundTask("DOOR_OPEN"); // do not: emit this->requestModeSERVICE(); } @@ -381,19 +382,31 @@ void ATBDeviceControllerPlugin::onCoinBoxInserted() qCritical() << "ATBDeviceControllerPlugin::onCoinBoxInserted()"; } +/** + * This is called, when all CoinBox is inserted and all doors + * are closed. + */ void ATBDeviceControllerPlugin::onCBinAndAllDoorsClosed() { qCritical() << "ATBDeviceControllerPlugin::onCBinAndAllDoorsClosed()"; QTimer::singleShot(2000, this, SIGNAL(requestModeIDLE())); + + this->dbus->finishedBackgroundTask("DOOR_OPEN"); } - +/** + * This is called, when all no coinbox is inserted and all doors are + * closed. + */ void ATBDeviceControllerPlugin::onAllDoorsClosed() { qCritical() << "ATBDeviceControllerPlugin::onAllDoorsClosed()"; emit this->requestModeIDLE(); + this->dbus->finishedBackgroundTask("DOOR_OPEN"); + + // TODO: check for errors and create a machine event } void ATBDeviceControllerPlugin::onNewVoltage(uint32_t voltage)