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
2fe62575
Commit
2fe62575
authored
Feb 12, 2021
by
Emigdio Jimenez
Browse files
Options
Browse Files
Download
Plain Diff
test_compliance
parents
999734ed
5cbe247f
Pipeline
#913
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
BreathingLoop.cpp
arduino/hev_prototype_v1/src/BreathingLoop.cpp
+21
-5
No files found.
arduino/hev_prototype_v1/src/BreathingLoop.cpp
View file @
2fe62575
...
...
@@ -281,12 +281,12 @@ void BreathingLoop::updateCycleReadings()
uint32_t
tnow
=
static_cast
<
uint32_t
>
(
millis
());
_cycle_index
=
(
_cycle_index
==
CYCLE_AVG_READINGS
-
1
)
?
0
:
_cycle_index
+
1
;
_cycle_readings
.
timestamp
=
tnow
;
_cycle_readings
.
fiO2_percent
=
_cycle_readings
.
lung_compliance
;
//_readings_avgs.o2_percent;// FIXME
_cycle_readings
.
fiO2_percent
=
_cycle_readings
.
lung_compliance
;
//_readings_avgs.o2_percent;// FIXME
_running_inhale_minute_volume
[
_cycle_index
]
=
_volume_inhale
;
_running_exhale_minute_volume
[
_cycle_index
]
=
_volume_exhale
;
//
logMsg(" I, E "+String(_volume_inhale)+ " "+String(_volume_exhale));
logMsg
(
" I, E "
+
String
(
_volume_inhale
)
+
" "
+
String
(
_volume_exhale
));
_total_cycle_duration
[
_cycle_index
]
=
(
_measured_durations
.
buff_pre_inhale
+
_measured_durations
.
inhale
...
...
@@ -304,6 +304,13 @@ void BreathingLoop::updateCycleReadings()
// inh_sum += _inhale_cycle_duration[i];
// exh_sum += _exhale_cycle_duration[i];
}
logMsg
(
"mv_sum: "
+
String
(
mv_sum
));
logMsg
(
"mvi_sum: "
+
String
(
mvi_sum
));
logMsg
(
"mve_sum: "
+
String
(
mve_sum
));
logMsg
(
"tot_sum: "
+
String
(
tot_sum
));
logMsg
(
"CYCLE_AVG_READINGS: "
+
String
(
CYCLE_AVG_READINGS
));
_airway_pressure
=
_ap_readings_N
==
0
?
0
:
_sum_airway_pressure
/
_ap_readings_N
;
_cycle_readings
.
respiratory_rate
=
60000.0
/
(
tot_sum
/
CYCLE_AVG_READINGS
);
...
...
@@ -313,8 +320,11 @@ void BreathingLoop::updateCycleReadings()
_cycle_readings
.
tidal_volume
=
mv_sum
/
CYCLE_AVG_READINGS
;
_cycle_readings
.
inhaled_tidal_volume
=
mvi_sum
/
CYCLE_AVG_READINGS
;
_cycle_readings
.
exhaled_tidal_volume
=
mve_sum
/
CYCLE_AVG_READINGS
;
_cycle_readings
.
lung_compliance
=
_cycle_readings
.
tidal_volume
/
(
_cycle_readings
.
peak_inspiratory_pressure
-
_peep
);
//_cycle_readings.peak_inspiratory_pressure = _readings_avgs.pressure_inhale;
_cycle_readings
.
static_compliance
=
_cycle_readings
.
tidal_volume
/
(
_cycle_readings
.
plateau_pressure
-
_peep
);
// _cycle_readings.plateau_pressure = _readings_avgs.pressure_patient;
_cycle_readings
.
lung_compliance
=
_cycle_readings
.
tidal_volume
/
(
_cycle_readings
.
peak_inspiratory_pressure
-
_peep
);
_cycle_readings
.
static_compliance
=
_cycle_readings
.
tidal_volume
/
(
_cycle_readings
.
plateau_pressure
-
_peep
);
//_cycle_readings.dynamic_compliance = _cycle_readings.inhaled_tidal_volume / (_cycle_readings.peak_inspiratory_pressure -_peep);
_cycle_readings
.
mean_airway_pressure
=
_airway_pressure
;
_cycle_readings
.
inhalation_pressure
=
_airway_pressure
;
_cycle_readings
.
apnea_index
+=
(
_apnea_event
==
true
)
?
1
:
0
;
...
...
@@ -325,6 +335,12 @@ void BreathingLoop::updateCycleReadings()
+
_max_exhale_time
;
// apnea time = time from breath start to maximum time allow for breath
_cycle_readings
.
mandatory_breath
=
_mandatory_inhale
&
_mandatory_exhale
;
logMsg
(
"_cycle_readings.tidal_volume: "
+
String
(
_cycle_readings
.
tidal_volume
));
logMsg
(
"_cycle_readings.inhaled_tidal_volume: "
+
String
(
_cycle_readings
.
inhaled_tidal_volume
));
logMsg
(
"_cycle_readings.exhaled_tidal_volume: "
+
String
(
_cycle_readings
.
exhaled_tidal_volume
));
logMsg
(
"_cycle_readings.peak_inspiratory_pressure: "
+
String
(
_cycle_readings
.
peak_inspiratory_pressure
));
logMsg
(
"_peep: "
+
String
(
_peep
));
_sum_airway_pressure
=
0
;
_ap_readings_N
=
0
;
_volume_inhale
=
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