Add atomic<bool> variable m_coinAttached to check for state change:
send signal runProc_coinAttached only if state changes from false true.
This commit is contained in:
parent
790c2fd031
commit
aa10d3b275
@ -15,6 +15,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "datIf.h"
|
#include "datIf.h"
|
||||||
#include <QSharedMemory>
|
#include <QSharedMemory>
|
||||||
|
#include <atomic>
|
||||||
#include "sendWRcmd.h"
|
#include "sendWRcmd.h"
|
||||||
#include "controlBus.h"
|
#include "controlBus.h"
|
||||||
#include "storeINdata.h"
|
#include "storeINdata.h"
|
||||||
@ -35,6 +36,10 @@ class T_runProc : public QObject
|
|||||||
|
|
||||||
void restoreDeviceParameter(struct T_devices *deviceSettings);
|
void restoreDeviceParameter(struct T_devices *deviceSettings);
|
||||||
|
|
||||||
|
#ifndef THIS_IS_CA_MASTER
|
||||||
|
std::atomic_bool m_coinAttached{false};
|
||||||
|
#endif
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void runProc_slotProcess(void);
|
void runProc_slotProcess(void);
|
||||||
bool bl_performComplStart(void);
|
bool bl_performComplStart(void);
|
||||||
|
@ -48,9 +48,13 @@ T_runProc::T_runProc()
|
|||||||
void T_runProc::runProc_slotProcess(void)
|
void T_runProc::runProc_slotProcess(void)
|
||||||
{
|
{
|
||||||
#ifndef THIS_IS_CA_MASTER
|
#ifndef THIS_IS_CA_MASTER
|
||||||
if (epi_getDI_CoinAttach()) {
|
bool const coinAttached = epi_getDI_CoinAttach();
|
||||||
|
if (m_coinAttached.exchange(coinAttached) == false) {
|
||||||
|
if (coinAttached) {
|
||||||
|
// old value was false, and new value is true
|
||||||
emit runProc_coinAttached();
|
emit runProc_coinAttached();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
cash_paymentProcessing();
|
cash_paymentProcessing();
|
||||||
doors_supervise();
|
doors_supervise();
|
||||||
bl_performComplStart(); // neu 1.12.23
|
bl_performComplStart(); // neu 1.12.23
|
||||||
|
Loading…
Reference in New Issue
Block a user