Index: denali.pro.user =================================================================== diff -u -r108450c58851ff7c48c4607494b8cdae59952908 -r27331dcb133e4d400eef25d5595c3b277e79504c --- denali.pro.user (.../denali.pro.user) (revision 108450c58851ff7c48c4607494b8cdae59952908) +++ denali.pro.user (.../denali.pro.user) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -1,6 +1,6 @@ - + EnvironmentId Index: scripts/export_logs.sh =================================================================== diff -u --- scripts/export_logs.sh (revision 0) +++ scripts/export_logs.sh (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -0,0 +1,39 @@ +#!/bin/bash + +CURRNET_DATE=$(date +%Y_%m_%d) +PATH_SRC="$1" +PATH_DST="$2" +PASS_HAS="$3" + +function echo_usage() { + if [[ -z "$PATH_SRC" || -z "$PATH_DST" ]]; then + echo "Usage:" + echo "./export_logs.sh " + echo "" + fi +} + +function export_logs() { + OPTP="" + PASS="Empty Password" + if [[ -n "$PASS_HAS" ]]; then + PASS=$(pwgen -ABcsnv1 16) + OPTP=--password="$PASS" + fi + + EXPORT_FILE=$CURRNET_DATE"_logs" + + echo "$PATH_DST"/"$EXPORT_FILE".zip # echo the out zip + rm -frd "$PATH_DST"/"$EXPORT_FILE".zip && # remove the old zip from dest + rm -frd $HOME/"$EXPORT_FILE".zip && # remove the old zip from home + zip -jr9 $HOME/"$EXPORT_FILE".zip "$PATH_SRC" "$OPTP" && # compress the new zip to home neesd to change to 7zzs + cp $HOME/"$EXPORT_FILE".zip "$PATH_DST" && # copy the new zip to dest + echo $PASS > "$PATH_DST"/"$EXPORT_FILE".pas && # copy the new pas to dest + rm -frd $HOME/"$EXPORT_FILE".zip # remove the tmp zip from home +} + +if [[ "$1" == "" ]]; then + echo_usage +fi + +export_logs Index: sources/bluetooth/BluetoothInterface.cpp =================================================================== diff -u -raa7591d9f61f5d8d5a2b3604d4c37d6cea829700 -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision aa7591d9f61f5d8d5a2b3604d4c37d6cea829700) +++ sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -1095,6 +1095,34 @@ } /*! + * \brief BluetoothInterface::notifyBloodPressure + * \details The main notifier of the Vital measurement. + * \param vModel - The Blood pressure model of type MUIBloodPressure + */ +void BluetoothInterface::notifyBloodPressure(const MUIBloodPressure &vModel) +{ + UIBloodPressureData data = vModel.data(); + emit didActionReceive(data); + LOG_EVENT(vModel.toString()); +} + +/*! + * \brief BluetoothInterface::mimic + * \details A mimic function to simulate the vital measured values. + * \param vSystolic - Systolic Viral value + * \param vDiastolic - Diastolic Viral value + * \param vPulseRate - Pulse Rate Viral value + */ +void BluetoothInterface::mimic( quint16 vSystolic , + quint16 vDiastolic , + quint16 vPulseRate ) { + MUIBloodPressure model(vSystolic , + vDiastolic , + vPulseRate ); + notifyBloodPressure(model); +} + +/*! * \brief BluetoothInterface::interpretBloodPressure * \details Interpreting the blood pressure message QByteArray vData and extracting the values of Systolic, Diastolic, HeartRate. * \param vData - the received QByteArray of data. @@ -1103,10 +1131,7 @@ { MUIBloodPressure model; model.fromByteArray(vData); - UIBloodPressureData data = model.data(); - qDebug() << "==========" << data.mSystolic << data.mDiastolic << data.mPulseRate; - emit didActionReceive(data); - LOG_EVENT(model.toString()); + notifyBloodPressure(model); } /*! Index: sources/bluetooth/BluetoothInterface.h =================================================================== diff -u -r9ae3b0d6624904693329309aaf8ff02784c17184 -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/bluetooth/BluetoothInterface.h (.../BluetoothInterface.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) +++ sources/bluetooth/BluetoothInterface.h (.../BluetoothInterface.h) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -78,6 +78,9 @@ public: bool isValid( ) const { return _isValid ; } void valid(bool vValid) { _isValid = vValid; } + void mimic(const quint16 vSystolic , + const quint16 vDiastolic , + const quint16 vPulseRate ); protected: void timerEvent(QTimerEvent *event) override; @@ -156,6 +159,7 @@ void printCharacteristics (QLowEnergyService *vService); void notifyStateChange (const BluetoothData &vData); + void notifyBloodPressure (const MUIBloodPressure &vModel); void interpretBloodPressure (const QByteArray &vData); void interpretInformation (); void interpretBattery (const QByteArray &vData); Index: sources/gui/qml/components/EntryDialog.qml =================================================================== diff -u -r6233e005c77ee0aa10e80c02254a21f2042b840b -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/gui/qml/components/EntryDialog.qml (.../EntryDialog.qml) (revision 6233e005c77ee0aa10e80c02254a21f2042b840b) +++ sources/gui/qml/components/EntryDialog.qml (.../EntryDialog.qml) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -33,7 +33,10 @@ signal autoHidden () signal closeClicked() signal confirmClicked() + signal opened () + signal closed () + property bool closeVisible : true property bool confirmVisible : true property bool confirmEnabled : true @@ -50,9 +53,12 @@ property alias notification : _notification property alias titleText : _titleText.text - function open () { opacity = 1 } - function close () { opacity = 0 } + function open () { opacity = 1 + opened () } + function close () { opacity = 0 + closed () } + width : Variables.applicationWidth height : Variables.applicationHeight opacity : 0 Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -r6233e005c77ee0aa10e80c02254a21f2042b840b -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 6233e005c77ee0aa10e80c02254a21f2042b840b) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -50,6 +50,11 @@ width : _container.width height : _container.height + function setFocus() { + firstInput.textInput.forceActiveFocus() + _keyboard.setVisible(true) + } + anchors.horizontalCenter: parent.horizontalCenter y : Qt.inputMethod.visible && _keyboard.visible ? _root.topMarginContent : ( ( _root.contentRectHeight - _container.height ) / 2 ) Behavior on y { NumberAnimation { duration: Variables.keybardAnimationDuration } } Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -raeb915075b9e13e5c1aaf2800ba6db03b6c24a0b -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision aeb915075b9e13e5c1aaf2800ba6db03b6c24a0b) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -85,7 +85,7 @@ /* No wait for Rsp, so navigates => */ page( _treatmentReviewConfirm ) /* After navigate ask for Tx data */ vPostTreatmentAdjustmentTreatmentLog .doRequest( )} onTreatmentReviewConfirm : { page( _disposablesRemovalConfirm ) - vTreatmentVitals.doReset(false) + vTreatmentVitals.doReset() } onDisposablesRemovalConfirm : { vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( )} onDisposablesRemovalBack : { page( _treatmentReviewConfirm )} Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml =================================================================== diff -u -raeb915075b9e13e5c1aaf2800ba6db03b6c24a0b -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision aeb915075b9e13e5c1aaf2800ba6db03b6c24a0b) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -63,8 +63,8 @@ } } onVisibleChanged: { - if ( visible ) - vTreatmentVitals.doReset(true) + if ( visible ) vTreatmentVitals.doReset() + vTreatmentVitals.enableUpdate = visible } } Index: sources/gui/qml/pages/treatment/TreatmentHome.qml =================================================================== diff -u -rab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4 -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision ab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4) +++ sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -135,8 +135,6 @@ } onVisibleChanged: { - vTreatmentVitals.enabled = visible - if (visible) { _mainMenu.hidden = true _treatmentMenu.hidden = false Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r54221e0e6482d4124661190fab14551cba0ec535 -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 54221e0e6482d4124661190fab14551cba0ec535) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -64,6 +64,9 @@ TreatmentBloodPrime { id: _treatmentBloodPrime } TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } TreatmentHome { id: _treatmentHome + onVisibleChanged : { + vTreatmentVitals.enableDialog = visible + } onSectionFlowClicked : { _treatmentAdjustmentFlow.open() } @@ -83,6 +86,9 @@ } 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 @@ -167,6 +173,12 @@ } EntryDialog { id: _vitalEntry + function update(vSystolic, vDiastolic ,vHeartRate) { + _bphrEntry.systolic = vSystolic ? vSystolic : "" + _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" + _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" + } + titleText : qsTr("VITALS") autoHide : true autoHideDuration : vTreatmentVitals.timeout * 60000 // min => ms @@ -185,6 +197,7 @@ onAutoHidden : vTreatmentVitals.doTimeout() // only for logging + onOpened : _bphrEntry.setFocus() BPHREntry { id : _bphrEntry contentRectHeight : _vitalEntry.contentRect.height @@ -275,11 +288,12 @@ } Connections { target: _mainHome - onStartTreatment : { page ( _treatmentHome )} + onStartTreatment : { page( _treatmentHome )} } Connections { target: vTreatmentVitals - onDidTrigger : { _vitalEntry.open() } + onDidTrigger : { + _vitalEntry.update(vSystolic, vDiastolic, vHeartRate ) + _vitalEntry.open() } } - } Index: sources/main.h =================================================================== diff -u -rdb92783a0a9dab0ddf2b68c51d15b1ae1cb3ddcc -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/main.h (.../main.h) (revision db92783a0a9dab0ddf2b68c51d15b1ae1cb3ddcc) +++ sources/main.h (.../main.h) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -28,6 +28,8 @@ #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/ui/data/MUIBloodPressureData.cpp =================================================================== diff -u -raa8f2c87c14c68d1fda6da2540d47144990a596c -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/model/ui/data/MUIBloodPressureData.cpp (.../MUIBloodPressureData.cpp) (revision aa8f2c87c14c68d1fda6da2540d47144990a596c) +++ sources/model/ui/data/MUIBloodPressureData.cpp (.../MUIBloodPressureData.cpp) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -34,6 +34,21 @@ }; } +/*! + * \brief MUIBloodPressure::MUIBloodPressure + * \details A constructor for testing purposes to set some default values to be used as simulated BCuff values. + * \param mSystolic - Systolic Viral value + * \param mDiastolic - Diastolic Viral value + * \param mPulseRate - Pulse Rate Viral value + * \note only three vital parameters are currently being used. + */ +MUIBloodPressure::MUIBloodPressure(quint16 vSystolic, quint16 vDiastolic, quint16 vPulseRate) +{ + _data.mSystolic .value = vSystolic ; + _data.mDiastolic .value = vDiastolic; + _data.mPulseRate .value = vPulseRate; +} + bool MUIBloodPressure::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mFlags )) Index: sources/model/ui/data/MUIBloodPressureData.h =================================================================== diff -u -raa8f2c87c14c68d1fda6da2540d47144990a596c -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/model/ui/data/MUIBloodPressureData.h (.../MUIBloodPressureData.h) (revision aa8f2c87c14c68d1fda6da2540d47144990a596c) +++ sources/model/ui/data/MUIBloodPressureData.h (.../MUIBloodPressureData.h) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -98,6 +98,9 @@ public: MUIBloodPressure () { } + MUIBloodPressure ( quint16 vSystolic , + quint16 vDiastolic , + quint16 vPulseRate ); bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data ( ) const ; Index: sources/view/VEventSpy.cpp =================================================================== diff -u -r1c18f738693756ca1f0342c2cc158e32bc28f90b -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 1c18f738693756ca1f0342c2cc158e32bc28f90b) +++ sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -23,6 +23,7 @@ #include "GuiGlobals.h" #include "FileHandler.h" #include "DeviceController.h" +#include "BluetoothInterface.h" // if needs to spy on the mouse events // (which is happening on the desktop only since there is not mouse attached to the device) @@ -215,10 +216,24 @@ firstEntry = false; QKeyEvent *keyEvent = static_cast(vEvent); - if (keyEvent->key() == Qt::Key_F12) { - QImage screenshotImage = Gui::_viewer->grabWindow(); // this has to be called in Gui Thread regarding the Qt doc - QString screenshotFileName = Storage::USB_Mount_Point + QString(Storage::Screenshot_Base_Path_Name) + currentDateTime + ".png"; - _DeviceController.doScreenshot(screenshotImage, screenshotFileName); + switch (keyEvent->key()) { + case Qt::Key_F12: { + QImage screenshotImage = Gui::_viewer->grabWindow(); // this has to be called in Gui Thread regarding the Qt doc + QString screenshotFileName = Storage::USB_Mount_Point + QString(Storage::Screenshot_Base_Path_Name) + currentDateTime + ".png"; + _DeviceController.doScreenshot(screenshotImage, screenshotFileName); } + break; + +#ifdef DEBUG_BCUFF_MIMIC + case Qt::Key_F11: { + static quint16 systolic, diastolic, pulserate ; + _BluetoothInterface.mimic( ++systolic, ++diastolic, ++pulserate); + } + break; +#endif + + default: + break; + } } // coco end Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -r59fc5195a10eeb83ac60cf32a9123fb9c9f8ec8e -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 59fc5195a10eeb83ac60cf32a9123fb9c9f8ec8e) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -46,19 +46,21 @@ */ void View::VTreatmentVitals::onActionReceive(const UIBloodPressureData &vData) { - if ( ! _enabled ) { + 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")); + 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 ); - update(vData.mSystolic, vData.mDiastolic, vData.mPulseRate); - treatmentLog(); - timerReset(); + if ( _enableDialog ) { emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mPulseRate); } + if ( _enableUpdate ) { update (vData.mSystolic, vData.mDiastolic, vData.mPulseRate); } } /*! @@ -68,7 +70,9 @@ * \param vDiastolic - Blood Pressure Diastolic * \param vHeartRate - Heart Rate */ -void View::VTreatmentVitals::doConfirm(quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate) { +void View::VTreatmentVitals::doConfirm( quint16 vSystolic, + quint16 vDiastolic, + quint16 vHeartRate) { adjustment_Accepted ( true ); adjustment_Reason ( 0 ); @@ -106,14 +110,15 @@ * \param vEnabled - Disable or enable the vitals. * \note it's still unknown that how to stop in case of the treatment ended by alarm or system fault. */ -void View::VTreatmentVitals::doReset(bool vEnabled) +void View::VTreatmentVitals::doReset() { - epoch ( 0 ); - lastRead ( ""); - systolic ( 0 ); - diastolic ( 0 ); - heartRate ( 0 ); - enabled (vEnabled); + epoch ( 0 ); + lastRead ( ""); + systolic ( 0 ); + diastolic ( 0 ); + heartRate ( 0 ); + enableDialog ( 0 ); + enableUpdate ( 0 ); // force notify the Gui emit epochChanged ( 0 ); @@ -132,7 +137,7 @@ */ void View::VTreatmentVitals::update(quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate) { - QDateTime currentDateTime = QDateTime::currentDateTime(); + QDateTime currentDateTime = QDateTime::currentDateTime(); epoch (currentDateTime.toSecsSinceEpoch()); lastRead (currentDateTime.toString(_datetimeFormat)); systolic ( vSystolic ); @@ -176,8 +181,8 @@ void View::VTreatmentVitals::onTimerChanged() { - if ( _interval && _enabled ) timerStart(); - else timerStop (); + if ( _interval && _enableDialog ) timerStart(); + else timerStop (); } /*! Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h =================================================================== diff -u -raeb915075b9e13e5c1aaf2800ba6db03b6c24a0b -r27331dcb133e4d400eef25d5595c3b277e79504c --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision aeb915075b9e13e5c1aaf2800ba6db03b6c24a0b) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision 27331dcb133e4d400eef25d5595c3b277e79504c) @@ -60,7 +60,8 @@ // timer - PROPERTY( bool , enabled , 0) // enable the vital screen timer + PROPERTY( bool , enableDialog , 0) // enable the vital screen timer + PROPERTY( bool , enableUpdate , 0) // enable the vital screen timer PROPERTY( quint8 , interval , 0) // show the vital screen in min PROPERTY( quint8 , timeout , 1) // close the vital screen in min @@ -93,7 +94,7 @@ void doConfirm (quint16 vSystolic, quint16 vDiastolic, quint16 vHeartRate); void doSkip (); void doTimeout (); - void doReset (bool vEnabled); + void doReset (); signals: /*! @@ -107,7 +108,7 @@ * \brief didTrigger * \details the signal to trigger the Gui to notify the user for the vitals measurement */ - void didTrigger(); + void didTrigger(quint16 vSystolic = 0, quint16 vDiastolic = 0, quint16 vHeartRate = 0); /*! * \brief didTrigger