Index: main.cpp =================================================================== diff -u -rd4b88173e0d4a683a315d2fc57b8e1ec356b1232 -rcbea4224ad67eecc2e7c4c66df9a7db711c72832 --- main.cpp (.../main.cpp) (revision d4b88173e0d4a683a315d2fc57b8e1ec356b1232) +++ main.cpp (.../main.cpp) (revision cbea4224ad67eecc2e7c4c66df9a7db711c72832) @@ -84,7 +84,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,7 +112,8 @@ QCoreApplication::translate("main", "Show the Message Output")); parser.addOption(optionConsoleoutFrameInterface); - // --- -0 : disable-keep-awake (the fast mode) + + // --- -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); @@ -171,6 +172,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 +232,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();