#ifndef DEVICECONTROLLERDIAG_H #define DEVICECONTROLLERDIAG_H #include #include #include "ATBMachineEvent.h" #include "interfaces.h" namespace DeviceController { Q_NAMESPACE enum State { O000, E001, E002, E003, E004, E005, E006, E007, E008, E009, E010, E011, E012, E013, E014, E015, 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