Reworked data types, part II
This commit is contained in:
@@ -58,31 +58,26 @@ class BCCanDriver : public QObject
|
||||
|
||||
public:
|
||||
|
||||
typedef enum
|
||||
enum class DriverState
|
||||
{
|
||||
sDriverError = 0,
|
||||
sIdle,
|
||||
sLoaded,
|
||||
sReady,
|
||||
dStateSize
|
||||
} dState;
|
||||
|
||||
[[maybe_unused]] constexpr static const char* stDriverError = "Error";
|
||||
[[maybe_unused]] constexpr static const char* stIdle = "[not loaded]";
|
||||
[[maybe_unused]] constexpr static const char* stLoaded = "[not connected]";
|
||||
[[maybe_unused]] constexpr static const char* stReady = "Ready";
|
||||
|
||||
static QString stateLabel( dState state );
|
||||
NotPresent,
|
||||
Error,
|
||||
Loaded,
|
||||
Initialized,
|
||||
Connected,
|
||||
Ready
|
||||
};
|
||||
Q_ENUM(DriverState)
|
||||
|
||||
explicit BCCanDriver( QObject* parent = nullptr );
|
||||
virtual ~BCCanDriver() = default;
|
||||
|
||||
dState getState();
|
||||
DriverState getState() const;
|
||||
|
||||
virtual BCCanDriver::dState loadDriver() = 0;
|
||||
virtual BCCanDriver::dState initDriver() = 0;
|
||||
virtual DriverState loadDriver() = 0;
|
||||
virtual DriverState initDriver() = 0;
|
||||
|
||||
virtual std::optional<bcdata_t> readRawValue( BCDevice::ID deviceID, BC::ID registerID ) const = 0;
|
||||
virtual bcdata_t readRawValue( BCDevice::ID deviceID, BC::ID registerID ) const = 0;
|
||||
virtual void writeRawValue( BCDevice::ID deviceID, BC::ID registerID, bcdata_t value ) const = 0;
|
||||
|
||||
signals:
|
||||
@@ -91,20 +86,18 @@ signals:
|
||||
void statusHint( const QString& msg ) const;
|
||||
|
||||
void stateChanged( int state );
|
||||
void itemReady( const QString& label );
|
||||
void itemLoaded( CBCItem& item );
|
||||
|
||||
public slots:
|
||||
|
||||
void onStartDriver();
|
||||
//void onLoadItem( CBCItem& item );
|
||||
|
||||
protected:
|
||||
|
||||
void setState( dState newState );
|
||||
void setState( DriverState newState );
|
||||
|
||||
dState _driverState = sIdle;
|
||||
DriverState _driverState{DriverState::NotPresent};
|
||||
|
||||
//??
|
||||
int _retries = 5;
|
||||
int _timeOuts = 20;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user