Index: AlarmMapping.csv =================================================================== diff -u -r2d0bacfbe1b70055247eb40743405a5f9acb15e3 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- AlarmMapping.csv (.../AlarmMapping.csv) (revision 2d0bacfbe1b70055247eb40743405a5f9acb15e3) +++ AlarmMapping.csv (.../AlarmMapping.csv) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -111,7 +111,7 @@ 110,"HD syringe pump speed check error." 111,"HD syringe pump not stopped in off state error." 112,"HD blood leak detector fault." - 113,"HD arterial air bubble detector self-test failure." + 113,"Unused." 114,"HD venous air bubble detector self-test failure." 115,"DG temperature sensor out of range." 116,"DG temperature sensor ADC out of range." Index: denali.pro.user =================================================================== diff -u -r04c386c7752b972928ecbf34b3e6e7f135c8a343 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- denali.pro.user (.../denali.pro.user) (revision 04c386c7752b972928ecbf34b3e6e7f135c8a343) +++ denali.pro.user (.../denali.pro.user) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -1,6 +1,6 @@ - + EnvironmentId Index: scripts/setup.sh =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- scripts/setup.sh (.../setup.sh) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ scripts/setup.sh (.../setup.sh) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -23,13 +23,13 @@ # to use the system time/date and not use the network time protocol timedatectl set-ntp 0 -echo "Setup the timezone (UTC)" -timedatectl set-timezone UTC +echo "Setup the timezone (PDT Pacific)" +timedatectl America/Los_Angeles echo "Setup the time/date" while true; do read -p "please enter the date (yyyy-MM-dd HH:mm): " -r DATE - date -s "$DATE" + timedatectl set-time "$DATE" if [ $? -eq 0 ]; then break fi Index: sources/ApplicationController.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -22,7 +22,7 @@ #include "MessageDispatcher.h" #include "Logger.h" #include "DeviceController.h" -#include "FileHandler.h" +//#include "FileHandler.h" #include "GuiController.h" #include "Settings.h" #include "MSettings.h" Index: sources/MainTimer.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/MainTimer.cpp (.../MainTimer.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/MainTimer.cpp (.../MainTimer.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -19,7 +19,7 @@ //Project #include "Logger.h" -#include "FileHandler.h" +//#include "FileHandler.h" /*! * \brief MainTimer::MainTimer Index: sources/_wip_/fileCopy/main.cpp =================================================================== diff -u --- sources/_wip_/fileCopy/main.cpp (revision 0) +++ sources/_wip_/fileCopy/main.cpp (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -0,0 +1,122 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \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 %{Cpp:License:FileName} + * \author (last) denali + * \date (last) 6/2/2022 + * \author (original) denali + * \date (original) 6/2/2022 + * + */ + +/* Work in progress code and has be embedded in the code. +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define APPNAME "fileCopy" +#define VERSION "v0.0.5.2" + +enum Error_Enums { + eOK , + eNotEnoughParametes , + + eSrcFileNotExist , + eDstFolderNotExist , + eDstFolderMakeError , + + eSrcOpenError , + eDstOpenError , + + eSrcReadError , + eDstWriteError , + eDstFlushError , +} err = eOK; + +int main(int argc, char *argv[]) +{ + std::cout << APPNAME << " " << VERSION << std::endl; + + int chunkSize = 1024 * 2; + bool createFolder = argc > 3 && std::strcmp(argv[3], "-c") == 0; + QString srcFileName; + QString dstFileName; + QDir dstDir; + QFile srcFile; + QFile dstFile; + qint64 totalSize = 0; + qint64 copySize = 0; + + if ( argc < 3 ) { err = eNotEnoughParametes ; goto lErr; } + + srcFileName = argv[1]; + dstFileName = argv[2]; + + if ( ! QFileInfo(srcFileName).exists() ) { err = eSrcFileNotExist ; goto lErr; } + dstDir = QFileInfo(dstFileName).absoluteDir(); + if ( ! createFolder ) { if ( ! dstDir.exists() ) { err = eDstFolderNotExist ; goto lErr; }} + else { if ( ! dstDir.mkpath ( dstDir.path() ) ) { err = eDstFolderMakeError ; goto lErr; }} + + srcFile.setFileName(srcFileName); + dstFile.setFileName(dstFileName); + + if ( ! srcFile.open(QIODevice::ReadOnly )) { err = eSrcOpenError ; goto lErr; } + if ( ! dstFile.open(QIODevice::WriteOnly )) { err = eDstOpenError ; goto lErr; } + + totalSize = srcFile.size(); + copySize = totalSize; + + std::cout << "start ..." << std::endl; + std::cout << "Src: " << srcFileName.toStdString() + << " " + << (totalSize > 1024*1024 ? (totalSize / 1024 / 1024) : (totalSize / 1024)) + << (totalSize > 1024*1024 ? "M" : "K" ) + << std::endl; + std::cout << "Dst: " << dstFileName.toStdString() << std::endl; + + while ( copySize ) { + char chunkData[chunkSize] = {}; + const qint64 readSize = srcFile.read (chunkData, chunkSize); + if ( readSize < 0 ) { err = eSrcOpenError ; goto lErr; } + const qint64 writeSize = dstFile.write(chunkData, readSize); + if ( writeSize < 0 ) { err = eDstWriteError ; goto lErr; } + + if ( readSize >= chunkSize ) { // a full chunk was available to read + copySize -= writeSize; // writeSize; + } + else { // Not a full chunk available EOF + copySize = 0; + } + + + int copyPercent = int(((float((totalSize - copySize))) / float(totalSize)) * 100); + std::cout << "\r" << "%" << copyPercent; + + } + + // close source + srcFile.close(); + + // close destination + if ( ! dstFile.flush() ) { err = eDstFlushError ; goto lErr; } + dstFile.close(); + + std::cout << "\nFinish" << std::endl; + return eOK; + +lErr: + std::cout << "\nError: " << err << std::endl; + return err; +} +*/ Index: sources/gui/GuiView.h =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/GuiView.h (.../GuiView.h) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/gui/GuiView.h (.../GuiView.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -55,9 +55,13 @@ PROPERTY(qint8 , sdTooLowPecent, -1) // -1 means the event never happened // disabled coco end - PROPERTY(bool , usbReady , false) - PROPERTY(bool , usbRemoved , true ) - +#ifdef BUILD_FOR_DESKTOP + PROPERTY(bool , usbReady , true ) + PROPERTY(bool , usbRemoved , false ) +#else + PROPERTY(bool , usbReady , false ) + PROPERTY(bool , usbRemoved , true ) +#endif public: explicit GuiView(QObject *parent = nullptr); Index: sources/gui/qml/main.qml =================================================================== diff -u -r2d0bacfbe1b70055247eb40743405a5f9acb15e3 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/qml/main.qml (.../main.qml) (revision 2d0bacfbe1b70055247eb40743405a5f9acb15e3) +++ sources/gui/qml/main.qml (.../main.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -311,7 +311,7 @@ anchors { top : parent.top left : parent.left - leftMargin : 1100 + leftMargin : 1090 } horizontalAlignment : Text.Alignleft verticalAlignment : Text.AlignBottom @@ -321,6 +321,22 @@ font.pixelSize: 14 } + Text { // TEST : Current timezone + color : Colors.textMain + anchors { + top : parent.top + left : parent.left + leftMargin : 1220 + } + horizontalAlignment : Text.Alignleft + verticalAlignment : Text.AlignBottom + + height : 15 + text : vDateTime.timezone + font.pixelSize: 14 + } + + SDItem { id: _sdItem // TODO: disable this later. this is only for diagnostic purpose. onDoubleClicked : { Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -147,6 +147,21 @@ onInvalidModeChanged : { page( null , vinvalidMode )} } + // As long as UI is in In-Tx BP/HR is updated and the dialog will pop up on interval. + Connections { target: vHDOperationMode + onInTreatmentChanged : { + vTreatmentVitals.enableDialog = vinTreatment + if ( vinTreatment ) { + vTreatmentVitals.doTimerStart() + } + else { + vTreatmentVitals.doTimerStop() + vTreatmentVitals.doReset() + } + + } + } + // the page function is more flixible regarding our current design // and it's easier(or may not need) to modify later if required. // and is more optimized and will never leave screen empty Index: sources/gui/qml/pages/posttreatment/PostTreatmentReview.qml =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/qml/pages/posttreatment/PostTreatmentReview.qml (.../PostTreatmentReview.qml) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/gui/qml/pages/posttreatment/PostTreatmentReview.qml (.../PostTreatmentReview.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -36,12 +36,17 @@ header.confirmText.text: qsTr("NEXT") - ExportButton { + ExportButton { id: _exportButton anchors.top : parent.top anchors.left : parent.left exportFunction : vPostTreatmentAdjustmentTreatmentLog.doExport enabled : vPostTreatmentAdjustmentTreatmentLog.isIdle && _GuiView.usbReady } + USBButton { id: _usbButton + anchors.top : _exportButton.top + anchors.left : _exportButton.right + anchors.leftMargin: Variables.minVGap + } ScrollBar { anchors.fill: _flickable Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -r301c0a2101eb9374145ae274c8d91460fc9a6a62 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 301c0a2101eb9374145ae274c8d91460fc9a6a62) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -88,9 +88,7 @@ onPatientDisconnectionConfirm : { vPostTreatmentAdjustmentPatientDisconnectionConfirm .doConfirm( ) /* No wait for Rsp, so navigates => */ page( _treatmentReviewConfirm ) /* After navigate ask for Tx data */ vPostTreatmentAdjustmentTreatmentLog .doRequest( )} - onTreatmentReviewConfirm : { page( _disposablesRemovalConfirm ) - vTreatmentVitals.doReset() - } + onTreatmentReviewConfirm : { page( _disposablesRemovalConfirm )} onDisposablesRemovalConfirm : { vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( )} onDisposablesRemovalBack : { page( _treatmentReviewConfirm )} Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -41,6 +41,12 @@ } PreTreatmentBase { id: _preTreatmentVitals // BP/HR Entry + function update(vSystolic, vDiastolic ,vHeartRate) { + _bphrEntry.systolic = vSystolic ? vSystolic : "" + _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" + _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" + } + header.stepIndex : 6 header.confirmText.text : _bphrEntry.isValid ? qsTr("CONFIRM") : qsTr("SKIP") header.backVisible : true @@ -70,13 +76,14 @@ } else { vTreatmentVitals.doSkip() // only for logging + } + } + Connections { target: vTreatmentVitals + onDidTrigger: { + _preTreatmentVitals.update( vSystolic, vDiastolic, vHeartRate ) } } - onVisibleChanged: { - if ( visible ) vTreatmentVitals.doReset() - vTreatmentVitals.enableUpdate = visible - } } PreTreatmentBase { id: _preTreatmentPatientConnection Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r768259b3c00ee3fbc5ba04475763b43cfac76bfe -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 768259b3c00ee3fbc5ba04475763b43cfac76bfe) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -32,6 +32,7 @@ StackItem { id : _root objectName: "TreatmentStack" + onVisibleChanged: console.debug(" ~~~~~~~~~~ ", objectName) stackView.initialItem : null // ultrafiltration state information bar properties @@ -65,9 +66,6 @@ TreatmentBloodPrime { id: _treatmentBloodPrime } TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } TreatmentHome { id: _treatmentHome - onVisibleChanged : { - vTreatmentVitals.enableDialog = visible - } onSectionFlowClicked : { _treatmentAdjustmentFlow.open() } @@ -87,9 +85,6 @@ } ScreenItem { id: _treatmentTrending - onVisibleChanged : { - vTreatmentVitals.enableDialog = visible - } /* ----- TEST: Under the test code, for the plotting of the items ----- Timer { id: _timer property real x1: 0 @@ -181,29 +176,39 @@ } titleText : qsTr("VITALS") - autoHide : true - autoHideDuration : vTreatmentVitals.timeout * 60000 // min => ms confirmEnabled : _bphrEntry.isValid onConfirmClicked : { + _vitalEntry.close() vTreatmentVitals.doConfirm( _bphrEntry.systolic , _bphrEntry.diastolic , _bphrEntry.heartRate ) - _vitalEntry.close() } - onCloseClicked : + onCloseClicked : { vTreatmentVitals.doSkip() // only for logging + } - onAutoHidden : - vTreatmentVitals.doTimeout() // only for logging - onOpened : _bphrEntry.setFocus() + onOpened : { + vTreatmentVitals.doTimerStop() // Can't be moved to C++, and has to be handled here because it can manually being opened by the user + _bphrEntry.setFocus() + } + onClosed : { + vTreatmentVitals.doTimerStart() + } + BPHREntry { id : _bphrEntry contentRectHeight : _vitalEntry.contentRect.height - onClicked : { - _vitalEntry.autoHideCancel = true + } + + Connections { target: vTreatmentVitals + onDidTrigger : { + if ( vTreatmentVitals.enableDialog ) { + _vitalEntry.update(vSystolic, vDiastolic, vHeartRate ) + _vitalEntry.open() + } } } } @@ -291,10 +296,4 @@ Connections { target: _mainHome onStartTreatment : { page( _treatmentHome )} } - - Connections { target: vTreatmentVitals - onDidTrigger : { - _vitalEntry.update(vSystolic, vDiastolic, vHeartRate ) - _vitalEntry.open() } - } } Index: sources/main.h =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/main.h (.../main.h) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/main.h (.../main.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -28,8 +28,6 @@ #define PRINT_THREAD_NAME #endif -#undef DEBUG_BCUFF_MIMIC - // TODO : A singleton parent class needs to be created // to taking care of the Threading, init, quit, and so Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r2d0bacfbe1b70055247eb40743405a5f9acb15e3 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 2d0bacfbe1b70055247eb40743405a5f9acb15e3) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 01-Jun-2022 + * \date (last) 08-Jun-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * @@ -146,7 +146,7 @@ /*0110*/case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_SPEED_ERROR : { result = QObject::tr("HD syringe pump speed check error." ); break; } /* 110*/ /*0111*/case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_NOT_STOPPED_ERROR : { result = QObject::tr("HD syringe pump not stopped in off state error." ); break; } /* 111*/ /*0112*/case GuiAlarmID::ALARM_ID_HD_BLOOD_LEAK_FAULT : { result = QObject::tr("HD blood leak detector fault." ); break; } /* 112*/ -/*0113*/case GuiAlarmID::ALARM_ID_HD_ARTERIAL_BUBBLE_SELF_TEST_FAILURE : { result = QObject::tr("HD arterial air bubble detector self-test failure." ); break; } /* 113*/ +/*0113*/case GuiAlarmID::ALARM_ID__AVAILABLE_4 : { result = QObject::tr("Unused." ); break; } /* 113*/ /*0114*/case GuiAlarmID::ALARM_ID_HD_VENOUS_BUBBLE_SELF_TEST_FAILURE : { result = QObject::tr("HD venous air bubble detector self-test failure." ); break; } /* 114*/ /*0115*/case GuiAlarmID::ALARM_ID_DG_TEMPERATURE_SENSOR_OUT_OF_RANGE : { result = QObject::tr("DG temperature sensor out of range." ); break; } /* 115*/ /*0116*/case GuiAlarmID::ALARM_ID_DG_TEMPERATURE_SENSOR_ADC_OUT_OF_RANGE : { result = QObject::tr("DG temperature sensor ADC out of range." ); break; } /* 116*/ Index: sources/storage/Logger.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/storage/Logger.cpp (.../Logger.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -331,8 +331,6 @@ */ bool Logger::exportLogs() { - // disabled coco begin validated: This needs user interaction to check the old files deleted - // has been tested manually int result = 0; static QString mOSource; QString mDestination = USB_Mount_Point; @@ -348,7 +346,6 @@ mOSource = ""; return result >= 0; // refer to QProcess::execute(hit F1 on execute) doc. } -// disabled coco end /*! * \brief Logger::concurrentExportLogs Index: sources/storage/Logger.h =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/storage/Logger.h (.../Logger.h) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/storage/Logger.h (.../Logger.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -99,10 +99,10 @@ QString _logFileNamePrefix; QHash _logPathNames; const QHash _logBasePathNames { - { LogType::eLogEvent, "log/" }, - { LogType::eLogDatum, "log/" }, - { LogType::eLogDebug, "service/" }, - { LogType::eLogTrtmt, Storage::Treatment_Log_Folder }, + { LogType::eLogEvent, Storage::Log_Folder_Event }, + { LogType::eLogDatum, Storage::Log_Folder_Data }, + { LogType::eLogDebug, Storage::Log_Folder_Service }, + { LogType::eLogTrtmt, Storage::Log_Folder_Treatment }, }; const QHash _logPrefix { // Will be used for the logging in the file Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r301c0a2101eb9374145ae274c8d91460fc9a6a62 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 301c0a2101eb9374145ae274c8d91460fc9a6a62) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -82,10 +82,13 @@ const char *Scripts_Path_Name = "/home/denali/Projects/application/scripts/"; #endif - // Treatment + // Please notice that is the folder not the path // and it needs to be concatenated after SDCard_Base_Path_Name for each build configuration - const char *Treatment_Log_Folder = "treatment/"; + const char *Log_Folder_Event = "log/" ; // Event Log + const char *Log_Folder_Data = "log/" ; // Data Log + const char *Log_Folder_Service = "service/" ; // Service Log + const char *Log_Folder_Treatment = "treatment/"; // Treatment // FIXME : Not sure having global settings object is a good idea. Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r301c0a2101eb9374145ae274c8d91460fc9a6a62 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 301c0a2101eb9374145ae274c8d91460fc9a6a62) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -46,8 +46,11 @@ // Scripts extern const char *Scripts_Path_Name; - // Treatment - extern const char *Treatment_Log_Folder; + // Log Type Folders + extern const char *Log_Folder_Event; // Event Log + extern const char *Log_Folder_Data; // Data Log + extern const char *Log_Folder_Service; // Service Log + extern const char *Log_Folder_Treatment; // Treatment // Date and Time extern const char *Date_Time_Set_Sh; Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -157,7 +157,7 @@ * \details sets the treatment log path if the given type is treatment log, with the path, vLogPath. * If the given vLogPath is empty, the defaults in Storage will be used. * \sa Storage::SDCard_Base_Path_Name - * \sa Storage::Treatment_Log_Folder + * \sa Storage::Log_Folder_Treatment * \param vLogType - The Log type of type Logger::LogType * \param vLogPath - the path to be set and used. */ @@ -167,7 +167,7 @@ if ( vLogPath.trimmed().isEmpty() ) { _treatmentLogPath = QString("%1%2") .arg(Storage::SDCard_Base_Path_Name) - .arg(Storage::Treatment_Log_Folder ); + .arg(Storage::Log_Folder_Treatment ); } else { _treatmentLogPath = vLogPath; @@ -362,10 +362,19 @@ */ bool TreatmentLog::exportLog() { - bool ok; - QString exportPath = Storage::USB_Mount_Point; - Storage::FileHandler::makeFolder(exportPath); - ok = FileHandler::copyFolder(_treatmentLogPath , exportPath); + bool ok = true; + QString dstPath = Storage::USB_Mount_Point ; + dstPath += Storage::Log_Folder_Treatment ; + QString srcFile = _lastTxInfo.mFileName ; + QString dstFile = dstPath + QFileInfo(srcFile).fileName(); + // HERE: expose to the UI dialog as the rejection/notification result + if ( ! Storage::FileHandler::makeFolder ( dstPath ) ) { LOG_DEBUG ( QString( "Couldn't create folder on USB drive to export TxLog" ) ); ok = false; goto lOut; } + if ( ! QFileInfo::exists ( srcFile ) ) { LOG_DEBUG ( QString( "TxLog '%1' doesn't exist" ).arg( srcFile ) ); ok = false; goto lOut; } + if ( QFileInfo::exists ( dstFile ) ) { LOG_DEBUG ( QString( "TxLog '%1' already exists" ).arg( dstFile ) ); ok = false; goto lOut; } + if ( ! QFile::copy (srcFile, dstFile ) ) { LOG_DEBUG ( QString( "Unable to Export TxLog '%1' to '%2'" ).arg( srcFile ).arg( dstFile ) ); ok = false; goto lOut; } + +lOut: + if ( ! ok ) LOG_EVENT_UI ( QString( "Unable to Export TxLog" )); return ok; } Index: sources/view/VEventSpy.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -25,6 +25,8 @@ #include "DeviceController.h" #include "BluetoothInterface.h" +#undef DEBUG_BCUFF_MIMIC + // if needs to spy on the mouse events // (which is happening on the desktop only since there is not mouse attached to the device) // remove the #define comment line below. Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -31,8 +31,6 @@ void View::VTreatmentVitals::initConnections() { ACTION_RECEIVE_BRIDGE_CONNECTION(_BluetoothInterface, UIBloodPressureData); - connect(this, SIGNAL( enableDialogChanged (const bool &)), - this, SLOT(onTimerChanged ( ))); connect(this, SIGNAL( intervalChanged (const quint8 &)), this, SLOT(onTimerChanged ( ))); } @@ -46,21 +44,16 @@ */ void View::VTreatmentVitals::onActionReceive(const UIBloodPressureData &vData) { - if ( ! ( _enableDialog || _enableUpdate ) ) { - // if the vitals is disabled it means Gui is probably in an incorrect state and is unable to handle the vital information. - LOG_EVENT_UI(tr("Measured vital values ignored due to incorrect state [%1,%2,%3]") - .arg(vData.mSystolic ) - .arg(vData.mDiastolic) - .arg(vData.mPulseRate)); - return; - } - // Not used yet. // adjustment_Accepted ( vData.mAccepted ); // adjustment_Reason ( vData.mReason ); - if ( _enableDialog ) { emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mPulseRate); } - if ( _enableUpdate ) { update (vData.mSystolic, vData.mDiastolic, vData.mPulseRate); } + emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mPulseRate); + // if the vitals is disabled it means Gui is probably in an incorrect state and is unable to handle the vital information. + LOG_EVENT_UI(tr("Vital received,%1,%2,%3") + .arg(vData.mSystolic ) + .arg(vData.mDiastolic) + .arg(vData.mPulseRate)); } /*! @@ -78,7 +71,7 @@ update(vSystolic, vDiastolic, vHeartRate); treatmentLog(); - LOG_EVENT_UI(tr("User Vital Confirmation,%1,%2,%3") + LOG_EVENT_UI(tr("Vital Confirmed,%1,%2,%3") .arg(_systolic ) .arg(_diastolic) .arg(_heartRate) @@ -92,19 +85,11 @@ */ void View::VTreatmentVitals::doSkip() { - LOG_EVENT_UI(tr("User Skipped Vital Entry")); + LOG_EVENT_UI(tr("Vital Skipped")); + timerReset(); } /*! - * \brief View::VTreatmentVitals::doTimeout - * \details logs the vital entry timeout - */ -void View::VTreatmentVitals::doTimeout() -{ - LOG_EVENT_UI(tr("User Vital Entry Timed out")); -} - -/*! * \brief View::VTreatmentVitals::doReset * \details reset the previously read vital values * \param vEnabled - Disable or enable the vitals. @@ -117,8 +102,8 @@ systolic ( 0 ); diastolic ( 0 ); heartRate ( 0 ); + enableDialog ( 0 ); - enableUpdate ( 0 ); // force notify the Gui emit epochChanged ( 0 ); @@ -170,19 +155,25 @@ */ void View::VTreatmentVitals::timerEvent(QTimerEvent *) { - // TODO: Change the logic of the timer to count down instead of count up and reset to interval on 0. - // DEBUG: qDebug() << __FUNCTION__ << _timerCounter; - if ( _interval == _timerCounter ) { - timerReset(); + if ( ! _interval ) return; // if interval is 0/OFF return + + _secCounter++; + if ( _secCounter % 60 ) return; // only check every minute + + if ( ! _timerCounter ) { + timerStop(); emit didTrigger(); } - _timerCounter++; + else { + _timerCounter--; + _secCounter = 0; + } } void View::VTreatmentVitals::onTimerChanged() { - if ( _interval && _enableDialog ) timerStart(); - else timerStop (); + if ( _interval ) timerReset(); + else timerStop (); // Timer stop is resetting timer too. } /*! @@ -192,18 +183,25 @@ */ void View::VTreatmentVitals::timerStart() { - _timerId = startTimer(60000); // 1 min interval + _timerId = startTimer(1000); // 1 sec interval which will used as 1 min in timerEvent (easier to debug) } void View::VTreatmentVitals::timerReset() { - _timerCounter = 1; + if ( _interval ) { + // ( -1 ) :the interval is 0 based but if as an example we set the counter to 5 then 5 itself gets a minute to pass which makes it 6 min. + _timerCounter = _interval - 1; + } + else { // if _interval == 0, counter should set to 0 too not to -1 + _timerCounter = 0; + } + _secCounter = 0; } /*! * \brief View::VTreatmentVitals::stop - * \details stops the timer + * \details stops the timer and resets the interval */ void View::VTreatmentVitals::timerStop() { Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -37,7 +37,8 @@ friend class ::tst_views; int _timerId = 0; - int _timerCounter = 1; + int _timerCounter = 0; + int _secCounter = 0; // disabled coco begin validated: // The property adjustment_Triggered has to be always true @@ -57,10 +58,8 @@ // timer - PROPERTY( bool , enableDialog , 0) // enable the vital screen timer - PROPERTY( bool , enableUpdate , 0) // enable the vital screen timer + PROPERTY( bool , enableDialog , 0) // enable the vital Dialog being triggered (pre-treatment is screen not a dialog) PROPERTY( quint8 , interval , 0) // show the vital screen in min - PROPERTY( quint8 , timeout , 1) // close the vital screen in min // timestamp PROPERTY( quint64 , epoch , 0) @@ -90,28 +89,19 @@ // vitals void doConfirm (quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate); void doSkip (); - void doTimeout (); void doReset (); + // timer + void doTimerStart () { timerStart(); } + void doTimerStop () { timerStop (); } + signals: - /*! - * \brief didAdjustment - * \details the notification signal to send the user's Request - * \param vData - data model includes request information - */ - void didAdjustment(const AdjustHDAlarmVolumeRequestData &vData); /*! * \brief didTrigger * \details the signal to trigger the Gui to notify the user for the vitals measurement */ void didTrigger(quint16 vSystolic = 0, quint16 vDiastolic = 0, quint16 vHeartRate = 0); - - /*! - * \brief didTrigger - * \details the signal to trigger the Gui to close the vitals measurement screen on no user interaction - */ - void didTimeout(); }; } Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp (.../VPostTreatmentAdjustTreatmentLog.cpp) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp (.../VPostTreatmentAdjustTreatmentLog.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -20,7 +20,7 @@ // Project #include "GuiController.h" -#include "FileHandler.h" +//#include "FileHandler.h" using namespace Storage; @@ -71,7 +71,7 @@ adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); - _TreatmentLog.initModel (vData, _patientID.trimmed() ); + _TreatmentLog.initModel ( vData, _patientID.trimmed() ); if ( vData.mAccepted ) { parametersText ( _TreatmentLog.values() ); } else { Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h (.../VPostTreatmentAdjustTreatmentLog.h) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h (.../VPostTreatmentAdjustTreatmentLog.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -95,7 +95,8 @@ PROPERTY(QString , txCode , "") - PROPERTY(bool , isIdle , true) + PROPERTY(bool , isIdle , true ) + PROPERTY(bool , isReady , false ) VIEW_DEC_CLASS (VPostTreatmentAdjustmentTreatmentLog) VIEW_DEC_SLOT (AdjustTreatmentLogResponseData) Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -15,7 +15,7 @@ #include "VDateTime.h" // Qt -#include +#include // Project #include "GuiController.h" @@ -54,6 +54,8 @@ month (_currentTime.toString("MM" )); year (_currentTime.toString("yyyy" )); + timezone(QTimeZone::systemTimeZone().abbreviation(_currentTime)); + status(""); } @@ -237,8 +239,11 @@ */ void VDateTime::timerEvent(QTimerEvent *) { - QDateTime datetime = QDateTime::currentDateTime(); - current(datetime.toString(_Settings.getDatetimeFormat())); - quint16 military = datetime.time().hour() * 100 + datetime.time().minute(); + _currentDateTime = QDateTime::currentDateTime(); + + current (_currentDateTime.toString(_Settings.getDatetimeFormat())); + timezone(QTimeZone::systemTimeZone().abbreviation(_currentDateTime)); + + quint16 military = _currentDateTime.time().hour() * 100 + _currentDateTime.time().minute(); greeting(military); } Index: sources/view/settings/VDateTime.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -rec7f919fdb70ff29a8de627937e4ad7008e59c1c --- sources/view/settings/VDateTime.h (.../VDateTime.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/view/settings/VDateTime.h (.../VDateTime.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) @@ -17,6 +17,7 @@ // Qt #include #include +#include // Project #include "main.h" // Doxygen : do not remove @@ -51,7 +52,7 @@ Q_ENUM(DateTimeSetStatus) enum GreetingRanges { - eMorningMin = 0500, // 05:00 AM + eMorningMin = 500, // 5:00 AM eMorningMax = 1200, // 12:00 PM eAfternoonMin = 1200, // 12:00 PM @@ -62,6 +63,7 @@ void timerEvent(QTimerEvent *event) override; private: + QDateTime _currentDateTime ; int _timerInterval = 1000; // ms QProcess _process ; @@ -90,6 +92,8 @@ PROPERTY(QString, current , "" ) PROPERTY(QString, greeting , "" ) + PROPERTY(QString, timezone , "" ) + VIEW_DEC_CLASS(VDateTime) VIEW_DEC_SLOT (AdjustHDDateTimeResponseData) VIEW_DEC_SLOT (AdjustDGDateTimeResponseData)