Compare commits

..

5 Commits
2.5.0 ... 2.6.0

3 changed files with 33 additions and 25 deletions

View File

@@ -647,7 +647,7 @@ void ATBDeviceControllerPlugin::onNewVoltage(uint32_t voltage)
json = JSON::objectBuilder() json = JSON::objectBuilder()
->set("Name", "batt") ->set("Name", "batt")
->set("Value", voltageString) ->set("Value", voltageString)
->set("Unit", "V") ->set("Unit", "mV")
->create(); ->create();
@@ -792,6 +792,7 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket( " << endl qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket( " << endl
<< " licenseplate = " << printingData["licenseplate"] << endl << " licenseplate = " << printingData["licenseplate"] << endl
<< " productText = " << printingData["productText"] << endl
<< " amount = " << printingData["amount"] << endl << " amount = " << printingData["amount"] << endl
<< " parkingEnd = " << printingData["parkingEnd"] << endl << " parkingEnd = " << printingData["parkingEnd"] << endl
<< " currentDateTime = " << printingData["currentDateTime"] << endl << " currentDateTime = " << printingData["currentDateTime"] << endl
@@ -841,11 +842,14 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
QByteArray ba_currentDate = codec->fromUnicode(currentDateString); QByteArray ba_currentDate = codec->fromUnicode(currentDateString);
memcpy((char*)dynTicketData->currentDate, ba_currentDate.data(), std::min(ba_currentDate.size(),8)); memcpy((char*)dynTicketData->currentDate, ba_currentDate.data(), std::min(ba_currentDate.size(),8));
// Product-Text
QByteArray ba_productText = codec->fromUnicode(printingData["productText"].toString());
memcpy((char*)dynTicketData->dynDat5, ba_productText.data(), std::min(ba_productText.size(),8));
// Ticket-Number // Ticket-Number
QByteArray ba_ticketNumber = codec->fromUnicode(printingData["ticketNumber"].toString()); QByteArray ba_ticketNumber = codec->fromUnicode(printingData["ticketNumber"].toString());
memcpy((char*)dynTicketData->dynDat7, ba_ticketNumber.data(), std::min(ba_ticketNumber.size(),8)); memcpy((char*)dynTicketData->dynDat7, ba_ticketNumber.data(), std::min(ba_ticketNumber.size(),8));
// DEBUG // DEBUG
/* /*
uint8_t* buf = dynTicketData->licensePlate; uint8_t* buf = dynTicketData->licensePlate;
@@ -1329,8 +1333,8 @@ void ATBDeviceControllerPlugin::onCashPayStopByEscrow()
"", "",
"", "",
"", "",
"", "CashPayStopByEscrow",
""); "CashPayStopByEscrow");
} }
void ATBDeviceControllerPlugin::onCashPayStopByError() void ATBDeviceControllerPlugin::onCashPayStopByError()
@@ -1347,8 +1351,8 @@ void ATBDeviceControllerPlugin::onCashPayStopByError()
"", "",
"", "",
"", "",
"", "onCashPayStopByError",
""); "onCashPayStopByError");
} }
void ATBDeviceControllerPlugin::onCashPayStopByTimeout() void ATBDeviceControllerPlugin::onCashPayStopByTimeout()
@@ -1365,8 +1369,8 @@ void ATBDeviceControllerPlugin::onCashPayStopByTimeout()
"", "",
"", "",
"", "",
"", "CashPayStopByTimeout",
""); "CashPayStopByTimeout");
} }
void ATBDeviceControllerPlugin::onCashPayStopedSuccess() void ATBDeviceControllerPlugin::onCashPayStopedSuccess()
@@ -1712,6 +1716,7 @@ void ATBDeviceControllerPlugin::onWokeUp(uchar source)
{ {
if (source == 0x01 || source == 0xFE) { if (source == 0x01 || source == 0xFE) {
// woke up from device controller // woke up from device controller
hw->dc_autoRequest(true);
this->diag->diagRequest(); this->diag->diagRequest();
} }
} }

View File

@@ -135,6 +135,7 @@ void DeviceControllerDiag::private_startDiag()
qCritical() << "DeviceControllerDiag::private_startDiag() DCdata is +++not+++ valid"; qCritical() << "DeviceControllerDiag::private_startDiag() DCdata is +++not+++ valid";
// try it again // try it again
hw->dc_autoRequest(true);
QTimer::singleShot(200, this, &DeviceControllerDiag::private_startDiag); QTimer::singleShot(200, this, &DeviceControllerDiag::private_startDiag);
} }
} }
@@ -164,7 +165,8 @@ void DeviceControllerDiag::sys_superviseSystem()
{ {
// es gibt keinerlei gültige Daten vom DC // es gibt keinerlei gültige Daten vom DC
qCritical() << "DeviceControllerDiag::sys_superviseSystem() no valid data!"; qCritical() << "DeviceControllerDiag::sys_superviseSystem() no valid data!";
this->private_sendDiagEvent(DeviceController::State::E254); hw->dc_autoRequest(true);
this->private_sendDiagEvent(DeviceController::State::M0254);
this->diagRequestTimeoutTimer->stop(); this->diagRequestTimeoutTimer->stop();
this->isRequestRunning = false; this->isRequestRunning = false;
if (this->E255counter > 5) { this->restartCArun(); } if (this->E255counter > 5) { this->restartCArun(); }
@@ -230,13 +232,13 @@ void DeviceControllerDiag::sub_componentAssessment()
// Service or battery door is open // Service or battery door is open
flag_sendOperate = false; flag_sendOperate = false;
qCritical() << "DeviceControllerDiag::sys_superviseSystem() Service or battery door is open, goto INTRUSION MODE"; qCritical() << "DeviceControllerDiag::sys_superviseSystem() Service or battery door is open, goto INTRUSION MODE";
this->private_sendDiagEvent(DeviceController::State::E253); this->private_sendDiagEvent(DeviceController::State::M0253);
} }
if (dynMaCond.middleDoor) { if (dynMaCond.middleDoor) {
// vault door is open // vault door is open
flag_sendOperate = false; flag_sendOperate = false;
qCritical() << "DeviceControllerDiag::sys_superviseSystem() vault door is open, goto INTRUSION MODE"; qCritical() << "DeviceControllerDiag::sys_superviseSystem() vault door is open, goto INTRUSION MODE";
this->private_sendDiagEvent(DeviceController::State::E252); this->private_sendDiagEvent(DeviceController::State::M0252);
} }
// check for invalid states: // check for invalid states:
@@ -364,12 +366,12 @@ void DeviceControllerDiag::sub_componentAssessment()
if (dynMaCond.nowCardTest>0) { if (dynMaCond.nowCardTest>0) {
flag_sendOperate = false; flag_sendOperate = false;
this->private_sendDiagEvent(DeviceController::State::E072); this->private_sendDiagEvent(DeviceController::State::M0072);
} }
if (dynMaCond.startupTestIsRunning>0) { if (dynMaCond.startupTestIsRunning>0) {
flag_sendOperate = false; flag_sendOperate = false;
this->private_sendDiagEvent(DeviceController::State::E073); this->private_sendDiagEvent(DeviceController::State::M0073);
} }
if (modCond.voltage>=200) { if (modCond.voltage>=200) {
@@ -524,28 +526,28 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
this->_isErrorState = true; this->_isErrorState = true;
break; break;
case DeviceController::State::E071: // cash box change is ongoing case DeviceController::State::M0071: // cash box change is ongoing
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "cash box change is ongoing"; parameter = "cash box change is ongoing";
break; break;
case DeviceController::State::E072: // card test running case DeviceController::State::M0072: // card test running
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "card test running"; parameter = "card test running";
break; break;
case DeviceController::State::E073: // startup-test is running case DeviceController::State::M0073: // startup-test is running
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "startup-test is running"; parameter = "startup-test is running";
break; break;
case DeviceController::State::E252: // cash box door open case DeviceController::State::M0252: // cash box door open
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "cash box door open"; parameter = "cash box door open";
break; break;
case DeviceController::State::E253: // service or battery door open case DeviceController::State::M0253: // service or battery door open
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "service or battery door open"; parameter = "service or battery door open";
break; break;
case DeviceController::State::E254: // no valid data from DeviceController case DeviceController::State::M0254: // no valid data from DeviceController
eventClass = EVENT_CLASS::STATE; eventClass = EVENT_CLASS::STATE;
parameter = "no valid data from DeviceController"; parameter = "no valid data from DeviceController";
break; break;

View File

@@ -41,13 +41,14 @@ namespace DeviceController {
E034, E034,
E071, M0071, // cashbox change is ongoing
E072, M0072, // cardtest is running
E073, M0073, // startup-test is running
M0252, // cashbox door open
M0253, // service or battery door is open
M0254, // no valid data from DC
E252,
E253,
E254,
E255, E255,
W001, W001,