2023-06-22 08:44:16 +02:00
|
|
|
#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);
|
|
|
|
|
2023-07-05 18:47:45 +02:00
|
|
|
void newVoltage(uint32_t voltage);
|
2023-06-22 08:44:16 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QObject *eventReceiver;
|
|
|
|
hwinf* hw;
|
|
|
|
|
|
|
|
bool isRequestRunning;
|
|
|
|
bool flagInterruptDiag;
|
|
|
|
|
|
|
|
QTimer *diagRequestTimeoutTimer;
|
|
|
|
|
|
|
|
uint8_t sub_componentAssessment();
|
|
|
|
uint8_t sys_getSystemErrors();
|
|
|
|
|
2023-07-05 18:47:45 +02:00
|
|
|
int lastVoltage;
|
|
|
|
|
2023-06-22 08:44:16 +02:00
|
|
|
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
|