Diag: re-map error codes according to old Szeged error list

This commit is contained in:
Siegfried Siegert 2023-07-25 11:14:26 +02:00
parent 34ec52250b
commit 6a39aae7a6
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 112 additions and 96 deletions

View File

@ -164,29 +164,32 @@ DeviceController::State DeviceControllerDiag::sub_componentAssessment()
// check for invalid states: // check for invalid states:
if (modCond.rtc>=200) if (modCond.rtc>=200)
return DeviceController::State::E001;
if (modCond.printer==200 || modCond.printer==201) // 200: not connected 201: printer-HW-error 202: no paper
return DeviceController::State::E002; return DeviceController::State::E002;
if (modCond.printer==200 || modCond.printer==201) // 200: not connected 201: printer-HW-error 202: no paper
return DeviceController::State::E020;
if (modCond.printer==202) if (modCond.printer==202)
return DeviceController::State::E003; return DeviceController::State::E018;
if (modCond.coinBlocker>=200) if (modCond.coinBlocker>=200)
return DeviceController::State::E004; return DeviceController::State::E025;
if (modCond.mdbBus>=200) if (modCond.mdbBus>=200)
return DeviceController::State::E005; return DeviceController::State::E034;
if (modCond.intEe>=200) if (modCond.intEe>=200)
return DeviceController::State::E006; return DeviceController::State::E011;
if (devPara.kindOfCoinChecker==1 || devPara.kindOfCoinChecker==2) // 0: without 1=EMP820 2=EMP900 3=currenza c² (MW) if (devPara.kindOfCoinChecker==1 || devPara.kindOfCoinChecker==2) // 0: without 1=EMP820 2=EMP900 3=currenza c² (MW)
{ {
if (modCond.coinChecker>=200 || modCond.coinEscrow>=200) if (modCond.coinEscrow>=200)
{
return DeviceController::State::E010;
}
if (modCond.coinSafe==201) // full
{ {
// Fehler Münzver.
return DeviceController::State::E007; return DeviceController::State::E007;
} }
if (modCond.coinSafe>200) // 200: kasse fehlt 201: voll 100:fast voll 1:ok if (modCond.coinSafe==200) // 200: kasse fehlt 201: voll 100:fast voll 1:ok
{ {
return DeviceController::State::E008; return DeviceController::State::E009;
} }
} else } else
if (devPara.kindOfCoinChecker==3) if (devPara.kindOfCoinChecker==3)
@ -194,36 +197,48 @@ DeviceController::State DeviceControllerDiag::sub_componentAssessment()
if (modCond.changer>=200) if (modCond.changer>=200)
{ {
// Fehler Münzver. // Fehler Münzver.
return DeviceController::State::E026;
}
if (modCond.coinSafe==201) // full
{
return DeviceController::State::E007; return DeviceController::State::E007;
} }
if (modCond.coinSafe>200) // 200: kasse fehlt 201: voll 100:fast voll 1:ok if (modCond.coinSafe == 200) // 200: kasse fehlt 201: voll 100:fast voll 1:ok
{ {
return DeviceController::State::E008; return DeviceController::State::E009;
} }
} }
/*
if ( modCond.billReader>=200 && devPara.BillAcceptor>0) if ( modCond.billReader>=200 && devPara.BillAcceptor>0)
{ {
// Fehler BNA if (modCond.billReader == 200) // 200: kasse fehlt 201: voll 100:fast voll 1:ok
return DeviceController::State::E009; {
return TODO;
}
if (modCond.billReader == 201) // 200: kasse fehlt 201: voll 100:fast voll 1:ok
{
return TODO;
}
} }
*/
if (dynMaCond.onAlarm>0) if (dynMaCond.onAlarm>0)
return DeviceController::State::E010; return DeviceController::State::A000;
if (dynMaCond.modeAbrech>0) if (dynMaCond.modeAbrech>0)
return DeviceController::State::E011; return DeviceController::State::E011;
if (dynMaCond.nowCardTest>0) if (dynMaCond.nowCardTest>0)
return DeviceController::State::E012; return DeviceController::State::E072;
if (dynMaCond.startupTestIsRunning>0) if (dynMaCond.startupTestIsRunning>0)
return DeviceController::State::E013; return DeviceController::State::E073;
if (modCond.voltage>=200) if (modCond.voltage>=200)
return DeviceController::State::E014; return DeviceController::State::E003;
if (modCond.temper>=200) if (modCond.temper>=200)
return DeviceController::State::E015; return DeviceController::State::E004;
// check for warnings // check for warnings
@ -234,23 +249,6 @@ DeviceController::State DeviceControllerDiag::sub_componentAssessment()
DeviceController::State DeviceControllerDiag::sys_getSystemErrors() DeviceController::State DeviceControllerDiag::sys_getSystemErrors()
{ {
// 0: everything fine 1..15: errors
/* 1: real time clock error
2: printer error
3: no paper
4: coin blocker
5: mdb error
6: mem error int.ee.
7: error coin validator
8: coin safe missed or full
9: bill acceptor error
10: alarm / intrusion
11: cash box change is ongoing
12: card test running
13: startup-test is running
14: voltage error
15: temperature error
*/
return this->sub_componentAssessment(); return this->sub_componentAssessment();
} }
@ -278,74 +276,83 @@ void DeviceControllerDiag::private_finishedDiag(DeviceController::State result)
} }
// Errors are in this range 1...15:
QString eventId = QUuid::createUuid().toString(QUuid::WithoutBraces).mid(0, 8); QString eventId = QUuid::createUuid().toString(QUuid::WithoutBraces).mid(0, 8);
QString eventName = QMetaEnum::fromType<DeviceController::State>().valueToKey(result);; QString eventName = QMetaEnum::fromType<DeviceController::State>().valueToKey(result);;
EVENT_CLASS eventClass = EVENT_CLASS::STATE; EVENT_CLASS eventClass = EVENT_CLASS::STATE;
QString parameter; QString parameter;
switch (result) { switch (result) {
case DeviceController::State::E001: // real time clock error
eventClass = EVENT_CLASS::ERROR; case DeviceController::State::A000: // alarm / intrusion
parameter = "real time clock error";
break;
case DeviceController::State::E002: // printer error
eventClass = EVENT_CLASS::ERROR;
parameter = "printer error";
break;
case DeviceController::State::E003: // no paper
eventClass = EVENT_CLASS::ERROR;
parameter = "no paper";
break;
case DeviceController::State::E004: // coin blocker
eventClass = EVENT_CLASS::ERROR;
parameter = "coin blocker";
break;
case DeviceController::State::E005: // mdb error
eventClass = EVENT_CLASS::ERROR;
parameter = "mdb error";
break;
case DeviceController::State::E006: // mem error int.ee.
eventName = "E006";
eventClass = EVENT_CLASS::ERROR;
parameter = "mem error int.ee.";
break;
case DeviceController::State::E007: // error coin validator
eventClass = EVENT_CLASS::ERROR;
parameter = "error coin validator";
break;
case DeviceController::State::E008: // coin safe missed or full
eventClass = EVENT_CLASS::ERROR;
parameter = "coin safe missed or full";
break;
case DeviceController::State::E009: // bill acceptor error
eventClass = EVENT_CLASS::ERROR;
parameter = "bill acceptor error";
break;
case DeviceController::State::E010: // alarm / intrusion
eventClass = EVENT_CLASS::ALARM; eventClass = EVENT_CLASS::ALARM;
parameter = "alarm / intrusion"; parameter = "alarm / intrusion";
break; break;
case DeviceController::State::E011: // cash box change is ongoing case DeviceController::State::E002: // real time clock error
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::ERROR;
parameter = "cash box change is ongoing"; parameter = "real time clock error";
break; break;
case DeviceController::State::E012: // card test running case DeviceController::State::E003: // voltage error
eventClass = EVENT_CLASS::STATE;
parameter = "card test running";
break;
case DeviceController::State::E013: // startup-test is running
eventClass = EVENT_CLASS::STATE;
parameter = "startup-test is running";
break;
case DeviceController::State::E014: // voltage error
eventClass = EVENT_CLASS::ERROR; eventClass = EVENT_CLASS::ERROR;
parameter = "voltage error"; parameter = "voltage error";
break; break;
case DeviceController::State::E015: // temperature error case DeviceController::State::E004: // temperature error
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::ERROR;
parameter = "temperature error"; parameter = "temperature error";
break; break;
case DeviceController::State::E007: // coin safe full
eventClass = EVENT_CLASS::ERROR;
parameter = "coin safe full";
break;
case DeviceController::State::E008: // bill acceptor full
eventClass = EVENT_CLASS::ERROR;
parameter = "bill acceptor full";
break;
case DeviceController::State::E009: // no cash box
eventClass = EVENT_CLASS::ERROR;
parameter = "no cash box";
break;
case DeviceController::State::E010: // coin escrow
eventClass = EVENT_CLASS::ERROR;
parameter = "coin escrow";
break;
case DeviceController::State::E011: // mem error int.ee.
eventClass = EVENT_CLASS::ERROR;
parameter = "mem error int.ee.";
break;
case DeviceController::State::E018: // no paper
eventClass = EVENT_CLASS::ERROR;
parameter = "no paper";
break;
case DeviceController::State::E020: // printer error
eventClass = EVENT_CLASS::ERROR;
parameter = "printer error";
break;
case DeviceController::State::E025: // coin blocker
eventClass = EVENT_CLASS::ERROR;
parameter = "coin blocker";
break;
case DeviceController::State::E026: // error coin validator
eventClass = EVENT_CLASS::ERROR;
parameter = "error coin validator";
break;
case DeviceController::State::E034: // mdb error
eventClass = EVENT_CLASS::ERROR;
parameter = "mdb error";
break;
case DeviceController::State::E071: // cash box change is ongoing
eventClass = EVENT_CLASS::STATE;
parameter = "cash box change is ongoing";
break;
case DeviceController::State::E072: // card test running
eventClass = EVENT_CLASS::STATE;
parameter = "card test running";
break;
case DeviceController::State::E073: // startup-test is running
eventClass = EVENT_CLASS::STATE;
parameter = "startup-test is running";
break;
case DeviceController::State::E252: // oper door / lower door open case DeviceController::State::E252: // oper door / lower door open
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "oper door / lower door open"; parameter = "oper door / lower door open";

View File

@ -13,21 +13,30 @@ namespace DeviceController {
enum State { enum State {
O000, O000,
E001, A000,
E002, E002,
E003, E003,
E004, E004,
E005,
E006,
E007, E007,
E008, E008,
E009, E009,
E010, E010,
E011, E011,
E012,
E013, E018,
E014,
E015, E020,
E025,
E026,
E034,
E071,
E072,
E073,
E252, E252,
E253, E253,