Index: main.cpp =================================================================== diff -u -rfe9459548d7b0f6c1d8cb77c0e23d7a385b48fa2 -r80b8371f1a93481e05302cef6e474db802fda153 --- main.cpp (.../main.cpp) (revision fe9459548d7b0f6c1d8cb77c0e23d7a385b48fa2) +++ main.cpp (.../main.cpp) (revision 80b8371f1a93481e05302cef6e474db802fda153) @@ -41,19 +41,11 @@ #include "Compatible.h" // Project -#include "FileHandler.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 "DeviceController.h" -#include "WifiInterface.h" -#include "BluetoothInterface.h" -#include "CloudSyncController.h" #include "Threads.h" @@ -84,14 +76,14 @@ const char *gFakeData_default = "00" ; bool gSendEmptyKeepAwake = false ; bool gFakeSeqAtBegin = false ; -bool gDisableUnhandledReport = false ; bool gDisableDialinUnhandled = false ; bool gDisableTimeout = false ; bool gDisableAlarmNoMinimize = false ; bool gDisableSDCFailLogStop = false ; bool gDisableCloudSyncFailStop = false ; bool gDisableCheckInLog = false ; +bool gDisableUnhandledReport = false ; bool gDisableAcknowLog = false ; bool gConsoleoutLogs = false ; @@ -344,6 +336,7 @@ gDisableCloudSyncFailStop = parser.isSet(optionDisableCloudSyncFailStop ); gDisableCheckInLog = parser.isSet(optionDisableCheckInLog ); + gDisableAcknowLog = parser.isSet(optionDisableAcknowLog ); gEnableDryDemo = parser.isSet(optionEnableDryDemo ); @@ -486,20 +479,14 @@ // and all the files are copied to the /home/root/ to later be copied to secured locations // and that will be done by lockdown.sh script running within application after the user is done with the setup and QUIT s the application. if ( gEnableManufacturing || gEnableUpdating ) { - QString scriptName = Storage::Device_Lockdown; quint16 errorCode; + Q_UNUSED(errorCode); QString errorText; - errorCode = Device::DeviceError::checkScript (scriptName, Storage::Device_Lockdown ); - errorText = Device::DeviceError::deviceErrorText( static_cast(errorCode), 1); qDebug() << errorText; // since we are in the manufacturing mode it is possible to probably take a look at the serial, if not that is being logged. #ifdef BUILD_FOR_TARGET Storage::FileHandler::write("/home/root/lockdown.log" , errorText, false); #else - Storage::FileHandler::write("/home/denali/lockdown.log" , errorText, false); #endif - if ( ! errorCode ) { - QProcess::startDetached( scriptName, { qApp->applicationName() + ":" + QString::number(qApp->applicationPid()) }); - } } } @@ -556,29 +543,19 @@ //! - Initializing required thread types Threads::registerTypes(); - bool guiStarted = startGui(); - - //! - Initializing Logger - if(_Logger.init(Threads::_Logger_Thread)) { - _Logger.enableConsoleOut(gConsoleoutLogs); - } - _Logger.postInit(); - if (gFakeInterval) { QString msg = " ~~ !!!!! APPLICATION RUNNING IN THE TEST MODE !!!!! ~~ "; qDebug() << msg; - LOG_APPED(" \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " - " \n " + msg + - " \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "); + // TODO is this needed? + //LOG_APPED(" \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " + // " \n " + msg + + // " \n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "); } if ( ! gParserErrorText.isEmpty() ) { - LOG_DEBUG(QString("Command-line arguments process failed:") + gParserErrorText); + //LOG_DEBUG(QString("Command-line arguments process failed:") + gParserErrorText); // TODO is this needed? } - //! - Initializing the Device Controller - _DeviceController.init(Threads::_DeviceController_Thread); - //! - Initializing the CANBus Interface if (_CanInterface.init(Threads::_CanFrame_Thread)) { _CanInterface.enableConsoleOut(gConsoleoutCanInterface); @@ -595,32 +572,16 @@ _MessageDispatcher.enableConsoleOut(gConsoleoutFrameInterface); } - //! - Initializing Application Controller - _ApplicationController.init(Threads::_Application_Thread); - - ////! - Initializing GUI Controller - _GuiController.init(Threads::_Gui_Thread); - //! - Initializing Main Timer _MainTimer.init(); - //! - Initializing WiFi Interface - _WifiInterface.init(Threads::_Wifi_Thread); - - //! - Initializing Bluetooth Interface - _BluetoothInterface.init(Threads::_Bluetooth_Thread); - - //! - Initializing the CloudSync controller - _CloudSyncController.init(Threads::_CloudSync_Thread); - //! - Initialize the QML Viewer and starts GUI int app_exec = -1; - LOG_DEBUG("UI Initializing"); - if ( guiStarted /*startGui()*/ ) { - LOG_DEBUG("UI Initialized"); - _ApplicationController .startPOST(); + //LOG_DEBUG("Dry Demo Initializing"); // TODO is this needed? + //if ( guiStarted /*startGui()*/ ) { + //LOG_DEBUG("UI Initialized"); // TODO is this needed? app_exec = app.exec(); - } + //} // Due to Qt Error the CAN Device cannot be disable/enable from withing another thread // (other than main thread which is the owner of the CanDevice). @@ -629,8 +590,6 @@ Threads::quitThreads(); - Gui::_viewer->deleteLater(); - #ifdef BUILD_FOR_TARGET lockdown(); #endif