From 74a8492e9bc5bb5650f554e69f6796e4931a98a5 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 15 Nov 2011 11:48:52 +1000 Subject: [PATCH] Fix: ExportCSV wasn't writing individual sessions --- exportcsv.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/exportcsv.cpp b/exportcsv.cpp index fbe32b6d..4793d88f 100644 --- a/exportcsv.cpp +++ b/exportcsv.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "SleepLib/profiles.h" #include "SleepLib/day.h" #include "exportcsv.h" @@ -194,15 +195,15 @@ void ExportCSV::on_exportButton_clicked() float ahi=sess->count(CPAP_Obstructive)+sess->count(CPAP_Hypopnea)+sess->count(CPAP_Apnea)+sess->count(CPAP_ClearAirway); ahi/=sess->hours(); data+=sep+QString::number(ahi,'f',3); - for (int i=0;icount(countlist.at(i))); - for (int i=0;iwavg(avglist.at(i))); - for (int i=0;ip90(p90list.at(i))); + for (int j=0;jcount(countlist.at(j))); + for (int j=0;jwavg(avglist.at(j))); + for (int j=0;jp90(p90list.at(j))); + data+=newline; + file.write(data.toAscii()); } - data+=newline; - file.write(data.toAscii()); } else if (ui->rb1_details->isChecked()) { QStringList all=countlist; all.append(avglist);