Index: main.cpp =================================================================== diff -u -r0470ff6f209ff0c5089f8f0849b6da04f60f8f41 -rbe1b2d8f110b741f3d630df438da07d411110543 --- main.cpp (.../main.cpp) (revision 0470ff6f209ff0c5089f8f0849b6da04f60f8f41) +++ main.cpp (.../main.cpp) (revision be1b2d8f110b741f3d630df438da07d411110543) @@ -7,18 +7,25 @@ * * \file main.cpp * \author (last) Behrouz NematiPour - * \date (last) 03-Aug-2020 + * \date (last) 16-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 * */ /*! * \mainpage UI Software Design Description - * \section Detailed Description + * \details Detailed Description.\n * This document has been generated by Doxygen.\n * This document describes the detail description of the UI Application Software design.\n - * UI Application starts by Application Initialization which happens in \ref main.cpp "Initialization section".\n + * UI Application starts by Application Initialization which happens in \ref main() "Application Initialization".\n + * For information please see : + * - \ref main() + * - \subpage CommandLineSwitches + * - \subpage DenaliMessageStructure + * - \subpage MessageFlow + * - \subpage GeneralModelsDescription + * - \subpage MessageView */ // Qt @@ -31,17 +38,17 @@ #include // Project -#include "maintimer.h" -#include "caninterface.h" -#include "frameinterface.h" -#include "messageacknowmodel.h" -#include "messagedispatcher.h" -#include "applicationcontroller.h" -#include "guicontroller.h" -#include "logger.h" +#include "MainTimer.h" +#include "CanInterface.h" +#include "FrameInterface.h" +#include "MessageAcknowModel.h" +#include "MessageDispatcher.h" +#include "ApplicationController.h" +#include "GuiController.h" +#include "Logger.h" #include "DriveWatcher.h" -#include "threads.h" #include "BLEScanner.h" +#include "Threads.h" // kernel #include @@ -77,26 +84,32 @@ bool gConsoleoutCanInterface = false ; /*! - * \brief commandlineParse - * \details parses the command line arguments \n - * Usage: ./denali [options] \n - * Denali \n - * \n - * Options: \n - * -h, --help Displays this help. \n - * -v, --version Displays version information. \n - * -c, --canOut Show the Can Frame Output \n - * -m, --msgOut Show the Message Output \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 - * -f, --fake-message Test fake message data \n - * will use default sequenced long fake message \n - * if set to 00(default) \n - * will used only if correct intger value \n - * assigned for interval option \n + * \page CommandLineSwitches Denali Command Line Switches + * \verbatim + * Usage: ./denali [options] + * Denali + * + * Options: + * -h, --help Displays this help. + * -v, --version Displays version information. + * -c, --canOut Show the Can Frame Output + * -m, --msgOut Show the Message Output + * -0, --enable-keep-awake Enable send low priority, empty message on + * the CANBus just to keep UI board CAN driver + * awake + * -i, --fake-interval Test fake message interval(ms) + * -f, --fake-message Test fake message data + * will use default sequenced long fake message + * if set to 00(default) + * will used only if correct integer value + * assigned for interval option + * \endverbatim */ +/*! + * \brief commandlineParse + * \details parses the command line arguments + * \ref CommandLineSwitches + */ void commandlineParse() { QCommandLineParser parser; parser.setApplicationDescription(QApplication::applicationName()); @@ -181,44 +194,57 @@ } } } + /*! * \brief setApplicationVersion - * \details sets up the application version regarding the environment valiables + * \details sets up the application version regarding the environment variables * 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; + bool ver_revis_empty = false; + QString ver_major = QString("%1").arg(VER_MAJOR ); + QString ver_minor = QString("%1").arg(VER_MINOR ); + QString ver_micro = QString("%1").arg(VER_MICRO ); + QString ver_revis = QString("%1").arg(VER_REVIS ); + QString ver_branch = QString("%1").arg(VER_BRANCH ); + + if (ver_revis.isEmpty()) { + ver_revis = VER_REVIS_DEV; + ver_revis_empty = true; } - QString ver_minor = QString("%1").arg(VER_MINOR); - if (ver_minor.isEmpty()) { - ver_minor = VER_MINOR_DEV; + + const char * masterbranch = "master"; + bool isOnMaster = !ver_branch.compare(masterbranch); + if (isOnMaster) { + ver_branch = ver_revis_empty ? masterbranch : ""; + ver_major += '.'; + ver_minor += '.'; + ver_micro += '.'; } - QString ver_micro = QString("%1").arg(VER_MICRO); - if (ver_micro.isEmpty()) { - ver_micro = VER_MICRO_DEV; + else { + ver_branch = VER_BRANCH ; + ver_revis = VER_REVIS_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)); + if ( ! ver_branch.isEmpty()) ver_branch += '.'; + QCoreApplication::setApplicationVersion( + QString("%1%2%3%4%5") + .arg(ver_branch) + .arg(ver_major) + .arg(ver_minor) + .arg(ver_micro) + .arg(ver_revis)); } #ifdef UNIT_TEST #include TEST_CLASS_INCLUDE QTEST_MAIN(TEST_CLASS_NAME) #else -/*! \brief Application Initialization\n - * Some part of the application need to be initialized out of any thread. - * So is initialized here to be initialized in the main thread. - * this section also includes: +/*! + * \brief Application Initialization + * \details Some part of the application need to be initialized out of any thread. + * So is initialized here to be initialized in the main thread. + * this section also includes: */ int main(int argc, char *argv[]) { @@ -272,21 +298,21 @@ " \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "); } - //! - Initializing USB Watcher + //! - Initializing the Drive Watcher _DriveWatcher.init(Threads::_DriveWatcher_Thread); - //! - Initializing CanBus Interface + //! - Initializing the CANBus Interface if (_CanInterface.init(Threads::_CanFrame_Thread)) { _CanInterface.enableConsoleOut(gConsoleoutCanInterface); } - //! - Initializing CanBus Message Handler + //! - Initializing the CANBus Message Handler _FrameInterface.init(Threads::_CanFrame_Thread); - //! - Initializing the CanBus Message Acknowledgment Model + //! - Initializing the CANBus Message Acknowledgment Model _MessageAcknowModel.init(Threads::_CanAcknow_Thread); - //! - Initializing CanBus Message Dispatcher + //! - Initializing the CANBus Message Dispatcher if (_MessageDispatcher.init(Threads::_CanMessage_Thread)) { _MessageDispatcher.enableConsoleOut(gConsoleoutFrameInterface); } @@ -304,7 +330,7 @@ _MainTimer.init(); - //! - Initialize the Qml Viewer and starts GUI + //! - Initialize the QML Viewer and starts GUI int app_exec = -1; LOG_DEBUG("UI Initializing"); if ( startGui() ) {