Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HEV - High Energy Ventilator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
HEV - High Energy Ventilator
Commits
6053148f
Commit
6053148f
authored
Jun 29, 2021
by
Tiago Sarmento
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ui_dev' of
https://ohwr.org/project/hev
into ui_dev
parents
c3e03eed
4bc18ee0
Pipeline
#1871
failed with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
6 deletions
+65
-6
NativeUI.py
NativeUI/NativeUI.py
+10
-0
extras_handler.py
NativeUI/handler_library/extras_handler.py
+10
-2
test_gui_reading_measurements_integration.py
.../integration/test_gui_reading_measurements_integration.py
+1
-1
ui_layout.py
NativeUI/ui_layout.py
+2
-0
ui_widgets.py
NativeUI/ui_widgets.py
+3
-0
info_display_widgets.py
NativeUI/widget_library/info_display_widgets.py
+33
-1
plot_widget.py
NativeUI/widget_library/plot_widget.py
+6
-2
No files found.
NativeUI/NativeUI.py
View file @
6053148f
...
...
@@ -393,6 +393,16 @@ class NativeUI(HEVClient, QMainWindow):
self
.
widgets
.
personal_display
.
update_status
)
# MCU Version Number
self
.
extra_handler
.
UpdateVersionNumber
.
connect
(
self
.
widgets
.
version_display_widget
.
update_mcu_version
)
# Cumulative Operation Hours
self
.
extra_handler
.
UpdateUptimeHours
.
connect
(
self
.
widgets
.
uptime_display_widget
.
update_uptime_hours
)
# Measurement Widgets should update when the data is changed.
for
widget
in
(
self
.
widgets
.
normal_measurements
.
widget_list
...
...
NativeUI/handler_library/extras_handler.py
View file @
6053148f
...
...
@@ -12,10 +12,13 @@ class ExtraHandler(PayloadHandler):
temporay - just to check new payloads make it through to nativeUI
"""
UpdateVersionNumber
=
Signal
(
str
)
UpdateUptimeHours
=
Signal
(
str
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
()
.
__init__
([
"ALARM_MUTE"
,
"BAD_THRESHOLD"
],
*
args
,
**
kwargs
)
super
()
.
__init__
([
"ALARM_MUTE"
,
"BAD_THRESHOLD"
,
"EXPERT_INFO"
],
*
args
,
**
kwargs
)
def
active_payload
(
self
,
*
args
,
name
=
"Extra handler"
,
**
kwargs
)
->
int
:
def
active_payload
(
self
,
payload
,
*
args
,
name
=
"Extra handler"
,
**
kwargs
)
->
int
:
"""
When the personal data is updated, extract those parameters needed for display
and emit the UpdatePersonalDisplay signal.
...
...
@@ -26,4 +29,9 @@ class ExtraHandler(PayloadHandler):
# for key in ["name", "patient_id", "age", "sex", "height", "weight"]:
# outdict[key] = current_data[key]
# self.UpdatePersonalDisplay.emit(outdict)
if
payload
[
"type"
]
==
"EXPERT_INFO"
:
data
=
self
.
get_db
()
self
.
UpdateVersionNumber
.
emit
(
"
%
s.
%
s.
%
s"
%
(
data
[
"version_major"
],
data
[
"version_minor"
],
data
[
"version_mpatch"
]))
self
.
UpdateUptimeHours
.
emit
(
"
%
s"
%
data
[
"uptime_hrs"
])
return
0
NativeUI/tests/integration/test_gui_reading_measurements_integration.py
View file @
6053148f
...
...
@@ -66,7 +66,7 @@ def test_steady_state_measurements_from_gui(background_procs, native_ui, qtbot):
# wait for approx 1 min because it takes that
# long for the real dump data to start reading meaningful values.
qtbot
.
wait
(
6
0000
)
qtbot
.
wait
(
9
0000
)
# To store measurement readings read straight from the GUI
plateau_pressures
=
[]
...
...
NativeUI/ui_layout.py
View file @
6053148f
...
...
@@ -411,6 +411,7 @@ class Layout:
# Create the system info tab
sysinfo_widgets
=
[
self
.
widgets
.
version_display_widget
,
self
.
widgets
.
uptime_display_widget
,
[
self
.
widgets
.
maintenance
,
self
.
widgets
.
maintenance_time_display_widget
],
self
.
widgets
.
update_time_display_widget
,
]
...
...
@@ -530,6 +531,7 @@ class Layout:
"""
tab_info
=
LocalisedQWidget
()
tab_info_layout
=
QtWidgets
.
QVBoxLayout
(
tab_info
)
tab_info_layout
.
addStretch
()
for
entry
in
widgets
:
if
isinstance
(
entry
,
list
):
for
widget
in
entry
:
...
...
NativeUI/ui_widgets.py
View file @
6053148f
...
...
@@ -44,6 +44,7 @@ from widget_library.info_display_widgets import (
VersionDisplayWidget
,
MaintenanceTimeDisplayWidget
,
UpdateTimeDisplayWidget
,
UptimeDisplayWidget
,
)
from
widget_library.alarm_control_widget
import
AlarmControlWidget
from
widget_library.chart_buttons_widget
import
ChartButtonsWidget
...
...
@@ -454,12 +455,14 @@ class Widgets:
# Info Tab
self
.
version_display_widget
=
VersionDisplayWidget
(
NativeUI
.
colors
)
self
.
uptime_display_widget
=
UptimeDisplayWidget
(
NativeUI
.
colors
)
self
.
maintenance_time_display_widget
=
MaintenanceTimeDisplayWidget
(
NativeUI
.
colors
)
self
.
update_time_display_widget
=
UpdateTimeDisplayWidget
(
NativeUI
.
colors
)
self
.
widget_list
=
self
.
widget_list
+
[
self
.
version_display_widget
,
self
.
uptime_display_widget
,
self
.
maintenance_time_display_widget
,
self
.
update_time_display_widget
,
]
...
...
NativeUI/widget_library/info_display_widgets.py
View file @
6053148f
...
...
@@ -19,6 +19,38 @@ import logging
from
PySide2
import
QtCore
,
QtWidgets
class
UptimeDisplayWidget
(
QtWidgets
.
QLabel
):
def
__init__
(
self
,
colors
,
*
args
,
**
kwargs
):
super
()
.
__init__
(
*
args
,
**
kwargs
)
self
.
__cumulative_hours
:
str
=
"???"
self
.
setStyleSheet
(
"background-color:"
+
colors
[
"page_background"
]
.
name
()
+
";"
"border: none;"
"color:"
+
colors
[
"page_foreground"
]
.
name
()
+
";"
)
self
.
__refresh_display
()
def
__refresh_display
(
self
)
->
int
:
display_text
=
""
display_text
+=
"Cumulative Operational Time:
%
s Hours"
%
self
.
__cumulative_hours
self
.
setText
(
display_text
)
return
0
@
QtCore
.
Slot
(
str
)
def
update_uptime_hours
(
self
,
text
:
str
)
->
int
:
self
.
__cumulative_hours
=
text
self
.
__refresh_display
()
return
0
def
localise_text
(
self
,
text
:
dict
)
->
int
:
pass
class
VersionDisplayWidget
(
QtWidgets
.
QLabel
):
"""
Widget that displays the current version number.
...
...
@@ -86,7 +118,7 @@ class VersionDisplayWidget(QtWidgets.QLabel):
return
0
@
QtCore
.
Slot
(
str
)
def
update_mcu_
version
(
self
,
hash
:
str
)
->
int
:
def
update_mcu_
hash
(
self
,
hash
:
str
)
->
int
:
"""
Update the value shown for the MCU hash
"""
...
...
NativeUI/widget_library/plot_widget.py
View file @
6053148f
...
...
@@ -34,7 +34,11 @@ class TimePlotsWidget(QtWidgets.QWidget):
self
.
graph_widget
=
pg
.
GraphicsLayoutWidget
()
layout
.
addWidget
(
self
.
graph_widget
)
labelStyle
=
{
"color"
:
NativeUI
.
colors
[
"page_foreground"
],
"font-size"
:
"15pt"
}
labelStyle
=
{
"color"
:
NativeUI
.
colors
[
"page_foreground"
],
"font-size"
:
"15pt"
,
"font-weight"
:
"bold"
}
# Set up pressure - time plot
self
.
pressure_plot
=
self
.
graph_widget
.
addPlot
()
...
...
@@ -72,7 +76,7 @@ class TimePlotsWidget(QtWidgets.QWidget):
plot
.
showGrid
(
x
=
True
,
y
=
True
)
plot
.
hideButtons
()
l
=
plot
.
addLegend
(
offset
=
(
-
1
,
1
))
l
.
setFont
(
NativeUI
.
text
_font
)
l
.
setFont
(
NativeUI
.
value
_font
)
plot
.
setMouseEnabled
(
x
=
False
,
y
=
False
)
plot
.
getAxis
(
"bottom"
)
.
setStyle
(
tickFont
=
NativeUI
.
text_font
)
plot
.
getAxis
(
"left"
)
.
setStyle
(
tickFont
=
NativeUI
.
text_font
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment