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
c7cdfc66
Unverified
Commit
c7cdfc66
authored
Apr 26, 2020
by
Adam Abed Abud
Committed by
GitHub
Apr 26, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #31 from dhcroft/master
Changed loop plots to AAMI recommended axis order
parents
bfce4f86
51a4ce62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
57 deletions
+53
-57
Chart-displayLoop.js
raspberry-backend/static/js/Chart-displayLoop.js
+53
-57
No files found.
raspberry-backend/static/js/Chart-displayLoop.js
View file @
c7cdfc66
...
...
@@ -13,34 +13,48 @@ function requestChartVar() {
success
:
function
(
point
)
{
if
(
chart_PV
.
data
.
datasets
[
1
].
data
.
length
>
100
){
chart_PV
.
data
.
datasets
[
1
].
data
.
shift
();
chart_
FV
.
data
.
datasets
[
1
].
data
.
shift
();
chart_
VF
.
data
.
datasets
[
1
].
data
.
shift
();
chart_PF
.
data
.
datasets
[
1
].
data
.
shift
();
}
// point labelled as: (stealing definitions from Chart-display.js)
// Pressure = pressure_buffer
// Flow = pressure_inhale ??
// Volume = temperature_buffer !!?
chart_PV
.
data
.
datasets
[
1
].
data
.
push
({
x
:
point
[
"temperature_buffer"
],
y
:
point
[
"pressure_buffer"
]});
chart_FV
.
data
.
datasets
[
1
].
data
.
push
({
x
:
point
[
"temperature_buffer"
],
y
:
point
[
"pressure_inhale"
]});
chart_PF
.
data
.
datasets
[
1
].
data
.
push
({
x
:
point
[
"pressure_inhale"
],
y
:
point
[
"pressure_buffer"
]});
chart_PV
.
data
.
datasets
[
0
].
data
=
[{
x
:
point
[
"temperature_buffer"
],
y
:
point
[
"pressure_buffer"
]}];
var
pressure
=
point
[
"pressure_buffer"
];
var
volume
=
point
[
"temperature_buffer"
];
var
flow
=
point
[
"pressure_inhale"
];
chart_FV
.
data
.
datasets
[
0
].
data
=
[{
x
:
point
[
"temperature_buffer"
],
y
:
point
[
"pressure_inhale"
]}];
// to quote the AAMI:
//For Pressure-Volume loops, the graph
//is required to use delivered volume on the vertical axis
//and airway pressure on the horizontal axis. Positive
//values should increase in up/right directions. Every
//breath resets the graph, setting the volume back at the
//origin.
chart_PF
.
data
.
datasets
[
0
].
data
=
[{
x
:
point
[
"pressure_inhale"
],
y
:
point
[
"pressure_buffer"
]}];
//For Flow-Volume loops the graph is required to use flow
//rate on the vertical axis and delivered volume on the
//horizontal axis. Positive values should increase in the
//up/right directions. Every breath resets the graph,
//setting the volume back at the origin. The document also
//suggests that there could be another version using
//exhalation flow, if possible.
// loops:
chart_PV
.
data
.
datasets
[
1
].
data
.
push
({
x
:
pressure
,
y
:
volume
});
chart_VF
.
data
.
datasets
[
1
].
data
.
push
({
x
:
volume
,
y
:
flow
});
chart_PF
.
data
.
datasets
[
1
].
data
.
push
({
x
:
pressure
,
y
:
flow
});
// current data:
chart_PV
.
data
.
datasets
[
0
].
data
=
[{
x
:
pressure
,
y
:
volume
}];
chart_VF
.
data
.
datasets
[
0
].
data
=
[{
x
:
volume
,
y
:
flow
}];
chart_PF
.
data
.
datasets
[
0
].
data
=
[{
x
:
pressure
,
y
:
flow
}];
// now run chart updates
chart_PV
.
update
();
chart_
FV
.
update
();
chart_
VF
.
update
();
chart_PF
.
update
();
console
.
info
(
"chart_PV.data"
,
chart_PV
.
data
);
},
},
cache
:
false
});
setTimeout
(
requestChartVar
,
200
);
...
...
@@ -53,55 +67,43 @@ $(document).ready(function() {
chart_PV
=
new
Chart
(
ctx_PV
,
{
type
:
'scatter'
,
data
:
{
datasets
:
[{
data
:
[],
label
:
"Pressure
:Volme
(current)"
,
label
:
"Pressure
(x) [mbar]: Volume (y) [ml]
(current)"
,
borderColor
:
"rgb(128,0,0)"
,
pointBackgroundColor
:
"rgb(128,0,0)"
,
fill
:
true
},
{
data
:
[],
label
:
"Loop
Pressure:Volme (last
20s)"
,
label
:
"Loop
(
20s)"
,
borderColor
:
"rgb(51,99,255)"
,
pointBackgroundColor
:
"rgb(51,99,255)"
,
fill
:
false
},
]},
options
:
{
elements
:
{
point
:
{
radius
:
5
}},
scales
:
{
xAxes
:
[{
type
:
'linear'
,
position
:
'bottom'
,
lablelString
:
'temperature_buffer??'
,
display
:
true
,
ticks
:
{
min
:
-
1000
,
max
:
1500
,
stepSize
:
500
,
fontSize
:
25
}}],
yAxes
:
[{
type
:
'linear'
,
position
:
'left'
,
lablelString
:
'pressure_buffer??'
,
display
:
true
,
scales
:
{
xAxes
:
[{
display
:
true
,
ticks
:
{
min
:
0
,
max
:
25
,
stepSize
:
5
,
fontSize
:
25
}}]}}
stepSize
:
5
,
fontSize
:
25
}}],
yAxes
:
[{
display
:
true
,
ticks
:
{
min
:
-
1000
,
max
:
1500
,
stepSize
:
500
,
fontSize
:
25
}}]}}
});
var
ctx_
FV
=
document
.
getElementById
(
'flow_volume_chart'
);
chart_
FV
=
new
Chart
(
ctx_FV
,
{
var
ctx_
VF
=
document
.
getElementById
(
'flow_volume_chart'
);
chart_
VF
=
new
Chart
(
ctx_VF
,
{
type
:
'scatter'
,
data
:
{
datasets
:
[{
data
:
[],
label
:
"
Flow:Volme
(current)"
,
label
:
"
Volume (x) [ml]: Flow (y) [ml/min]
(current)"
,
borderColor
:
"rgb(128,0,0)"
,
pointBackgroundColor
:
"rgb(128,0,0)"
,
fill
:
true
},
{
data
:
[],
label
:
"Loop
Flow:Volme (last
20s)"
,
label
:
"Loop
(
20s)"
,
borderColor
:
"rgb(51,99,255)"
,
pointBackgroundColor
:
"rgb(51,99,255)"
,
fill
:
false
}]}
,
options
:
{
elements
:
{
point
:
{
radius
:
5
}},
scales
:
{
xAxes
:
[{
type
:
'linear'
,
position
:
'bottom'
,
lablelString
:
'temperature_buffer??'
,
display
:
true
,
ticks
:
{
min
:
-
1000
,
max
:
1500
,
stepSize
:
500
,
fontSize
:
25
}}],
yAxes
:
[{
type
:
'linear'
,
position
:
'left'
,
lablelString
:
'pressure_inhale??'
,
display
:
true
,
scales
:
{
xAxes
:
[{
display
:
true
,
ticks
:
{
min
:
-
1000
,
max
:
1500
,
stepSize
:
500
,
fontSize
:
25
}}],
yAxes
:
[{
display
:
true
,
ticks
:
{
min
:
0
,
max
:
300
,
stepSize
:
100
,
fontSize
:
25
}}]}}
});
...
...
@@ -110,28 +112,22 @@ $(document).ready(function() {
chart_PF
=
new
Chart
(
ctx_PF
,
{
type
:
'scatter'
,
data
:
{
datasets
:
[{
data
:
[],
label
:
"Pressure
:Flow
(current)"
,
label
:
"Pressure
(x) [mbar]: Flow (y) [ml/min]
(current)"
,
borderColor
:
"rgb(128,0,0)"
,
pointBackgroundColor
:
"rgb(128,0,0)"
,
fill
:
true
},
{
data
:
[],
label
:
"Loop
Pressure:Flow (last
20s)"
,
label
:
"Loop
(
20s)"
,
borderColor
:
"rgb(51,99,255)"
,
pointBackgroundColor
:
"rgb(51,99,255)"
,
fill
:
false
}]}
,
options
:
{
elements
:
{
point
:
{
radius
:
5
,
fill
:
true
}},
scales
:
{
xAxes
:
[{
type
:
'linear'
,
position
:
'bottom'
,
lablelString
:
'pressure_inhale??'
,
display
:
true
,
scales
:
{
xAxes
:
[{
display
:
true
,
ticks
:
{
min
:
0
,
max
:
25
,
stepSize
:
5
,
fontSize
:
25
}}]
,
yAxes
:
[{
display
:
true
,
ticks
:
{
min
:
0
,
max
:
300
,
stepSize
:
100
,
fontSize
:
25
}}],
yAxes
:
[{
type
:
'linear'
,
position
:
'left'
,
lablelString
:
'pressure_buffer??'
,
display
:
true
,
ticks
:
{
min
:
0
,
max
:
25
,
stepSize
:
5
,
fontSize
:
25
}}]}}
stepSize
:
100
,
fontSize
:
25
}}]}}
});
});
...
...
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