Index: denali.pro.user =================================================================== diff -u -rdf0329c47627ceb1fe460cda2ae3ff8c9c851106 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- denali.pro.user (.../denali.pro.user) (revision df0329c47627ceb1fe460cda2ae3ff8c9c851106) +++ denali.pro.user (.../denali.pro.user) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -109,7 +109,7 @@ qmake QtProjectManager.QMakeBuildStep - true + false false false @@ -128,7 +128,7 @@ true - -b --tag denali >> denali + -b --tag denali >> denali sha256sum %{buildDir} @@ -203,7 +203,7 @@ true - -b --tag denali >> denali + -b --tag denali >> denali sha256sum %{buildDir} Custom Process Step @@ -1263,7 +1263,7 @@ true - -b --tag denali >> denali + -b --tag denali >> denali sha256sum %{buildDir} Index: sources/ApplicationController.cpp =================================================================== diff -u -r3561f79af1a92356eea01d5d0c3297c69d2ecdf2 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 3561f79af1a92356eea01d5d0c3297c69d2ecdf2) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -500,6 +500,10 @@ void ApplicationController::onSettingsUpdate() { onActionReceive(SettingsData()); + + // call initialization functions when setting's ready. + _Settings.datetimeFormat(); + emit didSettingsDone(); } Index: sources/ApplicationPost.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -38,7 +38,7 @@ { QString postLogFileName = qApp->applicationDirPath() + "/" + Storage::POST_LOG; if (Storage::FileHandler::read(postLogFileName, _content)) { - _isShaSum = checkShaSum (); // This is a fault. Will always return true for now. Alarm will be triggered to notify user in Active Alarm List. There is a comment in the class definition about some ideas later. + _isShaSum = checkShaSum (); _isCANBus = checkCANBus (); _isDisplay = checkDisplay (); _isTouch = checkTouch (); Index: sources/gui/qml/components/GridSelection.qml =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -28,14 +28,18 @@ * where only one option is selected by the user */ Rectangle { id: _root - property int rowCount : 2 - property int colCount : 2 + property int rowCount : _rowCount + property int colCount : _colCount property int curIndex : -1 property int optionHeight : Variables.gridSelectionButtonHeight property int optionWidth : Variables.gridSelectionButtonWidth property alias title : _title.text property var labels : [] + readonly property int _itemCount: labels.length + readonly property int _rowCount : Math.ceil( _itemCount / _colCount ) + readonly property int _colCount : 2 + anchors.horizontalCenter: parent.horizontalCenter color : Colors.transparent height : _root.rowCount * _root.optionHeight Index: sources/gui/qml/main.qml =================================================================== diff -u -r9abc1790bb39fb52bf5a2bd113bc8957e4a1fc30 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/gui/qml/main.qml (.../main.qml) (revision 9abc1790bb39fb52bf5a2bd113bc8957e4a1fc30) +++ sources/gui/qml/main.qml (.../main.qml) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -151,7 +151,6 @@ interval : vTreatmentCreate.bloodPressureMeasureInterval } - VGeneralEvent { id: vGeneralEvent } VHDAccelerometer { id: vHDAccelerometer } VHDSyringePump { id: vHDSyringePump } Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r301c0a2101eb9374145ae274c8d91460fc9a6a62 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 301c0a2101eb9374145ae274c8d91460fc9a6a62) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -174,7 +174,6 @@ GridSelection { id : _heparinType objectName : "_heparinTypeRect" title : qsTr("Heparin Type") - rowCount : 1 labels : vTreatmentCreate.heparinTypeOptions onClicked : vTreatmentCreate.heparinType = curIndex } @@ -189,17 +188,13 @@ GridSelection { id: _bicarbonateConcentrate objectName : "_bicarbonateConcentrateRect" title : qsTr("Bicarbonate Concentrate") - rowCount : 1 - colCount : 2 labels : vTreatmentCreate.bicarbonateConcentrateOptions onClicked : vTreatmentCreate.bicarbonateConcentrate = curIndex } GridSelection { id: _dialyzerType objectName : "_dialyzerTypeRect" title : qsTr("Dialyzer Type") - rowCount : 3 - colCount : 2 labels : vTreatmentCreate.dialyzerTypeOptions onClicked : vTreatmentCreate.dialyzerType = curIndex } Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -rdf0329c47627ceb1fe460cda2ae3ff8c9c851106 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision df0329c47627ceb1fe460cda2ae3ff8c9c851106) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 02-Apr-2022 + * \date (last) 05-Apr-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * Index: sources/model/settings/MSettings.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -77,6 +77,22 @@ } /*! + * \brief MSettings::value + * \details returns value of a key for the given group + * \param vGroup - the group to look for the value + * \param vKey - the key to look for the value + * \return the values in QString for the group vGroup + */ +QVariant MSettings::value(const QString &vGroup, const QString &vKey) +{ + QMutexLocker locker(&_mutex); + int index = _settings[vGroup].keys.indexOf(vKey); + if ( index >= 0 ) + return _settings[vGroup].values.at(index); + return QVariant(); +} + +/*! * \brief MSettings::location * \details The locations where the settings have been read for the group vGroup * \param vGroup - the group to look for the location @@ -132,3 +148,18 @@ mGroup.values += vValue ; _settings[vGroup] = mGroup; } + +/********** The common helper functions **********/ + +/*! + * \brief Settings::getDatetimeFormat + * \details Get the date time format + * \return The String output of the data/time format. + */ +void MSettings::datetimeFormat() +{ + QVariant dateFotmat = _Settings.value("DateTime", "Date Format"); + QVariant timeFotmat = _Settings.value("DateTime", "Time Format"); + if (dateFotmat.isValid() && timeFotmat.isValid()) + _datetimeFormat = dateFotmat.toString() + " " + timeFotmat.toString(); +} Index: sources/model/settings/MSettings.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/model/settings/MSettings.h (.../MSettings.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/model/settings/MSettings.h (.../MSettings.h) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -28,6 +28,9 @@ // namespace namespace Storage { +// FixMe: the model and controller need review and some functionalities need to be moved. +// FixMe: the controller should be the Singleton not the model. + class MSettings : public QObject { Q_OBJECT @@ -54,9 +57,16 @@ QStringList keys (const QString &vGroup ); QString key (const QString &vGroup , uint vIndex); QVariantList values (const QString &vGroup ); + QVariant value (const QString &vGroup , const QString &vKey); QString location (const QString &vGroup ); void add (const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation, const QString &vCategory); + +// the utility static functions +private : QString _datetimeFormat = "MM/dd/yyyy HH:mm:ss"; +public : void datetimeFormat(); +public : QString getDatetimeFormat() { return _datetimeFormat; } + }; } Index: sources/storage/Settings.cpp =================================================================== diff -u -r0c983aea7de7480e86739469f5a64ad18b244634 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/storage/Settings.cpp (.../Settings.cpp) (revision 0c983aea7de7480e86739469f5a64ad18b244634) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -122,4 +122,3 @@ } return 0; } - Index: sources/storage/Settings.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/storage/Settings.h (.../Settings.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/storage/Settings.h (.../Settings.h) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -52,6 +52,7 @@ Settings() {} int read(); + }; } Index: sources/storage/TreatmentLog.h =================================================================== diff -u -r301c0a2101eb9374145ae274c8d91460fc9a6a62 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision 301c0a2101eb9374145ae274c8d91460fc9a6a62) +++ sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -54,7 +54,7 @@ QString _unitTextDurationHour = tr("hour" ); QString _unitTextDurationMin = tr("min" ); QString _unitTextConcentration = tr("mEg/L" ); - QString _unitTextTemperature = tr("°C" ); + QString _unitTextTemperature = tr("C" ); QString _unitTextVolume = tr("L" ); QString _unitTextFluid = tr("mL" ); QString _unitTextHeparinConcentration = tr("IU/mL" ); Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -r75219a6e89b20f405aad0c12c5aed5937118b2ad -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 75219a6e89b20f405aad0c12c5aed5937118b2ad) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -139,7 +139,7 @@ { QDateTime currentDateTime = QDateTime::currentDateTime(); epoch (currentDateTime.toSecsSinceEpoch()); - lastRead (currentDateTime.toString(_datetimeFormat)); + lastRead (currentDateTime.toString(_Settings.getDatetimeFormat())); systolic ( vSystolic ); diastolic ( vDiastolic ); heartRate ( vHeartRate ); Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h =================================================================== diff -u -r79e076cece4ba503be6c3834eb68d1e5cb1b882f -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision 79e076cece4ba503be6c3834eb68d1e5cb1b882f) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -47,9 +47,6 @@ // coco end // Vitals data - // formatting - PROPERTY( QString , datetimeFormat ,"yyyy/MMM/dd - HH:mm") - // constant range variables / units / ... CONSTANT( quint16 , systolicMin , 60) CONSTANT( quint16 , systolicMax , 250) Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u -r2d5e51a42abdf392801371aea2d2dbcb197a1da2 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 2d5e51a42abdf392801371aea2d2dbcb197a1da2) +++ sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -19,6 +19,7 @@ // Project #include "GuiController.h" +#include "ApplicationController.h" using namespace View; @@ -238,7 +239,7 @@ void VDateTime::timerEvent(QTimerEvent *) { QDateTime datetime = QDateTime::currentDateTime(); - current(datetime.toString("MM/dd/yyyy HH:mm:ss")); + current(datetime.toString(_Settings.getDatetimeFormat())); quint16 military = datetime.time().hour() * 100 + datetime.time().minute(); greeting(military); }