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
4fc26cf7
Commit
4fc26cf7
authored
Apr 12, 2021
by
Benjamin Mummery
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
size controls for personal display moved to NativeUI
parent
9803cdfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
6 deletions
+48
-6
ui_layout.py
NativeUI/ui_layout.py
+8
-2
ui_widgets.py
NativeUI/ui_widgets.py
+1
-1
personal_display_widget.py
NativeUI/widget_library/personal_display_widget.py
+39
-3
No files found.
NativeUI/ui_layout.py
View file @
4fc26cf7
...
...
@@ -100,13 +100,15 @@ class Layout:
self
.
layout_top_bar
(
[
self
.
widgets
.
tab_modeswitch
,
self
.
widgets
.
tab_personal
,
self
.
widgets
.
personal_display
,
self
.
widgets
.
battery_display
,
]
)
)
self
.
widgets
.
battery_display
.
set_size
(
400
,
self
.
top_bar_height
)
self
.
widgets
.
personal_display
.
set_size
(
None
,
self
.
top_bar_height
)
self
.
widgets
.
battery_display
.
setFont
(
self
.
NativeUI
.
text_font
)
self
.
widgets
.
personal_display
.
setFont
(
self
.
NativeUI
.
text_font
)
vlayout
.
addLayout
(
hlayout
)
return
vlayout
...
...
@@ -190,7 +192,11 @@ class Layout:
"""
page_alarms
=
SwitchableStackWidget
(
self
.
NativeUI
,
[
self
.
widgets
.
alarm_tab
,
self
.
widgets
.
alarm_table_tab
,
self
.
widgets
.
clinical_tab
],
[
self
.
widgets
.
alarm_tab
,
self
.
widgets
.
alarm_table_tab
,
self
.
widgets
.
clinical_tab
,
],
[
"List of Alarms"
,
"Alarm Table"
,
"Clinical Limits"
],
)
page_alarms
.
setFont
(
self
.
NativeUI
.
text_font
)
...
...
NativeUI/ui_widgets.py
View file @
4fc26cf7
...
...
@@ -51,7 +51,7 @@ class Widgets:
# Top bar widgets
self
.
tab_modeswitch
=
TabModeswitchButton
(
NativeUI
)
self
.
battery_display
=
BatteryDisplayWidget
(
NativeUI
)
self
.
tab_personal
=
PersonalDisplayWidget
(
NativeUI
)
self
.
personal_display
=
PersonalDisplayWidget
(
NativeUI
)
# Left Bar widgets
self
.
page_buttons
=
PageButtonsWidget
(
NativeUI
)
...
...
NativeUI/widget_library/personal_display_widget.py
View file @
4fc26cf7
...
...
@@ -12,7 +12,7 @@ __maintainer__ = "Tiago Sarmento"
__email__
=
"tiago.sarmento@stfc.ac.uk"
__status__
=
"Prototype"
from
PySide2
import
QtWidgets
,
QtCore
from
PySide2
import
QtWidgets
,
Qt
Gui
,
Qt
Core
class
PersonalDisplayWidget
(
QtWidgets
.
QWidget
):
...
...
@@ -25,10 +25,46 @@ class PersonalDisplayWidget(QtWidgets.QWidget):
self
.
info_label
=
QtWidgets
.
QLabel
(
"Person person, 55kg"
)
self
.
info_label
.
setStyleSheet
(
"font:"
+
NativeUI
.
text_size
+
";"
"color:"
+
NativeUI
.
colors
[
"page_foreground"
]
.
name
()
+
";"
# "font:" + NativeUI.text_size + ";"
"color:"
+
NativeUI
.
colors
[
"page_foreground"
]
.
name
()
+
";"
)
self
.
info_label
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
hlayout
=
QtWidgets
.
QHBoxLayout
()
hlayout
.
addWidget
(
self
.
info_label
)
self
.
setLayout
(
hlayout
)
def
set_size
(
self
,
x
:
int
,
y
:
int
)
->
int
:
"""
Set the size of the personal display widget.
A size can be left free to change by setting its value to None.
"""
x_set
,
y_set
=
False
,
False
if
x
is
not
None
:
x_set
=
True
if
y
is
not
None
:
y_set
=
True
if
x_set
and
y_set
:
self
.
setFixedSize
(
x
,
y
)
self
.
info_label
.
setFixedSize
(
x
,
y
)
elif
x_set
and
not
y_set
:
self
.
setFixedWidth
(
x
)
self
.
info_label
.
setFixedWidth
(
x
)
elif
y_set
and
not
x_set
:
self
.
setFixedHeight
(
y
)
self
.
info_label
.
setFixedHeight
(
y
)
else
:
raise
ValueError
(
"set_size called with no size information"
)
return
0
def
setFont
(
self
,
font
:
QtGui
.
QFont
)
->
int
:
"""
Overrides the existing setFont method in order to propogate the change to
subwidgets.
"""
self
.
info_label
.
setFont
(
font
)
return
0
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