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
12a4d4a0
Commit
12a4d4a0
authored
Aug 12, 2020
by
Peter Švihra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added debug plotting
parent
690de648
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
ClientDebug.py
raspberry-dataserver/ClientDebug.py
+10
-3
No files found.
raspberry-dataserver/ClientDebug.py
View file @
12a4d4a0
...
...
@@ -38,6 +38,7 @@ class ClientPlots(QtWidgets.QMainWindow):
self
.
timestamp
=
list
(
el
*
(
-
1
)
for
el
in
range
(
self
.
history_length
))[::
-
1
]
self
.
PID_P
=
list
(
0
for
_
in
range
(
self
.
history_length
))
self
.
flow_calc
=
list
(
0
for
_
in
range
(
self
.
history_length
))
self
.
PID_I
=
list
(
0
for
_
in
range
(
self
.
history_length
))
self
.
PID_D
=
list
(
0
for
_
in
range
(
self
.
history_length
))
...
...
@@ -61,6 +62,7 @@ class ClientPlots(QtWidgets.QMainWindow):
self
.
pressurePlot
.
enableAutoRange
(
'y'
,
True
)
# Plot styles
self
.
line1
=
self
.
plot
(
self
.
flowPlot
,
self
.
timestamp
,
self
.
PID_D
,
"Flow"
,
"00F"
)
self
.
line1b
=
self
.
plot
(
self
.
flowPlot
,
self
.
timestamp
,
self
.
PID_D
,
"Flow Calculated"
,
"F00"
)
self
.
line2
=
self
.
plot
(
self
.
volumePlot
,
self
.
timestamp
,
self
.
PID_I
,
"Volume"
,
"707"
)
self
.
line3
=
self
.
plot
(
self
.
pressurePlot
,
self
.
timestamp
,
self
.
PID_P
,
"Airway Pressure"
,
"077"
)
...
...
@@ -87,8 +89,8 @@ class ClientPlots(QtWidgets.QMainWindow):
loop
.
close
()
def
plot
(
self
,
canvas
,
x
,
y
,
plotname
,
color
):
pen
=
pg
.
mkPen
(
color
=
color
,
width
=
3
)
return
canvas
.
plot
(
x
,
y
,
name
=
plotname
,
pen
=
pen
)
pen
=
pg
.
mkPen
(
color
=
color
,
width
=
3
)
return
canvas
.
plot
(
x
,
y
,
name
=
plotname
,
pen
=
pen
)
async
def
redraw
(
self
):
while
True
:
...
...
@@ -110,13 +112,16 @@ class ClientPlots(QtWidgets.QMainWindow):
self
.
statusBar
()
.
showMessage
(
f
"Got data for timestamp {payload['timestamp']}"
)
logging
.
info
(
"data acquired"
)
self
.
PID_D
.
append
(
payload
[
"flow"
])
self
.
flow_calc
.
append
(
payload
[
"flow_calc"
])
self
.
PID_I
.
append
(
payload
[
"volume"
])
self
.
PID_P
.
append
(
payload
[
"pressure_patient"
])
if
len
(
self
.
PID_D
)
>
self
.
history_length
:
self
.
PID_D
=
self
.
PID_D
[
1
:]
self
.
flow_calc
=
self
.
flow_calc
[
1
:]
self
.
PID_I
=
self
.
PID_I
[
1
:]
self
.
PID_P
=
self
.
PID_P
[
1
:]
self
.
line1
.
setData
(
self
.
timestamp
,
self
.
PID_D
)
self
.
line1b
.
setData
(
self
.
timestamp
,
self
.
flow_calc
)
self
.
line2
.
setData
(
self
.
timestamp
,
self
.
PID_I
)
self
.
line3
.
setData
(
self
.
timestamp
,
self
.
PID_P
)
elif
brtype
==
"READBACK"
:
...
...
@@ -131,11 +136,13 @@ class ClientPlots(QtWidgets.QMainWindow):
logging
.
info
(
"personal data acquired"
)
pass
elif
brtype
==
"ALARM"
:
logging
.
error
(
f
"received ALARM {payload}"
)
logging
.
debug
(
f
"received ALARM {payload}"
)
elif
brtype
==
"IVT"
:
pass
elif
brtype
==
"DEBUG"
:
pass
elif
brtype
==
"BATTERY"
:
pass
else
:
raise
KeyError
...
...
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