Restart carun on consecutive E255
This commit is contained in:
parent
6c2717c56b
commit
c1dd20ec4f
@ -5,6 +5,8 @@
|
|||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
|
||||||
#include "support/JSON.h"
|
#include "support/JSON.h"
|
||||||
|
|
||||||
|
|
||||||
@ -18,6 +20,7 @@ DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *paren
|
|||||||
, lastState(DeviceController::State::INITIAL_STATE)
|
, lastState(DeviceController::State::INITIAL_STATE)
|
||||||
, _isErrorState(false)
|
, _isErrorState(false)
|
||||||
, pData(pData)
|
, pData(pData)
|
||||||
|
, E255counter(0)
|
||||||
{
|
{
|
||||||
diagRequestTimeoutTimer = new QTimer(this);
|
diagRequestTimeoutTimer = new QTimer(this);
|
||||||
diagRequestTimeoutTimer->setInterval(1000*45);
|
diagRequestTimeoutTimer->setInterval(1000*45);
|
||||||
@ -104,6 +107,11 @@ void DeviceControllerDiag::private_startDiag()
|
|||||||
this->private_sendDiagEvent(DeviceController::State::E255);
|
this->private_sendDiagEvent(DeviceController::State::E255);
|
||||||
this->isRequestRunning = false;
|
this->isRequestRunning = false;
|
||||||
this->flagInterruptDiag = false;
|
this->flagInterruptDiag = false;
|
||||||
|
if (this->E255counter > 5) {
|
||||||
|
this->restartCArun();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->E255counter++;
|
||||||
|
|
||||||
// try it again, until success:
|
// try it again, until success:
|
||||||
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
|
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
|
||||||
@ -112,6 +120,7 @@ void DeviceControllerDiag::private_startDiag()
|
|||||||
* - diag does currently not stop suspend (start a background task)
|
* - diag does currently not stop suspend (start a background task)
|
||||||
* - diag is called again in ModeOOO wokeup()
|
* - diag is called again in ModeOOO wokeup()
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,6 +155,8 @@ void DeviceControllerDiag::sys_superviseSystem()
|
|||||||
this->private_sendDiagEvent(DeviceController::State::E255);
|
this->private_sendDiagEvent(DeviceController::State::E255);
|
||||||
this->flagInterruptDiag = false;
|
this->flagInterruptDiag = false;
|
||||||
this->isRequestRunning = false;
|
this->isRequestRunning = false;
|
||||||
|
if (this->E255counter > 5) { this->restartCArun(); }
|
||||||
|
else { this->E255counter++; }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,6 +167,8 @@ void DeviceControllerDiag::sys_superviseSystem()
|
|||||||
this->private_sendDiagEvent(DeviceController::State::E254);
|
this->private_sendDiagEvent(DeviceController::State::E254);
|
||||||
this->diagRequestTimeoutTimer->stop();
|
this->diagRequestTimeoutTimer->stop();
|
||||||
this->isRequestRunning = false;
|
this->isRequestRunning = false;
|
||||||
|
if (this->E255counter > 5) { this->restartCArun(); }
|
||||||
|
else { this->E255counter++; }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +181,7 @@ void DeviceControllerDiag::sys_superviseSystem()
|
|||||||
{
|
{
|
||||||
// noch keine Testergebnisse
|
// noch keine Testergebnisse
|
||||||
if (dynMaCond.startupTestIsRunning) {
|
if (dynMaCond.startupTestIsRunning) {
|
||||||
// TODO?
|
qCritical() << " startupTestIsRunning --> call again";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -599,3 +612,12 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reset / restart / reinit deviceController
|
||||||
|
*/
|
||||||
|
void DeviceControllerDiag::restartCArun()
|
||||||
|
{
|
||||||
|
this->E255counter = 0;
|
||||||
|
QProcess::startDetached("/bin/systemctl", {"restart", "carun"});
|
||||||
|
}
|
||||||
|
@ -94,6 +94,11 @@ public slots:
|
|||||||
*/
|
*/
|
||||||
void diagReInit();
|
void diagReInit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reset / restart / reinit deviceController
|
||||||
|
*/
|
||||||
|
void restartCArun();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void diagResponse(ATBMachineEvent* machineEvent);
|
void diagResponse(ATBMachineEvent* machineEvent);
|
||||||
|
|
||||||
@ -118,6 +123,8 @@ private:
|
|||||||
|
|
||||||
PersistentData* pData;
|
PersistentData* pData;
|
||||||
|
|
||||||
|
int E255counter;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onDiagRequestTimeoutTimerTimeout();
|
void onDiagRequestTimeoutTimerTimeout();
|
||||||
|
|
||||||
@ -126,7 +133,6 @@ private slots:
|
|||||||
|
|
||||||
void sys_superviseSystem();
|
void sys_superviseSystem();
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DEVICECONTROLLERDIAG_H
|
#endif // DEVICECONTROLLERDIAG_H
|
||||||
|
Loading…
Reference in New Issue
Block a user