Add class DeviceControllerDiag to supervise DeviceController state
This commit is contained in:
49
src/ATBAPP/DeviceControllerDiag.h
Normal file
49
src/ATBAPP/DeviceControllerDiag.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef DEVICECONTROLLERDIAG_H
|
||||
#define DEVICECONTROLLERDIAG_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
#include "ATBMachineEvent.h"
|
||||
#include "interfaces.h"
|
||||
|
||||
class DeviceControllerDiag : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DeviceControllerDiag(QObject *parent = nullptr);
|
||||
|
||||
void init(hwinf* hw, QObject* eventReceiver);
|
||||
|
||||
public slots:
|
||||
void diagRequest();
|
||||
|
||||
signals:
|
||||
void diagResponse(ATBMachineEvent* machineEvent);
|
||||
|
||||
|
||||
private:
|
||||
QObject *eventReceiver;
|
||||
hwinf* hw;
|
||||
|
||||
bool isRequestRunning;
|
||||
bool flagInterruptDiag;
|
||||
|
||||
QTimer *diagRequestTimeoutTimer;
|
||||
|
||||
uint8_t sub_componentAssessment();
|
||||
uint8_t sys_getSystemErrors();
|
||||
|
||||
private slots:
|
||||
void onDiagRequestTimeoutTimerTimeout();
|
||||
|
||||
void private_startDiag(); // diag entry method
|
||||
void private_finishedDiag(uint8_t result); // diag exit method
|
||||
|
||||
void sys_superviseSystem();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // DEVICECONTROLLERDIAG_H
|
||||
Reference in New Issue
Block a user