Summary fixes related to Oximeter day data

This commit is contained in:
Mark Watkins 2011-06-06 15:17:23 +10:00
parent a433aba6b0
commit 4c74c58394
6 changed files with 27 additions and 25 deletions

View File

@ -8331,14 +8331,14 @@
"sleeplib/profiles.h"
"sleeplib/machine_loader.h"
1307332921 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
1307337296 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
<wx/settings.h>
<wx/dcbuffer.h>
<wx/log.h>
"graph.h"
"sleeplib/profiles.h"
1307245704 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/binary_file.cpp
1307336656 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/binary_file.cpp
<wx/filename.h>
"binary_file.h"
@ -8346,7 +8346,7 @@
<wx/ffile.h>
<wx/utils.h>
1307289238 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/machine.cpp
1307336464 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/machine.cpp
<tr1/random>
<wx/colour.h>
<wx/log.h>
@ -8379,7 +8379,7 @@
"machine_loader.h"
"tinyxml/tinyxml.h"
1307273388 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.cpp
1307336462 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.cpp
<wx/dir.h>
<wx/filename.h>
<wx/ffile.h>
@ -8412,7 +8412,7 @@
1307287644 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h
"sleeplib/machine_loader.h"
1307334532 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
1307336371 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
<wx/log.h>
<wx/progdlg.h>
"cms50_loader.h"

View File

@ -428,7 +428,7 @@ double gGraphWindow::MinX()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->MinX();
@ -451,7 +451,7 @@ double gGraphWindow::MaxX()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->MaxX();
@ -474,7 +474,7 @@ double gGraphWindow::MinY()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->MinY();
@ -496,7 +496,7 @@ double gGraphWindow::MaxY()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->MaxY();
@ -519,7 +519,7 @@ double gGraphWindow::RealMinX()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->RealMinX();
@ -541,7 +541,7 @@ double gGraphWindow::RealMaxX()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->RealMaxX();
@ -563,7 +563,7 @@ double gGraphWindow::RealMinY()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->RealMinY();
@ -585,7 +585,7 @@ double gGraphWindow::RealMaxY()
//f=false;
bool first=true;
double val,tmp;
double val=0,tmp;
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) {
val=(*l)->RealMaxY();
@ -1793,7 +1793,7 @@ void TAPData::Reload(Day *day)
bool first;
wxDateTime last;
int lastval,val;
int lastval=0,val;
int field=0;
@ -1805,7 +1805,7 @@ void TAPData::Reload(Day *day)
val=ev[field]*10.0;
if (field > ev.fields()) throw BoundsError();
if (first) {
first=false;
first=false; // only bother setting lastval (below) this time.
} else {
wxTimeSpan d=ev.time()-last;
if (lastval>max_slots) throw BoundsError();
@ -1971,8 +1971,10 @@ void HistoryData::Reload(Day *day)
vector<Day *> & daylist=profile->daylist[date];
for (vector<Day *>::iterator dd=daylist.begin(); dd!=daylist.end(); dd++) { // average any multiple data sets
Day *d=(*dd);
y=Calc(d);
z++;
if (d->machine_type()==MT_CPAP) {
y=Calc(d);
z++;
}
}
if (!z) continue;
if (z>1) y /= z;

View File

@ -175,7 +175,7 @@ bool BinaryFile::Unpack(float & data)
for (int i=0; i<4; i++) {
b[3-i]=buffer[pos+i];
}
data=*((float *)(b));
data=*((float *)b);
pos+=4;
}
@ -192,7 +192,7 @@ bool BinaryFile::Unpack(double & data)
for (int i=0; i<8; i++) {
b[7-i]=buffer[pos+i];
}
data=*((double *)(b));
data=*((double *)b);
pos+=8;
}

View File

@ -140,7 +140,7 @@ bool CMS50Loader::OpenSPORFile(wxString path,Machine *mach,Profile *profile)
sess->AddEvent(new Event(date,OXI_Pulse,&last_pulse,1));
sess->AddEvent(new Event(date,OXI_SPO2,&last_spo2,1));
EventDataType PMin,PMax=0,SMin,SMax=0,PAvg=0,SAvg=0;
EventDataType PMin=0,PMax=0,SMin=0,SMax=0,PAvg=0,SAvg=0;
int PCnt=0,SCnt=0;
//wxDateTime
wxDateTime tt=date;

View File

@ -753,7 +753,7 @@ double Session::min_event_field(MachineCode mc,int field)
if (events.find(mc)==events.end()) return 0;
bool first=true;
double min;
double min=0;
vector<Event *>::iterator i;
for (i=events[mc].begin(); i!=events[mc].end(); i++) {
if (field>(*i)->e_fields) throw BoundsError();
@ -771,7 +771,7 @@ double Session::max_event_field(MachineCode mc,int field)
if (events.find(mc)==events.end()) return 0;
bool first=true;
double max;
double max=0;
vector<Event *>::iterator i;
for (i=events[mc].begin(); i!=events[mc].end(); i++) {
if (field>(*i)->e_fields) throw BoundsError();
@ -853,7 +853,7 @@ double Session::weighted_avg_event_field(MachineCode mc,int field)
bool first=true;
wxDateTime last;
int lastval,val;
int lastval=0,val;
const int max_slots=2600;
wxTimeSpan vtime[max_slots]=wxTimeSpan(0);
@ -1158,7 +1158,7 @@ bool Session::StoreEvents(wxString filename)
}
bool first;
float tf;
time_t last,eventtime,delta;
time_t last=0,eventtime,delta;
for (i=events.begin(); i!=events.end(); i++) {
first=true;

View File

@ -712,7 +712,7 @@ bool PRS1Loader::OpenWaveforms(Session *session,wxString filename)
// Convert to SampleFormat
SampleFormat *data=new SampleFormat [samples];
SampleFormat min,max;
SampleFormat min=0,max=0;
bool first=true;
SampleFormat c;