Merge branch 'master' of ssh://git.code.sf.net/p/sleepyhead/code

This commit is contained in:
Mark Watkins 2014-10-02 22:54:48 +10:00
commit 2450e262ee
29 changed files with 157 additions and 121 deletions

View File

@ -176,7 +176,7 @@ void gFlagsGroup::paint(QPainter &painter, gGraph &g, const QRegion &region)
QColor barcol; QColor barcol;
for (int i = 0; i < visflags.size(); i++) { for (int i = 0; i < visflags.size(); i++) {
schema::Channel & chan = schema::channel[visflags.at(i)->code()]; //schema::Channel & chan = schema::channel[visflags.at(i)->code()];
// Alternating box color // Alternating box color
if (i & 1) { barcol = COLOR_ALT_BG1; } if (i & 1) { barcol = COLOR_ALT_BG1; }

View File

@ -68,7 +68,7 @@ class gFlagsLine: public Layer
void setLineNum(int i) { line_num = i; } void setLineNum(int i) { line_num = i; }
virtual Layer * Clone() { virtual Layer * Clone() {
gFlagsLine * layer = new gFlagsLine(nullptr); //ouchie.. gFlagsLine * layer = new gFlagsLine(NoChannel); //ouchie..
Layer::CloneInto(layer); Layer::CloneInto(layer);
CloneInto(layer); CloneInto(layer);
return layer; return layer;

View File

@ -298,7 +298,8 @@ void gGraph::paint(QPainter &painter, const QRegion &region)
//m_marginbottom=5; //m_marginbottom=5;
left = marginLeft()*printScaleX(), right = marginRight()*printScaleX(), top = marginTop(), bottom = marginBottom() * printScaleY(); left = marginLeft()*printScaleX(), right = marginRight()*printScaleX(), top = marginTop(), bottom = marginBottom() * printScaleY();
int x = 0, y = 0; //int x;
int y;
if (m_showTitle) { if (m_showTitle) {
int title_x, yh; int title_x, yh;
@ -309,7 +310,7 @@ void gGraph::paint(QPainter &painter, const QRegion &region)
yh = fm.height(); yh = fm.height();
//GetTextExtent("Wy@",x,yh,mediumfont); // This gets a better consistent height. should be cached. //GetTextExtent("Wy@",x,yh,mediumfont); // This gets a better consistent height. should be cached.
y = yh; y = yh;
x = fm.width(title()); //x = fm.width(title());
//GetTextExtent(title(),x,y,mediumfont); //GetTextExtent(title(),x,y,mediumfont);
title_x = float(yh) ; title_x = float(yh) ;
@ -482,11 +483,11 @@ QPixmap gGraph::renderPixmap(int w, int h, bool printing)
fa.setPixelSize(28); fa.setPixelSize(28);
fb.setPixelSize(32); fb.setPixelSize(32);
fc.setPixelSize(70); fc.setPixelSize(70);
graphView()->setPrintScaleX(2.5); graphView()->setPrintScaleX(2.5f);
graphView()->setPrintScaleY(2.2); graphView()->setPrintScaleY(2.2f);
} else { } else {
graphView()->setPrintScaleX(1); graphView()->setPrintScaleX(1.0f);
graphView()->setPrintScaleY(1); graphView()->setPrintScaleY(1.0f);
} }
defaultfont = &fa; defaultfont = &fa;
@ -716,7 +717,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
int y = event->y(); int y = event->y();
int x = event->x(); int x = event->x();
bool doredraw = false; //bool doredraw = false;
timedRedraw(0); timedRedraw(0);
@ -796,7 +797,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
int offset = (x >= x2) ? 20 : - 20; int offset = (x >= x2) ? 20 : - 20;
ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align); ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align);
doredraw = true; //doredraw = true;
} else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging } else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging
m_graphview->setPointClicked(event->pos()); m_graphview->setPointClicked(event->pos());
x -= left; x -= left;
@ -822,7 +823,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
} }
m_graphview->SetXBounds(min_x, max_x, m_group, false); m_graphview->SetXBounds(min_x, max_x, m_group, false);
doredraw = true; // doredraw = true;
} else { } else {
qint64 qq = rmax_x - rmin_x; qint64 qq = rmax_x - rmin_x;
xx = max_x - min_x; xx = max_x - min_x;
@ -845,7 +846,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
} }
m_graphview->SetXBounds(min_x, max_x, m_group, false); m_graphview->SetXBounds(min_x, max_x, m_group, false);
doredraw = true; //doredraw = true;
} }
} }
} }
@ -1180,7 +1181,7 @@ void gGraph::ZoomX(double mult, int origin_px)
min = max - q; min = max - q;
} }
extern const int max_history; //extern const int max_history;
m_graphview->SetXBounds(min, max, m_group); m_graphview->SetXBounds(min, max, m_group);
//updateSelectionTime(max-min); //updateSelectionTime(max-min);
@ -1415,9 +1416,9 @@ int gGraph::minHeight()
{ {
int minheight = m_min_height; int minheight = m_min_height;
int top = 0; // int top = 0;
int center = 0; // int center = 0;
int bottom = 0; // int bottom = 0;
for (int i=0; i<m_layers.size(); ++i) { for (int i=0; i<m_layers.size(); ++i) {
int mh = m_layers[i]->minimumHeight(); int mh = m_layers[i]->minimumHeight();
mh += m_margintop + m_marginbottom; mh += m_margintop + m_marginbottom;

View File

@ -1712,7 +1712,7 @@ class MyWidgetAction : public QWidgetAction
public: public:
MyWidgetAction(ChannelID code, QObject * parent = nullptr) :QWidgetAction(parent), code(code) { chbox = nullptr; } MyWidgetAction(ChannelID code, QObject * parent = nullptr) :QWidgetAction(parent), code(code) { chbox = nullptr; }
protected: protected:
virtual QWidget * createWidget(QWidget * parent) { virtual QWidget * createWidget(QWidget * /*parent*/) {
connect(chbox, SIGNAL(toggled(bool)), this, SLOT(setChecked(bool))); connect(chbox, SIGNAL(toggled(bool)), this, SLOT(setChecked(bool)));
connect(chbox, SIGNAL(clicked()), this, SLOT(trigger())); connect(chbox, SIGNAL(clicked()), this, SLOT(trigger()));
@ -2793,7 +2793,7 @@ void gGraphView::wheelEvent(QWheelEvent *event)
gGraph *graph = nullptr; gGraph *graph = nullptr;
int group = 0; int group = 0;
int x = event->x(); //int x = event->x();
int y = event->y(); int y = event->y();
float h, py = 0, pinned_height = 0; float h, py = 0, pinned_height = 0;
@ -2982,7 +2982,7 @@ void gGraphView::keyPressEvent(QKeyEvent *event)
} }
if ((m_metaselect) && (event->key() >= Qt::Key_0) && (event->key() <= Qt::Key_9)) { if ((m_metaselect) && (event->key() >= Qt::Key_0) && (event->key() <= Qt::Key_9)) {
int bk = (int)event->key()-Qt::Key_0; //int bk = (int)event->key()-Qt::Key_0;
m_metaselect = false; m_metaselect = false;
timedRedraw(0); timedRedraw(0);

View File

@ -462,9 +462,9 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
} }
} }
bool mouseover = false; //bool mouseover = false;
if (rect.contains(w.graphView()->currentMousePos())) { if (rect.contains(w.graphView()->currentMousePos())) {
mouseover = true; //mouseover = true;
painter.fillRect(rect, QBrush(QColor(255,255,245,128))); painter.fillRect(rect, QBrush(QColor(255,255,245,128)));
} }
@ -501,7 +501,7 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
int idx; int idx;
bool done; bool done;
double x0, xL; double x0, xL;
double sr; double sr = 0.0;
int sam; int sam;
int minz, maxz; int minz, maxz;

View File

@ -41,7 +41,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
int start_py = topp; int start_py = topp;
double xx = w.max_x - w.min_x; double xx = w.max_x - w.min_x;
double yy = w.max_y - w.min_y; //double yy = w.max_y - w.min_y;
double jj = double(width) / double(xx); double jj = double(width) / double(xx);
@ -81,7 +81,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
qint64 clockdrift = qint64(p_profile->cpap->clockDrift()) * 1000L; qint64 clockdrift = qint64(p_profile->cpap->clockDrift()) * 1000L;
qint64 drift = 0; qint64 drift = 0;
bool hover = false; //bool hover = false;
// For each session, process it's eventlist // For each session, process it's eventlist
for (QList<Session *>::iterator s = m_day->begin(); s != m_day->end(); s++) { for (QList<Session *>::iterator s = m_day->begin(); s != m_day->end(); s++) {
@ -125,7 +125,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
// FT_Span // FT_Span
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
for (; dptr < eptr; dptr++) { for (; dptr < eptr; dptr++) {
hover = false; //hover = false;
X = stime + *tptr++; X = stime + *tptr++;
raw = *dptr; raw = *dptr;
@ -154,9 +154,9 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
QRect rect(x2, start_py, x1-x2, height); QRect rect(x2, start_py, x1-x2, height);
QColor col = m_flag_color; QColor col = m_flag_color;
if (rect.contains(mouse)) { // if (rect.contains(mouse)) {
hover = true; // hover = true;
} // }
painter.fillRect(rect, QBrush(col)); painter.fillRect(rect, QBrush(col));
} }
@ -195,7 +195,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
// FT_Bar // FT_Bar
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
for (; dptr < eptr; dptr++) { for (; dptr < eptr; dptr++) {
hover = false; // hover = false;
X = stime + *tptr++; X = stime + *tptr++;
raw = *dptr; raw = *dptr;
@ -249,7 +249,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
// painter.drawLine(rect.x(), top, rect.x(), bottom); // painter.drawLine(rect.x(), top, rect.x(), bottom);
// col = COLOR_Gold; // col = COLOR_Gold;
hover = true; // hover = true;
painter.setPen(QPen(col,3)); painter.setPen(QPen(col,3));
} else { } else {
painter.setPen(QPen(col,1)); painter.setPen(QPen(col,1));
@ -266,11 +266,11 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
// Top and bottom markers // Top and bottom markers
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
bool b = false; //bool b = false;
if (!w.selectingArea() && !m_blockhover && QRect(x1-2, topp, 6, height).contains(mouse) && !m_hover) { if (!w.selectingArea() && !m_blockhover && QRect(x1-2, topp, 6, height).contains(mouse) && !m_hover) {
// only want to draw the highlight/label once per frame // only want to draw the highlight/label once per frame
m_hover = true; m_hover = true;
b = true; //b = true;
// Draw text label // Draw text label
QString lab = QString("%1 (%2)").arg(schema::channel[m_code].fullname()).arg(raw); QString lab = QString("%1 (%2)").arg(schema::channel[m_code].fullname()).arg(raw);

View File

@ -43,10 +43,10 @@ gSummaryChart::gSummaryChart(ChannelID code, MachineType machtype)
tz_hours = tz_offset / 3600.0; tz_hours = tz_offset / 3600.0;
expected_slices = 5; expected_slices = 5;
addCalc(code, ST_MIN, brighten(schema::channel[code].defaultColor() ,0.60)); addCalc(code, ST_MIN, brighten(schema::channel[code].defaultColor() ,0.60f));
addCalc(code, ST_MID, brighten(schema::channel[code].defaultColor() ,1.20)); addCalc(code, ST_MID, brighten(schema::channel[code].defaultColor() ,1.20f));
addCalc(code, ST_90P, brighten(schema::channel[code].defaultColor() ,1.70)); addCalc(code, ST_90P, brighten(schema::channel[code].defaultColor() ,1.70f));
addCalc(code, ST_MAX, brighten(schema::channel[code].defaultColor() ,2.30)); addCalc(code, ST_MAX, brighten(schema::channel[code].defaultColor() ,2.30f));
} }
gSummaryChart::~gSummaryChart() gSummaryChart::~gSummaryChart()
@ -434,7 +434,7 @@ void gSummaryChart::paint(QPainter &painter, gGraph &graph, const QRegion &regio
if ((daylist.size() == 0) || (it == dayindex.end())) return; if ((daylist.size() == 0) || (it == dayindex.end())) return;
Day * lastday = nullptr; //Day * lastday = nullptr;
// int dc = 0; // int dc = 0;
// for (int i=idx; i<=idx_end; ++i) { // for (int i=idx; i<=idx_end; ++i) {
@ -527,11 +527,11 @@ void gSummaryChart::paint(QPainter &painter, gGraph &graph, const QRegion &regio
lastx1 += barw; lastx1 += barw;
it++; it++;
nousedays++; nousedays++;
lastday = day; //lastday = day;
continue; continue;
} }
lastday = day; //lastday = day;
float x1 = lastx1 + barw; float x1 = lastx1 + barw;
@ -986,13 +986,13 @@ void gSessionTimesChart::paint(QPainter &painter, gGraph &graph, const QRegion &
float x1 = lastx1 + barw; float x1 = lastx1 + barw;
bool hl = false; //bool hl = false;
QRect rec2(lastx1, rect.top(), barw, rect.height()); QRect rec2(lastx1, rect.top(), barw, rect.height());
if (rec2.contains(mouse)) { if (rec2.contains(mouse)) {
QColor col2(255,0,0,64); QColor col2(255,0,0,64);
painter.fillRect(rec2, QBrush(col2)); painter.fillRect(rec2, QBrush(col2));
hl = true; //hl = true;
} }
if (cit != cache.end()) { if (cit != cache.end()) {
@ -1284,7 +1284,7 @@ gPressureChart::gPressureChart()
// Do not reorder these!!! :P // Do not reorder these!!! :P
addCalc(CPAP_Pressure, ST_SETMAX, schema::channel[CPAP_Pressure].defaultColor()); // 00 addCalc(CPAP_Pressure, ST_SETMAX, schema::channel[CPAP_Pressure].defaultColor()); // 00
addCalc(CPAP_Pressure, ST_MID, schema::channel[CPAP_Pressure].defaultColor()); // 01 addCalc(CPAP_Pressure, ST_MID, schema::channel[CPAP_Pressure].defaultColor()); // 01
addCalc(CPAP_Pressure, ST_90P, brighten(schema::channel[CPAP_Pressure].defaultColor(), 1.33)); // 02 addCalc(CPAP_Pressure, ST_90P, brighten(schema::channel[CPAP_Pressure].defaultColor(), 1.33f)); // 02
addCalc(CPAP_PressureMin, ST_SETMIN, schema::channel[CPAP_PressureMin].defaultColor()); // 03 addCalc(CPAP_PressureMin, ST_SETMIN, schema::channel[CPAP_PressureMin].defaultColor()); // 03
addCalc(CPAP_PressureMax, ST_SETMAX, schema::channel[CPAP_PressureMax].defaultColor()); // 04 addCalc(CPAP_PressureMax, ST_SETMAX, schema::channel[CPAP_PressureMax].defaultColor()); // 04
@ -1294,9 +1294,9 @@ gPressureChart::gPressureChart()
addCalc(CPAP_IPAPHi, ST_SETMAX, schema::channel[CPAP_IPAPHi].defaultColor()); // 08 addCalc(CPAP_IPAPHi, ST_SETMAX, schema::channel[CPAP_IPAPHi].defaultColor()); // 08
addCalc(CPAP_EPAP, ST_MID, schema::channel[CPAP_EPAP].defaultColor()); // 09 addCalc(CPAP_EPAP, ST_MID, schema::channel[CPAP_EPAP].defaultColor()); // 09
addCalc(CPAP_EPAP, ST_90P, brighten(schema::channel[CPAP_EPAP].defaultColor(),1.33)); // 10 addCalc(CPAP_EPAP, ST_90P, brighten(schema::channel[CPAP_EPAP].defaultColor(),1.33f)); // 10
addCalc(CPAP_IPAP, ST_MID, schema::channel[CPAP_IPAP].defaultColor()); // 11 addCalc(CPAP_IPAP, ST_MID, schema::channel[CPAP_IPAP].defaultColor()); // 11
addCalc(CPAP_IPAP, ST_90P, brighten(schema::channel[CPAP_IPAP].defaultColor(),1.33)); // 12 addCalc(CPAP_IPAP, ST_90P, brighten(schema::channel[CPAP_IPAP].defaultColor(),1.33f)); // 12
} }
void gPressureChart::afterDraw(QPainter &, gGraph &graph, QRect rect) void gPressureChart::afterDraw(QPainter &, gGraph &graph, QRect rect)

View File

@ -70,7 +70,8 @@ void SummaryChart::SetDay(Day * nullday)
if (mididx == 0) { mid = ST_PERC; } if (mididx == 0) { mid = ST_PERC; }
else if (mididx == 1) { mid = ST_WAVG; } else if (mididx == 1) { mid = ST_WAVG; }
else if (mididx == 2) { mid = ST_AVG; } else mid = ST_AVG;
if (cpapmode >= MODE_ASV) { if (cpapmode >= MODE_ASV) {
addSlice(CPAP_EPAP, QColor("green"), ST_SETMIN); addSlice(CPAP_EPAP, QColor("green"), ST_SETMIN);
@ -94,7 +95,7 @@ void SummaryChart::SetDay(Day * nullday)
addSlice(CPAP_IPAPHi, QColor("blue"), ST_SETMAX); addSlice(CPAP_IPAPHi, QColor("blue"), ST_SETMAX);
} else if (cpapmode >= MODE_APAP) { } else if (cpapmode >= MODE_APAP) {
addSlice(CPAP_PressureMin, QColor("orange"), ST_SETMIN); addSlice(CPAP_PressureMin, QColor("orange"), ST_SETMIN);
addSlice(CPAP_Pressure, QColor("dark green"), mid, 0.5); addSlice(CPAP_Pressure, QColor("dark green"), mid, 0.5f);
addSlice(CPAP_Pressure, QColor("grey"), ST_PERC, perc); addSlice(CPAP_Pressure, QColor("grey"), ST_PERC, perc);
addSlice(CPAP_PressureMax, QColor("red"), ST_SETMAX); addSlice(CPAP_PressureMax, QColor("red"), ST_SETMAX);
} else { } else {
@ -627,7 +628,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
} }
QColor col1 = col; QColor col1 = col;
QColor col2 = brighten(col,2.37); QColor col2 = brighten(col,2.37f);
//outlines->setColor(Qt::black); //outlines->setColor(Qt::black);
int np = d.value().size(); int np = d.value().size();

View File

@ -385,7 +385,7 @@ void gXAxisDay::paint(QPainter &painter, gGraph &graph, const QRegion &region)
float left = region.boundingRect().left(); float left = region.boundingRect().left();
float top = region.boundingRect().top(); float top = region.boundingRect().top();
float width = region.boundingRect().width(); float width = region.boundingRect().width();
float height = region.boundingRect().height(); //float height = region.boundingRect().height();
QString months[] = { QString months[] = {
QObject::tr("Jan"), QObject::tr("Feb"), QObject::tr("Mar"), QObject::tr("Apr"), QObject::tr("May"), QObject::tr("Jun"), QObject::tr("Jan"), QObject::tr("Feb"), QObject::tr("Mar"), QObject::tr("Apr"), QObject::tr("May"), QObject::tr("Jun"),

View File

@ -73,12 +73,12 @@ class median_of_empty_list_exception:public std::exception{
/// ///
///The numbers must be convertible to double. ///The numbers must be convertible to double.
template<class RandAccessIter> template<class RandAccessIter>
double median(RandAccessIter begin, RandAccessIter end) float median(RandAccessIter begin, RandAccessIter end)
throw (median_of_empty_list_exception) // throw (median_of_empty_list_exception)
{ {
if (begin == end) { throw median_of_empty_list_exception(); } if (begin == end) { throw median_of_empty_list_exception(); }
std::size_t size = end - begin; int size = end - begin;
std::size_t middleIdx = size/2; int middleIdx = size/2;
RandAccessIter target = begin + middleIdx; RandAccessIter target = begin + middleIdx;
std::nth_element(begin, target, end); std::nth_element(begin, target, end);

View File

@ -136,7 +136,7 @@ EventDataType Day::calcMiddle(ChannelID code)
} }
EventDataType Day::calcMax(ChannelID code) EventDataType Day::calcMax(ChannelID code)
{ {
return p_profile->general->prefCalcMax() ? percentile(code, 0.995) : Max(code); return p_profile->general->prefCalcMax() ? percentile(code, 0.995f) : Max(code);
} }
EventDataType Day::calcPercentile(ChannelID code) EventDataType Day::calcPercentile(ChannelID code)
{ {

View File

@ -267,6 +267,8 @@ int CMS50Loader::doImportMode()
info.serial = QString(); info.serial = QString();
Machine * mach = CreateMachine(info); Machine * mach = CreateMachine(info);
Q_UNUSED(mach);
qDebug() << QString("Receiving Oximeter transmission %1:%2").arg(hour).arg(minute); qDebug() << QString("Receiving Oximeter transmission %1:%2").arg(hour).arg(minute);
// set importing to true or whatever.. // set importing to true or whatever..

View File

@ -377,7 +377,7 @@ int IntellipapLoader::Open(QString path)
sid = 0; sid = 0;
SessionID lastsid = 0; SessionID lastsid = 0;
int last_minp=0, last_maxp=0, last_ps=0, last_pres = 0; //int last_minp=0, last_maxp=0, last_ps=0, last_pres = 0;
for (int i = 0; i < recs; i++) { for (int i = 0; i < recs; i++) {
// convert timestamp to real epoch // convert timestamp to real epoch
@ -543,7 +543,7 @@ int IntellipapLoader::Open(QString path)
if (!sess) continue; if (!sess) continue;
// quint64 first = qint64(sid) * 1000L; // quint64 first = qint64(sid) * 1000L;
quint64 last = qint64(SessionEnd[i]) * 1000L; //quint64 last = qint64(SessionEnd[i]) * 1000L;
if (sess->last() > 0) { if (sess->last() > 0) {
// sess->really_set_last(last); // sess->really_set_last(last);

View File

@ -210,9 +210,6 @@ bool Machine::AddSession(Session *s)
Q_ASSERT(p_profile); Q_ASSERT(p_profile);
Q_ASSERT(p_profile->isOpen()); Q_ASSERT(p_profile->isOpen());
if (s->type() == MT_OXIMETER) {
int i=5;
}
updateChannels(s); updateChannels(s);
if (p_profile->session->ignoreOlderSessions()) { if (p_profile->session->ignoreOlderSessions()) {
@ -442,12 +439,12 @@ bool Machine::Purge(int secret)
QList<Session *> sessions = sessionlist.values(); QList<Session *> sessions = sessionlist.values();
// Clean up any loaded sessions from memory first.. // Clean up any loaded sessions from memory first..
bool success = true; //bool success = true;
for (int i=0; i < sessions.size(); ++i) { for (int i=0; i < sessions.size(); ++i) {
Session * sess = sessions[i]; Session * sess = sessions[i];
if (!sess->Destroy()) { if (!sess->Destroy()) {
qDebug() << "Could not destroy "+ info.loadername +" ("+info.serial+") session" << sess->session(); qDebug() << "Could not destroy "+ info.loadername +" ("+info.serial+") session" << sess->session();
success = false; // success = false;
} else { } else {
// sessionlist.remove(sess->session()); // sessionlist.remove(sess->session());
} }
@ -485,7 +482,7 @@ bool Machine::Purge(int secret)
qDebug() << "Deleting " << QDir::toNativeSeparators(fullpath); qDebug() << "Deleting " << QDir::toNativeSeparators(fullpath);
if (!dir.remove(fullpath)) { if (!dir.remove(fullpath)) {
qDebug() << "Could not purge file" << fullpath; qDebug() << "Could not purge file" << fullpath;
success=false; //success=false;
could_not_kill++; could_not_kill++;
} }
} else { } else {

View File

@ -320,6 +320,8 @@ const QString STR_IS_LockSummarySessions = "LockSummarySessions";
// AppearanceSettings Strings // AppearanceSettings Strings
const QString STR_AS_GraphHeight = "GraphHeight"; const QString STR_AS_GraphHeight = "GraphHeight";
const QString STR_AS_DailyPanelWidth = "DailyPanelWidth";
const QString STR_AS_RightPanelWidth = "RightPanelWidth";
const QString STR_AS_AntiAliasing = "UseAntiAliasing"; const QString STR_AS_AntiAliasing = "UseAntiAliasing";
const QString STR_AS_GraphSnapshots = "EnableGraphSnapshots"; const QString STR_AS_GraphSnapshots = "EnableGraphSnapshots";
const QString STR_AS_Animations = "AnimationsAndTransitions"; const QString STR_AS_Animations = "AnimationsAndTransitions";
@ -696,6 +698,8 @@ class AppearanceSettings : public ProfileSettings
: ProfileSettings(profile) : ProfileSettings(profile)
{ {
initPref(STR_AS_GraphHeight, 180.0); initPref(STR_AS_GraphHeight, 180.0);
initPref(STR_AS_DailyPanelWidth, 350.0);
initPref(STR_AS_RightPanelWidth, 230.0);
initPref(STR_AS_AntiAliasing, true); initPref(STR_AS_AntiAliasing, true);
initPref(STR_AS_GraphSnapshots, true); initPref(STR_AS_GraphSnapshots, true);
initPref(STR_AS_Animations, true); initPref(STR_AS_Animations, true);
@ -713,6 +717,10 @@ class AppearanceSettings : public ProfileSettings
//! \brief Returns the normal (unscaled) height of a graph //! \brief Returns the normal (unscaled) height of a graph
int graphHeight() const { return getPref(STR_AS_GraphHeight).toInt(); } int graphHeight() const { return getPref(STR_AS_GraphHeight).toInt(); }
//! \brief Returns the normal (unscaled) height of a graph
int dailyPanelWidth() const { return getPref(STR_AS_DailyPanelWidth).toInt(); }
//! \brief Returns the normal (unscaled) height of a graph
int rightPanelWidth() const { return getPref(STR_AS_RightPanelWidth).toInt(); }
//! \brief Returns true if AntiAliasing (the graphical smoothing method) is enabled //! \brief Returns true if AntiAliasing (the graphical smoothing method) is enabled
bool antiAliasing() const { return getPref(STR_AS_AntiAliasing).toBool(); } bool antiAliasing() const { return getPref(STR_AS_AntiAliasing).toBool(); }
//! \brief Returns true if renderPixmap function is in use, which takes snapshots of graphs //! \brief Returns true if renderPixmap function is in use, which takes snapshots of graphs
@ -748,6 +756,10 @@ class AppearanceSettings : public ProfileSettings
//! \brief Set the normal (unscaled) height of a graph. //! \brief Set the normal (unscaled) height of a graph.
void setGraphHeight(int height) { setPref(STR_AS_GraphHeight, height); } void setGraphHeight(int height) { setPref(STR_AS_GraphHeight, height); }
//! \brief Set the normal (unscaled) height of a graph.
void setDailyPanelWidth(int width) { setPref(STR_AS_DailyPanelWidth, width); }
//! \brief Set the normal (unscaled) height of a graph.
void setRightPanelWidth(int width) { setPref(STR_AS_RightPanelWidth, width); }
//! \brief Set to true to turn on AntiAliasing (the graphical smoothing method) //! \brief Set to true to turn on AntiAliasing (the graphical smoothing method)
void setAntiAliasing(bool aa) { setPref(STR_AS_AntiAliasing, aa); } void setAntiAliasing(bool aa) { setPref(STR_AS_AntiAliasing, aa); }
//! \brief Set to true if renderPixmap functions are in use, which takes snapshots of graphs. //! \brief Set to true if renderPixmap functions are in use, which takes snapshots of graphs.

View File

@ -41,7 +41,7 @@ Session::Session(Machine *m, SessionID session)
s_events_loaded = false; s_events_loaded = false;
s_summary_loaded = false; s_summary_loaded = false;
_first_session = true; _first_session = true;
s_enabled = -1; s_enabled = true;
s_first = s_last = 0; s_first = s_last = 0;
s_evchecksum_checked = false; s_evchecksum_checked = false;

View File

@ -1 +1 @@
const int build_number = 0; const int build_number = 1;

View File

@ -59,7 +59,7 @@ void Daily::setSidebarVisible(bool visible)
{ {
QList<int> a; QList<int> a;
int panel_width = visible ? 370 : 0; int panel_width = visible ? p_profile->appearance->dailyPanelWidth() : 0;
a.push_back(panel_width); a.push_back(panel_width);
a.push_back(this->width() - panel_width); a.push_back(this->width() - panel_width);
ui->splitter_2->setStretchFactor(1,1); ui->splitter_2->setStretchFactor(1,1);
@ -1156,9 +1156,9 @@ QString Daily::getStatisticsInfo(Day * day)
{ {
if (!day) return QString(); if (!day) return QString();
Machine *cpap = day->machine(MT_CPAP), Machine *cpap = day->machine(MT_CPAP);
*oxi = day->machine(MT_OXIMETER), // *oxi = day->machine(MT_OXIMETER),
*pos = day->machine(MT_POSITION); // *pos = day->machine(MT_POSITION);
int mididx=p_profile->general->prefCalcMiddle(); int mididx=p_profile->general->prefCalcMiddle();
@ -1351,13 +1351,13 @@ void Daily::Load(QDate date)
Day * day = p_profile->GetDay(date); Day * day = p_profile->GetDay(date);
Machine *cpap = nullptr, Machine *cpap = nullptr,
*oxi = nullptr, *oxi = nullptr,
*stage = nullptr, //*stage = nullptr,
*posit = nullptr; *posit = nullptr;
if (day) { if (day) {
cpap = day->machine(MT_CPAP); cpap = day->machine(MT_CPAP);
oxi = day->machine(MT_OXIMETER); oxi = day->machine(MT_OXIMETER);
stage = day->machine(MT_SLEEPSTAGE); // stage = day->machine(MT_SLEEPSTAGE);
posit = day->machine(MT_POSITION); posit = day->machine(MT_POSITION);
} }
@ -2004,7 +2004,7 @@ void Daily::on_LineCursorUpdate(double time)
} else dateDisplay->setText(QString(GraphView->emptyText())); } else dateDisplay->setText(QString(GraphView->emptyText()));
} }
void Daily::on_RangeUpdate(double minx, double maxx) void Daily::on_RangeUpdate(double minx, double /*maxx*/)
{ {
if (minx > 1) { if (minx > 1) {
dateDisplay->setText(GraphView->getRangeString()); dateDisplay->setText(GraphView->getRangeString());
@ -2561,3 +2561,10 @@ void Daily::on_toggleEvents_clicked(bool checked)
// // ui->sessionWidget->setCurrentItem(item); // // ui->sessionWidget->setCurrentItem(item);
// } // }
//} //}
void Daily::on_splitter_2_splitterMoved(int, int)
{
int size = ui->splitter_2->sizes()[0];
if (size == 0) return;
p_profile->appearance->setDailyPanelWidth(size);
}

View File

@ -281,6 +281,8 @@ private slots:
//void on_sessionWidget_itemSelectionChanged(); //void on_sessionWidget_itemSelectionChanged();
void on_splitter_2_splitterMoved(int pos, int index);
protected: protected:
virtual void closeEvent(QCloseEvent *); virtual void closeEvent(QCloseEvent *);
virtual void showEvent(QShowEvent *); virtual void showEvent(QShowEvent *);

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1211</width> <width>551</width>
<height>674</height> <height>441</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">

View File

@ -1 +0,0 @@
ghttp://mobile-phones.smh.com.au/MobilePhones?utm_source=Widget_Fairfax_SMH_CompareAndSave&utm_medium=Widget&utm_campaign=New_BYO_Phone_Prices

View File

@ -1,7 +1,7 @@
<html> <html>
<head><meta charset="UTF-8"></head> <head><meta charset="UTF-8"></head>
<body> <body>
<h1><image src="qrc:/docs/sheep.png" width=64 height=64>SleepyHead v0.9.8 <b>Testing</b></h1> <h1><image src="qrc:/docs/sheep.png" width=64 height=64>SleepyHead v0.9.8-1 <b>Testing</b></h1>
<p><h2><b>Release Notes</b></h2></p> <p><h2><b>Release Notes</b></h2></p>
<p>Greetings!</p> <p>Greetings!</p>
@ -11,21 +11,34 @@
<p>This is the first public test build in a while, so there is a lot of new stuff to take in.</p> <p>This is the first public test build in a while, so there is a lot of new stuff to take in.</p>
<p>First up, a warning: Some new stuff is going down that might break on you.. Overview overhead figures aren't completely finished yet. I know about these and am working on them. <b>Some highlights from the new series</b><br/>
You will likely have to Rebuild CPAP data to get this to behave properly.. If you have to do it more than once, somethings not right, and I need to know.</p> <list>
<li>Right click menu has tons of new stuff for you to play with... some of this you're hopefully going to love! :)</li>
<p>Right clicky menu has tons of new stuff for you to play with... some of this you're hopefully going to love! :)</p> <li>New Graph Clone ability allows you to make a temporary copy of a graph, and operate it completely independently...
<p>New Graph Clone ability allows you to make a temporary copy of a graph, and operate it completely independently...
You can even take these graph clones with you to another day! They aren't saved though. they are gone when you close SleepyHead.</li> You can even take these graph clones with you to another day! They aren't saved though. they are gone when you close SleepyHead.</li>
<p>Y-Axis menu allows for better control of Y-Axis scaling, all of this has been improved greatly... no more having to go into preferences <li>Y-Axis menu allows for better control of Y-Axis scaling, all of this has been improved greatly... no more having to go into preferences
to set minimum/maximum values (that SleepyHead wasn't honouring properly anyway). Now you can adjust these settings live for each graph!</p> to set minimum/maximum values (that SleepyHead wasn't honouring properly anyway). Now you can adjust these settings live for each graph!</li>
<p>Line Cursor mode (F3 to toggles) is a very powerful new feature.. Play with it and see what it does. It's off by default because it takes a lot more CPU power to work.</p> <li>Line Cursor mode (F3 to toggles) is a very powerful new feature.. Play with it and see what it does. It's off by default because it takes a lot more CPU power to work.</li>
</list>
<p>There is loads more waiting for you in the 0.9.8 series!</p>
<p><b>Sleep Well, and good luck!</b></p> <p><b>Sleep Well, and good luck!</b></p>
<p><b><i>JediMark</i></b></p> <p><b><i>JediMark</i></b></p>
<br/> <br/>
<b>New features & bug fixes in v0.9.8</b><br/> <b>Bug fixes in v0.9.8-1</b>
<list>
<li>Windows build related fixes</li>
<li>Increase brightness steps between barchart segments</li>
<li>Put Export CSV back</li>
<li>Do not save over machine.xml if profiles has an machines section but machines.xml is present</li>
<li>Fix PRS1 model numbers not ending in 'P' refusing to import</li>
<li>Show Model number in rx changes list instead of loader name</li>
<li>Only Resmed CPAP/APAP modes have EPR</li>
<li>Fix PRS1 4x0P models accidentally being called Plus instead of Pro</li>
<li>Fix Profile delete not removing row properly</li>
</list>
<br/>
<b>New features & bug fixes in v0.9.8-0</b><br/>
<list> <list>
<li>Rework of Records box</li> <li>Rework of Records box</li>
<li>Initial support for Philips Respironics System One Oximetery attachment</li> <li>Initial support for Philips Respironics System One Oximetery attachment</li>

View File

@ -304,10 +304,10 @@ retry_directory:
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
// Check when last checked for updates.. // Check when last checked for updates..
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
bool check_updates = false; //bool check_updates = false;
if (PREF[STR_GEN_UpdatesAutoCheck].toBool()) { if (PREF[STR_GEN_UpdatesAutoCheck].toBool()) {
int update_frequency = PREF[STR_GEN_UpdateCheckFrequency].toInt(); //int update_frequency = PREF[STR_GEN_UpdateCheckFrequency].toInt();
int days = 1000; int days = 1000;
lastchecked = PREF[STR_GEN_UpdatesLastChecked].toDateTime(); lastchecked = PREF[STR_GEN_UpdatesLastChecked].toDateTime();
@ -316,9 +316,9 @@ retry_directory:
days /= 86400; days /= 86400;
}; };
if (days > update_frequency) { // if (days > update_frequency) {
check_updates = true; // check_updates = true;
} // }
} }
if (!Profiles::profiles.size()) { if (!Profiles::profiles.size()) {
@ -337,7 +337,7 @@ retry_directory:
if (vc < 0) { if (vc < 0) {
release_notes(); release_notes();
check_updates = false; //check_updates = false;
} else if (vc > 0) { } else if (vc > 0) {
if (QMessageBox::warning(nullptr, STR_MessageBox_Error, QObject::tr("The version of SleepyHead you just ran is OLDER than the one used to create this data (%1).").arg(PREF[STR_PREF_VersionString].toString()) +"\n\n"+ if (QMessageBox::warning(nullptr, STR_MessageBox_Error, QObject::tr("The version of SleepyHead you just ran is OLDER than the one used to create this data (%1).").arg(PREF[STR_PREF_VersionString].toString()) +"\n\n"+
QObject::tr("It is likely that doing this will cause data corruption, are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { QObject::tr("It is likely that doing this will cause data corruption, are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {

View File

@ -6,7 +6,8 @@
* License. See the file COPYING in the main directory of the Linux * License. See the file COPYING in the main directory of the Linux
* distribution for more details. */ * distribution for more details. */
#include <QGLFormat> #include <QGLContext>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QResource> #include <QResource>
@ -330,6 +331,15 @@ MainWindow::MainWindow(QWidget *parent) :
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(on_aboutToQuit())); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(on_aboutToQuit()));
QList<int> a;
int panel_width = p_profile->appearance->rightPanelWidth();
a.push_back(this->width() - panel_width);
a.push_back(panel_width);
ui->splitter_2->setStretchFactor(1,1);
ui->splitter_2->setSizes(a);
ui->splitter_2->setStretchFactor(1,1);
} }
void MainWindow::on_changeWarningMessage() void MainWindow::on_changeWarningMessage()
@ -1563,7 +1573,7 @@ void MainWindow::DelayedScreenshot()
#endif #endif
#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX) #if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
QRect rec = QApplication::desktop()->screenGeometry(); //QRect rec = QApplication::desktop()->screenGeometry();
// grab the whole screen // grab the whole screen
QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId()); QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId());
@ -2041,10 +2051,6 @@ void MainWindow::on_actionPurge_Current_Day_triggered()
} }
day = p_profile->GetDay(date, MT_CPAP); day = p_profile->GetDay(date, MT_CPAP);
if (day != nullptr) {
int i = 5;
}
getDaily()->clearLastDay(); getDaily()->clearLastDay();
getDaily()->LoadDate(date); getDaily()->LoadDate(date);
} }
@ -2717,3 +2723,8 @@ void MainWindow::on_actionExport_Review_triggered()
{ {
QMessageBox::information(nullptr, STR_MessageBox_Information, QObject::tr("Sorry, this feature is not implemented yet"), QMessageBox::Ok); QMessageBox::information(nullptr, STR_MessageBox_Information, QObject::tr("Sorry, this feature is not implemented yet"), QMessageBox::Ok);
} }
void MainWindow::on_splitter_2_splitterMoved(int, int)
{
p_profile->appearance->setRightPanelWidth(ui->splitter_2->sizes()[1]);
}

View File

@ -332,6 +332,8 @@ class MainWindow : public QMainWindow
void on_actionExport_Review_triggered(); void on_actionExport_Review_triggered();
void on_splitter_2_splitterMoved(int pos, int index);
private: private:
void importCPAPBackups(); void importCPAPBackups();
void finishCPAPImport(); void finishCPAPImport();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1005</width> <width>687</width>
<height>849</height> <height>361</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -926,7 +926,7 @@
<enum>QTabWidget::Rounded</enum> <enum>QTabWidget::Rounded</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<property name="documentMode"> <property name="documentMode">
<bool>false</bool> <bool>false</bool>
@ -1332,18 +1332,6 @@ color: yellow;</string>
</widget> </widget>
</widget> </widget>
<widget class="QToolBox" name="toolBox"> <widget class="QToolBox" name="toolBox">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="palette"> <property name="palette">
<palette> <palette>
<active> <active>
@ -1494,8 +1482,8 @@ QToolBox::tab:selected {
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>240</width> <width>223</width>
<height>724</height> <height>582</height>
</rect> </rect>
</property> </property>
<property name="palette"> <property name="palette">
@ -1909,7 +1897,7 @@ border: 2px solid #56789a; border-radius: 30px;
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>240</width> <width>240</width>
<height>724</height> <height>237</height>
</rect> </rect>
</property> </property>
<property name="palette"> <property name="palette">
@ -3056,8 +3044,8 @@ border-radius: 10px;
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>240</width> <width>69</width>
<height>724</height> <height>237</height>
</rect> </rect>
</property> </property>
<property name="mouseTracking"> <property name="mouseTracking">
@ -3118,8 +3106,8 @@ border-radius: 10px;
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1005</width> <width>687</width>
<height>22</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">

View File

@ -1 +1,2 @@
0 0
1

View File

@ -20,8 +20,8 @@ contains(DEFINES, BrokenGL) {
DEFINES += BROKEN_OPENGL_BUILD DEFINES += BROKEN_OPENGL_BUILD
} else { } else {
message("Building with QGLWidget gGraphView") message("Building with QGLWidget gGraphView")
QT += opengl
} }
QT += opengl
#The following forces ResMed session locking.. it *may* not be necessary.. I'm still trying to assess this properly. #The following forces ResMed session locking.. it *may* not be necessary.. I'm still trying to assess this properly.
DEFINES += LOCK_RESMED_SESSIONS DEFINES += LOCK_RESMED_SESSIONS

View File

@ -1124,12 +1124,12 @@ QString Statistics::GenerateHTML()
periods.push_back(Period(last,last,tr("Last Session"))); periods.push_back(Period(last,last,tr("Last Session")));
bool done=false; //bool done=false;
int j=0; int j=0;
do { do {
s=QDate(l.year(), l.month(), 1); s=QDate(l.year(), l.month(), 1);
if (s < first) { if (s < first) {
done = true; //done = true;
s = first; s = first;
} }
if (p_profile->countDays(row.type, s, l) > 0) { if (p_profile->countDays(row.type, s, l) > 0) {