mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Overview Linecharts Preference - remove by condition compilation GT_SESSTION
This commit is contained in:
parent
8143b6edb2
commit
ea8ae436e4
@ -37,7 +37,9 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
Layer::SetDay(day);
|
Layer::SetDay(day);
|
||||||
|
|
||||||
m_values.clear();
|
m_values.clear();
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
m_times.clear();
|
m_times.clear();
|
||||||
|
#endif
|
||||||
m_days.clear();
|
m_days.clear();
|
||||||
m_hours.clear();
|
m_hours.clear();
|
||||||
m_goodcodes.clear();
|
m_goodcodes.clear();
|
||||||
@ -50,7 +52,7 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
|
|
||||||
|
|
||||||
int dn;
|
int dn;
|
||||||
EventDataType tmp, tmp2, total;
|
EventDataType tmp, total;
|
||||||
ChannelID code;
|
ChannelID code;
|
||||||
CPAPMode cpapmode = (CPAPMode)(int)p_profile->calcSettingsMax(CPAP_Mode, MT_CPAP,
|
CPAPMode cpapmode = (CPAPMode)(int)p_profile->calcSettingsMax(CPAP_Mode, MT_CPAP,
|
||||||
p_profile->FirstDay(MT_CPAP), p_profile->LastDay(MT_CPAP));
|
p_profile->FirstDay(MT_CPAP), p_profile->LastDay(MT_CPAP));
|
||||||
@ -111,19 +113,21 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_fday = 0;
|
m_fday = 0;
|
||||||
qint64 tt, zt;
|
qint64 tt;
|
||||||
m_empty = true;
|
m_empty = true;
|
||||||
|
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
if (m_graphtype == GT_SESSIONS) {
|
if (m_graphtype == GT_SESSIONS) {
|
||||||
// No point drawing anything if no real data on record
|
// No point drawing anything if no real data on record
|
||||||
if (p_profile->countDays(MT_CPAP, p_profile->FirstDay(MT_CPAP), p_profile->LastDay(MT_CPAP)) == 0) {
|
if (p_profile->countDays(MT_CPAP, p_profile->FirstDay(MT_CPAP), p_profile->LastDay(MT_CPAP)) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool first = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
int suboffset;
|
int suboffset;
|
||||||
SummaryType type;
|
SummaryType type;
|
||||||
bool first = true;
|
|
||||||
|
|
||||||
// For each day in the main profile daylist
|
// For each day in the main profile daylist
|
||||||
|
|
||||||
@ -149,7 +153,10 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
// Setup for Sessions Time display chart
|
// Setup for Sessions Time display chart
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
if (m_graphtype == GT_SESSIONS) {
|
if (m_graphtype == GT_SESSIONS) {
|
||||||
|
qint64 zt;
|
||||||
|
EventDataType tmp2;
|
||||||
// Turn all legends on
|
// Turn all legends on
|
||||||
for (int i = 0; i < m_codes.size(); i++) {
|
for (int i = 0; i < m_codes.size(); i++) {
|
||||||
m_goodcodes[i] = true;
|
m_goodcodes[i] = true;
|
||||||
@ -211,7 +218,9 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
m_hours[dn] = total;
|
m_hours[dn] = total;
|
||||||
m_empty = false;
|
m_empty = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// Data Channel summary charts
|
// Data Channel summary charts
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@ -460,7 +469,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
|||||||
EventDataType total;
|
EventDataType total;
|
||||||
|
|
||||||
int daynum = 0;
|
int daynum = 0;
|
||||||
EventDataType h, tmp, tmp2;
|
EventDataType h, tmp;
|
||||||
|
|
||||||
|
|
||||||
l_offset = (minx) % 86400000L;
|
l_offset = (minx) % 86400000L;
|
||||||
@ -617,6 +626,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
if (graphtype == GT_SESSIONS) {
|
if (graphtype == GT_SESSIONS) {
|
||||||
int j;
|
int j;
|
||||||
auto times = m_times.find(zd);
|
auto times = m_times.find(zd);
|
||||||
@ -643,7 +653,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < np; j++) {
|
for (j = 0; j < np; j++) {
|
||||||
tmp2 = times.value()[j] - miny;
|
EventDataType tmp2 = times.value()[j] - miny;
|
||||||
py = top + height - (tmp2 * ymult);
|
py = top + height - (tmp2 * ymult);
|
||||||
|
|
||||||
tmp = d.value()[j]; // length
|
tmp = d.value()[j]; // length
|
||||||
@ -674,7 +684,9 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
|||||||
total_val += hours;
|
total_val += hours;
|
||||||
total_hours += hours;
|
total_hours += hours;
|
||||||
total_days++;
|
total_days++;
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
if (!d.value().contains(0)) {
|
if (!d.value().contains(0)) {
|
||||||
goto jumpnext;
|
goto jumpnext;
|
||||||
}
|
}
|
||||||
@ -1102,6 +1114,7 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event, gGraph *graph)
|
|||||||
//EventDataType val;
|
//EventDataType val;
|
||||||
QString val;
|
QString val;
|
||||||
|
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
if (m_graphtype == GT_SESSIONS) {
|
if (m_graphtype == GT_SESSIONS) {
|
||||||
if (m_type[0] == ST_HOURS) {
|
if (m_type[0] == ST_HOURS) {
|
||||||
|
|
||||||
@ -1129,7 +1142,9 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event, gGraph *graph)
|
|||||||
v = m_times[zd][lastt] + m_values[zd][lastt];
|
v = m_times[zd][lastt] + m_values[zd][lastt];
|
||||||
strTooltip += "\r\n"+QString(QObject::tr("Waketime: %1")).arg(formatTime(v, false, false, true));
|
strTooltip += "\r\n"+QString(QObject::tr("Waketime: %1")).arg(formatTime(v, false, false, true));
|
||||||
|
|
||||||
} else if (m_graphtype == GT_BAR) {
|
} else
|
||||||
|
#endif
|
||||||
|
if (m_graphtype == GT_BAR) {
|
||||||
if (m_type[0] == ST_HOURS) {
|
if (m_type[0] == ST_HOURS) {
|
||||||
int t = d.value()[0] * 3600.0;
|
int t = d.value()[0] * 3600.0;
|
||||||
int h = t / 3600;
|
int h = t / 3600;
|
||||||
|
@ -14,12 +14,32 @@
|
|||||||
#include "gGraphView.h"
|
#include "gGraphView.h"
|
||||||
#include "gXAxis.h"
|
#include "gXAxis.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! \enum GraphType
|
/*! \enum GraphType
|
||||||
\value GT_BAR Display as a BarGraph
|
\value GT_BAR Display as a BarGraph
|
||||||
\value GT_LINE Display as a line plot
|
\value GT_LINE Display as a line plot
|
||||||
\value GT_SESSIONS Display type for session times chart
|
|
||||||
*/
|
*/
|
||||||
enum GraphType { GT_BAR, GT_LINE, GT_POINTS, GT_SESSIONS };
|
// \value GT_SESSIONS Display type for session times chart
|
||||||
|
/*
|
||||||
|
The following in a conjecture, since I can not test NON-CPAP data.
|
||||||
|
BMI, Weight and Zombie graphs are the only NON-CPAP charts in Overview.
|
||||||
|
|
||||||
|
Currently there are 4 graphs types, one of which is not used.
|
||||||
|
GT_BAR Used by CPAP graph to make bar graphs for each day
|
||||||
|
GT_LINE ? Used for making a line ?
|
||||||
|
GT_POINT ? Used to display points instead of lines ?
|
||||||
|
GT_SESSION ?? NOT USED. It will be conditionally compiled out.
|
||||||
|
|
||||||
|
BMI, Weight and Zombie graphs current use GT_LINE and not GT_BAR
|
||||||
|
The Overview Linecharts preference allows points to be displayed instead of lines.
|
||||||
|
*/
|
||||||
|
#define USE_GT_SESSIONS_OFF
|
||||||
|
enum GraphType { GT_BAR, GT_LINE, GT_POINTS
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
|
, GT_SESSIONS
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*! \class SummaryChart
|
/*! \class SummaryChart
|
||||||
@ -80,7 +100,9 @@ class SummaryChart: public Layer
|
|||||||
layer->m_type = m_type;
|
layer->m_type = m_type;
|
||||||
layer->m_typeval = m_typeval;
|
layer->m_typeval = m_typeval;
|
||||||
layer->m_values = m_values;
|
layer->m_values = m_values;
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
layer->m_times = m_times;
|
layer->m_times = m_times;
|
||||||
|
#endif
|
||||||
layer->m_hours = m_hours;
|
layer->m_hours = m_hours;
|
||||||
layer->m_days = m_days;
|
layer->m_days = m_days;
|
||||||
|
|
||||||
@ -116,7 +138,9 @@ class SummaryChart: public Layer
|
|||||||
QVector<SummaryType> m_type;
|
QVector<SummaryType> m_type;
|
||||||
QVector<EventDataType> m_typeval;
|
QVector<EventDataType> m_typeval;
|
||||||
QHash<int, QMap<short, EventDataType> > m_values;
|
QHash<int, QMap<short, EventDataType> > m_values;
|
||||||
|
#ifdef USE_GT_SESSIONS
|
||||||
QHash<int, QMap<short, EventDataType> > m_times;
|
QHash<int, QMap<short, EventDataType> > m_times;
|
||||||
|
#endif
|
||||||
QHash<int, EventDataType> m_hours;
|
QHash<int, EventDataType> m_hours;
|
||||||
QHash<int, Day *> m_days;
|
QHash<int, Day *> m_days;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user