Diag: E255 / W255 / M0254 -> set, send and finish diag
This states are rather meta infos about dc condition. Therefore the where created and sent outside of superviseSystem()-method. This commit should ensure that: - this states are sent to ISMAS - this states are inserted in machineEventSet in order to enable a reset in next diagRun
This commit is contained in:
parent
18a35acf20
commit
f75f2c57df
@ -111,9 +111,9 @@ void DeviceControllerDiag::private_startDiag()
|
|||||||
// check for DiagRequestTimeoutTimerTimeout:
|
// check for DiagRequestTimeoutTimerTimeout:
|
||||||
if (this->flagInterruptDiag) {
|
if (this->flagInterruptDiag) {
|
||||||
qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!";
|
qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!";
|
||||||
this->private_setDiagEvent(DeviceController::State::E255);
|
DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255);
|
||||||
this->isRequestRunning = false;
|
machineEventSet.insert(E255Event);
|
||||||
this->flagInterruptDiag = false;
|
private_sendDiagEvent(E255Event, DeviceController::Action::SET);
|
||||||
if (this->E255counter > 5) {
|
if (this->E255counter > 5) {
|
||||||
this->restartCArun();
|
this->restartCArun();
|
||||||
// try it again, until success:
|
// try it again, until success:
|
||||||
@ -169,9 +169,10 @@ void DeviceControllerDiag::sys_superviseSystem()
|
|||||||
// check for DiagRequestTimeoutTimerTimeout:
|
// check for DiagRequestTimeoutTimerTimeout:
|
||||||
if (this->flagInterruptDiag) {
|
if (this->flagInterruptDiag) {
|
||||||
qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!";
|
qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!";
|
||||||
this->private_setDiagEvent(DeviceController::State::E255);
|
// send
|
||||||
this->flagInterruptDiag = false;
|
DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255);
|
||||||
this->isRequestRunning = false;
|
machineEventSet.insert(E255Event);
|
||||||
|
private_sendDiagEvent(E255Event, DeviceController::Action::SET);
|
||||||
if (this->E255counter > 5) { this->restartCArun(); }
|
if (this->E255counter > 5) { this->restartCArun(); }
|
||||||
else { this->E255counter++; }
|
else { this->E255counter++; }
|
||||||
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
|
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
|
||||||
@ -184,9 +185,11 @@ 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!";
|
||||||
hw->dc_autoRequest(true);
|
hw->dc_autoRequest(true);
|
||||||
this->private_setDiagEvent(DeviceController::State::M0254);
|
|
||||||
this->diagRequestTimeoutTimer->stop();
|
DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::M0254);
|
||||||
this->isRequestRunning = false;
|
machineEventSet.insert(E255Event);
|
||||||
|
private_sendDiagEvent(E255Event, DeviceController::Action::SET);
|
||||||
|
|
||||||
if (this->E255counter > 5) { this->restartCArun(); }
|
if (this->E255counter > 5) { this->restartCArun(); }
|
||||||
else { this->E255counter++; }
|
else { this->E255counter++; }
|
||||||
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
|
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
|
||||||
@ -457,9 +460,8 @@ void DeviceControllerDiag::sub_componentAssessment()
|
|||||||
|
|
||||||
// send Operate if there is no error
|
// send Operate if there is no error
|
||||||
if (flag_sendOperate) {
|
if (flag_sendOperate) {
|
||||||
// O000 must not be part of event set
|
// O000 must not be part of machineEventSet
|
||||||
DCMachineEvent O000DCMachineEvent = DCMachineEvent(DeviceController::State::O000,
|
DCMachineEvent O000DCMachineEvent = DCMachineEvent(DeviceController::State::O000);
|
||||||
QUuid::createUuid().toString(QUuid::WithoutBraces).mid(0, 8));
|
|
||||||
this->private_sendDiagEvent(O000DCMachineEvent, DeviceController::Action::SET);
|
this->private_sendDiagEvent(O000DCMachineEvent, DeviceController::Action::SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +511,7 @@ void DeviceControllerDiag::private_setDiagEvent(DeviceController::State result)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DCMachineEvent newState = DCMachineEvent(result, QUuid::createUuid().toString(QUuid::WithoutBraces).mid(0, 8));
|
DCMachineEvent newState = DCMachineEvent(result);
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
qCritical() << "----> setDiagEvent: " << newState.state << " with id: " << newState.eventId;
|
qCritical() << "----> setDiagEvent: " << newState.state << " with id: " << newState.eventId;
|
||||||
@ -708,7 +710,12 @@ void DeviceControllerDiag::private_sendDiagEvent(DCMachineEvent result, DeviceCo
|
|||||||
void DeviceControllerDiag::restartCArun()
|
void DeviceControllerDiag::restartCArun()
|
||||||
{
|
{
|
||||||
this->E255counter = 0;
|
this->E255counter = 0;
|
||||||
this->private_setDiagEvent(DeviceController::State::W255);
|
|
||||||
|
|
||||||
|
DCMachineEvent W255Event = DCMachineEvent(DeviceController::State::W255);
|
||||||
|
machineEventSet.insert(W255Event);
|
||||||
|
private_sendDiagEvent(W255Event, DeviceController::Action::SET);
|
||||||
|
|
||||||
QProcess::startDetached("/bin/systemctl", {"restart", "carun"});
|
QProcess::startDetached("/bin/systemctl", {"restart", "carun"});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user