diff --git a/SleepLib/loader_plugins/prs1_loader.cpp b/SleepLib/loader_plugins/prs1_loader.cpp index 532d6413..6f117a83 100644 --- a/SleepLib/loader_plugins/prs1_loader.cpp +++ b/SleepLib/loader_plugins/prs1_loader.cpp @@ -597,7 +597,7 @@ bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *b CPAP_LeakTotal, PRS1_12 }; - int ncodes=sizeof(Codes)/sizeof(QString); + int ncodes=sizeof(Codes)/sizeof(ChannelID); EventList * Code[0x20]={NULL}; EventList * OA=session->AddEventList(CPAP_Obstructive, EVL_Event); diff --git a/SleepyHeadQT.pro b/SleepyHeadQT.pro index db35760c..25e022dd 100644 --- a/SleepyHeadQT.pro +++ b/SleepyHeadQT.pro @@ -31,10 +31,10 @@ TEMPLATE = app #exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --symbolic-full-name --abbrev-ref HEAD)\\\" exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\" -else:DEFINES += GIT_BRANCH=\\\"NOT BUILT FROM GIT SOURCE\\\" +else:DEFINES += GIT_BRANCH=\\\"UNKNOWN\\\" exists(.git):DEFINES += GIT_REVISION=\\\"$$system(git rev-parse HEAD)\\\" -else:DEFINES += GIT_BRANCH=\\\"UNKNOWN\\\" +else:DEFINES += GIT_REVISION=\\\"UNKNOWN\\\" SOURCES += main.cpp\ SleepLib/machine.cpp \ diff --git a/common_gui.cpp b/common_gui.cpp index 0f38ce8e..36b0b9e4 100644 --- a/common_gui.cpp +++ b/common_gui.cpp @@ -6,6 +6,7 @@ #include "common_gui.h" #include "qglobal.h" +#include #ifdef Q_WS_WIN32 #include "windows.h" diff --git a/mainwindow.cpp b/mainwindow.cpp index 4c9344e0..4ff278a4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -446,6 +446,20 @@ EventDataType calcAHI(QDate start, QDate end) return val; } +EventDataType calcFL(QDate start, QDate end) +{ + EventDataType val=(p_profile->calcCount(CPAP_FlowLimit,MT_CPAP,start,end)); + EventDataType hours=p_profile->calcHours(MT_CPAP,start,end); + + if (hours>0) + val/=hours; + else + val=0; + + return val; +} + + struct RXChange { RXChange() { highlight=0; machine=NULL; } @@ -454,6 +468,7 @@ struct RXChange last=copy.last; days=copy.days; ahi=copy.ahi; + fl=copy.fl; mode=copy.mode; min=copy.min; max=copy.max; @@ -470,6 +485,7 @@ struct RXChange QDate last; int days; EventDataType ahi; + EventDataType fl; CPAPMode mode; EventDataType min; EventDataType max; @@ -940,7 +956,7 @@ void MainWindow::on_summaryButton_clicked() } else { min=day->settings_min(CPAP_Pressure); } - if ((mode!=cmode) || (min!=cmin) || (max!=cmax) || (maxhi!=cmaxhi) || (mach!=lastmach) || (prelief!=lastpr)) { + if ((mode!=cmode) || (min!=cmin) || (max!=cmax) || (mach!=lastmach) || (prelset!=lastprelset)) { if ((cmode!=MODE_UNKNOWN) && (lastmach!=NULL)) { first=date.addDays(1); int days=PROFILE.countDays(MT_CPAP,first,last); @@ -949,6 +965,7 @@ void MainWindow::on_summaryButton_clicked() rx.last=last; rx.days=days; rx.ahi=calcAHI(first,last); + rx.fl=calcFL(first,last); rx.mode=cmode; rx.min=cmin; rx.max=cmax; @@ -998,6 +1015,7 @@ void MainWindow::on_summaryButton_clicked() rx.last=last; rx.days=days; rx.ahi=calcAHI(first,last); + rx.fl=calcFL(first,last); rx.mode=mode; rx.min=min; rx.max=max; @@ -1181,11 +1199,12 @@ void MainWindow::on_summaryButton_clicked() .arg(tr("Pressure")); } QString tooltip; - html+=QString("%1%2%3%4%5%6%7%8") + html+=QString("%1%2%3%4%5%6%7%8%9") .arg(tr("First")) .arg(tr("Last")) .arg(tr("Days")) .arg(ahitxt) + .arg(tr("FL")) .arg(tr("Machine")) .arg(tr("Mode")) .arg(tr("Pr. Rel.")) @@ -1261,13 +1280,14 @@ void MainWindow::on_summaryButton_clicked() tooltipshow=QString("tooltip.show(\"%1\");").arg(tooltip); tooltiphide="tooltip.hide();"; } - html+=QString("%3%4%5%6%7%8%9%10%11") + html+=QString("%3%4%5%6%7%8%9%10%11%12") .arg(rx.first.toString(Qt::ISODate)) .arg(rx.last.toString(Qt::ISODate)) .arg(rx.first.toString(Qt::SystemLocaleShortDate)) .arg(rx.last.toString(Qt::SystemLocaleShortDate)) .arg(rx.days) .arg(rx.ahi,0,'f',decimals) + .arg(rx.fl,0,'f',decimals) .arg(rx.machine->GetClass()) .arg(schema::channel[CPAP_Mode].option(int(rx.mode)-1)) .arg(presrel) diff --git a/overview.cpp b/overview.cpp index 87508347..83973e35 100644 --- a/overview.cpp +++ b/overview.cpp @@ -98,6 +98,8 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : UC=createGraph(tr("Usage"),tr("Usage\n(hours)")); + FL=createGraph(tr("Flow Limit"),tr("Flow Limit")); + float percentile=PROFILE.general->prefCalcPercentile()/100.0; int mididx=PROFILE.general->prefCalcMiddle(); SummaryType ST_mid; @@ -171,6 +173,10 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : uc->addSlice(NoChannel,QColor("green"),ST_HOURS); UC->AddLayer(uc); + fl=new SummaryChart(tr("FL"),GT_BAR); + fl->addSlice(CPAP_FlowLimit,QColor("brown"),ST_CPH); + FL->AddLayer(fl); + us=new SummaryChart(STR_UNIT_Hours,GT_SESSIONS); us->addSlice(NoChannel,QColor("dark blue"),ST_HOURS); us->addSlice(NoChannel,QColor("blue"),ST_SESSIONS); diff --git a/overview.h b/overview.h index 678bfc4d..3c046443 100644 --- a/overview.h +++ b/overview.h @@ -58,8 +58,8 @@ public: \param QString units The units of measurements to show in the popup */ gGraph * createGraph(QString name,QString units="",YTickerType yttype=YT_Number); - gGraph *AHI, *AHIHR, *UC, *US, *PR,*LK,*NPB,*SET,*SES,*RR,*MV,*TV,*PTB,*PULSE,*SPO2,*WEIGHT,*ZOMBIE, *BMI, *TGMV, *TOTLK; - SummaryChart *bc,*uc, *us, *pr,*lk,*npb,*set,*ses,*rr,*mv,*tv,*ptb,*pulse,*spo2,*weight,*zombie, *bmi, *ahihr, *tgmv, *totlk; + gGraph *AHI, *AHIHR, *UC, *FL, *US, *PR,*LK,*NPB,*SET,*SES,*RR,*MV,*TV,*PTB,*PULSE,*SPO2,*WEIGHT,*ZOMBIE, *BMI, *TGMV, *TOTLK; + SummaryChart *bc,*uc, *fl, *us, *pr,*lk,*npb,*set,*ses,*rr,*mv,*tv,*ptb,*pulse,*spo2,*weight,*zombie, *bmi, *ahihr, *tgmv, *totlk; //! \breif List of SummaryCharts shown on the overview page QVector OverviewCharts; diff --git a/quazip/ioapi.h b/quazip/ioapi.h index 716dd4b5..c6b71d4d 100644 --- a/quazip/ioapi.h +++ b/quazip/ioapi.h @@ -11,6 +11,7 @@ #ifndef _ZLIBIOAPI_H #define _ZLIBIOAPI_H +#define OF(x) x #define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_END (2) diff --git a/quazip/unzip.h b/quazip/unzip.h index 8ef4541d..49929728 100644 --- a/quazip/unzip.h +++ b/quazip/unzip.h @@ -68,6 +68,7 @@ typedef unzFile__ *unzFile; typedef voidp unzFile; #endif +#define OF(x) x #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) diff --git a/quazip/zip.h b/quazip/zip.h index 31c80bc4..053775f0 100644 --- a/quazip/zip.h +++ b/quazip/zip.h @@ -69,6 +69,8 @@ typedef zipFile__ *zipFile; typedef voidp zipFile; #endif +#define OF(x) x + #define ZIP_OK (0) #define ZIP_EOF (0) #define ZIP_ERRNO (Z_ERRNO)