Cosmetcis.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,6 +7,8 @@ bcvalue.cpp.autosave
|
||||
# Objektdateien ignorieren
|
||||
*.o
|
||||
|
||||
.qtc_clangd/
|
||||
|
||||
# Von Qt generierte MOC-Dateien (Meta-Object Compiler) ignorieren
|
||||
moc_*
|
||||
|
||||
|
||||
@@ -43,9 +43,6 @@
|
||||
static const char* cMHS_DRIVERNAME = "libmhstcan.so";
|
||||
#endif
|
||||
|
||||
//const char* CBCDLL_LIN = "libmhstcan.so";
|
||||
//const char* CBCDLL_WIN = "mhstcan.dll";
|
||||
|
||||
/**
|
||||
* @brief Destruktor. Entlädt den CAN-Bus Treiber wieder.
|
||||
*/
|
||||
|
||||
@@ -40,7 +40,6 @@ class BCDriverTinyCan : public BCDriver
|
||||
|
||||
public:
|
||||
|
||||
|
||||
virtual ~BCDriverTinyCan();
|
||||
|
||||
BCDriver::DriverStateResult loadAndStartDriver() override;
|
||||
@@ -54,16 +53,11 @@ private:
|
||||
BCDriver::DriverStateResult loadDriver();
|
||||
BCDriver::DriverStateResult setConsoleSlaveMode();
|
||||
|
||||
|
||||
|
||||
static constexpr int cRetries = 5;
|
||||
static constexpr int cTimeOuts = 20;
|
||||
static constexpr int cTIMEOUT_MS = 10; // 10ms
|
||||
static constexpr int cTIMEOUT_COUNT = 10;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // BCDRIVERTINYCAN_H
|
||||
|
||||
@@ -150,7 +150,7 @@ void BCMainWindow::initMainWindow()
|
||||
connect( _syncButton, &QToolButton::clicked, this, &BCMainWindow::onSyncDeviceView );
|
||||
connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
|
||||
|
||||
connect(this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::enqueueValue);
|
||||
connect(this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::onEnqueueValue);
|
||||
connect(&_worker, &QThread::finished, &_transmitter, &QObject::deleteLater);
|
||||
connect( &_transmitter, &BCTransmitter::driverStateChanged, this, &BCMainWindow::onDriverStateChanged );
|
||||
|
||||
@@ -265,7 +265,7 @@ void BCMainWindow::onSyncDeviceView()
|
||||
qDebug() << " --- begin sync of value: " << value->label;
|
||||
// wir setzen auf 'lesen'
|
||||
value->state.setFlag( BCValue::State::ReadMe );
|
||||
// statt '_transmitter.enqueueValueCommand( value )' entkoppeln
|
||||
// statt '_transmitter.onEnqueueValueCommand( value )' entkoppeln
|
||||
// wir das eleganter über emit requestValueUpdate()
|
||||
emit requestValueUpdate( value);
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ BCTransmitter::BCTransmitter(QObject *parent)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Steuert die Verbindung mit dem 'echten' CAN-Bus Treiber.
|
||||
* @param connect true: Vesuche den CAN-Bus Treiber zu laden und zu verbinden
|
||||
@@ -66,6 +68,12 @@ void BCTransmitter::onToggleDriverConnection( bool connect )
|
||||
_isBusy = false;
|
||||
}
|
||||
|
||||
|
||||
void BCTransmitter::onStartNativeDirver()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BCTransmitter::connectCanDriver()
|
||||
{
|
||||
// hier gehts nur um den echten Treiber
|
||||
@@ -110,7 +118,7 @@ void BCTransmitter::disconnectCanDriver()
|
||||
}
|
||||
|
||||
|
||||
void BCTransmitter::enqueueValue( BCValuePtrConst value)
|
||||
void BCTransmitter::onEnqueueValue( BCValuePtrConst value)
|
||||
{
|
||||
// Hier sind wir noch in GUI Thread
|
||||
QMutexLocker locker(&_mutex);
|
||||
@@ -122,19 +130,19 @@ void BCTransmitter::enqueueValue( BCValuePtrConst value)
|
||||
|
||||
// Trigger processing im Event-Loop des Worker Threads
|
||||
// invokeMethod mit QueuedConnection entkoppelt den Aufruf,
|
||||
// damit enqueueValue sofort zurückkehrt (non-blocking für den Aufrufer).
|
||||
// damit onEnqueueValue sofort zurückkehrt (non-blocking für den Aufrufer).
|
||||
|
||||
QMetaObject::invokeMethod(this, "processValue", Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(this, "onProcessValue", Qt::QueuedConnection);
|
||||
|
||||
/*
|
||||
QMetaObject::invokeMethod(this, [this]()
|
||||
{
|
||||
processValue();
|
||||
onProcessValue();
|
||||
}, Qt::QueuedConnection );
|
||||
*/
|
||||
}
|
||||
|
||||
void BCTransmitter::processValue()
|
||||
void BCTransmitter::onProcessValue()
|
||||
{
|
||||
|
||||
if (_isBusy)
|
||||
|
||||
@@ -63,8 +63,9 @@ public:
|
||||
public slots:
|
||||
|
||||
void onToggleDriverConnection( bool connect );
|
||||
void enqueueValue(BCValuePtrConst value );
|
||||
void processValue();
|
||||
void onEnqueueValue(BCValuePtrConst value );
|
||||
void onProcessValue();
|
||||
void onStartNativeDirver();
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user