Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HEV - High Energy Ventilator
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
HEV - High Energy Ventilator
Commits
c7cdfc66
Unverified
Commit
c7cdfc66
authored
4 years ago
by
Adam Abed Abud
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #31 from dhcroft/master
Changed loop plots to AAMI recommended axis order
parents
bfce4f86
51a4ce62
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
raspberry-backend/static/js/Chart-displayLoop.js
+53
-57
53 additions, 57 deletions
raspberry-backend/static/js/Chart-displayLoop.js
with
53 additions
and
57 deletions
raspberry-backend/static/js/Chart-displayLoop.js
+
53
−
57
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_
F
V
.
data
.
datasets
[
1
].
data
.
shift
();
chart_V
F
.
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_
F
V
.
update
();
chart_V
F
.
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]:
Vol
u
me
(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_
F
V
=
document
.
getElementById
(
'
flow_volume_chart
'
);
chart_
F
V
=
new
Chart
(
ctx_
F
V
,
{
var
ctx_V
F
=
document
.
getElementById
(
'
flow_volume_chart
'
);
chart_V
F
=
new
Chart
(
ctx_V
F
,
{
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
}}]}}
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment