DCPlugin/src/ATBAPP/DeviceControllerDiag.h

99 lines
1.5 KiB
C++

#ifndef DEVICECONTROLLERDIAG_H
#define DEVICECONTROLLERDIAG_H
#include <QObject>
#include <QTimer>
#include "ATBMachineEvent.h"
#include "interfaces.h"
namespace DeviceController {
Q_NAMESPACE
enum State {
O000,
A000,
E002,
E003,
E004,
E007,
E008,
E009,
E010,
E011,
E018,
E020,
E025,
E026,
E034,
E071,
E072,
E073,
E252,
E253,
E254,
E255,
W001,
W002,
W003,
W004
};
Q_ENUM_NS(State)
}
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);
void newVoltage(uint32_t voltage);
private:
QObject *eventReceiver;
hwinf* hw;
bool isRequestRunning;
bool flagInterruptDiag;
QTimer *diagRequestTimeoutTimer;
//uint8_t sub_componentAssessment();
DeviceController::State sub_componentAssessment();
DeviceController::State sys_getSystemErrors();
int lastVoltage;
private slots:
void onDiagRequestTimeoutTimerTimeout();
void private_startDiag(); // diag entry method
void private_finishedDiag(DeviceController::State result); // diag exit method
void sys_superviseSystem();
};
#endif // DEVICECONTROLLERDIAG_H