Index: AlarmMapping.csv =================================================================== diff -u -rc4b95505c1d02a74d9c1b8132578bbd8a21cec9a -re5577fbd781ded0678882680d5d31f08f56c9c68 --- AlarmMapping.csv (.../AlarmMapping.csv) (revision c4b95505c1d02a74d9c1b8132578bbd8a21cec9a) +++ AlarmMapping.csv (.../AlarmMapping.csv) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -293,4 +293,5 @@ 292,"HD processor is in Disinfect Heat mode." 293,"HD processor is in Disinfect Chemical mode." 294,"HD processor Disinfect Chemical mode instructions to user." - 295,"Total number of alarms." + 295,"UI POST CloudSync failure." + 296,"Total number of alarms." Index: denali.pro.user =================================================================== diff -u -rf8b8214be787dbfcff21322d1fa131673519733c -re5577fbd781ded0678882680d5d31f08f56c9c68 --- denali.pro.user (.../denali.pro.user) (revision f8b8214be787dbfcff21322d1fa131673519733c) +++ denali.pro.user (.../denali.pro.user) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -1230,7 +1230,7 @@ denali Qt4ProjectManager.Qt4RunConfiguration:/home/denali/Projects/application/denali.pro - --disable-timeout --disable-unhandled-report --disable-sd-card-fail-log-stop + --disable-timeout --disable-unhandled-report 3768 false true Index: main.cpp =================================================================== diff -u -r8be0073f796109578435eaa14edc7d3b9a2352da -re5577fbd781ded0678882680d5d31f08f56c9c68 --- main.cpp (.../main.cpp) (revision 8be0073f796109578435eaa14edc7d3b9a2352da) +++ main.cpp (.../main.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -88,6 +88,7 @@ bool gDisableTimeout = false ; bool gDisableAlarmNoMinimize = false ; bool gDisableSDCFailLogStop = false ; +bool gDisableCloudSyncFailStop = false ; bool gEnableCheckInLog = false ; bool gEnableAcknowLog = false ; @@ -103,29 +104,32 @@ * 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 - * -l, --logOut Show the Logs 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 - * -b, --fake-message-seq-at-begin Test fake message sequence at the beginning - * of the frame - * -u, --disable-unhandled-report Disable unhandled messages report as an - * error in the log - * -d, --disable-dialin-unhandled Disable the Dialin messages logged as - * unhandled - * -q, --disable-timeout Disables HD communication timeout - * -a, --disable-alarm-no-minimize Disables alarm no minimize - * -k, --disable-check-in-log Disables Check-In Log * + * -h, --help Displays this help. + * -v, --version Displays version information. + * -c, --canOut Show the Can Frame Output + * -m, --msgOut Show the Message Output + * -l, --logOut Show the Logs 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 + * -b, --fake-message-seq-at-begin Test fake message sequence at the + * beginning of the frame + * -u, --disable-unhandled-report Disable unhandled messages report as an + * error in the log + * -d, --disable-dialin-unhandled Disable the Dialin messages logged as + * unhandled + * -q, --disable-timeout Disables HD communication timeout + * -a, --disable-alarm-no-minimize Disables alarm no minimize + * -S, --disable-sd-card-fail-log-stop disable-sd-card-fail-log-stop + * -C, --disable-cloudsync-fail-stop disable-cloudsync-fail-stop + * -k, --enable-check-in-log Enables Check-In Log + * -K, --enable-acknow-log Enables Acknowledgment Log * \endverbatim */ /*! @@ -212,6 +216,11 @@ QCoreApplication::translate("main", "disable-sd-card-fail-log-stop")); parser.addOption(optionDisableSDCardFailLogStop); + // --- -C : disable-cloudsync-fail-stop + QCommandLineOption optionDisableCloudSyncFailStop(QStringList() << "C" << "disable-cloudsync-fail-stop", + QCoreApplication::translate("main", "disable-cloudsync-fail-stop")); + parser.addOption(optionDisableCloudSyncFailStop); + // --- -k : enable-Check-in-log (keep-alive) QCommandLineOption optionEnableCheckInLog(QStringList() << "k" << "enable-check-in-log", QCoreApplication::translate("main", "Enables Check-In Log")); @@ -234,6 +243,7 @@ gDisableTimeout = parser.isSet(optionDisableTimeout ); gDisableAlarmNoMinimize = parser.isSet(optionDisableAlarmMoMinimize ); gDisableSDCFailLogStop = parser.isSet(optionDisableSDCardFailLogStop ); + gDisableCloudSyncFailStop = parser.isSet(optionDisableCloudSyncFailStop ); gEnableCheckInLog = parser.isSet(optionEnableCheckInLog ); gEnableAcknowLog = parser.isSet(optionEnableAcknowLog ); Index: scripts/run.sh =================================================================== diff -u -r465a935949a85d3d1bebd11979737ff38ef96122 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- scripts/run.sh (.../run.sh) (revision 465a935949a85d3d1bebd11979737ff38ef96122) +++ scripts/run.sh (.../run.sh) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -35,15 +35,18 @@ POSTLOG=$HOME/post.log POSTERR=$HOME/post.err POSTOUT=$HOME/post.out -POSTMSG_CANBUS="CANBus passed" -POSTMSG_SDCARD="SD-CARD passed" -POSTMSG_TOUCH="Touch passed" -POSTMSG_RTC="RTC passed" -POSTMSG_WIFI="WiFi passed" -POSTMSG_BLUETOOTH="Bluetooth passed" -POSTMSG_SHASUM="App shasum passed" +POSTMSG_POSTFIX_PASSED=" passed" +POSTMSG_POSTFIX_FAILED=" failed" +POSTMSG_CANBUS="CANBus" +POSTMSG_SDCARD="SD-CARD" +POSTMSG_TOUCH="Touch" +POSTMSG_RTC="RTC" +POSTMSG_WIFI="WiFi" +POSTMSG_BLUETOOTH="Bluetooth" +POSTMSG_SHASUM="App shasum" +POSTMSG_CLOUDSYNC="CloudSync" +POSTMSG_CLOUDSYNC_RUNNING="CloudSync app IS running" - # cleanup the POST log file echo "Start: $(currDate)" > $POSTLOG echo "" > $POSTERR @@ -90,7 +93,9 @@ ifconfig can0 txqueuelen 4000 candump can0 -T1 # check if candump can successfully use the port. will terminate in 1ms if [ $? -eq 0 ]; then - echo $POSTMSG_CANBUS >> $POSTLOG + echo $POSTMSG_CANBUS$POSTMSG_POSTFIX_PASSED >> $POSTLOG +else + echo $POSTMSG_CANBUS$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi @@ -99,9 +104,11 @@ SDCTEST="$(mount | grep "$SDCARD_DEV on $SDCARD_MNT type $SDCARD_TYP (rw,")" if ! [ -z "$SDCTEST" ]; then SDINFO="$(df -h | grep -i $SDCARD_MNT)" - echo $POSTMSG_SDCARD >> $POSTLOG - echo $SDCTEST >> $POSTLOG - echo $SDINFO >> $POSTLOG + echo $POSTMSG_SDCARD$POSTMSG_POSTFIX_PASSED >> $POSTLOG + echo $SDCTEST >> $POSTLOG + echo $SDINFO >> $POSTLOG +else + echo $POSTMSG_SDCARD$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi @@ -111,7 +118,9 @@ #if there is other issues can even be empty. TSTEST="$(dmesg | grep Touch)" if [ $? -eq 0 ]; then - echo $POSTMSG_TOUCH >> $POSTLOG + echo $POSTMSG_TOUCH$POSTMSG_POSTFIX_PASSED >> $POSTLOG +else + echo $POSTMSG_TOUCH$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi @@ -125,7 +134,9 @@ sleep 1 RTC2=$(cat /sys/class/rtc/rtc0/since_epoch) if [ $(($RTC2 - $RTC1)) -eq 1 ]; then - echo $POSTMSG_RTC >> $POSTLOG + echo $POSTMSG_RTC$POSTMSG_POSTFIX_PASSED >> $POSTLOG + else + echo $POSTMSG_RTC$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi fi @@ -140,14 +151,18 @@ sleep 5 hciconfig hci0 up if [ $? -eq 0 ]; then - echo $POSTMSG_BLUETOOTH >> $POSTLOG + echo $POSTMSG_BLUETOOTH$POSTMSG_POSTFIX_PASSED >> $POSTLOG +else + echo $POSTMSG_BLUETOOTH$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi # ---------------------------------------- WiFi killall wpa_supplicant 1>> $POSTOUT 2>> $POSTERR if [[ ! -z $(dmesg | grep "wlan: driver loaded") ]]; then - echo $POSTMSG_WIFI >> $POSTLOG + echo $POSTMSG_WIFI$POSTMSG_POSTFIX_PASSED >> $POSTLOG +else + echo $POSTMSG_WIFI$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi @@ -156,7 +171,9 @@ SHA_ACT=$(tail -c 83 $HOME/denali | cut -c19-82) SHA_EXP=$(head -c -83 $HOME/denali | sha256sum -b --tag | cut -c14-77) if [ "$SHA_ACT" == "$SHA_EXP" ]; then - echo $POSTMSG_SHASUM >> $POSTLOG + echo $POSTMSG_SHASUM$POSTMSG_POSTFIX_PASSED >> $POSTLOG +else + echo $POSTMSG_SHASUM$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi @@ -173,8 +190,15 @@ cd $HOME/$CLOUDSYNC_FOLDER/ python3 ./cs.py start & sleep 2 - echo "$(python3 ./cs.py status)" >> $POSTLOG + CLOUDSYNC_STATUS="$(python3 ./cs.py status)" + if $CLOUDSYNC_STATUS == $POSTMSG_CLOUDSYNC_RUNNING; then + echo $POSTMSG_CLOUDSYNC$POSTMSG_POSTFIX_PASSED >> $POSTLOG + else + echo $POSTMSG_CLOUDSYNC$POSTMSG_POSTFIX_FAILED >> $POSTLOG + fi cd +else + echo $POSTMSG_CLOUDSYNC$POSTMSG_POSTFIX_FAILED >> $POSTLOG fi Index: sources/ApplicationController.cpp =================================================================== diff -u -r8be0073f796109578435eaa14edc7d3b9a2352da -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 8be0073f796109578435eaa14edc7d3b9a2352da) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -93,6 +93,8 @@ this , SLOT(onPOSTWiFi (bool))); connect(&_post , SIGNAL( didBluetooth(bool)), this , SLOT(onPOSTBluetooth(bool))); + connect(&_post , SIGNAL( didCloudSync(bool)), + this , SLOT(onPOSTCloudSync(bool))); connect(&_post , SIGNAL( didFail (Gui::GuiAlarmID )), this , SLOT(onPOSTFail (Gui::GuiAlarmID ))); @@ -541,6 +543,7 @@ if (vPass) { _WifiInterface.doStart(); } + emit didPOSTWiFi(vPass); } /*! @@ -554,10 +557,20 @@ } else { _BluetoothInterface.doNotifyStatePOSTError(); + emit didPOSTBluetooth(vPass); } } /*! + * \brief ApplicationController::onPOSTCloudSync + * \details Notifies the CloudSync POST status + */ +void ApplicationController::onPOSTCloudSync(bool vPass) +{ + emit didPOSTCloudSync(vPass); +} + +/*! * \brief ApplicationController::onPOSTFail * \details sends the Alarm Trigger message, used when the POST Failed. * \param vAlarmID Index: sources/ApplicationController.h =================================================================== diff -u -r465a935949a85d3d1bebd11979737ff38ef96122 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/ApplicationController.h (.../ApplicationController.h) (revision 465a935949a85d3d1bebd11979737ff38ef96122) +++ sources/ApplicationController.h (.../ApplicationController.h) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -107,10 +107,17 @@ void onPOSTWiFi (bool vPass); void onPOSTBluetooth (bool vPass); + void onPOSTCloudSync (bool vPass); + void onPOSTFail (Gui::GuiAlarmID vAlarmID); void onPOSTDone (bool vPass); signals: + void didPOSTWiFi (bool vPass); + void didPOSTBluetooth (bool vPass); + void didPOSTCloudSync (bool vPass); + +signals: void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG void didFailedTransmit(Sequence seq); Index: sources/ApplicationPost.cpp =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -46,6 +46,7 @@ _isRtc = checkRtc (); _isWiFi = checkWiFi (); // is not mandatory and the device can still be used without it. Alarm will be triggered to notify user in Active Alarm List. _isBluetooth = checkBluetooth (); // is not mandatory and the device can still be used without it. Alarm will be triggered to notify user in Active Alarm List. + _isCloudSync = checkCloudSync (); // is not mandatory and the device can still be used without it. Alarm will be triggered to notify user in Active Alarm List. _isEthernet = checkEthernet (); // this is not a Fault and not required the application to stop. No Alarm will be triggered. _isSound = checkSound (); // this is not a Fault and not required the application to stop. No Alarm will be triggered. // WARNING: @@ -60,7 +61,8 @@ isSDCard () && isRtc () && isWiFi () && - isBluetooth () + isBluetooth () && + isCloudSync () ; } else { @@ -78,7 +80,7 @@ */ bool ApplicationPost::checkShaSum() { - bool ok = _content.contains(_postmsg_shasum); + bool ok = _content.contains(_postmsg_shasum + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SHASUM); emit didShaSum(ok); return ok; @@ -91,7 +93,7 @@ */ bool ApplicationPost::checkCANBus() { - bool ok = _content.contains(_postmsg_canbus); + bool ok = _content.contains(_postmsg_canbus + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CANBUS); emit didCANBus(ok); return ok; @@ -118,7 +120,7 @@ */ bool ApplicationPost::checkTouch() { - bool ok = _content.contains(_postmsg_touch); + bool ok = _content.contains(_postmsg_touch + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH); emit didTouch(ok); return ok; @@ -131,7 +133,7 @@ */ bool ApplicationPost::checkSDCard() { - bool ok = _content.contains(_postmsg_sdcard); + bool ok = _content.contains(_postmsg_sdcard + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SDCARD); emit didSDCard(ok); return ok; @@ -144,7 +146,7 @@ */ bool ApplicationPost::checkRtc() { - bool ok = _content.contains(_postmsg_rtc); + bool ok = _content.contains(_postmsg_rtc + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_RTC); emit didRtc(ok); return ok; @@ -157,7 +159,7 @@ */ bool ApplicationPost::checkWiFi() { - bool ok = _content.contains(_postmsg_wifi); + bool ok = _content.contains(_postmsg_wifi + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_WIFI); emit didWiFi(ok); return ok; @@ -170,13 +172,26 @@ */ bool ApplicationPost::checkBluetooth() { - bool ok = _content.contains(_postmsg_bluetooth); + bool ok = _content.contains(_postmsg_bluetooth + _postmsg_postfix_passed); if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_BLUETOOTH); emit didBluetooth(ok); return ok; } /*! + * \brief ApplicationPost::checkCloudSync + * \details Checks the CloudSync service is loaded and functional + * \return false if there is an issue. + */ +bool ApplicationPost::checkCloudSync() +{ + bool ok = _content.contains(_postmsg_cloudsync + _postmsg_postfix_passed); + if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CLOUDSYNC); + emit didCloudSync(ok); + return ok; +} + +/*! * \brief ApplicationPost::checkEthernet * \details Checks the Ethernet driver is loaded and functional. * \return false if there is an issue [Removed from the PRS (always true)]. Index: sources/ApplicationPost.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/ApplicationPost.h (.../ApplicationPost.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/ApplicationPost.h (.../ApplicationPost.h) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -58,38 +58,44 @@ QString _content; // WARNING: these variables has to match with the ones in the run.sh. - const char *_postmsg_canbus = "CANBus passed" ; // POSTMSG_CANBUS="CANBus passed" - const char *_postmsg_sdcard = "SD-CARD passed" ; // POSTMSG_SDCARD="SD-CARD passed" - const char *_postmsg_touch = "Touch passed" ; // POSTMSG_TOUCH="Touch passed" - const char *_postmsg_rtc = "RTC passed" ; // POSTMSG_RTC="RTC passed" - const char *_postmsg_wifi = "WiFi passed" ; // POSTMSG_WIFI="WiFi passed" - const char *_postmsg_bluetooth = "Bluetooth passed" ; // POSTMSG_BLUETOOTH="Bluetooth passed" - const char *_postmsg_shasum = "App shasum passed" ; // POSTMSG_SHASUM="App shasum passed" + const QString _postmsg_postfix_passed = " passed" ; // POSTMSG_POSTFIX_PASSED=" passed" + const QString _postmsg_postfix_failed = " failed" ; // POSTMSG_POSTFIX_FAILED=" failed" - bool _isShaSum = false ; // HIGH : ALARM_ID_UI_POST_FAILURE_SHASUM - bool _isCANBus = false ; // HIGH : ALARM_ID_UI_POST_FAILURE_CANBUS - bool _isDisplay = false ; // HIGH : ALARM_ID_UI_POST_FAILURE_DISPLAY - bool _isTouch = false ; // HIGH : ALARM_ID_UI_POST_FAILURE_TOUCH - bool _isSDCard = false ; // HIGH : ALARM_ID_UI_POST_FAILURE_SDCARD - bool _isRtc = false ; // MEDIUM : ALARM_ID_UI_POST_FAILURE_RTC - bool _isWiFi = false ; // LOW : ALARM_ID_UI_POST_FAILURE_WIFI : this is a fault but will not affect the final UI POST result. will just send AlarmTrigger. - bool _isBluetooth = false ; // LOW : ALARM_ID_UI_POST_FAILURE_BLUETOOTH : this is a fault but will not affect the final UI POST result. will just send AlarmTrigger. - bool _isEthernet = false ; // NONE : ALARM_ID_UI_POST_FAILURE_ETHERNET : this is not a Fault and not required the application to stop. - bool _isSound = false ; // NONE : ALARM_ID_UI_POST_FAILURE_SOUND : this is not a Fault and not required the application to stop. + const QString _postmsg_canbus = "CANBus" ; // POSTMSG_CANBUS="CANBus" + const QString _postmsg_sdcard = "SD-CARD" ; // POSTMSG_SDCARD="SD-CARD" + const QString _postmsg_touch = "Touch" ; // POSTMSG_TOUCH="Touch" + const QString _postmsg_rtc = "RTC" ; // POSTMSG_RTC="RTC" + const QString _postmsg_wifi = "WiFi" ; // POSTMSG_WIFI="WiFi" + const QString _postmsg_bluetooth = "Bluetooth" ; // POSTMSG_BLUETOOTH="Bluetooth" + const QString _postmsg_shasum = "App shasum" ; // POSTMSG_SHASUM="App shasum" + const QString _postmsg_cloudsync = "CloudSync" ; // POSTMSG_CLOUDSYNC="CloudSync" + // tests // Severity + bool _isShaSum = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_SHASUM + bool _isCANBus = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_CANBUS + bool _isDisplay = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_DISPLAY : Not known way to test, other than visual check + bool _isTouch = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_TOUCH + bool _isSDCard = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_SDCARD + bool _isRtc = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_RTC + bool _isWiFi = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_WIFI + bool _isBluetooth = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_BLUETOOTH + bool _isCloudSync = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_CLOUDSYNC + bool _isEthernet = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_ETHERNET : this is not a Fault and not required the application to stop. + bool _isSound = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_SOUND : this is not a Fault and not required the application to stop. + bool _isDone = false ; - // tests // Severity - bool checkShaSum (); // HIGH : ALARM_ID_UI_POST_FAILURE_SHASUM - bool checkCANBus (); // HIGH : ALARM_ID_UI_POST_FAILURE_CANBUS - bool checkDisplay (); // HIGH : ALARM_ID_UI_POST_FAILURE_DISPLAY - bool checkTouch (); // HIGH : ALARM_ID_UI_POST_FAILURE_TOUCH - bool checkSDCard (); // HIGH : ALARM_ID_UI_POST_FAILURE_SDCARD - bool checkRtc (); // MEDIUM : ALARM_ID_UI_POST_FAILURE_RTC - bool checkWiFi (); // LOW : ALARM_ID_UI_POST_FAILURE_WIFI : this is a fault but will not affect the final UI POST result. will just send AlarmTrigger. - bool checkBluetooth (); // LOW : ALARM_ID_UI_POST_FAILURE_BLUETOOTH : this is a fault but will not affect the final UI POST result. will just send AlarmTrigger. - bool checkEthernet (); // NONE : ALARM_ID_UI_POST_FAILURE_ETHERNET : this is not a Fault and not required the application to stop. - bool checkSound (); // NONE : ALARM_ID_UI_POST_FAILURE_SOUND : this is not a Fault and not required the application to stop. + bool checkShaSum (); + bool checkCANBus (); + bool checkDisplay (); + bool checkTouch (); + bool checkSDCard (); + bool checkRtc (); + bool checkWiFi (); + bool checkBluetooth (); + bool checkCloudSync (); + bool checkEthernet (); + bool checkSound (); public: bool isShaSum () { return _isShaSum ; } @@ -100,6 +106,7 @@ bool isRtc () { return _isRtc ; } bool isWiFi () { return _isWiFi ; } bool isBluetooth () { return _isBluetooth ; } + bool isCloudSync () { return _isCloudSync ; } bool isEthernet () { return _isEthernet ; } bool isSound () { return _isSound ; } @@ -118,6 +125,7 @@ void didRtc (bool vPass); void didWiFi (bool vPass); void didBluetooth (bool vPass); + void didCloudSync (bool vPass); void didEthernet (bool vPass); void didSound (bool vPass); Index: sources/bluetooth/BluetoothInterface.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -29,6 +29,7 @@ using namespace Bluetooth; using namespace Model; +SINGLETON_DISABLE(BluetoothInterface) /*! * \brief BluetoothInterface::BluetoothInterface * \details Constructor @@ -54,6 +55,10 @@ // since the _local, _agent objects are created there. LOG_DEBUG(tr("%1 Initialized").arg(metaObject()->className())); + // TODO: the same logic has to work for all the controllers + // needs more testing. + SINGLETON_DISABLE_CONNECT(didPOSTBluetooth) + return true; } Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rba928149acf9501b0ab751eab84f4b7e8ac05353 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision ba928149acf9501b0ab751eab84f4b7e8ac05353) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -221,8 +221,8 @@ {Gui::GuiActionType::ID_AdjustVersionsUIReq ,1+1+1+2+4 }, // variable length parameters {Gui::GuiActionType::ID_AdjustVersionsHDRsp ,1+1+1+2+1+1+1+1}, // variable length parameters {Gui::GuiActionType::ID_AdjustVersionsDGRsp ,1+1+1+2+1+1+1+1}, // variable length parameters - {Gui::GuiActionType::ID_AdjustSerialHDRsp , 1 * 15 }, // 1 parameter 15bytes - {Gui::GuiActionType::ID_AdjustSerialDGRsp , 1 * 15 }, // 1 parameter 15bytes + {Gui::GuiActionType::ID_AdjustSerialHDRsp , 1 * 1 }, // minimum 1 parameter 1 byte + {Gui::GuiActionType::ID_AdjustSerialDGRsp , 1 * 1 }, // minimum 1 parameter 1 byte // ---- {Gui::GuiActionType::ID_AdjustVersionsHDReq , 0 * 4 }, // 0 parameter {Gui::GuiActionType::ID_AdjustVersionsUIRsp ,1+1+1+2+4 }, // variable length parameters Index: sources/cloudsync/CloudSyncController.cpp =================================================================== diff -u -r6f2622be80fcaee8d71baf78404627381157970c -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision 6f2622be80fcaee8d71baf78404627381157970c) +++ sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -20,12 +20,15 @@ // Project #include "MainTimer.h" #include "MessageDispatcher.h" +#include "ApplicationController.h" #include "GuiController.h" #include "DeviceController.h" #include "FileHandler.h" #include "crc.h" #include "TreatmentLog.h" +SINGLETON_DISABLE(CloudSyncController) + /*! * \brief CloudSyncController::CloudSyncController * \details Constructor @@ -86,6 +89,10 @@ */ void CloudSyncController::initConnections() { + if ( ! gDisableCloudSyncFailStop ) { + SINGLETON_DISABLE_CONNECT(didPOSTCloudSync) + } + connect(&_DeviceController , SIGNAL(didWatchFileChange (const QString &)), this , SLOT( onWatchFileChange (const QString &))); connect(&_MessageDispatcher , SIGNAL(didActionReceive (GuiActionType , const QVariantList &)), @@ -472,7 +479,7 @@ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // writing the message into the buffer. - LOG_EVENT( "CS," + vInpBuff ); + LOG_EVENT_UI( vInpBuff ); if ( ! Storage::FileHandler::write(_date_inp_File, vInpBuff + "\n") ) { error = eError_LogFileInp; args = { _date_inp_File }; ok = false; goto lErr; } return ok; Index: sources/device/DeviceController.cpp =================================================================== diff -u -r465a935949a85d3d1bebd11979737ff38ef96122 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 465a935949a85d3d1bebd11979737ff38ef96122) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -266,14 +266,16 @@ mInitialized = true; //DEBUG:0: qDebug() << " ~~~~~~~~~~ " << __FUNCTION__ << mInitialized << mCIsReady << mOIsReady << mCIsReadOnly << mOIsReadOnly; emit didSDCardStateChange(mCIsReady, mCIsReadOnly); - - if (! mCIsReady ) { - mOTotal = 0; - mOAvailable = 0; - emit didSDCardSpaceChange(mCIsReady, mCTotal, mCAvailable, mPercent); - return; - } } + //NOTE: this if block has to be independent of the mOIsReady != mCIsReady + // because current and old may be the same all the time and then this if block will not execute + // and reaches to the log and fills the log unnecessarily. + if (! mCIsReady ) { + mOTotal = 0; + mOAvailable = 0; + emit didSDCardSpaceChange(mCIsReady, mCTotal, mCAvailable, mPercent); + return; + } mPercent = mCTotal ? ((100 * mCAvailable) / mCTotal) : 0; if (mPercent < _minRequiredAvailableSpacePercent) { @@ -289,7 +291,6 @@ emit didSDCardSpaceChange(mCIsReady, mCTotal, mCAvailable, mPercent); /// DEBUG: qDebug() << Storage::SDCard_Base_Path_Name << mCIsReady << mCTotal << mCAvailable << mPercent ; } - } /*! Index: sources/gui/qml/pages/settings/SettingsDG.qml =================================================================== diff -u -r8be0073f796109578435eaa14edc7d3b9a2352da -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/gui/qml/pages/settings/SettingsDG.qml (.../SettingsDG.qml) (revision 8be0073f796109578435eaa14edc7d3b9a2352da) +++ sources/gui/qml/pages/settings/SettingsDG.qml (.../SettingsDG.qml) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -64,7 +64,7 @@ _heatDisinfectionScheduleTime .isValid && _heatDisinfectionScheduleCycle .isValid - confirmVisible : true + confirmVisible : false // phase 1 // true confirmEnabled : _root.enableScheduling firstFocusInput : _waterFlushScheduleTime notificationText: _settingsDG.status @@ -79,7 +79,7 @@ } Row { id: _container - visible: true + visible: false // phase 1 // true spacing: 25 y : Qt.inputMethod.visible && _keyboard.visible ? topMarginContent : ( (_root.height - _container.height) / 2 ) Behavior on y { NumberAnimation { duration: Variables.keybardAnimationDuration } } Index: sources/main.h =================================================================== diff -u -rcb7d9e125fe619ab0713f9146e9774940e26a096 -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/main.h (.../main.h) (revision cb7d9e125fe619ab0713f9146e9774940e26a096) +++ sources/main.h (.../main.h) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -50,9 +50,35 @@ static vCLASS _instance; \ return _instance; \ } \ + static bool _disable; \ + /* Intentionally disable made private */ \ + static void disable(); \ +public: \ + static bool isDisable() { \ + return _disable; \ + } \ private: //--------------------------------------------------------------------------------// +#include +#define SINGLETON_DISABLE(vCLASS) \ + bool vCLASS::_disable = false; \ + void vCLASS:: disable() { \ + if ( QThread::currentThread() == qApp->thread() ) { \ + LOG_DEBUG(QString(" !!! Failed Disable "#vCLASS" [%1] !!!").arg(QThread::currentThread()->objectName())); \ + return; \ + } \ + LOG_DEBUG(QString(" !!! Disabled "#vCLASS" [%1] !!!").arg(QThread::currentThread()->objectName())); \ + QEventLoopLocker _eventLoopLocker(QThread::currentThread()); \ + _disable = true; \ + } //--------------------------------------------------------------------------------// +#define SINGLETON_DISABLE_CONNECT(vSIGNAL) \ + connect(&_ApplicationController , \ + &ApplicationController::vSIGNAL , \ + this , \ + [=](bool vPass) { if ( ! vPass ) disable(); }); +//--------------------------------------------------------------------------------// +//--------------------------------------------------------------------------------// extern int gFakeInterval ; extern QByteArray gFakeData ; extern const char*gFakeData_default ; @@ -63,6 +89,7 @@ extern bool gDisableTimeout ; extern bool gDisableAlarmNoMinimize ; extern bool gDisableSDCFailLogStop ; +extern bool gDisableCloudSyncFailStop ; extern bool gEnableCheckInLog ; extern bool gEnableAcknowLog ; Index: sources/model/hd/adjustment/settings/MAdjustHDRequests.h =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/model/hd/adjustment/settings/MAdjustHDRequests.h (.../MAdjustHDRequests.h) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/model/hd/adjustment/settings/MAdjustHDRequests.h (.../MAdjustHDRequests.h) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -140,7 +140,7 @@ } // disabled coco end static QString toString(const QVariantList &vParameters) { - return MModel::toString("VersionReq", vParameters); + return MModel::toString("POSTInfReq", vParameters); } static Can::Can_Id canid () { return Can::eChlid_UI_Sync; } Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -rc4b95505c1d02a74d9c1b8132578bbd8a21cec9a -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision c4b95505c1d02a74d9c1b8132578bbd8a21cec9a) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 18-Aug-2022 + * \date (last) 24-Aug-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * @@ -328,7 +328,8 @@ /*0292*/case GuiAlarmID::ALARM_ID_HD_DISINFECT_HEAT : { result = QObject::tr("HD processor is in Disinfect Heat mode." ); break; } /* 292*/ /*0293*/case GuiAlarmID::ALARM_ID_HD_DISINFECT_CHEM : { result = QObject::tr("HD processor is in Disinfect Chemical mode." ); break; } /* 293*/ /*0294*/case GuiAlarmID::ALARM_ID_HD_DISINFECT_CHEM_INSTRUCTION1 : { result = QObject::tr("HD processor Disinfect Chemical mode instructions to user." ); break; } /* 294*/ -/*0295*/case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } /* 295*/ +/*0295*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CLOUDSYNC : { result = QObject::tr("UI POST CloudSync failure." ); break; } /* 295*/ +/*0296*/case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } /* 296*/ default: result = QObject::tr("ALARM_ID_UNDEFINED [%1]").arg(int(vAlarmID)); Index: sources/model/hd/alarm/MAlarmTriggered.cpp =================================================================== diff -u -rcd4b8fbd5ea88717e74dd4cbe00dac82d9844dde -re5577fbd781ded0678882680d5d31f08f56c9c68 --- sources/model/hd/alarm/MAlarmTriggered.cpp (.../MAlarmTriggered.cpp) (revision cd4b8fbd5ea88717e74dd4cbe00dac82d9844dde) +++ sources/model/hd/alarm/MAlarmTriggered.cpp (.../MAlarmTriggered.cpp) (revision e5577fbd781ded0678882680d5d31f08f56c9c68) @@ -46,7 +46,6 @@ else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } - if ( vIndex ) *vIndex = index; } /*!