Index: cppcheck.err =================================================================== diff -u -rd9c602dc1f1e5ba34bc665264d739ce6509e0198 -r510ea07f96362a18f9961f41b5b91740df075c1f --- cppcheck.err (.../cppcheck.err) (revision d9c602dc1f1e5ba34bc665264d739ce6509e0198) +++ cppcheck.err (.../cppcheck.err) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -53,7 +53,7 @@ [sources/view/VBluetooth.cpp:125]: (style) The function 'doGetPairedDevices' is never used. [sources/view/VTreatmentCreate.cpp:775]: (style) The function 'doGetPrescriptionParameterNames' is never used. [sources/view/VTreatmentCreate.cpp:792]: (style) The function 'doGetPrescriptionParameterValues' is never used. -[sources/view/VVitals.cpp:55]: (style) The function 'doManualBPMeasureEntry' is never used. +[sources/view/VVitals.cpp:54]: (style) The function 'doManualBPMeasureEntry' is never used. [sources/view/VEventSpy.cpp:139]: (style) The function 'doMouseReset' is never used. [sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp:66]: (style) The function 'doOptionDuration' is never used. [sources/view/VTreatmentCreate.cpp:895]: (style) The function 'doRequestPop' is never used. @@ -63,7 +63,7 @@ [sources/view/hd/alarm/VAlarmStatus.cpp:74]: (style) The function 'doSilence' is never used. [sources/view/VTreatmentBegin.cpp:72]: (style) The function 'doStartTreatment' is never used. [sources/view/VEventSpy.cpp:182]: (style) The function 'doTouchReset' is never used. -[sources/view/VVitals.cpp:42]: (style) The function 'doUpdateBPMeasureInterval' is never used. +[sources/view/VVitals.cpp:41]: (style) The function 'doUpdateBPMeasureInterval' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:53]: (style) The function 'doUserActionEnd' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:63]: (style) The function 'doUserActionOk' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:33]: (style) The function 'doUserActionResume' is never used. Index: denali.pro.user =================================================================== diff -u -r4f572cf1b77d6188ed9bd859f6767b0daab159b3 -r510ea07f96362a18f9961f41b5b91740df075c1f --- denali.pro.user (.../denali.pro.user) (revision 4f572cf1b77d6188ed9bd859f6767b0daab159b3) +++ denali.pro.user (.../denali.pro.user) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -1,6 +1,6 @@ - + EnvironmentId Index: denali.qrc =================================================================== diff -u -r4f572cf1b77d6188ed9bd859f6767b0daab159b3 -r510ea07f96362a18f9961f41b5b91740df075c1f --- denali.qrc (.../denali.qrc) (revision 4f572cf1b77d6188ed9bd859f6767b0daab159b3) +++ denali.qrc (.../denali.qrc) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -97,7 +97,7 @@ sources/gui/qml/components/RangeSlider.qml sources/gui/qml/components/MuteButton.qml sources/gui/qml/components/UpDownButton.qml - sources/gui/qml/components/DenaliTextInput.qml + sources/gui/qml/components/TextEntry.qml sources/gui/qml/components/Keyboard.qml Fisheye: Tag 510ea07f96362a18f9961f41b5b91740df075c1f refers to a dead (removed) revision in file `sources/gui/qml/components/DenaliTextInput.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/components/Keyboard.qml =================================================================== diff -u -r4f572cf1b77d6188ed9bd859f6767b0daab159b3 -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/gui/qml/components/Keyboard.qml (.../Keyboard.qml) (revision 4f572cf1b77d6188ed9bd859f6767b0daab159b3) +++ sources/gui/qml/components/Keyboard.qml (.../Keyboard.qml) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -1,5 +1,6 @@ // Qt import QtQuick 2.12 +import QtQuick.Controls 2.12 // Dialog import QtQuick.VirtualKeyboard 2.1 // Project @@ -22,12 +23,16 @@ _keyboardDialog.visible = visible } - ModalDialog { id: _keyboardDialog + Dialog { id: _keyboardDialog width: parent.width height: parent.height visible: false modal: false + background: Rectangle { id: _backgroundRect + color : Colors.backgroundDialog + } + InputPanel { id: _keyboardInput width: parent.width anchors { Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u --- sources/gui/qml/components/TextEntry.qml (revision 0) +++ sources/gui/qml/components/TextEntry.qml (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -0,0 +1,76 @@ +/*! + * + * 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 TextEntry.qml + * \author (last) Peter Lucia + * \date (last) 07-Jan-2021 + * \author (original) Peter Lucia + * \date (original) 07-Jan-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" + +Item { id: _root + property alias textInput : _input + property alias labelText : _label.text + property alias validator : _input.validator + signal enterPressed() + + width: Variables.textInputWidth + height: Variables.textInputHeight + + Text { id: _label + anchors { + left: parent.left + top: parent.top + } + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextInput { id: _input + anchors { + left: _label.right + } + + color: Colors.textMain + text: "" + font.pixelSize: Fonts.fontPixelTextRectExtra + selectionColor: "white" + height: parent.height + width: Variables.textInputLineWidth + horizontalAlignment: TextInput.AlignHCenter + inputMethodHints: Qt.ImhDigitsOnly + selectedTextColor: Colors.textSelected + + onFocusChanged: { + if (focus) { + selectAll() + _keyboard.setVisible(true) + } + } + + onAccepted: { + _root.enterPressed() + } + } + + Line { + color: Colors.textEntry + width: Variables.textInputLineWidth + anchors { + top: _input.bottom + left: _input.left + } + } +} Index: sources/gui/qml/dialogs/VitalsEntry.qml =================================================================== diff -u -r4f572cf1b77d6188ed9bd859f6767b0daab159b3 -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/gui/qml/dialogs/VitalsEntry.qml (.../VitalsEntry.qml) (revision 4f572cf1b77d6188ed9bd859f6767b0daab159b3) +++ sources/gui/qml/dialogs/VitalsEntry.qml (.../VitalsEntry.qml) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -15,7 +15,6 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // Project // Qml imports @@ -30,77 +29,75 @@ contentItem.objectName: "VitalsEntryContent" modal: false - Rectangle { id: _titleBar; - color: "transparent"; - height: _root.height / 4; - width: _root.width; - radius: _root.radius; + Item { id: _titleBar + height: _root.height / 4 + width: _root.width Text { id: _titleBarText color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle text: qsTr("Blood Pressure / HR Entry") - anchors.centerIn: _titleBar; + anchors.centerIn: _titleBar } } - DenaliTextInput { id: _systolic + TextEntry { id: _systolic anchors { top: _titleBar.bottom left: parent.left leftMargin: Variables.vitalsLeftMargin } validator: IntValidator{ - bottom: Variables.vitalsEntryMin - top: Variables.vitalsEntryMax + bottom: Variables.vitalsEntrySystolicMin + top: Variables.vitalsEntrySystolicMax } labelText: qsTr("Systolic: ") - onPressedEnter: { + onEnterPressed: { _diastolic.textInput.focus = true } } - DenaliTextInput { id: _diastolic + TextEntry { id: _diastolic anchors { top: _titleBar.bottom left: _systolic.right } validator: IntValidator{ - bottom: Variables.vitalsEntryMin - top: Variables.vitalsEntryMax + bottom: Variables.vitalsEntryDiastolicMin + top: Variables.vitalsEntryDiastolicMax } labelText: qsTr("Diastolic: ") - onPressedEnter: { + onEnterPressed: { _pulse.textInput.focus = true } } - DenaliTextInput { id: _pulse + TextEntry { id: _pulse anchors { top: _titleBar.bottom left: _diastolic.right } validator: IntValidator{ - bottom: Variables.vitalsEntryMin - top: Variables.vitalsEntryMax + bottom: Variables.vitalsEntryPulseBPMMin + top: Variables.vitalsEntryPulseBPMMax } labelText: qsTr("Heart Rate (BPM): ") - onPressedEnter: { + onEnterPressed: { _keyboard.setVisible(false) } } Row { id: _buttons - spacing: Variables.buttonSpacing; + spacing: Variables.buttonSpacing anchors { - horizontalCenter: parent.horizontalCenter; - bottom: parent.bottom; - bottomMargin: Variables.dialogMargin / 2; + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + bottomMargin: Variables.dialogMargin / 2 } TouchRect { id: _confirm objectName: "_VitalsEntryConfirm" - width: _root.width / 3; + width: _root.width / 3 text.text: qsTr("CONFIRM") button.onPressed: { if (!disabled) { @@ -110,14 +107,15 @@ close() } } - disabled: (_systolic.textInput.text === "") || - (_diastolic.textInput.text === "") || - (_pulse.textInput.text === "") + + disabled: (!_systolic.textInput.acceptableInput || + !_diastolic.textInput.acceptableInput || + !_pulse.textInput.acceptableInput) } TouchRect { id: _cancel objectName: "_VitalsEntryCancel" - width: _root.width / 3; + width: _root.width / 3 text.text: qsTr("CANCEL") button.onPressed: { close() Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r4f572cf1b77d6188ed9bd859f6767b0daab159b3 -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 4f572cf1b77d6188ed9bd859f6767b0daab159b3) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -124,8 +124,6 @@ readonly property int vitalsTopMargin : 30 readonly property int vitalsLeftMargin : 50 - readonly property int vitalsEntryMin : 0 - readonly property int vitalsEntryMax : 999 readonly property int textInputWidth : 350 readonly property int textInputHeight : 50 @@ -174,6 +172,13 @@ readonly property int venousLimitStep : +10; ///< PRS356,PRS357 // has to be the same since it's on the same line scale readonly property int venousLimitGap : +30; + readonly property int vitalsEntrySystolicMin : 60 // PRS 451 + readonly property int vitalsEntrySystolicMax : 250 // PRS 451 + readonly property int vitalsEntryDiastolicMin : 40 // PRS 452 + readonly property int vitalsEntryDiastolicMax : 180 // PRS 452 + readonly property int vitalsEntryPulseBPMMin : 40 // PRS 453 + readonly property int vitalsEntryPulseBPMMax : 180 // PRS 453 + readonly property string notSetVariableText : "__" // Units Index: sources/gui/qml/main.qml =================================================================== diff -u -r4f572cf1b77d6188ed9bd859f6767b0daab159b3 -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/gui/qml/main.qml (.../main.qml) (revision 4f572cf1b77d6188ed9bd859f6767b0daab159b3) +++ sources/gui/qml/main.qml (.../main.qml) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -155,16 +155,19 @@ _alarmListDialog.visible = false _alarmBar .visible = true } + function alarmMaximize() { _alarmDialog .visible = true _alarmListDialog.visible = false _alarmBar .visible = false } + function alarmList() { _alarmDialog .visible = false _alarmListDialog.visible = true _alarmBar .visible = false } + function alarmHide() { _alarmDialog .visible = false _alarmListDialog.visible = false @@ -302,11 +305,11 @@ onDidAlarmRaise: { let silenceMinimize = false + // this is the response to the silence request + // so the dialog should be closed when the request accepted + // if not then if can stay minimized nothing happens + // if can't stay minimized then it has to be shown if (vAlarmStatus.alarm_Flag_alarmsSilenced && silenceMinimize) { - // this is the response to the silence request - // so the dialog should be closed when the request accepted - // if not then if can stay minimized nothing happens - // if can't stay minimized then it has to be shown alarmMinimize() } else { Index: sources/view/VBluetooth.cpp =================================================================== diff -u -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) +++ sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -373,7 +373,7 @@ { QJsonObject obj; - if (_lastSelectedDevice != NULL && _lastSelectedDevice->isValid()) + if (_lastSelectedDevice != nullptr && _lastSelectedDevice->isValid()) { QJsonObject subObj; subObj["Name"] = _lastSelectedDevice->getName(); Index: sources/view/VVitals.cpp =================================================================== diff -u -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/view/VVitals.cpp (.../VVitals.cpp) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) +++ sources/view/VVitals.cpp (.../VVitals.cpp) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -36,44 +36,43 @@ * \brief VVitals::doUpdateBPMeasureInterval * Updates the blood pressure and hr measurement interval during a treatment * Called whenever a new treatment parameters request is issued - * \param msgID - (QVariantList) the treatment parameters request - * \param request - (QVariantList) the treatment parameters request + * \param vIntervalMinutes (quint32) - the BP measure interval in minutes */ -void VVitals::doUpdateBPMeasureInterval(const quint32 &intervalMinutes) +void VVitals::doUpdateBPMeasureInterval(const quint32 &vIntervalMinutes) { - LOG_DEBUG(QString("Updated BP/HR measurement notify interval to %1 minutes").arg(intervalMinutes)); - bloodPressureMeasureIntervalMinutes(intervalMinutes); + LOG_DEBUG(QString("Updated BP/HR measurement notify interval to %1 minutes").arg(vIntervalMinutes)); + bloodPressureMeasureIntervalMinutes(vIntervalMinutes); } /*! * \brief VVitals::doManualBPMeasureEntry * Called when a user manually enters the bp measurement data - * \param systolic - systolic blood pressure value - * \param diastolic - diastolic blood pressure value - * \param pulse_rate - pulse rate in beats per minute + * \param vSystolic - systolic blood pressure value + * \param vDiastolic - diastolic blood pressure value + * \param vPulseRate - pulse rate in beats per minute */ -void VVitals::doManualBPMeasureEntry(const quint32 &systolic, const quint32 &diastolic, const quint32 &pulse_rate) +void VVitals::doManualBPMeasureEntry(const quint32 &vSystolic, const quint32 &vDiastolic, const quint32 &vPulseRate) { // coco begin validated: Has been validated manually BLEMeasurementData measurement; - measurement.systolic = systolic; - measurement.diastolic = diastolic; - measurement.pulse_rate = pulse_rate; + measurement.systolic = vSystolic; + measurement.diastolic = vDiastolic; + measurement.pulse_rate = vPulseRate; onReceiveBPMeasurement(measurement); } // coco end /*! * \brief VVitals::onReceiveBPMeasurement * Private slot that is called when we recieve a blood pressure measurement - * \param measurement - (BLEScanner::bp_measurement) the blood pressure measurement + * \param vMeasurement - (BLEScanner::bp_measurement) the blood pressure measurement */ -void VVitals::onReceiveBPMeasurement(BLEMeasurementData measurement) +void VVitals::onReceiveBPMeasurement(const BLEMeasurementData &vMeasurement) { // coco begin validated: Has been validated manually - bloodPressureDiastolic (measurement.diastolic); - bloodPressureSystolic (measurement.systolic); - pulseBPM (measurement.pulse_rate); + bloodPressureDiastolic (vMeasurement.diastolic); + bloodPressureSystolic (vMeasurement.systolic); + pulseBPM (vMeasurement.pulse_rate); } // coco end @@ -82,9 +81,9 @@ * When we receive an HD operation mode update * \param hdOpMode - the HD operation mode */ -void VVitals::onHDOperationModeUpdate(HDOperationModeData hdOpMode) +void VVitals::onHDOperationModeUpdate(const HDOperationModeData &vHDOpMode) { - if (hdOpMode.mOpMode != GuiHDOpModes::MODE_TREA) + if (vHDOpMode.mOpMode != GuiHDOpModes::MODE_TREA) _inTreatmentMode = false; else _inTreatmentMode = true; @@ -97,6 +96,9 @@ void VVitals::onTimeout() { // coco begin validated: Has been validated manually + if (bloodPressureMeasureIntervalMinutes() == 0) + return; + if (_inTreatmentMode && _lastNotification.secsTo(QDateTime::currentDateTime()) >= bloodPressureMeasureIntervalMinutes()*60) // PRS 94 { @@ -111,22 +113,22 @@ } /*else { int secondsRemaining = bloodPressureMeasureIntervalMinutes()*60 - _lastNotification.secsTo(QDateTime::currentDateTime()); LOG_DEBUG(QString("There are %1 seconds until next bp/hr measurement request notification").arg(secondsRemaining)); - }*/ + }*/ } // coco end /*! * \brief VVitals::onReceiveAlertResponse * Called when we receive an alert response - * \param response - the alert response + * \param vResponse - the alert response */ -void VVitals::onReceiveAlertResponse(GuiAlertResponseData response) +void VVitals::onReceiveAlertResponse(const GuiAlertResponseData &vResponse) { // coco begin validated: Has been validated manually - if (response.id != GuiAlertID::ID_Alert_BLE_Measurement_Timeout) + if (vResponse.id != GuiAlertID::ID_Alert_BLE_Measurement_Timeout) return; - LOG_DEBUG(QString("User confirmed alert? %1").arg(response.confirmed)); - if (!response.confirmed) + LOG_DEBUG(QString("User confirmed alert? %1").arg(vResponse.confirmed)); + if (!vResponse.confirmed) { emit didManualEntryRequest(); } @@ -137,12 +139,12 @@ * \brief VVitals::onActionReceive * Called when a treatment start request response is received * Sets the last take vitals notification time to the start of treatment - * \param response - (TreatmentStartResponseData) the response data + * \param vResponse - (TreatmentStartResponseData) the response data */ -void VVitals::onActionReceive(const TreatmentStartResponseData &response) +void VVitals::onActionReceive(const TreatmentStartResponseData &vResponse) { // coco begin validated: Has been validated manually - if (response.startTreatmentResponse != 1) + if (vResponse.startTreatmentResponse != 1) return; // coco end _lastNotification = QDateTime::currentDateTime(); Index: sources/view/VVitals.h =================================================================== diff -u -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d -r510ea07f96362a18f9961f41b5b91740df075c1f --- sources/view/VVitals.h (.../VVitals.h) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) +++ sources/view/VVitals.h (.../VVitals.h) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) @@ -1,6 +1,6 @@ -#ifndef VVITALS_H -#define VVITALS_H +#pragma once + // Qt #include #include @@ -10,8 +10,6 @@ #include "main.h" #include "GuiController.h" -#define UNSET 9999 - // forward declarations class tst_views; @@ -30,33 +28,31 @@ // friends friend class ::tst_views; + bool _inTreatmentMode = false; + bool _enterManually = false; + QDateTime _lastNotification; + public: explicit VVitals(QObject *parent = nullptr); protected: // coco begin validated: Has been validated manually - PROPERTY(quint32, bloodPressureSystolic, UNSET) - PROPERTY(quint32, bloodPressureDiastolic, UNSET) - PROPERTY(quint32, pulseBPM, UNSET) - PROPERTY(quint32, bloodPressureMeasureIntervalMinutes, UNSET) + PROPERTY(quint32, bloodPressureSystolic, 0) + PROPERTY(quint32, bloodPressureDiastolic, 0) + PROPERTY(quint32, pulseBPM, 0) + PROPERTY(quint32, bloodPressureMeasureIntervalMinutes, 0) // coco end public slots: - void doUpdateBPMeasureInterval(const quint32 &intervalMinutes); - void doManualBPMeasureEntry(const quint32 &systolic, const quint32 &diastolic, const quint32 &pulse_rate); + void doUpdateBPMeasureInterval(const quint32 &vIntervalMinutes); + void doManualBPMeasureEntry(const quint32 &vSystolic, const quint32 &vDiastolic, const quint32 &vPulseRate); signals: - void didRequestShowAlert(GuiAlertRequestData); + void didRequestShowAlert(const GuiAlertRequestData &alert); void didManualEntryRequest(); private slots: - void onReceiveBPMeasurement(BLEMeasurementData measurement); - void onReceiveAlertResponse(GuiAlertResponseData response); - void onActionReceive(const TreatmentStartResponseData &response); - void onHDOperationModeUpdate(HDOperationModeData hdOpMode); + void onReceiveBPMeasurement(const BLEMeasurementData &vMeasurement); + void onReceiveAlertResponse(const GuiAlertResponseData &vResponse); + void onActionReceive(const TreatmentStartResponseData &vResponse); + void onHDOperationModeUpdate(const HDOperationModeData &vHDOpMode); void onTimeout(); - -private: - bool _inTreatmentMode = false; - bool _enterManually = false; - QDateTime _lastNotification; }; } -#endif // VVITALS_H