Index: main.cpp =================================================================== diff -u -r8f71000a841da5e8f18efccbb30a7655d3a211cd -r56e378f7504701b9e9a9dccaf205aef2fd52c58e --- main.cpp (.../main.cpp) (revision 8f71000a841da5e8f18efccbb30a7655d3a211cd) +++ main.cpp (.../main.cpp) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) @@ -1,14 +1,15 @@ /*! * * 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 + * \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 - * \date 2019/09/30 - * \author Behrouz NematiPour + * \file main.cpp + * \author (last) Behrouz NematiPour + * \date (last) 03-Aug-2020 + * \author (original) Behrouz NematiPour + * \date (original) 24-Sep-2019 * */ @@ -38,7 +39,7 @@ #include "applicationcontroller.h" #include "guicontroller.h" #include "logger.h" -#include "usbwatcher.h" +#include "DriveWatcher.h" #include "threads.h" // kernel @@ -68,7 +69,8 @@ const char *gFakeData_default = "00" ; bool gSendEmptyKeepAwake = false ; bool gFakeSeqAtBegin = false ; -bool gDisableHunhandledReport = false ; +bool gDisableUnhandledReport = false ; +bool gDisableTimeout = false ; bool gConsoleoutFrameInterface = false ; bool gConsoleoutCanInterface = false ; @@ -112,6 +114,7 @@ QCoreApplication::translate("main", "Show the Message Output")); parser.addOption(optionConsoleoutFrameInterface); + // --- -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")); @@ -140,17 +143,23 @@ parser.addOption(optionFakeSeqAtBegin); // --- -u : disable-unhandled-report - QCommandLineOption optionDisableHunhandledReport(QStringList() << "u" << "disable-unhandled-report", + QCommandLineOption optionDisableUnhandledReport(QStringList() << "u" << "disable-unhandled-report", QCoreApplication::translate("main", "Disable unhandled messages report as an error in the log")); - parser.addOption(optionDisableHunhandledReport); + parser.addOption(optionDisableUnhandledReport); + // --- -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 ); + gDisableUnhandledReport = parser.isSet(optionDisableUnhandledReport ); + gDisableTimeout = parser.isSet(optionDisableTimeout ); if (parser.isSet(optionSendEmptyKeepAwake)) gSendEmptyKeepAwake = true; bool ok = false; @@ -249,17 +258,21 @@ //! - Initializing Logger _Logger.init(Threads::_Logger_Thread); - LOG_EVENT(QObject::tr("Application Started")); + LOG_EVENT("UI," + QObject::tr("Application %1 Started,%2") + .arg(app.applicationName ()) + .arg(app.applicationVersion()) + ); if (gFakeInterval) { - qDebug() << " ~~ !!!!! APPLICATION RUNNING IN THE TEST MODE !!!!! ~~ " ; + QString msg = " ~~ !!!!! APPLICATION RUNNING IN THE TEST MODE !!!!! ~~ "; + qDebug() << msg; LOG_EVENT(" \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " - " \n ~~ !!!!! APPLICATION RUNNING IN THE TEST MODE !!!!! ~~ " + " \n " + msg + " \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "); } //! - Initializing USB Watcher - _USBWatcher.init(Threads::_USBWatcher_Thread); + _DriveWatcher.init(Threads::_DriveWatcher_Thread); //! - Initializing CanBus Interface if (_CanInterface.init(Threads::_CanFrame_Thread)) { @@ -286,9 +299,12 @@ //! - Initializing Main Timer _MainTimer.init(); + //! - Initialize the Qml Viewer and starts GUI int app_exec = -1; + LOG_DEBUG("UI Initializing"); if ( startGui() ) { + LOG_DEBUG("UI Initialized"); app_exec = app.exec(); }