From 9566d23ae88acfe238d8f7d45cda5b01f3939638 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 9 Jan 2012 14:23:15 +1000 Subject: [PATCH] Nothing slips past Jimbo.. :) --- SleepLib/calcs.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/SleepLib/calcs.cpp b/SleepLib/calcs.cpp index 524dab6e..eafaca1d 100644 --- a/SleepLib/calcs.cpp +++ b/SleepLib/calcs.cpp @@ -522,24 +522,26 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool // Respiratory Rate post filtering ///////////////////////////////////////////////////////////////////// - RR->setGain(0.02); - RR->setMin(minrr); - RR->setMax(maxrr); - RR->setFirst(start); - RR->setLast(et); - RR->setCount(rr_count); - + if (calcResp) { + RR->setGain(0.02); + RR->setMin(minrr); + RR->setMax(maxrr); + RR->setFirst(start); + RR->setLast(et); + RR->setCount(rr_count); + } ///////////////////////////////////////////////////////////////////// // Tidal Volume post filtering ///////////////////////////////////////////////////////////////////// - TV->setGain(0.1); - TV->setMin(mintv); - TV->setMax(maxtv); - TV->setFirst(start); - TV->setLast(et); - TV->setCount(tv_count); - + if (calcTv) { + TV->setGain(0.1); + TV->setMin(mintv); + TV->setMax(maxtv); + TV->setFirst(start); + TV->setLast(et); + TV->setCount(tv_count); + } }