Index: leahi.qrc =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- leahi.qrc (.../leahi.qrc) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ leahi.qrc (.../leahi.qrc) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -100,6 +100,8 @@ resources/images/help.png resources/images/Popup_gradient.png resources/images/backspace.png + resources/images/Vitals.png + resources/images/Vitals_Red.png sources/gui/qml/components/MainMenu.qml Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -re1ecb77ba0ff9619b7363f14e1ed3c3e110c4057 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision e1ecb77ba0ff9619b7363f14e1ed3c3e110c4057) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -17,6 +17,8 @@ GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } + function vitalsRecorded() { _pulseAnimation.start() } + MouseArea { id: _mouseArea anchors.fill : parent // TODO: disable this later. this is only for diagnostic purpose. @@ -103,13 +105,34 @@ Row { id: _headerButtonRow height : parent.height - spacing : 30 + spacing : 25 anchors { verticalCenter: parent.verticalCenter right : parent.right rightMargin : _headerButtonRow.spacing } + IconButton { id : _vitalsButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iVitals" + extraSpace : _headerButtonRow.spacing + + onPressed : _treatmentAdjustmentVitals.open() + + SequentialAnimation { id: _pulseAnimation + loops : 2 + running : false + alwaysRunToEnd : true + onStarted : _vitalsButton.iconImageSource = "qrc:/images/iVitalsRed" + onStopped : _vitalsButton.iconImageSource = "qrc:/images/iVitals" + onFinished : _vitalsButton.iconImageSource = "qrc:/images/iVitals" + NumberAnimation { target: _vitalsButton; property: "scale"; to: 1.14; duration: 110; easing.type: Easing.OutCubic } // beat up + NumberAnimation { target: _vitalsButton; property: "opacity"; from: 1; to: 0; duration: 500; } // pulse down + NumberAnimation { target: _vitalsButton; property: "scale"; to: 1.0; duration: 180; easing.type: Easing.InCubic } // beat down + NumberAnimation { target: _vitalsButton; property: "opacity"; from: 0; to: 1; duration: 500; } // pulse up + } + } + IconButton { id : _prescriptionButton iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iPrescription" @@ -122,18 +145,10 @@ iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iWifi" extraSpace : _headerButtonRow.spacing + onPressed : _headerbarWifi.openDialog(_wifiButton) } - IconButton { id : _bluetoothButton - iconSize : Variables.headerIconDiameter - iconImageSource : "qrc:/images/iBluetooth" - extraSpace : _headerButtonRow.spacing - enabled : false - - onPressed : print("Bluetooth button pressed!") - } - IconButton { id : _cloudSyncButton iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iCloudSync" Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -78,6 +78,14 @@ anchors.fill : _backgroundRect } + NumPad { id: _numPad + x : _root.width - _numPad.width + y : 0 + slideToOpen : true + + onCancel : _numPad.hide() + } + Image { id: _backgroundImage anchors.fill: parent source : "qrc:/images/iPopupGradient" @@ -102,15 +110,7 @@ } } - NumPad { id: _numPad - x: Math.round((_root.width - _numPad.width) / 2) - y: Math.round((Variables.applicationHeight -_root.y - _numPad.height - Variables.mainMenuHeight * 2)) - onCancel: { - _numPad.hide() - } - } - NumberAnimation { id: _autoHideAnimation running: false target: _root Index: sources/gui/qml/components/NumPad.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/components/NumPad.qml (.../NumPad.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/components/NumPad.qml (.../NumPad.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -34,12 +34,38 @@ readonly property bool isValueValid : validator ? validator(valueInt) : true readonly property var valueInt : isNaN(parseInt(_valueLabel.text)) ? undefined : parseInt(_valueLabel.text) readonly property string backSpace : "qrc:/images/iBackspace" + property bool slideToOpen : false + property bool isOpened : false + + onVisibleChanged : if ( ! _root.visible ) { reset() } + onDisplayValueChanged : if ( _root.setter ) { _root.setter( _valueLabel.text ) } + onSettingValueChanged : _valueLabel.text = _root.settingValue !== undefined ? _root.settingValue : "" + width : 450 + height : 500 + visible : false + radius : 9 + color : Colors.transparent + + layer.enabled : ! slideToOpen + layer.effect : DropShadow { id: _dropShadow + horizontalOffset: 4 + verticalOffset : 4 + radius : 12 + samples : 32 + color : Colors.dropShadowDialogColor + source : _root + anchors.fill : _root + } + signal cancel() x: Math.round((Variables.applicationWidth - _root.width) / 2) - y: Math.round((Variables.applicationHeight - _root.height)) + y: Math.round((Variables.applicationHeight - _root.height) / 2) + // slide animation for slideToOpen + Behavior on x { NumberAnimation { duration: Variables.keybardAnimationDuration } } + function open(entry, title, min, max, unit) { reset() _root.settingValue = Qt.binding(function () { return entry.text }) @@ -56,37 +82,48 @@ show() } - function show() { if ( ! _root.visible ) { _root.visible = true } } + function show() { + if ( ! isOpened ) { + if ( ! _root.visible ) + { + _root.visible = true + } - function hide() { if ( _root.visible ) { _root.visible = false } } + if ( slideToOpen ) + { + print("show x: " + x) + x = x + _root.width + } + isOpened = true + } + } + + function hide() { + if ( isOpened ) { + if ( slideToOpen ) + { + print("hide x: " + x) + + x = x - _root.width + } + + else if ( _root.visible ) + { + _root.visible = false + } + + isOpened = false + } + } + function reset() { _numPadGrid.replaceValueText = true _root.getter = null _root.setter = null _root.displayValue = "" } - onVisibleChanged : if ( ! _root.visible ) { reset() } - onDisplayValueChanged : if ( _root.setter ) { _root.setter( _valueLabel.text ) } - onSettingValueChanged : _valueLabel.text = _root.settingValue !== undefined ? _root.settingValue : "" - width : 450 - height : 500 - visible : false - radius : 9 - color : Colors.transparent - - layer.enabled : true - layer.effect : DropShadow { id: _dropShadow - horizontalOffset: 4 - verticalOffset : 4 - radius : 12 - samples : 32 - color : Colors.dropShadowDialogColor - source : _root - anchors.fill : _root - } - Image { id: _backgroundImage anchors.fill: parent source : "qrc:/images/iPopupGradient" @@ -109,19 +146,48 @@ left : parent.left margins : 10 } + visible: ! slideToOpen onClicked: { cancel() reset() } } + TouchRect { id : _sliderButton + anchors { + verticalCenter : parent.verticalCenter + left : parent.right + leftMargin : height / 2 * -1 + } + z : -1 + width : 100 + height : 100 + radius : height + border.color: Colors.transparent + backgroundColor : "#455B78" + onPressed : isOpened ? hide() : show() + + Image { id : _iconImage + anchors { + + verticalCenter : parent.verticalCenter + right : parent.right + rightMargin : 15 + } + height : Variables.headerIconDiameter + width : Variables.headerIconDiameter + fillMode: Image.PreserveAspectFit + source : isOpened ? "qrc:/images/iChevronLeft" : + "qrc:/images/iChevronRight" + } + } + Text { id: _title anchors { top : _root.top topMargin : 5 horizontalCenter: _root.horizontalCenter - } font { pixelSize : 26 Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -131,6 +131,17 @@ width : unitWidth } } + +// Text { id: _lastRecorded +// height : 50 +// width : 50 +// font.pixelSize : 16 +// font.weight : Font.Normal +// verticalAlignment : Text.AlignBottom +// color : Colors.textMain +// text : qsTr("Last Recorded: %1").arg(vTreatmentVitals.lastRead) +// } + } } } Index: sources/gui/qml/main.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/main.qml (.../main.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/main.qml (.../main.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -134,6 +134,7 @@ import "qrc:/globals" import "qrc:/pages" import "qrc:/pages/treatment" +import "qrc:/pages/treatment/adjustments" import "qrc:/pages/settings" import "qrc:/components" import "qrc:/dialogs" @@ -332,18 +333,23 @@ // } } // keyboard should always be before AlarmItem to not to covet it. - KeyboardItem { id: _keyboard } + KeyboardItem { id: _keyboard } - HeaderbarWiFi { id: _headerbarWifi } - HeaderbarStorage { id: _headerbarStorage } - HeaderbarSettings { id: _headerbarSettings } - HeaderbarInformation { id: _headerbarInformation } - LockDialog { id: _lockDialog } - AlarmItem { id: _alarmItem ; z: 996 } - PowerItem { id: _powerItem ; z: 997 } - ConfirmDialog { id: _confirmDialog ; z: 998 } - DiagnosticsDialog { id: _diagnosticsDialog; z: 999 } + // Headerbar popups + HeaderbarWiFi { id: _headerbarWifi } + HeaderbarStorage { id: _headerbarStorage } + HeaderbarSettings { id: _headerbarSettings } + HeaderbarInformation { id: _headerbarInformation } + // Adjustment Popups + TreatmentAdjustmentVitals { id: _treatmentAdjustmentVitals } + + LockDialog { id: _lockDialog } + AlarmItem { id: _alarmItem ; z: 996 } + PowerItem { id: _powerItem ; z: 997 } + ConfirmDialog { id: _confirmDialog ; z: 998 } + DiagnosticsDialog { id: _diagnosticsDialog; z: 999 } + // Note: NotificationBar has to be anchored to the main menu and if it is moved into the AlarmItem // then cannot be anchored. NotificationBar { id: _alarmBar Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -123,8 +123,6 @@ } } - TreatmentAdjustmentVitals { id: _treatmentAdjustmentVitals } - // ---------- Manages Responses ---------- Connections { target: vTreatmentAdjustmentDuration function onAdjustmentTriggered ( vValue ) { Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -28,10 +28,18 @@ titleText : qsTr("VITALS") confirmEnabled : _bphrEntry.isValid - height : 400 + height : 500 width : 750 - y : 125 +// y : Variables.mainMenuHeight + x: numPad.isOpened ? Math.round((Variables.applicationWidth - width) / 2) - 200 : + Math.round((Variables.applicationWidth - width) / 2) + notificationText: qsTr("Interval:" ) + + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) + + " , " + + qsTr("Last Read:") + + " " + vTreatmentVitals.lastRead + function update(vSystolic, vDiastolic ,vHeartRate) { _bphrEntry.systolic = vSystolic ? vSystolic : "" _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" @@ -50,6 +58,7 @@ _bphrEntry.diastolic , _bphrEntry.heartRate ) + _headerBar.vitalsRecorded() } onCloseClicked: { @@ -63,10 +72,15 @@ Connections { target: vTreatmentVitals function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { + print("**** vTreatmentVitals.enableDialo " + vTreatmentVitals.enableDialog) + print(("%1 / %2 -- %3").arg(vSystolic).arg(vDiastolic).arg(vHeartRate)) + _headerBar.vitalsRecorded() if ( vTreatmentVitals.enableDialog ) { _root.update ( vSystolic, vDiastolic, vHeartRate ) - _root.open () +// _root.open () } } } + + Behavior on x { NumberAnimation { duration: Variables.keybardAnimationDuration } } } Index: sources/gui/qml/pages/treatment/sections/TreatmentVitals.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/gui/qml/pages/treatment/sections/TreatmentVitals.qml (.../TreatmentVitals.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/pages/treatment/sections/TreatmentVitals.qml (.../TreatmentVitals.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -66,14 +66,7 @@ font.weight : Font.Normal verticalAlignment : Text.AlignBottom color : Colors.textMain - text : qsTr("Last Recorded: %1").arg(vTreatmentVitals.lastRead) + text : qsTr("Last Read: %1").arg(vTreatmentVitals.lastRead) } } - - // TODO -// notification.text: qsTr("Interval:" ) -// + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) -// + " , " -// + qsTr("Last Read:") -// + " " + vTreatmentVitals.lastRead } Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -29,19 +29,14 @@ * \details All the class signal/slot connections are defined here. */ void View::VTreatmentVitals::initConnections() { -// ACTION_RECEIVE_BRIDGE_CONNECTION(_BluetoothInterface, UIBloodPressureData); -// ACTION_VIEW_CONNECTION(AdjustVitalsResponseData); -// ADJUST_VIEW_CONNECTION(AdjustVitalsRequestData ); - connect(this, SIGNAL( intervalChanged (const quint8 &)), this, SLOT(onIntervalChanged ( ))); } void View::VTreatmentVitals::onActionReceive(const TreatmentVitalsData &vData) -// void View::VTreatmentVitals::onActionReceive(const AdjustVitalsResponseData &vData) { - update_rt (vData.mSystolic, vData.mDiastolic, vData.mHeartRate); -// update (vData.mSystolic, vData.mDiastolic, vData.mHeartRate); +// update_rt (vData.mSystolic, vData.mDiastolic, vData.mHeartRate); + update (vData.mSystolic, vData.mDiastolic, vData.mHeartRate); emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mHeartRate); qDebug() << tr("**************8Vital received,%1,%2,%3") @@ -55,30 +50,7 @@ .arg(vData.mHeartRate)); } - /*! - * \brief View::VTreatmentVitals::onActionReceive - * \details The data handler which gets the data form GuiControl and GuiController will get the data from BtCuff controller. - * \param vData - Vital values - * \note the accepted and reason in this case should be the BtCuff status which may not necessarily comes front BtCuff itself, - * and the intermediate controller like the GuiController or the BtCuffController can report from BtCuff behalf if it is connected or not responsive. - */ -//void View::VTreatmentVitals::onActionReceive(const UIBloodPressureData &vData) -//{ -// // Not used yet. -// // adjustment_Accepted ( vData.mAccepted ); -// // adjustment_Reason ( vData.mReason ); - -// update_rt (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_APPED_UI(tr("Vital received,%1,%2,%3") -// .arg(vData.mSystolic ) -// .arg(vData.mDiastolic) -// .arg(vData.mPulseRate)); -//} - -/*! * \brief View::VTreatmentVitals::doConfirm * \details Append the user measured BP/HR in to the list of the Treatment Log Average data * \param vSystolic - Blood Pressure Systolic @@ -207,11 +179,8 @@ if ( ! _counter_min ) { timerStop(); - AdjustVitalsRequestData mData; - emit didAdjustment(mData); - qDebug() << "****didAdjustment --- AdjustVitalsRequestData" ; - -// emit didTrigger(); + qDebug() << "**** TIME IS UP" ; + emit didTrigger(); } else { _counter_min--; Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp (.../VTreatmentAdjustmentVitals.cpp) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp (.../VTreatmentAdjustmentVitals.cpp) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -13,20 +13,19 @@ * */ - #include "VTreatmentAdjustmentVitals.h" // Project #include "GuiController.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentVitals) -void VTreatmentAdjustmentVitals::initConnections() { +void View::VTreatmentAdjustmentVitals::initConnections() { ACTION_VIEW_CONNECTION(AdjustVitalsResponseData); ADJUST_VIEW_CONNECTION(AdjustVitalsRequestData ); } -void VTreatmentAdjustmentVitals::onActionReceive(const AdjustVitalsResponseData &vData) +void View::VTreatmentAdjustmentVitals::onActionReceive(const AdjustVitalsResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); @@ -35,3 +34,14 @@ // *** otherwise will use the previous values before being set. *** adjustment ( true ); } + +/*! + * \brief View::VTreatmentAdjustmentVitals::doRequest + * \details Sends the request to get vitals + */ +void View::VTreatmentAdjustmentVitals::doRequest() +{ + qDebug() << "View::VTreatmentAdjustmentVitals::doRequest()"; + AdjustVitalsRequestData data; + emit didAdjustment(data); +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.h =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r31b1e7a5d69f014398827e16286f28515cd60e35 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.h (.../VTreatmentAdjustmentVitals.h) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.h (.../VTreatmentAdjustmentVitals.h) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) @@ -41,6 +41,9 @@ VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentVitals, AdjustVitalsResponseData) +public slots: + void doRequest(); + signals: /*! * \brief didAdjustment