Reworked driver code.

This commit is contained in:
2026-01-01 00:40:27 +01:00
parent 54e89e412a
commit 3ed3511f50
9 changed files with 201 additions and 212 deletions

View File

@@ -96,8 +96,8 @@ public:
Error,
Loaded,
Initialized,
Connected,
Ready
Opended, // bis hierher: dll vorhanden, Treiber geladen
Ready // hier: devices connectable
};
Q_ENUM(DriverState)
@@ -106,28 +106,19 @@ public:
DriverState getState() const;
virtual DriverState loadDriver() = 0;
virtual DriverState initDriver() = 0;
virtual uint32_t readRawByte( uint32_t deviceID, uint8_t registerID ) const = 0;
virtual void writeRawByte( uint32_t deviceID, uint8_t registerID, uint8_t value ) const = 0;
signals:
// __fix wird das gebraucht?
void errorOccured( const QString& errMsg );
void statusHint( const QString& msg ) const;
void stateChanged( DriverState state );
public slots:
void onStartDriver();
virtual void onStartDriver() = 0;
signals:
void driverStateChanged( DriverState state, const QString& message="" );
protected:
void setState( DriverState newState );
DriverState _driverState{DriverState::NotPresent};
};
@@ -139,15 +130,14 @@ class BCDriverDummy : public BCDriver
public:
explicit BCDriverDummy( QObject* parent = nullptr );
DriverState loadDriver() override;
DriverState initDriver() override;
uint32_t readRawByte( uint32_t deviceID, uint8_t registerID ) const override;
void writeRawByte( uint32_t deviceID, uint8_t registerID, uint8_t value ) const override;
public slots:
virtual void onStartDriver() override;
};
#endif // BCDRIVER_H