Index: main.cpp =================================================================== diff -u -r95c671ab7037af055db551456a719ff67bf10262 -r44a85c96ab55e424866ec4cca0270aa218355f82 --- main.cpp (.../main.cpp) (revision 95c671ab7037af055db551456a719ff67bf10262) +++ main.cpp (.../main.cpp) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) @@ -1,15 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n - * - * \file main.cpp - * \date 2019/09/30 - * \author Behrouz NematiPour - * + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file main.cpp + * \author (last) Peter Lucia + * \date (last) 26-Jun-2020 + * \author (original) Behrouz NematiPour + * \date (original) 24-Sep-2019 + * */ /*! @@ -66,9 +67,10 @@ int gFakeInterval = 0 ; QByteArray gFakeData = "" ; const char *gFakeData_default = "00" ; -bool gSendEmptyKeepAwake = true ; +bool gSendEmptyKeepAwake = false ; bool gFakeSeqAtBegin = false ; bool gDisableHunhandledReport = false ; +bool gDisableTimeout = false ; bool gConsoleoutFrameInterface = false ; bool gConsoleoutCanInterface = false ; @@ -84,7 +86,7 @@ * -v, --version Displays version information. \n * -c, --canOut Show the Can Frame Output \n * -m, --msgOut Show the Message Output \n - * -0, --disable-keep-awake Disable send low priority, empty message on \n + * -0, --enable-keep-awake Enable send low priority, empty message on \n * the CANBus just to keep UI board CAN driver \n * awake \n * -i, --fake-interval Test fake message interval(ms) \n @@ -112,9 +114,10 @@ QCoreApplication::translate("main", "Show the Message Output")); parser.addOption(optionConsoleoutFrameInterface); - // --- -0 : disable-keep-awake (the fast mode) - QCommandLineOption optionSendEmptyKeepAwake(QStringList() << "0" << "disable-keep-awake", - QCoreApplication::translate("main", "Disable send low priority, empty message on the CANBus just to keep UI board CAN driver awake")); + + // --- -0 : enable-keep-awake (the fast mode) + QCommandLineOption optionSendEmptyKeepAwake(QStringList() << "0" << "enable-keep-awake", + QCoreApplication::translate("main", "Enable send low priority, empty message on the CANBus just to keep UI board CAN driver awake")); parser.addOption(optionSendEmptyKeepAwake); // --- -i : fake-interval @@ -144,15 +147,21 @@ QCoreApplication::translate("main", "Disable unhandled messages report as an error in the log")); parser.addOption(optionDisableHunhandledReport); + // --- -u : disable-unhandled-report + QCommandLineOption optionDisableTimeout(QStringList() << "q" << "disable-timeout", + QCoreApplication::translate("main", "Disables HD communication timeout")); + parser.addOption(optionDisableTimeout); + // --- parse command lines parser.process(*qApp); gConsoleoutCanInterface = parser.isSet(optionConsoleoutCanInterface ); gConsoleoutFrameInterface = parser.isSet(optionConsoleoutFrameInterface ); gDisableHunhandledReport = parser.isSet(optionDisableHunhandledReport ); + gDisableTimeout = parser.isSet(optionDisableTimeout ); - if (parser.isSet(optionSendEmptyKeepAwake)) gSendEmptyKeepAwake = false; + if (parser.isSet(optionSendEmptyKeepAwake)) gSendEmptyKeepAwake = true; bool ok = false; if (parser.isSet(optionFakeInterval)) { @@ -171,6 +180,35 @@ } } } +/*! + * \brief setApplicationVersion + * \details sets up the application version regarding the environment valiables + * which are set by bamboo and if those are not set value of 0 will be used + * and revision(build) version will be set to current date/time. + */ +void setApplicationVersion() { + QString ver_major = QString("%1").arg(VER_MAJOR); + if (ver_major.isEmpty()) { + ver_major = VER_MAJOR_DEV; + } + QString ver_minor = QString("%1").arg(VER_MINOR); + if (ver_minor.isEmpty()) { + ver_minor = VER_MINOR_DEV; + } + QString ver_micro = QString("%1").arg(VER_MICRO); + if (ver_micro.isEmpty()) { + ver_micro = VER_MICRO_DEV; + } + QString ver_revis = QString("%1").arg(VER_REVIS); + if (ver_revis.isEmpty()) { + ver_revis = VER_REVIS_DEV; + } + QCoreApplication::setApplicationVersion(QString("%1.%2.%3.%4") + .arg(ver_major) + .arg(ver_minor) + .arg(ver_micro) + .arg(ver_revis)); +} #ifdef UNIT_TEST #include TEST_CLASS_INCLUDE @@ -202,22 +240,7 @@ app.thread()->setObjectName("Main Thread"); //! - Setting the application version regarding the Bamboo build number. - QString ver_major = QString("%1").arg(VER_MAJOR); - if (ver_major.isEmpty()) { - ver_major = VER_MAJOR_DEV; - } - QString ver_minor = QString("%1").arg(VER_MINOR); - if (ver_minor.isEmpty()) { - ver_minor = VER_MINOR_DEV; - } - QString ver_revis = QString("%1").arg(VER_REVIS); - if (ver_revis.isEmpty()) { - ver_revis = VER_REVIS_DEV; - } - QCoreApplication::setApplicationVersion(QString("%1.%2.%3") - .arg(ver_major) - .arg(ver_minor) - .arg(ver_revis)); + setApplicationVersion(); //! - Parse the command line arguments commandlineParse();