From 6a39aae7a6b380daf708c5da5768584606e0aa29 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Tue, 25 Jul 2023 11:14:26 +0200 Subject: [PATCH] Diag: re-map error codes according to old Szeged error list --- src/ATBAPP/DeviceControllerDiag.cpp | 185 +++++++++++++++------------- src/ATBAPP/DeviceControllerDiag.h | 23 ++-- 2 files changed, 112 insertions(+), 96 deletions(-) diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index 377622b..c5bca39 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -164,29 +164,32 @@ DeviceController::State DeviceControllerDiag::sub_componentAssessment() // check for invalid states: 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; + 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) - return DeviceController::State::E003; + return DeviceController::State::E018; if (modCond.coinBlocker>=200) - return DeviceController::State::E004; + return DeviceController::State::E025; if (modCond.mdbBus>=200) - return DeviceController::State::E005; + return DeviceController::State::E034; 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 (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; } - 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 if (devPara.kindOfCoinChecker==3) @@ -194,36 +197,48 @@ DeviceController::State DeviceControllerDiag::sub_componentAssessment() if (modCond.changer>=200) { // Fehler Münzver. + return DeviceController::State::E026; + } + if (modCond.coinSafe==201) // full + { 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) { - // Fehler BNA - return DeviceController::State::E009; + if (modCond.billReader == 200) // 200: kasse fehlt 201: voll 100:fast voll 1:ok + { + return TODO; + } + if (modCond.billReader == 201) // 200: kasse fehlt 201: voll 100:fast voll 1:ok + { + return TODO; + } } + */ if (dynMaCond.onAlarm>0) - return DeviceController::State::E010; + return DeviceController::State::A000; if (dynMaCond.modeAbrech>0) return DeviceController::State::E011; if (dynMaCond.nowCardTest>0) - return DeviceController::State::E012; + return DeviceController::State::E072; if (dynMaCond.startupTestIsRunning>0) - return DeviceController::State::E013; + return DeviceController::State::E073; if (modCond.voltage>=200) - return DeviceController::State::E014; + return DeviceController::State::E003; if (modCond.temper>=200) - return DeviceController::State::E015; + return DeviceController::State::E004; // check for warnings @@ -234,23 +249,6 @@ DeviceController::State DeviceControllerDiag::sub_componentAssessment() 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(); } @@ -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 eventName = QMetaEnum::fromType().valueToKey(result);; EVENT_CLASS eventClass = EVENT_CLASS::STATE; QString parameter; switch (result) { - case DeviceController::State::E001: // real time clock error - eventClass = EVENT_CLASS::ERROR; - 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 + + case DeviceController::State::A000: // alarm / intrusion eventClass = EVENT_CLASS::ALARM; parameter = "alarm / intrusion"; break; - case DeviceController::State::E011: // cash box change is ongoing - eventClass = EVENT_CLASS::STATE; - parameter = "cash box change is ongoing"; + case DeviceController::State::E002: // real time clock error + eventClass = EVENT_CLASS::ERROR; + parameter = "real time clock error"; break; - case DeviceController::State::E012: // card test running - 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 + case DeviceController::State::E003: // voltage error eventClass = EVENT_CLASS::ERROR; parameter = "voltage error"; break; - case DeviceController::State::E015: // temperature error - eventClass = EVENT_CLASS::STATE; + case DeviceController::State::E004: // temperature error + eventClass = EVENT_CLASS::ERROR; parameter = "temperature error"; 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 eventClass = EVENT_CLASS::STATE; parameter = "oper door / lower door open"; diff --git a/src/ATBAPP/DeviceControllerDiag.h b/src/ATBAPP/DeviceControllerDiag.h index e39eb2a..0a3e848 100644 --- a/src/ATBAPP/DeviceControllerDiag.h +++ b/src/ATBAPP/DeviceControllerDiag.h @@ -13,21 +13,30 @@ namespace DeviceController { enum State { O000, - E001, + A000, + E002, E003, E004, - E005, - E006, + E007, E008, E009, E010, E011, - E012, - E013, - E014, - E015, + + E018, + + E020, + + E025, + E026, + + E034, + + E071, + E072, + E073, E252, E253,