Some renamings.
This commit is contained in:
@@ -29,24 +29,24 @@ SOURCES += \
|
||||
bcanimateddelegate.cpp \
|
||||
bcdatamanager.cpp \
|
||||
bcdeviceview.cpp \
|
||||
bcdriver.cpp \
|
||||
bcdrivertinycan.cpp \
|
||||
bclegacy.cpp \
|
||||
bctransmitter.cpp \
|
||||
bcvalue.cpp \
|
||||
bcvaluemodel.cpp \
|
||||
bcvaluetype.cpp \
|
||||
lib/can_drv_win.c \
|
||||
bccandriver.cpp \
|
||||
bccandrivertinycan.cpp \
|
||||
main.cpp \
|
||||
bcmainwindow.cpp
|
||||
|
||||
HEADERS += \
|
||||
bc.h \
|
||||
bcanimateddelegate.h \
|
||||
bccandriver.h \
|
||||
bccandrivertinycan.h \
|
||||
bcdatamanager.h \
|
||||
bcdeviceview.h \
|
||||
bcdriver.h \
|
||||
bcdrivertinycan.h \
|
||||
bcmainwindow.h \
|
||||
bctransmitter.h \
|
||||
bcvalue.h \
|
||||
|
||||
@@ -272,8 +272,6 @@ void BCAnimatedDelegate::paintHighlightRow(QPainter* painter, const QStyleOption
|
||||
|
||||
void BCAnimatedDelegate::onHighlightRow(int row)
|
||||
{
|
||||
qDebug() << " --- should highlight: " << row;
|
||||
|
||||
// Alte Animation für diese Zeile stoppen falls vorhanden
|
||||
if (m_rowAnimations.contains(row))
|
||||
{
|
||||
|
||||
@@ -32,22 +32,22 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <bccandriver.h>
|
||||
#include <bcdriver.h>
|
||||
|
||||
|
||||
|
||||
BCCanDriver::BCCanDriver(QObject* parent )
|
||||
BCDriver::BCDriver(QObject* parent )
|
||||
: QObject{ parent }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BCCanDriver::DriverState BCCanDriver::getState() const
|
||||
BCDriver::DriverState BCDriver::getState() const
|
||||
{
|
||||
return _driverState;
|
||||
}
|
||||
|
||||
void BCCanDriver::setState( DriverState newState )
|
||||
void BCDriver::setState( DriverState newState )
|
||||
{
|
||||
_driverState = newState;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ void BCCanDriver::setState( DriverState newState )
|
||||
* aber die Console noch nicht eingeschaltet war.
|
||||
*/
|
||||
|
||||
void BCCanDriver::onStartDriver()
|
||||
void BCDriver::onStartDriver()
|
||||
{
|
||||
|
||||
try
|
||||
@@ -30,8 +30,8 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef BCCANDRIVER_H
|
||||
#define BCCANDRIVER_H
|
||||
#ifndef BCDRIVER_H
|
||||
#define BCDRIVER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
@@ -69,7 +69,7 @@ uint32_t CanEventStatus(void);
|
||||
*/
|
||||
|
||||
struct CBCItem;
|
||||
class BCCanDriverStatus;
|
||||
class BCDriverStatus;
|
||||
|
||||
/**
|
||||
* @Abstrakte Basisklasse für alle CAN-Bus Treiber.
|
||||
@@ -78,13 +78,13 @@ class BCCanDriverStatus;
|
||||
* über den TinyCAN Adapter oder ggf. über einen EL327 Stecker.
|
||||
*
|
||||
* Die hier relevante Implementierung über das TinyCan System
|
||||
* findet sich in der Unterklasse 'BCCanDriverTinyCan'.
|
||||
* findet sich in der Unterklasse 'BCDriverTinyCan'.
|
||||
*
|
||||
* @see BCCanDriverTinyCan
|
||||
* @see BCDriverTinyCan
|
||||
*/
|
||||
|
||||
|
||||
class BCCanDriver : public QObject
|
||||
class BCDriver : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -101,8 +101,8 @@ public:
|
||||
};
|
||||
Q_ENUM(DriverState)
|
||||
|
||||
explicit BCCanDriver( QObject* parent = nullptr );
|
||||
virtual ~BCCanDriver() = default;
|
||||
explicit BCDriver( QObject* parent = nullptr );
|
||||
virtual ~BCDriver() = default;
|
||||
|
||||
DriverState getState() const;
|
||||
|
||||
@@ -135,4 +135,4 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
#endif // BCCANDRIVER_H
|
||||
#endif // BCDRIVER_H
|
||||
@@ -33,18 +33,18 @@
|
||||
#include <QDebug>
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include <bccandrivertinycan.h>
|
||||
#include <bcdrivertinycan.h>
|
||||
#include <can_drv.h>
|
||||
|
||||
|
||||
BCCanDriverTinyCan::BCCanDriverTinyCan( QObject* parent )
|
||||
: BCCanDriver(parent )
|
||||
BCDriverTinyCan::BCDriverTinyCan( QObject* parent )
|
||||
: BCDriver(parent )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
BCCanDriver::DriverState BCCanDriverTinyCan::loadDriver()
|
||||
BCDriver::DriverState BCDriverTinyCan::loadDriver()
|
||||
{
|
||||
|
||||
//qDebug() << "CanBusControl " << cbc::Version << '\n' << "based on BigXionFlasher (c) 2011-2013 by Thomas Koenig <info@bigxionflasher.org> - www.bigxionflasher.org";
|
||||
@@ -54,7 +54,7 @@ BCCanDriver::DriverState BCCanDriverTinyCan::loadDriver()
|
||||
if( ::LoadDriver( NULL ) < 0 )
|
||||
throw BCException( "Driver Error: 'LoadDriver'" );
|
||||
|
||||
setState(BCCanDriver::DriverState::Loaded);
|
||||
setState(BCDriver::DriverState::Loaded);
|
||||
|
||||
if( ::CanInitDriver( NULL ) < 0 )
|
||||
throw BCException( "Driver Error: 'InitDriver'" );
|
||||
@@ -66,7 +66,7 @@ BCCanDriver::DriverState BCCanDriverTinyCan::loadDriver()
|
||||
::CanSetMode( 0, OP_CAN_START, CAN_CMD_ALL_CLEAR );
|
||||
::CanGetDeviceStatus( 0, &status );
|
||||
|
||||
setState(BCCanDriver::DriverState::Initialized);
|
||||
setState(BCDriver::DriverState::Initialized);
|
||||
|
||||
if( status.DrvStatus < DRV_STATUS_CAN_OPEN )
|
||||
throw BCException( "Driver Error: could not open device." );
|
||||
@@ -77,9 +77,9 @@ BCCanDriver::DriverState BCCanDriverTinyCan::loadDriver()
|
||||
throw BCException( "Driver Error: CAN Status 'BusOff'" );
|
||||
}
|
||||
|
||||
setState(BCCanDriver::DriverState::Ready);
|
||||
setState(BCDriver::DriverState::Ready);
|
||||
|
||||
return BCCanDriver::DriverState::Ready;
|
||||
return BCDriver::DriverState::Ready;
|
||||
|
||||
}
|
||||
|
||||
@@ -102,18 +102,18 @@ BCCanDriver::DriverState BCCanDriverTinyCan::loadDriver()
|
||||
*/
|
||||
|
||||
|
||||
BCCanDriver::DriverState BCCanDriverTinyCan::initDriver()
|
||||
BCDriver::DriverState BCDriverTinyCan::initDriver()
|
||||
{
|
||||
|
||||
uint32_t console = static_cast<uint32_t>(BCDevice::ID::Console);
|
||||
uint8_t slaveFlag = static_cast<uint8_t>(BC::ID::Cons_Status_Slave);
|
||||
|
||||
qDebug() << "XXX BCCanDriverTinyCan::Driver Init: putting BCDevice::ID::Console in slave mode ... ";
|
||||
qDebug() << "XXX BCDriverTinyCan::Driver Init: putting BCDevice::ID::Console in slave mode ... ";
|
||||
// BCDevice::ID::Console already in slave mode. good!
|
||||
if( readRawByte( console, slaveFlag ) )
|
||||
return DriverState::Ready;
|
||||
|
||||
qDebug() << "BCCanDriverTinyCan::BCCanDriverTinyCan::XXX Driver Init: putting BCDevice::ID::Console in slave mode ... ";
|
||||
qDebug() << "BCDriverTinyCan::BCDriverTinyCan::XXX Driver Init: putting BCDevice::ID::Console in slave mode ... ";
|
||||
|
||||
unsigned int retry = cTimeOuts;
|
||||
emit statusHint( "Driver Init: putting BCDevice::ID::Console in slave mode ... " );
|
||||
@@ -132,7 +132,7 @@ BCCanDriver::DriverState BCCanDriverTinyCan::initDriver()
|
||||
emit statusHint( QString("putting BCDevice::ID::Console in slave mode ") + (isSlave ? "done" : "failed") );
|
||||
|
||||
// ist das jetzt irgendwie schlimm, wenn wir keine slave BCDevice::ID::Console haben
|
||||
//return isSlave ? BCCanDriver::connected
|
||||
//return isSlave ? BCDriver::connected
|
||||
|
||||
return DriverState::Ready;
|
||||
|
||||
@@ -140,7 +140,7 @@ BCCanDriver::DriverState BCCanDriverTinyCan::initDriver()
|
||||
}
|
||||
|
||||
|
||||
uint32_t BCCanDriverTinyCan::readRawByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
uint32_t BCDriverTinyCan::readRawByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
{
|
||||
|
||||
uint32_t myRandomByte = static_cast<uint32_t>(QRandomGenerator::global()->bounded(256));
|
||||
@@ -213,14 +213,14 @@ retry:
|
||||
}
|
||||
|
||||
|
||||
// void BCCanDriverTinyCan::setValue( unsigned char receipient, unsigned char reg, unsigned char value )
|
||||
void BCCanDriverTinyCan::writeRawByte( uint32_t deviceID, uint8_t registerID ,uint8_t value ) const
|
||||
// void BCDriverTinyCan::setValue( unsigned char receipient, unsigned char reg, unsigned char value )
|
||||
void BCDriverTinyCan::writeRawByte( uint32_t deviceID, uint8_t registerID ,uint8_t value ) const
|
||||
{
|
||||
|
||||
if( getState() != DriverState::Ready)
|
||||
throw BCException( "writeRawValue error: driver not loaded." );
|
||||
|
||||
qDebug() << " --- BCCanDriverTinyCan writeRawValue: " << value;
|
||||
qDebug() << " --- BCDriverTinyCan writeRawValue: " << value;
|
||||
return;
|
||||
|
||||
|
||||
@@ -30,19 +30,19 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef BCCANDRIVERTINYCAN_H
|
||||
#define BCCANDRIVERTINYCAN_H
|
||||
#ifndef BCDRIVERTINYCAN_H
|
||||
#define BCDRIVERTINYCAN_H
|
||||
|
||||
#include <bccandriver.h>
|
||||
#include <bcdriver.h>
|
||||
|
||||
class BCCanDriverTinyCan : public BCCanDriver
|
||||
class BCDriverTinyCan : public BCDriver
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit BCCanDriverTinyCan( QObject* parent=nullptr );
|
||||
virtual ~BCCanDriverTinyCan() = default;
|
||||
explicit BCDriverTinyCan( QObject* parent=nullptr );
|
||||
virtual ~BCDriverTinyCan() = default;
|
||||
|
||||
DriverState loadDriver() override;
|
||||
DriverState initDriver() override;
|
||||
@@ -76,4 +76,4 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#endif // BCCANDRIVERTINYCAN_H
|
||||
#endif // BCDRIVERTINYCAN_H
|
||||
@@ -46,7 +46,7 @@ void BCTransmitter::onToggleConnectionState( bool connect )
|
||||
{
|
||||
if( connect )
|
||||
{
|
||||
if( _canDriver.getState() != BCCanDriver::DriverState::Ready )
|
||||
if( _canDriver.getState() != BCDriver::DriverState::Ready )
|
||||
_canDriver.onStartDriver();
|
||||
|
||||
// fix!
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <atomic>
|
||||
|
||||
#include <bcvalue.h>
|
||||
#include <bccandrivertinycan.h>
|
||||
#include <bcdrivertinycan.h>
|
||||
|
||||
// template ...
|
||||
class BCTransmitter : public QObject, public BCAbstractTransmitter
|
||||
@@ -72,7 +72,7 @@ private:
|
||||
QMutex _mutex;
|
||||
std::atomic<bool> _isBusy{ false };
|
||||
|
||||
BCCanDriverTinyCan _canDriver;
|
||||
BCDriverTinyCan _canDriver;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user