Reworked driver code.
This commit is contained in:
34
bcdriver.cpp
34
bcdriver.cpp
@@ -48,12 +48,6 @@ BCDriver::DriverState BCDriver::getState() const
|
||||
return _driverState;
|
||||
}
|
||||
|
||||
void BCDriver::setState( DriverState newState )
|
||||
{
|
||||
_driverState = newState;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Der Slot, der das Initialisieren des Treibers auslöst.
|
||||
@@ -65,34 +59,33 @@ void BCDriver::setState( DriverState newState )
|
||||
* aber die Console noch nicht eingeschaltet war.
|
||||
*/
|
||||
|
||||
void BCDriver::onStartDriver()
|
||||
void BCDriverDummy::onStartDriver()
|
||||
{
|
||||
|
||||
_driverState = DriverState::Ready;
|
||||
emit driverStateChanged( DriverState::Ready, "Driver Ready." );
|
||||
}
|
||||
/*
|
||||
try
|
||||
{
|
||||
|
||||
// erstmal die Dll Laden: State::sIdle -> State::sLoaded
|
||||
if( _driverState == DriverState::NotPresent)
|
||||
_driverState = loadDriver();
|
||||
_driverState = loadAndInitDriver();
|
||||
|
||||
emit stateChanged( _driverState );
|
||||
|
||||
// DLL geladen, Verbindungsversuch
|
||||
_driverState = initDriver();
|
||||
|
||||
// Wir haben was erreicht
|
||||
emit stateChanged( _driverState );
|
||||
}
|
||||
catch( std::exception& except )
|
||||
{
|
||||
//::CanDownDriver();
|
||||
//::UnloadDriver();
|
||||
//::UnloadAndInitDriver();
|
||||
|
||||
emit errorOccured( except.what() );
|
||||
emit statusHint( except.what() );
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// -----------------------------------------------------------------------------------
|
||||
/// -----------------------------------------------------------------------------------
|
||||
@@ -107,14 +100,11 @@ BCDriverDummy::BCDriverDummy( QObject* parent )
|
||||
{
|
||||
}
|
||||
|
||||
BCDriver::DriverState BCDriverDummy::loadDriver()
|
||||
BCDriver::DriverState BCDriverDummy::loadAndInitDriver()
|
||||
{
|
||||
return BCDriver::DriverState::Ready;
|
||||
}
|
||||
BCDriver::DriverState BCDriverDummy::initDriver()
|
||||
{
|
||||
return DriverState::Ready;
|
||||
}
|
||||
|
||||
|
||||
uint32_t BCDriverDummy::readRawByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user