Index: denali.pro.user =================================================================== diff -u -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- denali.pro.user (.../denali.pro.user) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) +++ denali.pro.user (.../denali.pro.user) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -1,6 +1,6 @@ - + EnvironmentId Index: denali.qrc =================================================================== diff -u -rdf74454a7a75eb63ac577739c1fd0f179e479f44 -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- denali.qrc (.../denali.qrc) (revision df74454a7a75eb63ac577739c1fd0f179e479f44) +++ denali.qrc (.../denali.qrc) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -13,6 +13,7 @@ sources/gui/qml/dialogs/NotificationDialog.qml sources/gui/qml/dialogs/AlarmListDialog.qml sources/gui/qml/dialogs/Alert.qml + sources/gui/qml/dialogs/VitalsEntry.qml resources/images/Settings_gear_setting_tools-128.png @@ -96,6 +97,7 @@ sources/gui/qml/components/RangeSlider.qml sources/gui/qml/components/MuteButton.qml sources/gui/qml/components/UpDownButton.qml + sources/gui/qml/components/FieldInput.qml sources/gui/qml/compounds/PressureRangeSlider.qml Index: sources/gui/qml/components/FieldInput.qml =================================================================== diff -u --- sources/gui/qml/components/FieldInput.qml (revision 0) +++ sources/gui/qml/components/FieldInput.qml (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -0,0 +1,51 @@ +/*! + * + * 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 FieldInput.qml + * \author (last) Peter Lucia + * \date (last) 07-Jan-2021 + * \author (original) Peter Lucia + * \date (original) 07-Jan-2021 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +// Project +// Qml imports +import "qrc:/globals" + +Rectangle { id: _root + property alias textInput : _input + property alias labelText : _label.text + property alias validator : _input.validator + property var margin : 30 + property var editingFinished : false + + color: "transparent" + height: 50 + + Text { id: _label + anchors { + right: parent.horizontalCenter + } + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextField { id: _input + horizontalAlignment: TextInput.AlignLeft + anchors { + left: _label.right + leftMargin: _root.margin + verticalCenter: _label.verticalCenter + } + onEditingFinished: { _root.editingFinished = true } + } +} Index: sources/gui/qml/dialogs/VitalsEntry.qml =================================================================== diff -u --- sources/gui/qml/dialogs/VitalsEntry.qml (revision 0) +++ sources/gui/qml/dialogs/VitalsEntry.qml (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -0,0 +1,121 @@ +/*! + * + * 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 Alert.qml + * \author (last) Peter Lucia + * \date (last) 30-Nov-2020 + * \author (original) Peter Lucia + * \date (original) 30-Nov-2019 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief Contains the Alert Dialog Implementation + */ +ModalDialog { id : _root + objectName: "VitalsEntry" // SquishQt testability + contentItem.objectName: "VitalsEntryContent" + + Rectangle { id: _titleBar; + color: "transparent"; + height: _root.height / 4; + width: _root.width; + radius: _root.radius; + + Text { id: _alert + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + text: qsTr("Vitals Entry") + anchors.centerIn: _titleBar; + } + } + + FieldInput { id: _systolic + anchors { + top: _titleBar.bottom + topMargin: Variables.vitalsTopMargin + } + textInput.height: Variables.vitalsInputFieldHeight + width: parent.width + margin: Variables.vitalsMargin + validator: IntValidator{ bottom: 0; top: 500;} + labelText: "Blood Pressure (Systolic)" + } + + FieldInput { id: _diastolic + anchors { + top: _systolic.bottom + topMargin: Variables.vitalsTopMargin + } + textInput.height: Variables.vitalsInputFieldHeight + width: parent.width + margin: Variables.vitalsMargin + validator: IntValidator{ bottom: 0; top: 500;} + labelText: "Blood Pressure (Diastolic)" + } + + FieldInput { id: _pulse + anchors { + top: _diastolic.bottom + topMargin: Variables.vitalsTopMargin + } + textInput.height: Variables.vitalsInputFieldHeight + width: parent.width + margin: Variables.vitalsMargin + validator: IntValidator{ bottom: 0; top: 500;} + labelText: "Heart Rate (BPM)" + } + + Row { id: _buttons + spacing: Variables.buttonSpacing; + anchors { + horizontalCenter: parent.horizontalCenter; + bottom: parent.bottom; + bottomMargin: Variables.dialogMargin / 2; + } + + TouchRect { id: _confirm + objectName: "_VitalsEntryConfirm" + width: _root.width / 3; + text.text: qsTr("CONFIRM") + button.onPressed: { + vVitals.bloodPressureSystolic = parseInt(_systolic.textInput.text) + vVitals.bloodPressureDiastolic = parseInt(_diastolic.textInput.text) + vVitals.pulseBPM = parseInt(_pulse.textInput.text) + close() + } + disabled: (_systolic.textInput.text === "") || + (_diastolic.textInput.text === "") || + (_pulse.textInput.text === "") + } + + TouchRect { id: _cancel + objectName: "_VitalsEntryCancel" + width: _root.width / 3; + text.text: qsTr("CANCEL") + button.onPressed: { + close() + } + } + } + + Connections { + target: vVitals + onDidManualEntryRequest: { + _root.open() + } + } +} Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -rdf74454a7a75eb63ac577739c1fd0f179e479f44 -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision df74454a7a75eb63ac577739c1fd0f179e479f44) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -122,6 +122,12 @@ readonly property int settingsOptionWidth : 550 readonly property int settingsOptionHeight : 50 + readonly property int vitalsTopMargin : 30 + readonly property int vitalsMargin : 50 + readonly property int vitalsInputFieldWidth : 150 + readonly property int vitalsInputFieldHeight : 50 + + // ---------- < PRS > Related Section ---------- // Min/Max readonly property int bloodFlowMin : 100 Index: sources/gui/qml/main.qml =================================================================== diff -u -rdf74454a7a75eb63ac577739c1fd0f179e479f44 -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- sources/gui/qml/main.qml (.../main.qml) (revision df74454a7a75eb63ac577739c1fd0f179e479f44) +++ sources/gui/qml/main.qml (.../main.qml) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -281,6 +281,7 @@ } Alert { id: _alert } + VitalsEntry { id: _vitalsEntry } Connections { target: vAlarmStatus onAlarm_Flag_noResumeChanged : vAlarmStatus.alarm_KeepMinimized = false Index: sources/view/VBluetooth.cpp =================================================================== diff -u -rfdb48ba3fba8e95027ebf573325c8f25db74c070 -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision fdb48ba3fba8e95027ebf573325c8f25db74c070) +++ sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -373,7 +373,7 @@ { QJsonObject obj; - if (_lastSelectedDevice->isValid()) + if (_lastSelectedDevice != NULL && _lastSelectedDevice->isValid()) { QJsonObject subObj; subObj["Name"] = _lastSelectedDevice->getName(); @@ -384,6 +384,12 @@ for (QList::iterator iter = _pairedDevices.begin(); iter != _pairedDevices.end(); ++iter) obj[((VBluetoothDeviceInfo*)(*iter))->getAddress()] = ((VBluetoothDeviceInfo*)(*iter))->getName(); + if (obj.isEmpty()) + { + LOG_DEBUG("No Bluetooth devices to save."); + return; + } + QJsonDocument document(obj); emit didRequestConcurrentSave(path, document.toJson(), false); } Index: sources/view/VVitals.cpp =================================================================== diff -u -rfdb48ba3fba8e95027ebf573325c8f25db74c070 -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- sources/view/VVitals.cpp (.../VVitals.cpp) (revision fdb48ba3fba8e95027ebf573325c8f25db74c070) +++ sources/view/VVitals.cpp (.../VVitals.cpp) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -104,7 +104,8 @@ LOG_DEBUG("Notify user to take a measurement"); request.id = GuiAlertID::ID_Alert_BLE_Measurement_Timeout; request.title = tr("Please take vitals"); - request.description = tr("Press 'Confirm' once you have finished measuring your blood pressure and heart rate."); + request.description = tr("Press 'Confirm' once you have finished measuring your blood pressure and heart rate.\n" + "Press 'Cancel' for manual entry."); emit didRequestShowAlert(request); _lastNotification = QDateTime::currentDateTime(); } /*else { @@ -125,6 +126,10 @@ if (response.id != GuiAlertID::ID_Alert_BLE_Measurement_Timeout) return; LOG_DEBUG(QString("User confirmed alert? %1").arg(response.confirmed)); + if (!response.confirmed) + { + emit didManualEntryRequest(); + } } // coco end Index: sources/view/VVitals.h =================================================================== diff -u -rfdb48ba3fba8e95027ebf573325c8f25db74c070 -readda1cc1ad9d62aecf6b0a8e64330fad438ee0d --- sources/view/VVitals.h (.../VVitals.h) (revision fdb48ba3fba8e95027ebf573325c8f25db74c070) +++ sources/view/VVitals.h (.../VVitals.h) (revision eadda1cc1ad9d62aecf6b0a8e64330fad438ee0d) @@ -45,6 +45,7 @@ void doManualBPMeasureEntry(const quint32 &systolic, const quint32 &diastolic, const quint32 &pulse_rate); signals: void didRequestShowAlert(GuiAlertRequestData); + void didManualEntryRequest(); private slots: void onReceiveBPMeasurement(BLEMeasurementData measurement); void onReceiveAlertResponse(GuiAlertResponseData response);