Index: sources/canbus/CanInterface.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -ra58f91b077c8131bea3dbde0fc338adb113fc9f3 --- sources/canbus/CanInterface.cpp (.../CanInterface.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/canbus/CanInterface.cpp (.../CanInterface.cpp) (revision a58f91b077c8131bea3dbde0fc338adb113fc9f3) @@ -47,9 +47,7 @@ if ( _init ) return false; _init = true; - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if ( ! initDevice() ) return false; - // disabled coco end if ( ! testDevice() ) return false; initConnections(); @@ -73,9 +71,7 @@ */ bool CanInterface::init(QThread &vThread) { - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if ( ! init() ) return false; - // disabled coco end initThread(vThread); return true; } @@ -87,11 +83,8 @@ */ void CanInterface::quit() { - // disabled coco begin validated: Application termination is not correctly done in coco!!! - // it has been tested and works perfectly fine in normal run. quitThread(); // verified } -// disabled coco end /*! * \brief CanInterface status @@ -109,7 +102,6 @@ * \param vEnabled - Enable console output if true */ void CanInterface::enableConsoleOut(bool vEnabled) { - // disabled coco begin validated: This code meant to be used only for debugging and tested manually if (_enableConsoleOut == vEnabled) return; _enableConsoleOut = vEnabled; if (_enableConsoleOut) { @@ -118,7 +110,6 @@ LOG_DEBUG("Console out CanInterface disabled"); } } -// disabled coco end /*! * \brief CanInterface connections definition @@ -127,9 +118,7 @@ */ void CanInterface::initConnections() { - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if (_canDevice) { - // disabled coco end connect(_canDevice, SIGNAL( framesReceived()), this , SLOT (onFrameReceive ())); @@ -168,15 +157,11 @@ */ void CanInterface::quitThread() { - // disabled coco begin validated: Application termination is not correctly done in coco!!! - // it has been tested and works perfectly fine in normal run. - if (! _thread) return; // runs in thread moveToThread(qApp->thread()); // verified } -// disabled coco end /*! * \brief CanInterface::createDevice @@ -187,13 +172,11 @@ { QString mError; _canDevice = QCanBus::instance()->createDevice(_canType, _canInterface, &mError); - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if (!_canDevice) { status(tr("Device Creation"), mError); LOG_DEBUG(status()); return false; } - // disabled coco end _canDevice->setConfigurationParameter(QCanBusDevice::CanFdKey , _canFDKey ); _canDevice->setConfigurationParameter(QCanBusDevice::BitRateKey , _canBitRate ); return true; @@ -222,9 +205,7 @@ */ void CanInterface::quitDevice() { - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if (!_canDevice) return; - // disabled coco end _canDevice->disconnectDevice(); delete _canDevice; _canDevice = nullptr; @@ -261,9 +242,7 @@ */ bool CanInterface::transmit(const QCanBusFrame &vFrame) { - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if( !_canDevice ) return false; - //disabled coco end return _canDevice->writeFrame(vFrame); } @@ -275,7 +254,6 @@ */ void CanInterface::consoleOut(const QCanBusFrame &vFrame, const QString &vFrameCount) { - // disabled coco begin validated: This code is only for debugging purposes and had been tested manually. if ( ! _enableConsoleOut ) return; const QString time = QString::fromLatin1("%1.%2 ") @@ -292,7 +270,6 @@ // the fprintf is used for the colored output fprintf(stderr, "%s %s %s %i %s\n", vFrameCount.toLatin1().constData(), time.toLatin1().constData(), flags.toLatin1().constData(), vFrame.frameId(), view.toLatin1().constData()); } -// disabled coco end /*! * \brief CanInterface::rxCount @@ -323,11 +300,8 @@ */ FrameCount CanInterface::erCount() { - // disabled coco begin validated: CANBus error handling has been tested manually. - // since it requires massive can messages sent/received to catch the error Types::safeIncrement(_erFrameCount); return _erFrameCount; - // disabled coco end } /*! @@ -338,8 +312,6 @@ */ QString CanInterface::frameFlags(const QCanBusFrame &vFrame) { - // disabled coco begin validated: CANBus error handling has been tested manually. - // since it requires massive can messages sent/received to catch the error QString result = QLatin1String(" --- "); if (vFrame.hasBitrateSwitch()) @@ -350,7 +322,6 @@ result[3] = QLatin1Char('L'); return result; - // disabled coco end } /*! @@ -360,8 +331,6 @@ */ void CanInterface::onFrameError(QCanBusDevice::CanBusError vError) { - // disabled coco begin validated: CANBus error handling has been tested manually. - // since it requires massive can messages sent/received to catch the error erCount(); switch (vError) { case QCanBusDevice::ReadError: @@ -382,7 +351,6 @@ } emit didFrameError(_canStatus); } -// disabled coco end /*! * \brief CanInterface::onFrameWritten @@ -405,16 +373,12 @@ */ void CanInterface::onFrameReceive () { - // disabled coco begin validated: Manually tested since required to disable and enable the CANBus if (!_canDevice) return; - // disabled coco end while (_canDevice->framesAvailable()) { const QCanBusFrame frame = _canDevice->readFrame(); rxCount(); - // disabled coco begin validated: This code is only for debugging purposes and had been tested manually. if ( _enableConsoleOut ) consoleOut(frame, QString("Rx:%1").arg(_rxFrameCount)); - // disabled coco end emit didFrameReceive(frame); } } @@ -429,9 +393,7 @@ { bool ok = transmit(vFrame); txCount(); - // disabled coco begin validated: This code is only for debugging purposes and had been tested manually. if ( _enableConsoleOut ) consoleOut(vFrame, QString("Tx:%1").arg(_txFrameCount)); - // disabled coco end emit didFrameTransmit(ok); }