2023-06-22 08:44:16 +02:00
|
|
|
#ifndef DEVICECONTROLLERDIAG_H
|
|
|
|
#define DEVICECONTROLLERDIAG_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
#include "ATBMachineEvent.h"
|
|
|
|
#include "interfaces.h"
|
|
|
|
|
2023-07-25 07:59:58 +02:00
|
|
|
namespace DeviceController {
|
|
|
|
Q_NAMESPACE
|
|
|
|
|
|
|
|
enum State {
|
|
|
|
O000,
|
|
|
|
|
2023-07-25 11:14:26 +02:00
|
|
|
A000,
|
|
|
|
|
2023-07-25 07:59:58 +02:00
|
|
|
E002,
|
|
|
|
E003,
|
|
|
|
E004,
|
2023-07-25 11:14:26 +02:00
|
|
|
|
2023-07-25 07:59:58 +02:00
|
|
|
E007,
|
|
|
|
E008,
|
|
|
|
E009,
|
|
|
|
E010,
|
|
|
|
E011,
|
2023-07-25 11:14:26 +02:00
|
|
|
|
|
|
|
E018,
|
|
|
|
|
|
|
|
E020,
|
|
|
|
|
|
|
|
E025,
|
|
|
|
E026,
|
|
|
|
|
|
|
|
E034,
|
|
|
|
|
|
|
|
E071,
|
|
|
|
E072,
|
|
|
|
E073,
|
2023-07-25 07:59:58 +02:00
|
|
|
|
|
|
|
E252,
|
|
|
|
E253,
|
|
|
|
E254,
|
|
|
|
E255,
|
|
|
|
|
|
|
|
W001,
|
|
|
|
W002,
|
|
|
|
W003,
|
|
|
|
W004
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(State)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-06-22 08:44:16 +02:00
|
|
|
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;
|
|
|
|
|
2023-07-25 07:59:58 +02:00
|
|
|
//uint8_t sub_componentAssessment();
|
|
|
|
DeviceController::State sub_componentAssessment();
|
|
|
|
DeviceController::State sys_getSystemErrors();
|
2023-06-22 08:44:16 +02:00
|
|
|
|
2023-07-05 18:47:45 +02:00
|
|
|
int lastVoltage;
|
|
|
|
|
2023-06-22 08:44:16 +02:00
|
|
|
private slots:
|
|
|
|
void onDiagRequestTimeoutTimerTimeout();
|
|
|
|
|
2023-07-25 07:59:58 +02:00
|
|
|
void private_startDiag(); // diag entry method
|
|
|
|
void private_finishedDiag(DeviceController::State result); // diag exit method
|
2023-06-22 08:44:16 +02:00
|
|
|
|
|
|
|
void sys_superviseSystem();
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DEVICECONTROLLERDIAG_H
|