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
ddbcecc8
Commit
ddbcecc8
authored
Mar 12, 2021
by
Benjamin Mummery
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unified text size
parent
d9476537
Pipeline
#1063
failed
Changes
14
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
118 additions
and
98 deletions
+118
-98
NativeUI.py
NativeUI/NativeUI.py
+2
-1
alarm_list.py
NativeUI/alarm_widgets/alarm_list.py
+3
-1
alarm_popup.py
NativeUI/alarm_widgets/alarm_popup.py
+1
-0
global_ok_cancel_buttons.py
NativeUI/global_widgets/global_ok_cancel_buttons.py
+2
-0
global_select_button.py
NativeUI/global_widgets/global_select_button.py
+11
-10
global_spinbox.py
NativeUI/global_widgets/global_spinbox.py
+25
-9
global_typeval_popup.py
NativeUI/global_widgets/global_typeval_popup.py
+6
-6
tab_start_stop_buttons.py
NativeUI/global_widgets/tab_start_stop_buttons.py
+3
-2
template_set_values.py
NativeUI/global_widgets/template_set_values.py
+1
-1
hev_main.py
NativeUI/hev_main.py
+7
-8
tab_buttons.py
NativeUI/main_widgets/tab_buttons.py
+5
-3
tab_history_buttons.py
NativeUI/main_widgets/tab_history_buttons.py
+7
-7
tab_measurements.py
NativeUI/main_widgets/tab_measurements.py
+21
-26
tab_spin_buttons.py
NativeUI/main_widgets/tab_spin_buttons.py
+24
-24
No files found.
NativeUI/NativeUI.py
View file @
ddbcecc8
...
...
@@ -64,6 +64,7 @@ class NativeUI(HEVClient, QMainWindow):
"background-disabled"
:
QColor
.
fromRgb
(
15
,
15
,
15
),
"foreground-disabled"
:
QColor
.
fromRgb
(
100
,
100
,
100
),
}
self
.
text_size
=
"20pt"
self
.
iconpath
=
self
.
__find_icons
()
# database
...
...
@@ -413,7 +414,7 @@ if __name__ == "__main__":
dep
.
setGeometry
(
0
,
0
,
1920
,
1080
)
dep
.
setWindowFlags
(
QtCore
.
Qt
.
FramelessWindowHint
)
elif
args
.
debug
>
0
:
rescale
=
0.7
rescale
=
1
dep
.
setGeometry
(
0
,
0
,
rescale
*
1920
,
rescale
*
1080
)
dep
.
battery_signal
.
connect
(
dep
.
topBar
.
tab_battery
.
update_value
)
...
...
NativeUI/alarm_widgets/alarm_list.py
View file @
ddbcecc8
...
...
@@ -27,7 +27,9 @@ class alarmList(QtWidgets.QWidget):
self
.
setSizePolicy
(
QtWidgets
.
QSizePolicy
.
Expanding
,
QtWidgets
.
QSizePolicy
.
Expanding
)
self
.
setStyleSheet
(
"background-color:white; font:15pt white;"
)
self
.
setStyleSheet
(
"background-color:white;"
"font-size: "
+
NativeUI
.
text_size
+
";"
)
iconpath_bell
=
os
.
path
.
join
(
NativeUI
.
iconpath
,
"bell-solid.png"
)
iconpath_bellReg
=
os
.
path
.
join
(
NativeUI
.
iconpath
,
"bell-regular.png"
)
...
...
NativeUI/alarm_widgets/alarm_popup.py
View file @
ddbcecc8
...
...
@@ -40,6 +40,7 @@ class alarmWidget(QtWidgets.QWidget):
textLabel
.
setText
(
self
.
alarmPayload
[
"alarm_code"
])
textLabel
.
setFixedWidth
(
150
)
textLabel
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
textLabel
.
setStyleSheet
(
"font-size: "
+
NativeUI
.
text_size
+
";"
)
self
.
layout
.
addWidget
(
textLabel
)
self
.
setFixedHeight
(
40
)
...
...
NativeUI/global_widgets/global_ok_cancel_buttons.py
View file @
ddbcecc8
...
...
@@ -34,6 +34,7 @@ class okButton(
"background-color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"border-color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"font-size: "
+
NativeUI
.
text_size
+
";"
"border-radius: 8px;"
"border:none"
)
...
...
@@ -60,6 +61,7 @@ class cancelButton(
"background-color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"border-color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"font-size: "
+
NativeUI
.
text_size
+
";"
"border-radius: 8px;"
"border:none"
)
...
...
NativeUI/global_widgets/global_select_button.py
View file @
ddbcecc8
...
...
@@ -18,23 +18,24 @@ from PySide2 import QtWidgets, QtGui, QtCore
class
selectorButton
(
QtWidgets
.
QPushButton
):
def
__init__
(
self
,
NativeUI
,
*
args
,
**
kwargs
):
super
(
selectorButton
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
fontsize
=
20
style
=
(
"QPushButton{"
"
font: "
+
str
(
fontsize
)
+
"pt
;"
"
font-size: "
+
NativeUI
.
text_size
+
"
;"
"}"
"QPushButton[selected='0']{"
"
font: "
+
str
(
fontsize
)
+
"pt
;"
"color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"background-color: "
+
NativeUI
.
colors
[
"background-enabled"
]
.
name
()
+
";"
"border:none"
"
font-size: "
+
NativeUI
.
text_size
+
"
;"
"
color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"
background-color: "
+
NativeUI
.
colors
[
"background-enabled"
]
.
name
()
+
";"
"
border:none"
"}"
"QPushButton[selected='1']{"
"font: "
+
str
(
fontsize
)
+
"pt;"
"color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"background-color: "
+
NativeUI
.
colors
[
"foreground-disabled"
]
.
name
()
+
";"
"border:none"
" font-size: "
+
NativeUI
.
text_size
+
";"
" color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
" background-color: "
+
NativeUI
.
colors
[
"foreground-disabled"
]
.
name
()
+
";"
" border:none"
"}"
)
...
...
NativeUI/global_widgets/global_spinbox.py
View file @
ddbcecc8
...
...
@@ -75,7 +75,7 @@ class labelledSpin(QtWidgets.QWidget):
self
.
manuallyUpdated
=
False
layout
=
QtWidgets
.
QHBoxLayout
()
widgetList
=
[]
textStyle
=
"color:white;
font: 16pt
"
textStyle
=
"color:white;
"
"font-size: "
+
NativeUI
.
text_size
+
";
"
if
self
.
label
!=
""
:
self
.
nameLabel
=
QtWidgets
.
QLabel
(
self
.
label
)
...
...
@@ -88,14 +88,30 @@ class labelledSpin(QtWidgets.QWidget):
self
.
simpleSpin
.
setSingleStep
(
self
.
step
)
self
.
simpleSpin
.
setDecimals
(
self
.
decPlaces
)
self
.
simpleSpin
.
setStyleSheet
(
"""QDoubleSpinBox{ width:100px; font:16pt}
QDoubleSpinBox[bgColour="0"]{background-color:white; }
QDoubleSpinBox[bgColour="1"]{background-color:grey; }
QDoubleSpinBox[textColour="0"]{color:black}
QDoubleSpinBox[textColour="1"]{color:red}
QDoubleSpinBox::up-button{width:20; border:solid white; color:black }
QDoubleSpinBox::down-button{width:20; }
"""
"QDoubleSpinBox{"
" width: 100px"
" font-size: "
+
NativeUI
.
text_size
+
";"
"}"
"QDoubleSpinBox[bgColour='0']{"
" background-color:white;"
"}"
"QDoubleSpinBox[bgColour='1']{"
" background-color:grey;"
"}"
"QDoubleSpinBox[textColour='0']{"
" color:black"
"}"
"QDoubleSpinBox[textColour='1']{"
" color:red"
"}"
"QDoubleSpinBox::up-button{"
" width:20;"
" border:solid white;"
" color:black"
"}"
"QDoubleSpinBox::down-button{"
" width:20;"
"}"
)
self
.
simpleSpin
.
setProperty
(
"textColour"
,
"0"
)
self
.
simpleSpin
.
setProperty
(
"bgColour"
,
"0"
)
...
...
NativeUI/global_widgets/global_typeval_popup.py
View file @
ddbcecc8
...
...
@@ -33,18 +33,18 @@ class TypeValuePopup(QtWidgets.QDialog):
self
.
lineEdit
.
setText
(
"4"
)
self
.
lineEdit
.
setStyleSheet
(
"QLineEdit{"
"
font: 16pt
;"
"background-color: white;"
"border-radius: 4px;"
"
font-size: "
+
NativeUI
.
text_size
+
"
;"
"
background-color: white;"
"
border-radius: 4px;"
"}"
"QLineEdit[colour = '0']{"
"color: green;"
"
color: green;"
"}"
"QLineEdit[colour = '1']{"
"color: rgb(144, 231, 211);"
"
color: rgb(144, 231, 211);"
"}"
"QLineEdit[colour = '2']{"
"color: red;"
"
color: red;"
"}"
)
self
.
lineEdit
.
setProperty
(
"colour"
,
"1"
)
...
...
NativeUI/global_widgets/tab_start_stop_buttons.py
View file @
ddbcecc8
...
...
@@ -52,8 +52,9 @@ class TabStartStopStandbyButtons(QtWidgets.QWidget):
+
NativeUI
.
colors
[
"background-enabled"
]
.
name
()
+
";"
"border-color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"font-size: 20pt;"
"color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
+
"border:none"
"font-size: "
+
NativeUI
.
text_size
+
";"
"color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"border:none"
)
button
.
setFixedSize
(
self
.
__button_size
)
...
...
NativeUI/global_widgets/template_set_values.py
View file @
ddbcecc8
...
...
@@ -98,7 +98,7 @@ class TemplateSetValues(QtWidgets.QWidget):
self
.
titleLabel
.
setStyleSheet
(
"background-color:"
+
self
.
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"color:"
+
self
.
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"font
: 20pt
;"
"font
-size: "
+
self
.
NativeUI
.
text_size
+
"
;"
)
self
.
titleLabel
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
grid
.
addWidget
(
self
.
titleLabel
,
i
,
0
,
1
,
6
)
...
...
NativeUI/hev_main.py
View file @
ddbcecc8
...
...
@@ -107,7 +107,6 @@ class MainView(QWidget):
class
TabNormalExpertButtons
(
QWidget
):
def
__init__
(
self
,
NativeUI
,
*
args
,
**
kwargs
):
super
()
.
__init__
(
*
args
,
**
kwargs
)
font_size
=
20
button_size
=
QSize
(
150
,
50
)
self
.
NativeUI
=
NativeUI
layout
=
QHBoxLayout
()
...
...
@@ -123,19 +122,19 @@ class TabNormalExpertButtons(QWidget):
for
button
in
self
.
buttons
:
button
.
setStyleSheet
(
"QPushButton{"
"color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"
font-size: "
+
str
(
font_size
)
+
"pt
;"
"background-color: "
"
color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"
font-size: "
+
NativeUI
.
text_size
+
"
;"
"
background-color: "
+
NativeUI
.
colors
[
"background-enabled"
]
.
name
()
+
";"
"border-color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"border:none"
"
border-color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"
border:none"
"}"
"QPushButton:disabled{"
"background-color: "
"
background-color: "
+
NativeUI
.
colors
[
"background-disabled"
]
.
name
()
+
";"
"border:none"
"
border:none"
"}"
)
button
.
setFixedSize
(
button_size
)
...
...
NativeUI/main_widgets/tab_buttons.py
View file @
ddbcecc8
...
...
@@ -31,9 +31,11 @@ class customButton(QtWidgets.QPushButton):
super
()
.
__init__
()
# self.setIcon(icon)
self
.
setStyleSheet
(
"border:none; background-image:url('"
+
iconPath
+
"');height:100px;width:100px"
"border:none;"
"background-image:url('"
+
iconPath
+
"');"
"font-size: "
+
self
.
NativeUI
.
text_size
+
";"
"height:100px;"
"width:100px;"
)
...
...
NativeUI/main_widgets/tab_history_buttons.py
View file @
ddbcecc8
...
...
@@ -31,8 +31,8 @@ class TabHistoryButtons(QtWidgets.QWidget):
super
()
.
__init__
(
*
args
,
**
kwargs
)
self
.
NativeUI
=
NativeUI
self
.
__button_size
=
QSize
(
50
,
50
)
self
.
__button_
font_size
=
20
button_size
=
60
self
.
__button_
size
=
QSize
(
button_size
,
button_size
)
self
.
button_sixty
=
HistoryButton
(
"60s"
,
signal_value
=
60
)
self
.
button_thirty
=
HistoryButton
(
"30s"
,
signal_value
=
30
)
...
...
@@ -49,13 +49,13 @@ class TabHistoryButtons(QtWidgets.QWidget):
for
button
in
self
.
buttons
:
button
.
setStyleSheet
(
"QPushButton{"
"background-color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"border-color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"
font-size: "
+
str
(
self
.
__button_font_size
)
+
"px
;"
"
background-color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"
border-color: "
+
NativeUI
.
colors
[
"background"
]
.
name
()
+
";"
"
color: "
+
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"
font-size: "
+
NativeUI
.
text_size
+
"
;"
"}"
"QPushButton:disabled{"
"background-color: "
"
background-color: "
+
NativeUI
.
colors
[
"background-disabled"
]
.
name
()
+
";"
"}"
...
...
NativeUI/main_widgets/tab_measurements.py
View file @
ddbcecc8
...
...
@@ -53,10 +53,13 @@ class Measurements_Block(QtWidgets.QWidget):
"measurement type
%
s is not a recognised parameter"
%
measurement
[
2
]
)
label
=
QtWidgets
.
QLabel
(
"Measurements"
)
label
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
label
.
setStyleSheet
(
"color: grey; font-size: 15px"
)
layout
.
addWidget
(
label
)
# label = QtWidgets.QLabel("Measurements")
# label.setAlignment(QtCore.Qt.AlignCenter)
# label.setStyleSheet(
# "color: grey;"
# "font-size: " + NativeUI.text_size + ";"
# )
# layout.addWidget(label)
# Compute max number of items per column
max_col_length
=
int
(
len
(
widget_list
)
/
(
columns
))
...
...
@@ -112,10 +115,9 @@ class MeasurementWidget(QtWidgets.QWidget):
**
kwargs
):
super
(
MeasurementWidget
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
width
=
150
height
=
100
labelheight
=
25
border_radius
=
5
width
=
250
height
=
120
labelheight
=
35
self
.
NativeUI
=
NativeUI
self
.
key
=
key
...
...
@@ -133,13 +135,11 @@ class MeasurementWidget(QtWidgets.QWidget):
self
.
name_display
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
self
.
name_display
.
setStyleSheet
(
"color: "
+
self
.
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"background-color:
"
+
self
.
NativeUI
.
colors
[
"background-
dis
abled"
]
.
name
()
"background-color:"
+
self
.
NativeUI
.
colors
[
"background-
en
abled"
]
.
name
()
+
";"
"border-style: outset;"
"border-width: 1px;"
"border-color:"
+
self
.
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"border-radius: "
+
str
(
border_radius
)
+
"px;"
"border: none;"
"font-size: "
+
NativeUI
.
text_size
+
";"
)
self
.
name_display
.
setFixedSize
(
width
,
labelheight
)
self
.
name_display
.
setFont
(
QtGui
.
QFont
(
"SansSerif"
,
10
))
...
...
@@ -147,15 +147,10 @@ class MeasurementWidget(QtWidgets.QWidget):
self
.
value_display
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
self
.
value_display
.
setStyleSheet
(
"color: black;"
"background-color: lightblue;"
"border-style: outset;"
"border-width: 1px;"
"border-color: black;"
"border-radius: "
+
str
(
border_radius
)
+
"px;"
)
self
.
value_display
.
setFixedSize
(
width
+
border_radius
,
height
-
labelheight
+
border_radius
"background-color: "
+
self
.
NativeUI
.
colors
[
"foreground"
]
.
name
()
+
";"
"border: none;"
)
self
.
value_display
.
setFixedSize
(
width
,
height
-
labelheight
)
self
.
value_display
.
setFont
(
QtGui
.
QFont
(
"SansSerif"
,
20
))
# Layout
...
...
@@ -225,12 +220,12 @@ class TabMeasurements(Measurements_Block):
def
__init__
(
self
,
NativeUI
,
*
args
,
**
kwargs
):
measurements
=
[
(
"P
_plateau [cmH2
O]"
,
"plateau_pressure"
,
"cycle"
),
(
"P
<sub>Plateau</sub> [cmH<sub>2</sub>
O]"
,
"plateau_pressure"
,
"cycle"
),
(
"RR"
,
"respiratory_rate"
,
"cycle"
),
(
"FIO
2
[
%
]"
,
"fiO2_percent"
,
"cycle"
),
(
"FIO
<sub>2</sub>
[
%
]"
,
"fiO2_percent"
,
"cycle"
),
(
"VTE [mL]"
,
"exhaled_tidal_volume"
,
"cycle"
),
(
"MVE [
L/min
]"
,
"exhaled_minute_volume"
,
"cycle"
),
(
"PEEP [cmH
2
O]"
,
"peep"
,
"readback"
),
(
"MVE [
<sup>L</sup>/<sub>min</sub>
]"
,
"exhaled_minute_volume"
,
"cycle"
),
(
"PEEP [cmH
<sub>2</sub>
O]"
,
"peep"
,
"readback"
),
]
super
()
.
__init__
(
...
...
NativeUI/main_widgets/tab_spin_buttons.py
View file @
ddbcecc8
...
...
@@ -39,9 +39,11 @@ class SpinButton(QtWidgets.QFrame):
labelBgColour
=
"rgb(60,58,60)"
self
.
label
.
setStyleSheet
(
"font: 16pt; color:white; background-color:"
+
labelBgColour
+
"; border-radius:4px; border: 2px solid white "
"font-size: "
+
NativeUI
.
text_size
+
";"
"color:white;"
"background-color:"
+
labelBgColour
+
";"
"border-radius:4px;"
"border: 2px solid white"
)
self
.
label
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
self
.
layout
.
addWidget
(
self
.
label
)
...
...
@@ -53,27 +55,25 @@ class SpinButton(QtWidgets.QFrame):
# ) # override is defined in 'eventFilter'. ensures lineEdit responds to double mouse click
self
.
doubleSpin
.
lineEdit
()
.
setStyleSheet
(
"border:blue;"
)
boxStyleString
=
"""QDoubleSpinBox{
border:none;
background-color: black;
font: 16pt large 'Times New Roman';
height:60px;
}
QDoubleSpinBox[colour="0"] {
color:green;
}
QDoubleSpinBox[colour="1"] {
color:rgb(144,231,211);
}
QDoubleSpinBox[colour="2"] {
color:red;
}
"""
upButtonStyleString
=
"""QDoubleSpinBox::up-button{
height:30;
width:40;
} """
boxStyleString
=
(
"QDoubleSpinBox{"
" border:none;"
" background-color: black;"
" font: "
+
NativeUI
.
text_size
+
" large 'Times New Roman';"
" height: 60px;"
"}"
"QDoubleSpinBox[colour='0'] {"
" color:green;"
"}"
"QDoubleSpinBox[colour='1'] {"
" color:rgb(144,231,211);"
"}"
"QDoubleSpinBox[colour='2'] {"
" color:red;"
"}"
)
upButtonStyleString
=
"QDoubleSpinBox::up-button{"
"height:30;"
"width:40;"
"}"
# upButtonPressedStyleString = (
# "QDoubleSpinBox::up-button:pressed{ border:orange;}"
...
...
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