mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
MSVC Build fixes
This commit is contained in:
parent
e3f2e0c886
commit
26b2e4179a
@ -715,12 +715,12 @@ void gGraphView::DrawTextQue(QPainter &painter)
|
|||||||
|
|
||||||
pm=QPixmap(ww, hh);
|
pm=QPixmap(ww, hh);
|
||||||
|
|
||||||
int aaw1 = pm.width();
|
//int aaw1 = pm.width();
|
||||||
pm.fill(Qt::transparent);
|
pm.fill(Qt::transparent);
|
||||||
|
|
||||||
QPainter imgpainter(&pm);
|
QPainter imgpainter(&pm);
|
||||||
|
|
||||||
int aaw2 = pm.width();
|
//int aaw2 = pm.width();
|
||||||
imgpainter.setPen(q.color);
|
imgpainter.setPen(q.color);
|
||||||
|
|
||||||
imgpainter.setFont(*q.font);
|
imgpainter.setFont(*q.font);
|
||||||
@ -729,11 +729,11 @@ void gGraphView::DrawTextQue(QPainter &painter)
|
|||||||
imgpainter.setRenderHint(QPainter::TextAntialiasing, true);
|
imgpainter.setRenderHint(QPainter::TextAntialiasing, true);
|
||||||
QRectF rect(0,0, ww, hh);
|
QRectF rect(0,0, ww, hh);
|
||||||
imgpainter.drawText(rect, q.flags, q.text);
|
imgpainter.drawText(rect, q.flags, q.text);
|
||||||
int aaw3 = pm.width();
|
//int aaw3 = pm.width();
|
||||||
imgpainter.end();
|
imgpainter.end();
|
||||||
|
|
||||||
QPixmapCache::insert(hstr, pm);
|
QPixmapCache::insert(hstr, pm);
|
||||||
int aaw4 = pm.width();
|
//int aaw4 = pm.width();
|
||||||
strings_drawn_this_frame++;
|
strings_drawn_this_frame++;
|
||||||
} else {
|
} else {
|
||||||
//cached
|
//cached
|
||||||
|
@ -102,7 +102,7 @@ void gDailySummary::SetDay(Day *day)
|
|||||||
|
|
||||||
ahi = day->calcAHI();
|
ahi = day->calcAHI();
|
||||||
|
|
||||||
CPAPMode mode = (CPAPMode)round(day->settings_wavg(CPAP_Mode));
|
CPAPMode mode = (CPAPMode)(int)round(day->settings_wavg(CPAP_Mode));
|
||||||
|
|
||||||
info.append(QObject::tr("%1: %2").arg(STR_TR_AHI).arg(day->calcAHI(),0,'f',2));
|
info.append(QObject::tr("%1: %2").arg(STR_TR_AHI).arg(day->calcAHI(),0,'f',2));
|
||||||
info_background.append(QColor("orange"));
|
info_background.append(QColor("orange"));
|
||||||
|
@ -16,9 +16,6 @@
|
|||||||
#include "calcs.h"
|
#include "calcs.h"
|
||||||
#include "profiles.h"
|
#include "profiles.h"
|
||||||
|
|
||||||
extern double round(double number);
|
|
||||||
|
|
||||||
|
|
||||||
bool SearchEvent(Session * session, ChannelID code, qint64 time, int dur, bool update=true)
|
bool SearchEvent(Session * session, ChannelID code, qint64 time, int dur, bool update=true)
|
||||||
{
|
{
|
||||||
qint64 t, start;
|
qint64 t, start;
|
||||||
|
@ -94,7 +94,7 @@ const QString EventsOffset = "TID_Events_Offset";
|
|||||||
|
|
||||||
void HighPass(char * data, int samples, float cutoff, float dt)
|
void HighPass(char * data, int samples, float cutoff, float dt)
|
||||||
{
|
{
|
||||||
float Y[samples];
|
float *Y = new float [samples];
|
||||||
for (int i=0; i < samples; ++i) Y[i] = 0.0f;
|
for (int i=0; i < samples; ++i) Y[i] = 0.0f;
|
||||||
|
|
||||||
Y[0] = ((unsigned char *)data)[0] ;
|
Y[0] = ((unsigned char *)data)[0] ;
|
||||||
@ -111,7 +111,7 @@ void HighPass(char * data, int samples, float cutoff, float dt)
|
|||||||
for (int i=0; i< samples; ++i) {
|
for (int i=0; i< samples; ++i) {
|
||||||
data[i] = Y[i];
|
data[i] = Y[i];
|
||||||
}
|
}
|
||||||
|
delete Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WeinmannLoader::Open(QString path)
|
int WeinmannLoader::Open(QString path)
|
||||||
@ -146,7 +146,7 @@ int WeinmannLoader::Open(QString path)
|
|||||||
|
|
||||||
int size = WCD_Pin_Offset - WeekComplianceOffset;
|
int size = WCD_Pin_Offset - WeekComplianceOffset;
|
||||||
|
|
||||||
unsigned char weekco[size];
|
quint8 * weekco = new quint8 [size];
|
||||||
memset(weekco, 0, size);
|
memset(weekco, 0, size);
|
||||||
wmdata.seek(WeekComplianceOffset);
|
wmdata.seek(WeekComplianceOffset);
|
||||||
wmdata.read((char *)weekco, size);
|
wmdata.read((char *)weekco, size);
|
||||||
@ -172,6 +172,8 @@ int WeinmannLoader::Open(QString path)
|
|||||||
p+=0x84;
|
p+=0x84;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] weekco;
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Read Day Compliance Information....
|
// Read Day Compliance Information....
|
||||||
@ -180,7 +182,7 @@ int WeinmannLoader::Open(QString path)
|
|||||||
int comp_end = index[FlowOffset];
|
int comp_end = index[FlowOffset];
|
||||||
int comp_size = comp_end - comp_start;
|
int comp_size = comp_end - comp_start;
|
||||||
|
|
||||||
unsigned char comp[comp_size];
|
quint8 * comp = new quint8 [comp_size];
|
||||||
memset((char *)comp, 0, comp_size);
|
memset((char *)comp, 0, comp_size);
|
||||||
|
|
||||||
wmdata.seek(comp_start);
|
wmdata.seek(comp_start);
|
||||||
@ -248,6 +250,8 @@ int WeinmannLoader::Open(QString path)
|
|||||||
p += 0xd6;
|
p += 0xd6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] comp;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Read Flow Waveform....
|
// Read Flow Waveform....
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -258,14 +262,14 @@ int WeinmannLoader::Open(QString path)
|
|||||||
wmdata.seek(flowstart);
|
wmdata.seek(flowstart);
|
||||||
|
|
||||||
int flowsize = flowend - flowstart;
|
int flowsize = flowend - flowstart;
|
||||||
char data[flowsize];
|
char * data = new char [flowsize];
|
||||||
memset((char *)data, 0, flowsize);
|
memset((char *)data, 0, flowsize);
|
||||||
wmdata.read((char *)data, flowsize);
|
wmdata.read((char *)data, flowsize);
|
||||||
|
|
||||||
float dt = 1.0 / (1000.0 / flow_sample_duration); // samples per second
|
float dt = 1.0 / (1000.0 / flow_sample_duration); // samples per second
|
||||||
|
|
||||||
// Centre Waveform using High Pass Filter
|
// Centre Waveform using High Pass Filter
|
||||||
HighPass(data, flowsize, 0.1, dt);
|
HighPass(data, flowsize, 0.1f, dt);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Read Status....
|
// Read Status....
|
||||||
@ -275,7 +279,7 @@ int WeinmannLoader::Open(QString path)
|
|||||||
int st_end = index[PresOffset];
|
int st_end = index[PresOffset];
|
||||||
int st_size = st_end - st_start;
|
int st_size = st_end - st_start;
|
||||||
|
|
||||||
char st[st_size];
|
char * st = new char [st_size];
|
||||||
memset(st, 0, st_size);
|
memset(st, 0, st_size);
|
||||||
|
|
||||||
wmdata.seek(st_start);
|
wmdata.seek(st_start);
|
||||||
@ -290,7 +294,7 @@ int WeinmannLoader::Open(QString path)
|
|||||||
int pr_end = index[AMVOffset];
|
int pr_end = index[AMVOffset];
|
||||||
int pr_size = pr_end - pr_start;
|
int pr_size = pr_end - pr_start;
|
||||||
|
|
||||||
char pres[pr_size];
|
char * pres = new char [pr_size];
|
||||||
memset(pres, 0, pr_size);
|
memset(pres, 0, pr_size);
|
||||||
|
|
||||||
wmdata.seek(pr_start);
|
wmdata.seek(pr_start);
|
||||||
@ -304,7 +308,7 @@ int WeinmannLoader::Open(QString path)
|
|||||||
int mv_end = index[EventsOffset];
|
int mv_end = index[EventsOffset];
|
||||||
int mv_size = mv_end - mv_start;
|
int mv_size = mv_end - mv_start;
|
||||||
|
|
||||||
char mv[mv_size];
|
char * mv = new char [mv_size];
|
||||||
memset(mv, 0, mv_size);
|
memset(mv, 0, mv_size);
|
||||||
|
|
||||||
wmdata.seek(mv_start);
|
wmdata.seek(mv_start);
|
||||||
@ -318,13 +322,12 @@ int WeinmannLoader::Open(QString path)
|
|||||||
int ev_end = wmdata.size();
|
int ev_end = wmdata.size();
|
||||||
int ev_size = ev_end - ev_start;
|
int ev_size = ev_end - ev_start;
|
||||||
|
|
||||||
unsigned char ev[ev_size];
|
quint8 * ev = new quint8 [ev_size];
|
||||||
memset((char *) ev, 0, ev_size);
|
memset((char *) ev, 0, ev_size);
|
||||||
|
|
||||||
wmdata.seek(ev_start);
|
wmdata.seek(ev_start);
|
||||||
wmdata.read((char *) ev, ev_size);
|
wmdata.read((char *) ev, ev_size);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Process sessions
|
// Process sessions
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -464,6 +467,12 @@ int WeinmannLoader::Open(QString path)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
delete [] data;
|
||||||
|
delete [] st;
|
||||||
|
delete [] pres;
|
||||||
|
delete [] mv;
|
||||||
|
delete [] ev;
|
||||||
|
|
||||||
mach->Save();
|
mach->Save();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -583,10 +583,10 @@ Channel::Channel(ChannelID id, ChanType type, MachineType machtype, ScopeType sc
|
|||||||
m_order(255)
|
m_order(255)
|
||||||
{
|
{
|
||||||
if (type == WAVEFORM) {
|
if (type == WAVEFORM) {
|
||||||
calc[Calc_Min] = ChannelCalc(id, Calc_Min, adjustcolor(color, 0.25, 1, 1.3), false);
|
calc[Calc_Min] = ChannelCalc(id, Calc_Min, adjustcolor(color, 0.25f, 1.0f, 1.3f), false);
|
||||||
calc[Calc_Middle] = ChannelCalc(id, Calc_Middle, adjustcolor(color, 1.3, 1, 1), false);
|
calc[Calc_Middle] = ChannelCalc(id, Calc_Middle, adjustcolor(color, 1.3f, 1.0f, 1.0f), false);
|
||||||
calc[Calc_Perc] = ChannelCalc(id, Calc_Perc, adjustcolor(color, 1.1, 1.2, 1), false);
|
calc[Calc_Perc] = ChannelCalc(id, Calc_Perc, adjustcolor(color, 1.1f, 1.2f, 1.0f), false);
|
||||||
calc[Calc_Max] = ChannelCalc(id, Calc_Max, adjustcolor(color, 0.5, 1.2, 1), false);
|
calc[Calc_Max] = ChannelCalc(id, Calc_Max, adjustcolor(color, 0.5f, 1.2f, 1.0f), false);
|
||||||
|
|
||||||
calc[Calc_Zero] = ChannelCalc(id, Calc_Zero, Qt::red, false);
|
calc[Calc_Zero] = ChannelCalc(id, Calc_Zero, Qt::red, false);
|
||||||
calc[Calc_LowerThresh] = ChannelCalc(id, Calc_LowerThresh, Qt::blue, false);
|
calc[Calc_LowerThresh] = ChannelCalc(id, Calc_LowerThresh, Qt::blue, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user