Index: AlarmMapping.csv =================================================================== diff -u -rb22dd46db3def5d3c36d36c319f0bea89bf018d9 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- AlarmMapping.csv (.../AlarmMapping.csv) (revision b22dd46db3def5d3c36d36c319f0bea89bf018d9) +++ AlarmMapping.csv (.../AlarmMapping.csv) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -251,8 +251,21 @@ 250,"DG chemical disinfect inlet conductivity and temperature out of range." 251,"HD invalid system record." 252,"HD invalid service record." - 253,"DG invalid sytem record." + 253,"DG invalid system record." 254,"DG invalid service record." 255,"HD and UI software builds are not compatible." 256,"HD and DG software builds are not compatible." - 257,"Total number of alarms." + 257,"DG FPGA power out timeout." + 258,"HD FPGA power out timeout." + 259,"HD temperatures out of range." + 260,"UI POST File System Integrity failure." + 261,"UI POST CANBus failure." + 262,"UI POST Display failure." + 263,"UI POST Touch failure." + 264,"UI POST SD-Card failure." + 265,"UI POST RTC failure." + 266,"UI POST WiFi failure." + 267,"UI POST Bluetooth failure." + 268,"UI POST Ethernet failure." + 269,"UI POST Sound failure." + 270,"Total number of alarms." Index: alarmMapping.sh =================================================================== diff -u -rb22dd46db3def5d3c36d36c319f0bea89bf018d9 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- alarmMapping.sh (.../alarmMapping.sh) (revision b22dd46db3def5d3c36d36c319f0bea89bf018d9) +++ alarmMapping.sh (.../alarmMapping.sh) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -19,10 +19,11 @@ git pull cd .. -# update the alarm messaging +# update the alarm messaging ../scripts/build/alarmMapping \ common/AlarmDefs.h \ sources/model/hd/alarm/MAlarmMapping.cpp \ 1> alarmMapping.log \ 2> alarmMapping.err +cp ../scripts/build/AlarmMapping.csv . Index: denali.pro.user =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r3f555c49ddd2c983f469709e3c001d0e76159248 --- denali.pro.user (.../denali.pro.user) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ denali.pro.user (.../denali.pro.user) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -ra302861c33cdda0f0a95ade9b7c6a02b5593a9f2 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- en_US.udic (.../en_US.udic) (revision a302861c33cdda0f0a95ade9b7c6a02b5593a9f2) +++ en_US.udic (.../en_US.udic) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -161,3 +161,6 @@ Bak IPAddress Wifi +FSINTEGRITY +FILESYSTEM +Cyber Index: post.log =================================================================== diff -u --- post.log (revision 0) +++ post.log (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -0,0 +1,6 @@ +Start: 03082021051326 +CANBus passed +SD-CARD passed +Touch passed +RTC passed +End: 03082021051327 Index: scripts/run.sh =================================================================== diff -u -r7077e38c74db9cccb5496ffefcf8936c0916de76 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- scripts/run.sh (.../run.sh) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) +++ scripts/run.sh (.../run.sh) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -8,76 +8,119 @@ # # @file run.sh # -# @author (last) Behrouz NematiPour -# @date (last) 25-Aug-2020 -# @author (original) Behrouz NematiPour -# @date (original) 28-Oct-2019 +# @author (last) Behrouz NematiPour +# @date (last) 2-Aug-2021 +# @author (original) Behrouz NematiPour +# @date (original) 28-Oct-2019 # ############################################################################ + +function currDate() +{ + echo $(date +"%d%m%Y%H%M%S") +} + + HOME=/home/root SDCARD_DEV=/dev/mmcblk1p1 SDCARD_MNT=/media/sd-card USB_DEV=/dev/sda1 USB_MNT=/media/usb -LOG_PATH=$SDCARD_MNT +#DO NOT MODIFY POST VARIABLES +#unless the denali applicaiton is updated as well to match. +POSTLOG=$HOME/post.log +POSTMSG_CANBUS="CANBus passed" +POSTMSG_SDCARD="SD-CARD passed" +POSTMSG_TOUCH="Touch passed" +POSTMSG_RTC="RTC passed" + +# cleanup the POST log file +echo "Start: $(currDate)" > $POSTLOG + + #create folders for sd-card and usb if not exist mkdir -p $SDCARD_MNT mkdir -p $USB_MNT +# ---------------------------------------- UPDATE #mounting usb mount $USB_DEV $USB_MNT if [ $? -eq 0 ]; then echo ":: USB drive found and mounted on $USB_MNT" fi - #A simple none secure update -if [ -e $USB_MNT/denali ]; then - mv $HOME/denali $HOME/denali.$(date +"%d%m%Y%H%M%S") +if [ -e $USB_MNT/denali ]; then + mv $HOME/denali $HOME/denali.$(currDate) cp $USB_MNT/denali $HOME/denali - sync;sync;sync; - mv $USB_MNT/denali $USB_MNT/denali.updated - sync;sync;sync; + # check if update where successful + if [ $? -eq 0 ]; then + sync;sync;sync; + echo ":: Denali application has been updated with the one on the USB drive" + mv $USB_MNT/denali $USB_MNT/denali.updated + sync;sync;sync; + fi fi -# check if update where successful -if [ $? -eq 0 ]; then - echo ":: Denali application has been updated with the one on the USB drive" -fi +# ---------------------------------------- SETUP & POST +#Here only passed is logged and if nothing added to the post.log means it failed. -#setting up can interface -# current settings can be retrieved by the command below -# $ ip -details -statistics link show can0 +#setting up can interface ----------------- CANBus +#current settings can be retrieved by the command below +#$ ip -details -statistics link show can0 ip link set can0 up type can bitrate 250000 restart-ms 100 ifconfig can0 txqueuelen 4000 +candump can0 -T1 # check if candump can successfully use the port. will terminate in 1ms if [ $? -eq 0 ]; then - echo ":: Can interface setup" + echo $POSTMSG_CANBUS >> $POSTLOG fi -#mounting sdcard + +#mounting sdcard -------------------------- SD-CARD mount $SDCARD_DEV $SDCARD_MNT if [ $? -eq 0 ]; then - echo ":: SD-Card found and mounted on $SDCARD_MNT" -else - #setting the can log location - LOG_PATH=$HOME + SDTEST="$(mount | grep "$SDCARD_DEV on $SDCARD_MNT.*(rw,")" + if ! [ -z "$SDTEST" ]; then + echo $SDTEST >> $POSTLOG + echo $POSTMSG_SDCARD >> $POSTLOG + fi fi -echo ":: Log location set to $LOG_PATH" -#launching candump and setting the can log locations -#candump can0 1>$LOG_PATH/canmsg.log 2>$LOG_PATH/canmsg.err & -#if [ $? -eq 0 ]; then -# echo ":: candump launched" -#fi +#test the touch screen -------------------- Touch +#if loaded successful it has a long description with "Touch" keyword, 'T' capital. +#if fails has a one line error with "touch" keyword, 't' non-capital. +#if there is other issues can even be empty. +TSTEST="$(dmesg | grep Touch)" +if [ $? -eq 0 ]; then + echo $POSTMSG_TOUCH >> $POSTLOG +fi + + +#test the RTC ----------------------------- RTC +#may not be an accurate test but sufficient for now +#and couldn't find a way to get the rtc clock with the higher resolusion +#it should not be confused with date command which is system date/time and not hwclock +hwclock -r # if there is any issue with rtc hwclock will show errors +if [ $? -eq 0 ]; then + RTC1=$(cat /sys/class/rtc/rtc/since_epoch) + sleep 1 + RTC2=$(cat /sys/class/rtc/rtc/since_epoch) + if [ $(($RTC2 - $RTC1)) -eq 1 ]; then + echo $POSTMSG_RTC >> $POSTLOG + fi +fi + + # stop the connection manager daemon killall connmand # setup wifi killall wpa_supplicant >> $HOME/filesystem.out 2>> $HOME/filesystem.err #launching denali application, disable keep-alive -$HOME/denali -u & # 2>> $HOME/filesystem.err & +$HOME/denali -u & udhcpc -i eth0 -n & +echo "End: $(date +"%d%m%Y%H%M%S")" >> $POSTLOG Index: sources/ApplicationController.cpp =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -120,7 +120,6 @@ connect(&_Logger , SIGNAL(didExportLogs()), this , SLOT( onExport ())); - // Settings - move to application thread connect(this, SIGNAL(didSettingsInit()), this, SLOT( onSettingsInit())); @@ -502,11 +501,15 @@ } void ApplicationController::onstartPOST() { + emit didActionTransmit(GuiActionType::ID_KeepAlive, {}); ApplicationPost post; - connect(&post, &ApplicationPost::didPOSTFailed, [=] (const Gui::GuiAlarmID &vAlarmID) { + connect(&post, &ApplicationPost::didPOSTFail, [=] (Gui::GuiAlarmID vAlarmID) { emit didActionTransmit(GuiActionType::ID_AlarmTriggered, { vAlarmID }); }); - AdjustUIPostFinalResultRequestData data; - data.mResult = post.start(); - emit didAdjustment(data); + connect(&post, &ApplicationPost::didPOSTDone, [=] (bool vResult) { + AdjustUIPostFinalResultRequestData data; + data.mResult = vResult; + emit didAdjustment(data); + }); + post.start(); } Index: sources/ApplicationPost.cpp =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -14,9 +14,12 @@ */ #include "ApplicationPost.h" // Qt +#include +#include // Project - +#include "FileHandler.h" +#include "StorageGlobals.h" /*! * \brief ApplicationPost::ApplicationPost * \details Constructor @@ -30,10 +33,129 @@ * \details Starting the post application initialization * \return */ -bool ApplicationPost::start() +void ApplicationPost::start() { - // TEST Code - emit didPOSTFailed(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH); - emit didPOSTFailed(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CAN); - return false; + bool ok = false; + if (Storage::FileHandler::read(qApp->applicationDirPath() + "/" + Storage::POST_LOG, _content) ) { + ok = checkFileSystem () + && checkCANBus () + && checkDisplay () + && checkTouch () + && checkSDCard () + && RTC () + && checkWiFi () + && checkBluetooth () + && checkEthernet () + && checkSound () + ; + } + emit didPOSTDone(ok); } + +/*! + * \brief ApplicationPost::checkFileSystem + * \details Checks the File System Integrity + * \return false if there is an issue. + */ +bool ApplicationPost::checkFileSystem() +{ + bool ok = true; + // it will be done after consulting as part of CyberSecurity + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_FILESYSTEM); + return ok; +} + +/*! + * \brief ApplicationPost::checkCANBus + * \details Checks the CAN Bus driver is loaded and the bus is functional + * \return false if there is an issue. + */ +bool ApplicationPost::checkCANBus() +{ + bool ok = _content.contains(_postmsg_canbus); + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CANBUS); + return ok; +} + +/*! + * \brief ApplicationPost::checkDisplay + * \details Checks the display driver is loaded + * \return false if there is an issue. + */ +bool ApplicationPost::checkDisplay() +{ + bool ok = true; + // do the test : not a good test has been found yet. + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_DISPLAY); + return ok; +} + +/*! + * \brief ApplicationPost::checkTouchScreen + * \details Checks the touch driver is loaded + * \return false if there is an issue. + */ +bool ApplicationPost::checkTouch() +{ + bool ok = _content.contains(_postmsg_touch); + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH); + return ok; +} + +/*! + * \brief ApplicationPost::checkSDCard + * \details Checks the SD-Card driver is loaded and the is functional + * \return false if there is an issue. + */ +bool ApplicationPost::checkSDCard() +{ + bool ok = _content.contains(_postmsg_sdcard); + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SDCARD); + return ok; +} + +/*! + * \brief ApplicationPost::CRC + * \details Checks the CAN Bus driver is loaded and the bus is functional + * \return false if there is an issue. + */ +bool ApplicationPost::RTC() +{ + bool ok = _content.contains(_postmsg_rtc); + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_RTC); + return ok; +} + +bool ApplicationPost::checkWiFi() +{ + bool ok = true; + // do the test + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_WIFI); + return ok; +} + +bool ApplicationPost::checkBluetooth() +{ + bool ok = true; // This should not stop the FW POST and is only a warning that will show up in the alarm list. + // do the test + // Test : if (! ok) + emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_BLUETOOTH); + return ok; +} + +bool ApplicationPost::checkEthernet() +{ + bool ok = true; + // do the test : we are not using this for now since it has been removed from the PRS. + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_ETHERNET); + return ok; +} + +bool ApplicationPost::checkSound() +{ + bool ok = true; + // do the test + if (! ok) emit didPOSTFail(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SOUND); + return ok; +} + Index: sources/ApplicationPost.h =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/ApplicationPost.h (.../ApplicationPost.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ sources/ApplicationPost.h (.../ApplicationPost.h) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -23,20 +23,30 @@ class ApplicationPost : public QObject { Q_OBJECT + + QString _content; + const char *_postmsg_canbus ="CANBus passed" ; + const char *_postmsg_sdcard ="SD-CARD passed" ; + const char *_postmsg_touch ="Touch passed" ; + const char *_postmsg_rtc ="RTC passed" ; + + // tests // Severity + bool checkFileSystem (); // HIGH : ALARM_ID_UI_POST_FAILURE_FILESYSTEM + 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 RTC (); // MEDIUM : ALARM_ID_UI_POST_FAILURE_RTC + bool checkWiFi (); // LOW : ALARM_ID_UI_POST_FAILURE_WIFI + bool checkBluetooth (); // LOW : ALARM_ID_UI_POST_FAILURE_BLUETOOTH + 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. + public: explicit ApplicationPost(QObject *parent = nullptr); - bool start(); + void start(); signals: - void didPOSTFailed(const Gui::GuiAlarmID &vAlarmID); - -public slots: + void didPOSTFail(Gui::GuiAlarmID vAlarmID); + void didPOSTDone(bool vResult ); }; - - - - - - -// if the touch is not connected this message in dmesg -// [ 5.152555] ft5x06-ts 3-0038: Could not detect touch screen -19. Index: sources/gui/qml/main.qml =================================================================== diff -u -ra302861c33cdda0f0a95ade9b7c6a02b5593a9f2 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/gui/qml/main.qml (.../main.qml) (revision a302861c33cdda0f0a95ade9b7c6a02b5593a9f2) +++ sources/gui/qml/main.qml (.../main.qml) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -252,21 +252,22 @@ font.pixelSize: 14 } - Text { // TEST : Current Date/Time + Text { // TEST : Ethernet IP color : Colors.textMain anchors { - top : parent.top - horizontalCenter: parent.horizontalCenter + top : parent.top + left : parent.left + leftMargin : 450 } horizontalAlignment : Text.Alignleft verticalAlignment : Text.AlignBottom height : 15 - text : vDateTime.current + text : vNetwork.ethernetIP font.pixelSize: 14 } - Text { // TEST : Ethernet IP + Text { // TEST : Current Date/Time color : Colors.textMain anchors { top : parent.top @@ -277,7 +278,7 @@ verticalAlignment : Text.AlignBottom height : 15 - text : vNetwork.ethernetIP + text : vDateTime.current font.pixelSize: 14 } Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -107,8 +107,8 @@ visible : true // HD will pause for a few seconds before changing to stand-by mode // So we can show that POST has completed - done : vHDPOSTData.done fail : ! vHDPOSTData.doneResult + done : vHDPOSTData.done } } @@ -118,9 +118,11 @@ } Connections { target: vHDOperationMode - // onFaultChanged : { page( _faultModeScreen , vfault )} // may needed later. + // onFaultChanged : { page( _faultModeScreen , vfault )} // may needed later. onServiceChanged : { page( _serviceModeScreen , vservice )} - onInitChanged : { page( _initialModeScreen , vinit )} + onInitChanged : { page( _initialModeScreen , vinit ) + if ( vinit ) vHDPOSTData.reset() // better to reset on vinit = true because the rest makes the screen animation to run + } onHomeChanged : { page( _mainHome , vhome )} onStandbyChanged : { /* It depends on the subModes of the standBy. Handled by onHome. */ } Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 31-Jul-2021 + * \date (last) 03-Aug-2021 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * @@ -286,14 +286,18 @@ /*0256*/case GuiAlarmID::ALARM_ID_HD_DG_COMPATIBILITY_ERROR : { result = QObject::tr("HD and DG software builds are not compatible." ); break; } /* 256*/ /*0257*/case GuiAlarmID::ALARM_ID_DG_FPGA_POWER_OUT_TIMEOUT : { result = QObject::tr("DG FPGA power out timeout." ); break; } /* 257*/ /*0258*/case GuiAlarmID::ALARM_ID_HD_FPGA_POWER_OUT_TIMEOUT : { result = QObject::tr("HD FPGA power out timeout." ); break; } /* 258*/ -/*0259*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CAN : { result = QObject::tr("UI POST CANBus failure." ); break; } /* 259*/ -/*0260*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH : { result = QObject::tr("UI POST Touch failure." ); break; } /* 260*/ -/*0261*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SDCARD : { result = QObject::tr("UI POST SD-Card failure." ); break; } /* 261*/ -/*0262*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CRC : { result = QObject::tr("UI POST CRC failure." ); break; } /* 262*/ -/*0263*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_WIFI : { result = QObject::tr("UI POST WiFi failure." ); break; } /* 263*/ -/*0264*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_BLUETOOTH : { result = QObject::tr("UI POST Bluetooth failure." ); break; } /* 264*/ -/*0265*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_ETHERNET : { result = QObject::tr("UI POST Ethernet failure." ); break; } /* 265*/ -/*0266*/case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } /* 266*/ +/*0259*/case GuiAlarmID::ALARM_ID_HD_TEMPERATURES_OUT_OF_RANGE : { result = QObject::tr("HD temperatures out of range." ); break; } /* 259*/ +/*0260*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_FILESYSTEM : { result = QObject::tr("UI POST File System Integrity failure." ); break; } /* 260*/ +/*0261*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CANBUS : { result = QObject::tr("UI POST CANBus failure." ); break; } /* 261*/ +/*0262*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_DISPLAY : { result = QObject::tr("UI POST Display failure." ); break; } /* 262*/ +/*0263*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH : { result = QObject::tr("UI POST Touch failure." ); break; } /* 263*/ +/*0264*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SDCARD : { result = QObject::tr("UI POST SD-Card failure." ); break; } /* 264*/ +/*0265*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_RTC : { result = QObject::tr("UI POST RTC failure." ); break; } /* 265*/ +/*0266*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_WIFI : { result = QObject::tr("UI POST WiFi failure." ); break; } /* 266*/ +/*0267*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_BLUETOOTH : { result = QObject::tr("UI POST Bluetooth failure." ); break; } /* 267*/ +/*0268*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_ETHERNET : { result = QObject::tr("UI POST Ethernet failure." ); break; } /* 268*/ +/*0269*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SOUND : { result = QObject::tr("UI POST Sound failure." ); break; } /* 269*/ +/*0270*/case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } /* 270*/ default: result = QObject::tr("ALARM_ID_UNDEFINED [%1]").arg(int(vAlarmID)); Index: sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp (.../MTreatmentBloodPrimeData.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp (.../MTreatmentBloodPrimeData.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -20,16 +20,19 @@ return { _data.mTarget .value, _data.mCurrent.value, + _data.mSafety.value, }; } bool MTreatmentBloodPrime::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mTarget )) if (GetValue(vByteArray, index, _data.mCurrent)) + if (GetValue(vByteArray, index, _data.mSafety)) return true ; else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } } /*! @@ -41,5 +44,6 @@ Data data; data.mTarget = _data.mTarget .value; data.mCurrent = _data.mCurrent.value; + data.mSafety = _data.mSafety.value; return data; } Index: sources/model/hd/data/treatment/MTreatmentBloodPrimeData.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/model/hd/data/treatment/MTreatmentBloodPrimeData.h (.../MTreatmentBloodPrimeData.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/hd/data/treatment/MTreatmentBloodPrimeData.h (.../MTreatmentBloodPrimeData.h) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -38,6 +38,7 @@ * | || * | #1:(F32) | \ref Data::mTarget | * | #2:(F32) | \ref Data::mCurrent | + * | #3:(F32) | \ref Data::mSafety | * * \sa Data * @@ -59,6 +60,7 @@ struct { Types::F32 mTarget ; Types::F32 mCurrent; + Types::F32 mSafety ; } _data; public: @@ -70,6 +72,7 @@ struct Data { float mTarget = 0; ///< Target volume of BloodPrime delivery float mCurrent = 0; ///< Current volume of BloodPrime delivery + float mSafety = 0; ///< Safety volume of BloodPrime delivery }; public: Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r052c794d6a8db55a2fbfdad172275af073ee54c3 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -28,6 +28,8 @@ /****** TO BE CONSISTENT, ALWAYS INCLUDE '/' AT THE END OF ALL THE FOLDER/DIR/PATH IN HERE ******/ + const char *POST_LOG = "post.log"; // this file shall reside in the home folder where the application stored. + // USB #ifdef BUILD_FOR_TARGET const char *USB_Mount_Point = "/media/usb/"; Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r13d6a4fae2f910ab6e289ac9280258a94f734405 -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 13d6a4fae2f910ab6e289ac9280258a94f734405) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -22,6 +22,9 @@ */ namespace Storage { + + // POST + extern const char *POST_LOG; // USB extern const char *USB_Mount_Point; extern const char *USB_File_System; Index: sources/view/hd/data/post/VHDPOSTData.h =================================================================== diff -u -rb50431293b0690d6071f0fd58044880909cef01d -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/view/hd/data/post/VHDPOSTData.h (.../VHDPOSTData.h) (revision b50431293b0690d6071f0fd58044880909cef01d) +++ sources/view/hd/data/post/VHDPOSTData.h (.../VHDPOSTData.h) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -57,5 +57,18 @@ VIEW_DEC_CLASS(VHDPOSTData) VIEW_DEC_SLOT (HDPostSingleResultData) VIEW_DEC_SLOT (HDPostFinalResultData ) + +public slots: + /*! + * \brief reset + * \details In a very unlikely scenario of going back to the init state (it only happened during testing and demo) + * the UI should be able to reset the states of itself + * since the HD is not sending the messages when changing the states until the end of the POST process. + */ + void reset() { + doneResult (false); + done (false); + } + }; } Index: sources/view/hd/data/treatment/VTreatmentBloodPrimeData.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/view/hd/data/treatment/VTreatmentBloodPrimeData.cpp (.../VTreatmentBloodPrimeData.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/data/treatment/VTreatmentBloodPrimeData.cpp (.../VTreatmentBloodPrimeData.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -23,4 +23,5 @@ { target (vData.mTarget ); current(vData.mCurrent); + safety (vData.mSafety ); } Index: sources/view/hd/data/treatment/VTreatmentBloodPrimeData.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r3f555c49ddd2c983f469709e3c001d0e76159248 --- sources/view/hd/data/treatment/VTreatmentBloodPrimeData.h (.../VTreatmentBloodPrimeData.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/data/treatment/VTreatmentBloodPrimeData.h (.../VTreatmentBloodPrimeData.h) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) @@ -38,6 +38,7 @@ PROPERTY( float , target , 0) PROPERTY( float , current , 0) + PROPERTY( float , safety , 0) VIEW_DEC(VTreatmentBloodPrime, TreatmentBloodPrimeData) };