Index: denali.qrc
===================================================================
diff -u -rc1ceb8df87b195e8a1b9dc09e0bbab9c6655c308 -rd1a4fe257de0cc4fe51f241075f429d22d83eebe
--- denali.qrc (.../denali.qrc) (revision c1ceb8df87b195e8a1b9dc09e0bbab9c6655c308)
+++ denali.qrc (.../denali.qrc) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -32,6 +32,7 @@
sources/gui/qml/dialogs/NotificationDialog.qml
sources/gui/qml/dialogs/AlarmListDialog.qml
sources/gui/qml/dialogs/DiagnosticsDialog.qml
+ sources/gui/qml/dialogs/StatusDialog.qml
resources/images/Logo d.png
@@ -69,6 +70,8 @@
resources/images/chevron-left.png
resources/images/chevron-right.png
resources/images/DenaliDevice.png
+ resources/images/BTLogoNotConnected.png
+ resources/images/BTLogoConnected.png
sources/gui/qml/components/MainMenu.qml
@@ -145,6 +148,7 @@
sources/gui/qml/KeyboardItem.qml
sources/gui/qml/SDCProgressItem.qml
sources/gui/qml/USBProgressItem.qml
+ sources/gui/qml/BluetoothStatusIndicator.qml
sources/gui/qml/plugins/virtualkeyboard/styles/denali/images/backspace.svg
Index: resources/images/BTLogoConnected.png
===================================================================
diff -u
Binary files differ
Index: resources/images/BTLogoNotConnected.png
===================================================================
diff -u
Binary files differ
Index: sources/gui/qml/BluetoothStatusIndicator.qml
===================================================================
diff -u
--- sources/gui/qml/BluetoothStatusIndicator.qml (revision 0)
+++ sources/gui/qml/BluetoothStatusIndicator.qml (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -0,0 +1,101 @@
+/*!
+ *
+ * Copyright (c) 2022-2023 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 BluetoothStatusIndicator.qml
+ * \author (last) Vy Duong
+ * \date (last) 28-Aug-2023
+ * \author (original) Vy Duong
+ * \date (original) 28-Aug-2023
+ *
+ */
+
+// Qt
+import QtQuick 2.12
+import QtQuick.Controls 2.12 // Dialog
+
+// Project
+// C++ imports
+// Qml imports
+import "qrc:/globals"
+import "qrc:/components"
+import "qrc:/dialogs"
+
+/*!
+ * \brief BluetoothStatusIndicator is the component to provide user information about the Bluetooth Device.
+ * \detials This item includes connection status of bluetooth.
+ * The ProgressCircle turns green if the Bluetooth is connected and grey when not connected to a remote device
+ * The ProgressCircle will indicate the battery percentage of the connected remote bt cuff
+ * Single click will open a small dialog with additional info
+ */
+TouchRect { id: _btStatusRoot
+ readonly property bool isConnected : vBluetooth.pairedAddr !== "" // The pairedAddr property is empty if there is no connection
+ readonly property real batteryLevel : vBluetooth.pairedBatt
+
+ property alias thickness : _batteryLevelCircle.thickness
+ property bool displayInformation : true
+
+ touchExpanding : 20 // since the object visual is so small make the mouseArea bigger for the human finger to easier touch.
+ enabled : true//_btStatusRoot.isConnected
+ color : Colors.transparent
+
+ width : 30
+ height: width
+ radius: width
+
+ ProgressCircle { id: _batteryLevelCircle
+ anchors.fill: parent
+ diameter: _btStatusRoot.width
+ minimum : 0
+ maximum : 100
+ value : _btStatusRoot.batteryLevel
+ color : _btStatusRoot.isConnected ? (_btStatusRoot.batteryLevel > 25 ? Colors.progressCircleConnected : Colors.progressCircleError): Colors.progressCircleNotReady
+ }
+
+ Image { id: _btIcon
+ anchors.centerIn: parent
+ anchors.fill : parent
+ source : _btStatusRoot.isConnected ? "qrc:/images/BtLogoConnected" : "qrc:/images/BtLogoNotConnected"
+ }
+
+ // TODO: Update this to use the updatable RSSI of the bluetooth remote,
+ // which is not available until Qt 6.5+ :
+ // https://bugreports.qt.io/browse/QTBUG-69747
+
+ Text { id: _rssiValue
+ visible : true //TODO _btStatusRoot.isConnected
+ anchors.top: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ color : Colors.white
+ text : "Bt" // TODO vBluetooth.pairedRssi
+ font.pixelSize: 12
+ font.bold: true
+ }
+
+ onClicked: _btInfoDialog.open()
+
+ Item {
+ // To allow better positioning control, wrapping ModalDialog in Item
+ anchors.right : _btStatusRoot.right
+ anchors.top : _btStatusRoot.bottom
+ width : _btInfoDialog.width
+ height: _btInfoDialog.height
+
+ StatusDialog{ id: _btInfoDialog
+ dialogTitleText : qsTr("Bluetooth Info")
+ infoLabels : [
+ "Device name" ,
+ "Mac Addr" ,
+ "Battery Level" ,
+ ]
+ statusInfo : [
+ vBluetooth.pairedName,
+ vBluetooth.pairedAddr,
+ vBluetooth.pairedBatt + "%"
+ ]
+ }
+ }
+}
Index: sources/gui/qml/dialogs/StatusDialog.qml
===================================================================
diff -u
--- sources/gui/qml/dialogs/StatusDialog.qml (revision 0)
+++ sources/gui/qml/dialogs/StatusDialog.qml (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -0,0 +1,86 @@
+/*!
+ *
+ * Copyright (c) 2021-2023 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 StatusDialog.qml
+ * \author (last) Vy Duong
+ * \date (last) 28-Aug-2023
+ * \author (original) Vy Duong
+ * \date (original) 28-Aug-2023
+ *
+ */
+
+// Qt
+import QtQuick 2.12
+
+// Project
+import Gui.Actions 0.1
+import Gui.VEventSpy 0.1
+
+// Qml imports
+import "qrc:/globals"
+import "qrc:/components"
+
+/*!
+ * \brief General Status dialog screen used for wifi and bt status
+ */
+ModalDialog { id: _root
+ property alias dialogTitleText : _dialogTitle.text
+ property alias statusInfo : _infoRepeater.model
+ property var infoLabels : []
+ property int fontPixelSizeText : Fonts.fontPixelStatusDialogText
+
+ width : 300
+ height : 175
+
+ Column{
+ x: 0
+ y: 0
+ anchors.fill: parent
+ anchors.margins: 5
+
+ Text { id: _dialogTitle
+ width: _root.width - _closeButton.width
+ color: Colors.statusDialogTitle
+ font.pixelSize: fontPixelSizeText
+ font.family: Fonts.fontFamilyFixed
+ horizontalAlignment: Text.AlignLeft
+ text: qsTr("Dialog Title")
+ }
+
+ Repeater { id: _infoRepeater
+ model: []
+ Column {
+ width: _root.width - _closeButton.width
+
+ Text { id: _text
+ objectName : _root.textObjectName + index
+ text : (index < _root.infoLabels.length) ? _root.infoLabels[index] : ""
+ color : Colors.textMain
+ font.pixelSize : fontPixelSizeText
+ font.family : Fonts.fontFamilyFixed
+ }
+ Text {
+ objectName : _root.textObjectName + "L" + index
+ text : " " + modelData
+ color : Colors.textMain
+ font.pixelSize : fontPixelSizeText
+ font.family: Fonts.fontFamilyFixed
+ }
+ }
+ }
+ }
+
+ CloseButton { id : _closeButton
+ anchors.top : undefined
+ anchors.left : undefined
+ anchors.right : parent.right
+ anchors.bottom : parent.bottom
+ anchors.margins : 10
+ onClicked : close()
+ }
+}
+
Index: sources/gui/qml/globals/Colors.qml
===================================================================
diff -u -rbb93d05bea8defa9ff689ceda63d03e5233da855 -rd1a4fe257de0cc4fe51f241075f429d22d83eebe
--- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision bb93d05bea8defa9ff689ceda63d03e5233da855)
+++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -125,6 +125,11 @@
readonly property color scrollBarBgColor : white //"#80696969" // half transparent dimgray
+ readonly property color progressCircleConnected : "green"
+ readonly property color progressCircleNotReady : "#53667d" // unselected color
+ readonly property color progressCircleError : "red"
+ readonly property color statusDialogTitle : "#438FEB"
+
// ---------- < PRS > Related Section ----------
// Alarm priority colors
function alarmPriorityColors(vPriority) {
Index: sources/gui/qml/globals/Fonts.qml
===================================================================
diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -rd1a4fe257de0cc4fe51f241075f429d22d83eebe
--- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803)
+++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -87,6 +87,7 @@
readonly property int fontPixelDebugTitle : 25
readonly property int fontPixelDebugText : 28
readonly property int fontPixelDebugLabel : 15
+ readonly property int fontPixelStatusDialogText : 15
readonly property string fontFamilyFixed : "Noto Sans CJK SC"
}
Index: sources/gui/qml/main.qml
===================================================================
diff -u -rb9d5efd980be633f5d0bd92cc76295f3a0669db4 -rd1a4fe257de0cc4fe51f241075f429d22d83eebe
--- sources/gui/qml/main.qml (.../main.qml) (revision b9d5efd980be633f5d0bd92cc76295f3a0669db4)
+++ sources/gui/qml/main.qml (.../main.qml) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -327,21 +327,6 @@
font.pixelSize: 15
}
- Text { // TEST : BluetoothStatus
- color : Colors.textMain
- anchors {
- top : parent.top
- left : parent.left
- leftMargin : 615
- }
- horizontalAlignment : Text.Alignleft
- verticalAlignment : Text.AlignBottom
-
- height : 15
- text : "B:" + vBluetooth.pairedAddr
- font.pixelSize: 14
- }
-
Text { // TEST : The treatment vital dialog countdown time
color : Colors.textMain
anchors {
@@ -362,7 +347,7 @@
anchors {
top : parent.top
left : parent.left
- leftMargin : 1080
+ leftMargin : 615
}
horizontalAlignment : Text.Alignleft
verticalAlignment : Text.AlignBottom
@@ -377,7 +362,7 @@
anchors {
top : parent.top
left : parent.left
- leftMargin : 1220
+ leftMargin : 800
}
horizontalAlignment : Text.Alignleft
verticalAlignment : Text.AlignBottom
@@ -387,6 +372,15 @@
font.pixelSize: 14
}
+ BluetoothStatusIndicator { id: _bluetoothStatusIndicator
+ anchors {
+ top : parent.top
+ right : parent.right
+ topMargin : 5
+ rightMargin : 75
+ }
+ }
+
SDCProgressItem { id: _sdcProgressItem
// TODO: disable this later. this is only for diagnostic purpose.
onDoubleClicked : {
Index: sources/view/settings/VBluetooth.cpp
===================================================================
diff -u -rab995780e1eb9082f3c33a357e1386c19de1fa81 -rd1a4fe257de0cc4fe51f241075f429d22d83eebe
--- sources/view/settings/VBluetooth.cpp (.../VBluetooth.cpp) (revision ab995780e1eb9082f3c33a357e1386c19de1fa81)
+++ sources/view/settings/VBluetooth.cpp (.../VBluetooth.cpp) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -141,6 +141,7 @@
case MBluetooth::eIS_Device_Waiting : // Selected device connected and is in waiting mode for read.
pairedAddr(vData.deviceAddr);
pairedBatt(vData.deviceBatt);
+ pairedName(vData.deviceName);
scanEnabled(true);
break;
Index: sources/view/settings/VBluetooth.h
===================================================================
diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -rd1a4fe257de0cc4fe51f241075f429d22d83eebe
--- sources/view/settings/VBluetooth.h (.../VBluetooth.h) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263)
+++ sources/view/settings/VBluetooth.h (.../VBluetooth.h) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe)
@@ -50,6 +50,7 @@
PROPERTY(qint16 , error , 0 )
PROPERTY(QString , pairedAddr , "" )
+ PROPERTY(QString , pairedName , "" )
PROPERTY(quint8 , pairedBatt , 0 )
// List Model