#ifndef DEVICECONTROLLERDIAG_H #define DEVICECONTROLLERDIAG_H #include #include #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); void newVoltage(uint32_t voltage); private: QObject *eventReceiver; hwinf* hw; bool isRequestRunning; bool flagInterruptDiag; QTimer *diagRequestTimeoutTimer; uint8_t sub_componentAssessment(); uint8_t sys_getSystemErrors(); int lastVoltage; 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