|
|
|
@@ -104,7 +104,7 @@ void DeviceControllerDiag::private_startDiag()
|
|
|
|
|
// check for DiagRequestTimeoutTimerTimeout:
|
|
|
|
|
if (this->flagInterruptDiag) {
|
|
|
|
|
qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!";
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E255);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E255);
|
|
|
|
|
this->isRequestRunning = false;
|
|
|
|
|
this->flagInterruptDiag = false;
|
|
|
|
|
if (this->E255counter > 5) {
|
|
|
|
@@ -153,7 +153,7 @@ void DeviceControllerDiag::sys_superviseSystem()
|
|
|
|
|
// check for DiagRequestTimeoutTimerTimeout:
|
|
|
|
|
if (this->flagInterruptDiag) {
|
|
|
|
|
qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!";
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E255);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E255);
|
|
|
|
|
this->flagInterruptDiag = false;
|
|
|
|
|
this->isRequestRunning = false;
|
|
|
|
|
if (this->E255counter > 5) { this->restartCArun(); }
|
|
|
|
@@ -166,7 +166,7 @@ void DeviceControllerDiag::sys_superviseSystem()
|
|
|
|
|
// es gibt keinerlei gültige Daten vom DC
|
|
|
|
|
qCritical() << "DeviceControllerDiag::sys_superviseSystem() no valid data!";
|
|
|
|
|
hw->dc_autoRequest(true);
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::M0254);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::M0254);
|
|
|
|
|
this->diagRequestTimeoutTimer->stop();
|
|
|
|
|
this->isRequestRunning = false;
|
|
|
|
|
if (this->E255counter > 5) { this->restartCArun(); }
|
|
|
|
@@ -223,7 +223,7 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
|
|
|
|
|
if (dynMaCond.onAlarm>0) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::A000);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::A000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check for open doors
|
|
|
|
@@ -232,41 +232,41 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
// Service or battery door is open
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
qCritical() << "DeviceControllerDiag::sys_superviseSystem() Service or battery door is open, goto INTRUSION MODE";
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::M0253);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::M0253);
|
|
|
|
|
}
|
|
|
|
|
if (dynMaCond.middleDoor) {
|
|
|
|
|
// vault door is open
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
qCritical() << "DeviceControllerDiag::sys_superviseSystem() vault door is open, goto INTRUSION MODE";
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::M0252);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::M0252);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check for invalid states:
|
|
|
|
|
|
|
|
|
|
if (modCond.rtc>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E002);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E002);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.printer==200 || modCond.printer==201) { // 200: not connected 201: printer-HW-error 202: no paper
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E020);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E020);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.printer==202) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E018);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E018);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (modCond.coinBlocker>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E025);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E025);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.mdbBus>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E034);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E034);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.intEe>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E011);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E011);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2023-07-26: workaround for 00281/Szeged --------------------------------------------------------------
|
|
|
|
@@ -276,16 +276,16 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
if (devPara.kindOfCoinChecker > 0) {
|
|
|
|
|
if (modCond.coinSafe==201) { // full
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E007);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E007);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinSafe==200) { // 200: kasse fehlt 201: voll 100:fast voll 1:ok
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E009);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E009);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinEscrow>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
// coinEscrow>200 is considered a warning:
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W010);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W010);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// -----------------------------------------------------------------------------------------------
|
|
|
|
@@ -308,15 +308,15 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
if (modCond.coinEscrow>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
// coinEscrow>200 is considered a warning:
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W010);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W010);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinSafe==201) { // full
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E007);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E007);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinSafe==200) { // 200: kasse fehlt 201: voll 100:fast voll 1:ok
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E009);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E009);
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
if (devPara.kindOfCoinChecker==3)
|
|
|
|
@@ -324,15 +324,15 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
if (modCond.changer>=200) {
|
|
|
|
|
// Fehler Münzver.
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E026);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E026);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinSafe==201) { // full
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E007);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E007);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinSafe == 200) { // 200: kasse fehlt 201: voll 100:fast voll 1:ok
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E009);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E009);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -361,61 +361,86 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
|
|
|
|
|
if (dynMaCond.modeAbrech>0) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E011);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E011);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dynMaCond.nowCardTest>0) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::M0072);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::M0072);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dynMaCond.startupTestIsRunning>0) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::M0073);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::M0073);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (modCond.voltage>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::E003);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::E003);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.temper>=200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W004);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W004);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check for warnings
|
|
|
|
|
if (modCond.printer>=100 && modCond.printer<200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W001);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W001);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.coinSafe>=100 && modCond.coinSafe<200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W002);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W002);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.voltage>=100 && modCond.voltage<200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W003);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W003);
|
|
|
|
|
}
|
|
|
|
|
if (modCond.temper>=100 && modCond.temper<200) {
|
|
|
|
|
flag_sendOperate = false;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W004);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W004);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (flag_sendOperate) {
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::O000);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::O000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compare machineEventSets
|
|
|
|
|
// New events: present in current but not previous
|
|
|
|
|
QSet<DeviceController::State> newEvents = this->machineEventSet - this->previousMachineEventSet;
|
|
|
|
|
|
|
|
|
|
// Reset events: present in previous but not current
|
|
|
|
|
QSet<DeviceController::State> resetEvents = this->previousMachineEventSet - this->machineEventSet;
|
|
|
|
|
|
|
|
|
|
// Triggering Actions
|
|
|
|
|
// Iterate through the results
|
|
|
|
|
for (const DeviceController::State& event : newEvents) {
|
|
|
|
|
private_sendDiagEvent(event, DeviceController::Action::SET); // New event detected
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Proposal: send reset
|
|
|
|
|
/*
|
|
|
|
|
for (const DeviceController::State& event : resetEvents) {
|
|
|
|
|
private_sendDiagEvent(event, DeviceController::Action::RESET); // Event no longer present
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// finish diag
|
|
|
|
|
|
|
|
|
|
this->diagRequestTimeoutTimer->stop();
|
|
|
|
|
this->isRequestRunning = false;
|
|
|
|
|
this->flagInterruptDiag = false;
|
|
|
|
|
|
|
|
|
|
this->previousMachineEventSet = machineEventSet;
|
|
|
|
|
this->machineEventSet.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief DeviceControllerDiag::private_sendDiagEvent
|
|
|
|
|
* @brief DeviceControllerDiag::private_setDiagEvent
|
|
|
|
|
* @param result - result value from 'sub_componentAssessment()',
|
|
|
|
|
* - 0x00 everything is fine
|
|
|
|
|
* - 0xFF on timer interrupt
|
|
|
|
@@ -423,25 +448,21 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|
|
|
|
* - 0xFD Service or battery door is open
|
|
|
|
|
* - 0xFE vault door is open
|
|
|
|
|
*/
|
|
|
|
|
void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
|
|
|
|
|
void DeviceControllerDiag::private_setDiagEvent(DeviceController::State result)
|
|
|
|
|
{
|
|
|
|
|
qCritical() << "DeviceControllerDiag::private_sendDiagEvent() result: " << result;
|
|
|
|
|
qCritical() << "DeviceControllerDiag::private_setDiagEvent() result: " << result;
|
|
|
|
|
|
|
|
|
|
if (this->eventReceiver == nullptr) {
|
|
|
|
|
qCritical() << "DeviceControllerDiag: no eventReceiver";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (machineEventSet.contains(result)) {
|
|
|
|
|
// do not send already sent events
|
|
|
|
|
qCritical() << " ... is in machineEventList";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
machineEventSet.insert(result);
|
|
|
|
|
}
|
|
|
|
|
machineEventSet.insert(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result, DeviceController::Action action)
|
|
|
|
|
{
|
|
|
|
|
QString eventId = QUuid::createUuid().toString(QUuid::WithoutBraces).mid(0, 8);
|
|
|
|
|
|
|
|
|
|
QString eventName = QMetaEnum::fromType<DeviceController::State>().valueToKey(result);;
|
|
|
|
@@ -608,7 +629,7 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
|
|
|
|
|
"DC",
|
|
|
|
|
eventClass,
|
|
|
|
|
eventName,
|
|
|
|
|
1, // eventState
|
|
|
|
|
action, // eventState
|
|
|
|
|
parameter,
|
|
|
|
|
"" // second level info
|
|
|
|
|
);
|
|
|
|
@@ -625,6 +646,6 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
|
|
|
|
|
void DeviceControllerDiag::restartCArun()
|
|
|
|
|
{
|
|
|
|
|
this->E255counter = 0;
|
|
|
|
|
this->private_sendDiagEvent(DeviceController::State::W255);
|
|
|
|
|
this->private_setDiagEvent(DeviceController::State::W255);
|
|
|
|
|
QProcess::startDetached("/bin/systemctl", {"restart", "carun"});
|
|
|
|
|
}
|
|
|
|
|