mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Daily view summary graph experiment (TEST)
This commit is contained in:
parent
be13ad98ba
commit
8263872aa2
@ -117,9 +117,11 @@ gGraph::gGraph(QString name, gGraphView *graphview, QString title, QString units
|
||||
m_graphview(graphview),
|
||||
m_title(title),
|
||||
m_units(units),
|
||||
m_height(height),
|
||||
m_visible(true)
|
||||
{
|
||||
if (height == 0) {
|
||||
height = p_profile->appearance->graphHeight();
|
||||
}
|
||||
if (graphview->contains(name)) {
|
||||
qDebug() << "Trying to duplicate " << name << " when a graph with the same name already exists";
|
||||
name+="-1";
|
||||
@ -1381,6 +1383,18 @@ Layer *gGraph::getLineChart()
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
int gGraph::minHeight()
|
||||
{
|
||||
int minheight = m_min_height;
|
||||
|
||||
for (int i=0; i<m_layers.size(); ++i) {
|
||||
int mh = m_layers[i]->minimumHeight();
|
||||
mh += m_margintop + m_marginbottom;
|
||||
if (mh > minheight) minheight = mh;
|
||||
}
|
||||
// layers need to set their own too..
|
||||
return minheight;
|
||||
}
|
||||
|
||||
void GetTextExtent(QString text, int &width, int &height, QFont *font)
|
||||
{
|
||||
@ -1390,7 +1404,7 @@ void GetTextExtent(QString text, int &width, int &height, QFont *font)
|
||||
#endif
|
||||
QFontMetrics fm(*font);
|
||||
//#ifdef Q_OS_WIN32
|
||||
QRect r = fm.tightBoundingRect(text);
|
||||
QRect r = fm.boundingRect(text);
|
||||
width = r.width();
|
||||
height = r.height();
|
||||
//#else
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <QString>
|
||||
#include <QPainter>
|
||||
|
||||
#include "Graphs/glcommon.h"
|
||||
#include "Graphs/layer.h"
|
||||
|
||||
class gGraphView;
|
||||
@ -48,7 +49,7 @@ class gGraph : public QObject
|
||||
\param short group containing which graph-link group this graph belongs to
|
||||
*/
|
||||
gGraph(QString name, gGraphView *graphview = nullptr, QString title = "", QString units = "",
|
||||
int height = 100, short group = 0);
|
||||
int height = 0, short group = 0);
|
||||
virtual ~gGraph();
|
||||
|
||||
//! \brief Tells all Layers to deselect any highlighting
|
||||
@ -83,7 +84,8 @@ class gGraph : public QObject
|
||||
//! \brief Set the height element. (relative to the total of all heights)
|
||||
void setHeight(float height) { m_height = height; invalidate_yAxisImage = true; }
|
||||
|
||||
int minHeight() { return m_min_height; }
|
||||
//! \brief Return minimum height this graph is allowed to (considering layer preferences too)
|
||||
int minHeight();
|
||||
void setMinHeight(int height) { m_min_height = height; }
|
||||
|
||||
int maxHeight() { return m_max_height; }
|
||||
|
@ -891,6 +891,9 @@ bool gGraphView::renderGraphs(QPainter &painter)
|
||||
int pinned_graphs = 0; // count
|
||||
|
||||
for (int i = 0; i < m_graphs.size(); i++) {
|
||||
if (m_graphs[i]->height() < m_graphs[i]->minHeight()) {
|
||||
m_graphs[i]->setHeight(m_graphs[i]->minHeight());
|
||||
}
|
||||
if (m_graphs[i]->isEmpty()) { continue; }
|
||||
|
||||
if (!m_graphs[i]->visible()) { continue; }
|
||||
|
@ -65,11 +65,17 @@ bool gSegmentChart::isEmpty()
|
||||
|
||||
void gSegmentChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
{
|
||||
int left = region.boundingRect().left();
|
||||
int top = region.boundingRect().top();
|
||||
int width = region.boundingRect().width();
|
||||
int height = region.boundingRect().height();
|
||||
QRect rect = region.boundingRect();
|
||||
int height = qMin(rect.height(), rect.width());
|
||||
int width = qMin(rect.height(), rect.width());
|
||||
|
||||
int left = rect.left();
|
||||
int top = rect.top();
|
||||
|
||||
if (rect.width() > rect.height()) {
|
||||
left = rect.left() + (rect.width() - rect.height());
|
||||
}
|
||||
left --;
|
||||
if (!m_visible) { return; }
|
||||
|
||||
if (!m_day) { return; }
|
||||
|
@ -504,7 +504,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
lastY.resize(numcodes);
|
||||
int zd = minx / 86400000L;
|
||||
zd--;
|
||||
QHash<int, QHash<short, EventDataType> >::iterator d = m_values.find(zd);
|
||||
QHash<int, QMap<short, EventDataType> >::iterator d = m_values.find(zd);
|
||||
|
||||
QVector<bool> goodcodes;
|
||||
goodcodes.resize(m_goodcodes.size());
|
||||
@ -629,7 +629,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
|
||||
if (graphtype == GT_SESSIONS) {
|
||||
int j;
|
||||
QHash<int, QHash<short, EventDataType> >::iterator times = m_times.find(zd);
|
||||
QHash<int, QMap<short, EventDataType> >::iterator times = m_times.find(zd);
|
||||
QColor col = m_colors[0];
|
||||
//if (hours<compliance_hours) col=QColor("#f03030");
|
||||
|
||||
@ -702,7 +702,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
bool good;
|
||||
SummaryType type;
|
||||
|
||||
for (QHash<short, EventDataType>::iterator g = d.value().begin(); g != d.value().end(); g++) {
|
||||
for (QMap<short, EventDataType>::iterator g = d.value().begin(); g != d.value().end(); g++) {
|
||||
short j = g.key();
|
||||
|
||||
if (!j) { continue; }
|
||||
@ -1092,9 +1092,9 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event, gGraph *graph)
|
||||
hl_day = zd;
|
||||
graph->Trigger(2000);
|
||||
|
||||
QHash<int, QHash<short, EventDataType> >::iterator d = m_values.find(hl_day);
|
||||
QHash<int, QMap<short, EventDataType> >::iterator d = m_values.find(hl_day);
|
||||
|
||||
QHash<short, EventDataType> &valhash = d.value();
|
||||
QMap<short, EventDataType> &valhash = d.value();
|
||||
|
||||
x += m_rect.left(); //gYAxis::Margin+gGraphView::titleWidth; //graph->m_marginleft+
|
||||
int y = event->y() - m_rect.top() + rtop - 15;
|
||||
|
@ -74,8 +74,8 @@ class SummaryChart: public Layer
|
||||
//QVector<bool> m_zeros;
|
||||
QVector<SummaryType> m_type;
|
||||
QVector<EventDataType> m_typeval;
|
||||
QHash<int, QHash<short, EventDataType> > m_values;
|
||||
QHash<int, QHash<short, EventDataType> > m_times;
|
||||
QHash<int, QMap<short, EventDataType> > m_values;
|
||||
QHash<int, QMap<short, EventDataType> > m_times;
|
||||
QHash<int, EventDataType> m_hours;
|
||||
QHash<int, Day *> m_days;
|
||||
|
||||
|
242
sleepyhead/Graphs/gdailysummary.cpp
Normal file
242
sleepyhead/Graphs/gdailysummary.cpp
Normal file
@ -0,0 +1,242 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* vim: set ts=8 sts=4 et sw=4 tw=99:
|
||||
*
|
||||
* gDailySummary Graph Implementation
|
||||
*
|
||||
* Copyright (c) 2011-2014 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file COPYING in the main directory of the Linux
|
||||
* distribution for more details. */
|
||||
|
||||
#include <cmath>
|
||||
#include <QFontMetrics>
|
||||
#include "gdailysummary.h"
|
||||
#include "Graphs/gGraph.h"
|
||||
#include "Graphs/gGraphView.h"
|
||||
#include "SleepLib/profiles.h"
|
||||
|
||||
gDailySummary::gDailySummary() : Layer(NoChannel)
|
||||
{
|
||||
}
|
||||
|
||||
void gDailySummary::SetDay(Day *day)
|
||||
{
|
||||
m_day = day;
|
||||
if (day) {
|
||||
m_minx = m_day->first();
|
||||
m_maxx = m_day->last();;
|
||||
|
||||
quint32 zchans = schema::SPAN | schema::FLAG;
|
||||
bool show_minors = true;
|
||||
if (p_profile->general->showUnknownFlags()) zchans |= schema::UNKNOWN;
|
||||
|
||||
if (show_minors) zchans |= schema::MINOR_FLAG;
|
||||
QList<ChannelID> available = day->getSortedMachineChannels(zchans);
|
||||
|
||||
flag_values.clear();
|
||||
flag_background.clear();
|
||||
flag_foreground.clear();
|
||||
flag_labels.clear();
|
||||
flag_codes.clear();
|
||||
|
||||
EventDataType val;
|
||||
EventDataType hours = day->hours();
|
||||
|
||||
int x,y;
|
||||
flag_value_width = flag_label_width = flag_height = 0;
|
||||
for (int i=0; i < available.size(); ++i) {
|
||||
ChannelID code = available.at(i);
|
||||
schema::Channel & chan = schema::channel[code];
|
||||
QString data;
|
||||
if (chan.type() == schema::SPAN) {
|
||||
val = (100.0 / hours)*(day->sum(code)/3600.0);
|
||||
data = QString("%1%").arg(val,0,'f',2);
|
||||
} else {
|
||||
val = day->count(code) / hours;
|
||||
data = QString("%1").arg(val,0,'f',2);
|
||||
}
|
||||
flag_values.push_back(data);
|
||||
flag_codes.push_back(code);
|
||||
flag_background.push_back(chan.defaultColor());
|
||||
flag_foreground.push_back((brightness(chan.defaultColor()) < 0.3) ? Qt::white : Qt::black); // pick a contrasting color
|
||||
|
||||
QString label = chan.fullname();
|
||||
flag_labels.push_back(label);
|
||||
GetTextExtent(label, x, y, defaultfont);
|
||||
|
||||
// Update maximum text boundaries
|
||||
if (y > flag_height) flag_height = y;
|
||||
if (x > flag_label_width) flag_label_width = x;
|
||||
|
||||
GetTextExtent(data, x, y, defaultfont);
|
||||
if (x > flag_value_width) flag_value_width = x;
|
||||
if (y > flag_height) flag_height = y;
|
||||
}
|
||||
m_empty = (available.size() > 0);
|
||||
|
||||
info_labels.clear();
|
||||
info_values.clear();
|
||||
|
||||
QDateTime dt = QDateTime::fromMSecsSinceEpoch(day->first());
|
||||
info_labels.append(QObject::tr("Date"));
|
||||
info_values.append(dt.date().toString(Qt::LocaleDate));
|
||||
info_labels.append(QObject::tr("Sleep"));
|
||||
info_values.append(dt.time().toString());
|
||||
QDateTime wake = QDateTime::fromMSecsSinceEpoch(day->last());
|
||||
info_labels.append(QObject::tr("Wake"));
|
||||
info_values.append(wake.time().toString());
|
||||
int secs = hours * 3600.0;
|
||||
int h = secs / 3600;
|
||||
int m = secs / 60 % 60;
|
||||
int s = secs % 60;
|
||||
info_labels.append(QObject::tr("Hours"));
|
||||
info_values.append(QString().sprintf("%ih, %im, %is",h,m,s));
|
||||
|
||||
info_value_width = info_label_width = info_height = 0;
|
||||
|
||||
for (int i=0; i < info_labels.size(); ++i) {
|
||||
GetTextExtent(info_labels.at(i), x, y, mediumfont);
|
||||
if (y > info_height) info_height = y;
|
||||
if (x > info_label_width) info_label_width = x;
|
||||
|
||||
GetTextExtent(info_values.at(i), x, y, mediumfont);
|
||||
if (y > info_height) info_height = y;
|
||||
if (x > info_value_width) info_value_width = x;
|
||||
}
|
||||
|
||||
m_minimum_height = flag_values.size() * flag_height;
|
||||
|
||||
} else {
|
||||
m_minx = m_maxx = 0;
|
||||
m_miny = m_maxy = 0;
|
||||
m_empty = true;
|
||||
|
||||
m_day = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool gDailySummary::isEmpty()
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void gDailySummary::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
{
|
||||
|
||||
QRect rect = region.boundingRect();
|
||||
|
||||
int top = rect.top();
|
||||
int left = rect.left();
|
||||
int width = rect.width();
|
||||
int height = rect.height();
|
||||
|
||||
// Draw bounding box
|
||||
painter.setPen(QColor(Qt::black));
|
||||
// painter.drawRect(QRect(left,top,width,height),5,5);
|
||||
|
||||
|
||||
QRectF rect1, rect2;
|
||||
int size;
|
||||
// QFontMetrics fm(*mediumfont);
|
||||
// top += fm.height();
|
||||
// painter.setFont(*mediumfont);
|
||||
// size = info_values.size();
|
||||
//
|
||||
// for (int i=0; i < size; ++i) {
|
||||
// rect1 = QRect(0,0,200,100), rect2 = QRect(0,0,200,100);
|
||||
// rect1 = painter.boundingRect(rect1, info_labels.at(i));
|
||||
// w.renderText(info_labels.at(i), column, row, 0, Qt::black, mediumfont);
|
||||
|
||||
// rect2 = painter.boundingRect(rect2, info_values.at(i));
|
||||
// w.renderText(info_values.at(i), column, row + rect1.height(), 0, Qt::black, mediumfont);
|
||||
// column += qMax(rect1.width(), rect2.width()) + 15;
|
||||
// }
|
||||
// row += rect1.height()+rect2.height()-5;
|
||||
// column = left + 10;
|
||||
|
||||
size = flag_values.size();
|
||||
|
||||
|
||||
int vis = 0;
|
||||
for (int i=0; i < size; ++i) {
|
||||
schema::Channel & chan = schema::channel[flag_codes.at(i)];
|
||||
if (chan.enabled()) vis++;
|
||||
}
|
||||
float row = top + 10;
|
||||
float column = left+10;
|
||||
|
||||
flag_value_width = 0;
|
||||
flag_label_width = 0;
|
||||
flag_height = 0;
|
||||
|
||||
float hpl = float(height-20) / float(vis);
|
||||
QFont font(defaultfont->family());
|
||||
font.setPixelSize(hpl*0.75);
|
||||
|
||||
painter.setFont(font);
|
||||
|
||||
for (int i=0; i < size; ++i) {
|
||||
rect1 = QRectF(0,0,0,0), rect2 = QRectF(0,0,0,0);
|
||||
|
||||
rect1 = painter.boundingRect(rect1, Qt::AlignLeft | Qt::AlignTop, flag_labels.at(i));
|
||||
rect2 = painter.boundingRect(rect2, Qt::AlignLeft | Qt::AlignTop, flag_values.at(i));
|
||||
|
||||
if (rect1.width() > flag_label_width) flag_label_width = rect1.width();
|
||||
if (rect2.width() > flag_value_width) flag_value_width = rect2.width();
|
||||
if (rect1.height() > flag_height) flag_height = rect1.height();
|
||||
if (rect2.height() > flag_height) flag_height = rect2.height();
|
||||
|
||||
}
|
||||
flag_height = hpl;
|
||||
|
||||
|
||||
QRect flag_outline(column -5, row -5, (flag_value_width + flag_label_width + 20 + 4) + 10, (hpl * vis) + 10);
|
||||
painter.setPen(QPen(Qt::gray, 1));
|
||||
painter.drawRoundedRect(flag_outline, 5, 5);
|
||||
|
||||
|
||||
for (int i=0; i < size; ++i) {
|
||||
schema::Channel & chan = schema::channel[flag_codes.at(i)];
|
||||
if (!chan.enabled()) continue;
|
||||
painter.setPen(flag_foreground.at(i));
|
||||
|
||||
QRectF box(column, floor(row) , (flag_value_width + flag_label_width + 20 + 4), ceil(flag_height));
|
||||
painter.fillRect(box, QBrush(flag_background.at(i)));
|
||||
if (box.contains(w.graphView()->currentMousePos())) {
|
||||
w.ToolTip(chan.description(), w.graphView()->currentMousePos().x()+5, w.graphView()->currentMousePos().y(), TT_AlignLeft);
|
||||
font.setBold(true);
|
||||
font.setItalic(true);
|
||||
painter.setFont(font);
|
||||
QRect rect1 = QRect(column+2, row , flag_label_width, ceil(hpl));
|
||||
painter.drawText(rect1, Qt::AlignVCenter, flag_labels.at(i));
|
||||
QRect rect2 = QRect(column+2 + flag_label_width + 20, row, flag_value_width, ceil(hpl));
|
||||
painter.drawText(rect2, Qt::AlignVCenter, flag_values.at(i));
|
||||
font.setBold(false);
|
||||
font.setItalic(false);
|
||||
painter.setFont(font);
|
||||
} else {
|
||||
QRect rect1 = QRect(column+2, row , flag_label_width, ceil(hpl));
|
||||
painter.drawText(rect1, Qt::AlignVCenter, flag_labels.at(i));
|
||||
QRect rect2 = QRect(column+2 + flag_label_width + 20, row, flag_value_width, ceil(hpl));
|
||||
painter.drawText(rect2, Qt::AlignVCenter, flag_values.at(i));
|
||||
}
|
||||
|
||||
row += (flag_height);
|
||||
|
||||
// if (row > (top + rect.height() - flag_height - 4)) {
|
||||
// row = top;
|
||||
// column += flag_label_width + 20 + flag_value_width + 5;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool gDailySummary::mouseMoveEvent(QMouseEvent *event, gGraph *graph)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
Q_UNUSED(graph)
|
||||
return true;
|
||||
}
|
56
sleepyhead/Graphs/gdailysummary.h
Normal file
56
sleepyhead/Graphs/gdailysummary.h
Normal file
@ -0,0 +1,56 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* vim: set ts=8 sts=4 et sw=4 tw=99:
|
||||
*
|
||||
* gDailySummary Graph Implementation
|
||||
*
|
||||
* Copyright (c) 2011-2014 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file COPYING in the main directory of the Linux
|
||||
* distribution for more details. */
|
||||
|
||||
#ifndef GDAILYSUMMARY_H
|
||||
#define GDAILYSUMMARY_H
|
||||
|
||||
#include "Graphs/layer.h"
|
||||
#include "SleepLib/day.h"
|
||||
|
||||
class gDailySummary:public Layer
|
||||
{
|
||||
public:
|
||||
gDailySummary();
|
||||
virtual ~gDailySummary() {}
|
||||
|
||||
virtual void SetDay(Day *d);
|
||||
|
||||
virtual bool isEmpty();
|
||||
|
||||
//! Draw filled rectangles behind Event Flag's, and an outlines around them all, Calls the individual paint for each gFlagLine
|
||||
virtual void paint(QPainter &painter, gGraph &w, const QRegion ®ion);
|
||||
|
||||
virtual int minimumHeight() { return m_minimum_height; }
|
||||
bool mouseMoveEvent(QMouseEvent *event, gGraph *graph);
|
||||
|
||||
protected:
|
||||
QList<QString> flag_values;
|
||||
QList<QString> flag_labels;
|
||||
QList<ChannelID> flag_codes;
|
||||
QList<QColor> flag_foreground;
|
||||
QList<QColor> flag_background;
|
||||
|
||||
QList<QString> info_labels;
|
||||
QList<QString> info_values;
|
||||
|
||||
float flag_height;
|
||||
float flag_label_width;
|
||||
float flag_value_width;
|
||||
|
||||
int info_height;
|
||||
int info_label_width;
|
||||
int info_value_width;
|
||||
|
||||
int m_minimum_height;
|
||||
bool m_empty;
|
||||
};
|
||||
|
||||
#endif // GDAILYSUMMARY_H
|
@ -12,6 +12,11 @@
|
||||
#include <cmath>
|
||||
#include "glcommon.h"
|
||||
|
||||
float brightness(QColor color) {
|
||||
return color.redF()*0.299 + color.greenF()*0.587 + color.blueF()*0.114;
|
||||
}
|
||||
|
||||
|
||||
#ifdef BUILD_WITH_MSVC
|
||||
|
||||
#if (_MSC_VER < 1800)
|
||||
|
@ -18,6 +18,9 @@
|
||||
#define nullptr NULL
|
||||
#endif
|
||||
|
||||
//! \brief Returns the grayscale brightness (between 0 and 1) of a color
|
||||
float brightness(QColor color);
|
||||
|
||||
#define MIN(a,b) (((a)<(b)) ? (a) : (b));
|
||||
#define MAX(a,b) (((a)<(b)) ? (b) : (a));
|
||||
|
||||
|
@ -70,6 +70,9 @@ class Layer
|
||||
//! \brief Deselect any highlighted components
|
||||
virtual void deselect() { }
|
||||
|
||||
//! \brief Override to set the minimum allowed height for this layer
|
||||
virtual int minimumHeight() { return 0; }
|
||||
|
||||
//! \brief Return this layers physical minimum date boundary
|
||||
virtual qint64 Minx() { return m_day ? m_day->first() : m_minx; }
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "Graphs/gYAxis.h"
|
||||
#include "Graphs/gSegmentChart.h"
|
||||
#include "Graphs/gStatsLine.h"
|
||||
#include "Graphs/gdailysummary.h"
|
||||
|
||||
//extern QProgressBar *qprogress;
|
||||
extern MainWindow * mainwin;
|
||||
@ -147,6 +148,14 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
*SF = nullptr,
|
||||
*AHI = nullptr;
|
||||
|
||||
const QString STR_GRAPH_DailySummary = "DailySummary";
|
||||
|
||||
gGraph * SG;
|
||||
graphlist[STR_GRAPH_DailySummary] = SG =new gGraph(STR_GRAPH_DailySummary, GraphView, QObject::tr("Summary"), QObject::tr("Summary of this daily information"), default_height);
|
||||
// SG->AddLayer(new gFlagsLabelArea(nullptr),LayerLeft,gYAxis::Margin);
|
||||
SG->AddLayer(AddCPAP(new gDailySummary()));
|
||||
|
||||
|
||||
graphlist[STR_GRAPH_SleepFlags] = SF = new gGraph(STR_GRAPH_SleepFlags, GraphView, STR_TR_EventFlags, STR_TR_EventFlags, default_height);
|
||||
SF->setPinned(true);
|
||||
|
||||
@ -209,9 +218,20 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
evseg->AddSlice(CPAP_UserFlag2,QColor(0xc0,0xc0,0xe0,0xff),tr("UF2"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
GAHI->AddLayer(AddCPAP(evseg));
|
||||
GAHI->setMargins(0,0,0,0);
|
||||
|
||||
|
||||
// gSegmentChart * evseg2=new gSegmentChart(GST_Pie);
|
||||
// evseg2->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),STR_TR_H);
|
||||
// evseg2->AddSlice(CPAP_Apnea,QColor(0x20,0x80,0x20,0xff),STR_TR_UA);
|
||||
// evseg2->AddSlice(CPAP_Obstructive,QColor(0x40,0xaf,0xbf,0xff),STR_TR_OA);
|
||||
// evseg2->AddSlice(CPAP_ClearAirway,QColor(0xb2,0x54,0xcd,0xff),STR_TR_CA);
|
||||
|
||||
// SG->AddLayer(AddCPAP(evseg2), LayerRight, default_height, default_height, 0, false, default_height);
|
||||
|
||||
gFlagsGroup *fg=new gFlagsGroup();
|
||||
SF->AddLayer(AddCPAP(fg));
|
||||
// Spans
|
||||
@ -247,8 +267,9 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
|
||||
// The following list contains graphs that don't have standard xgrid/yaxis labels
|
||||
QStringList skipgraph;
|
||||
skipgraph.push_back("EventBreakdown");
|
||||
skipgraph.push_back("SF");
|
||||
skipgraph.push_back(STR_GRAPH_EventBreakdown);
|
||||
skipgraph.push_back(STR_GRAPH_SleepFlags);
|
||||
skipgraph.push_back(STR_GRAPH_DailySummary);
|
||||
|
||||
QHash<QString, gGraph *>::iterator it;
|
||||
|
||||
@ -1301,10 +1322,6 @@ QString Daily::getEventBreakdown(Day * cpap)
|
||||
return html;
|
||||
}
|
||||
|
||||
float brightness(QColor color) {
|
||||
return color.redF()*0.299 + color.greenF()*0.587 + color.blueF()*0.114;
|
||||
}
|
||||
|
||||
QString Daily::getSleepTime(Day * cpap, Day * oxi)
|
||||
{
|
||||
QString html;
|
||||
|
@ -219,14 +219,17 @@ Overview::Overview(QWidget *parent, gGraphView *shared) :
|
||||
bc = new SummaryChart(STR_TR_AHI, GT_BAR);
|
||||
}
|
||||
|
||||
bc->addSlice(CPAP_Hypopnea, COLOR_Hypopnea, ST_CPH);
|
||||
bc->addSlice(CPAP_Apnea, COLOR_Apnea, ST_CPH);
|
||||
bc->addSlice(CPAP_Obstructive, COLOR_Obstructive, ST_CPH);
|
||||
bc->addSlice(CPAP_ClearAirway, COLOR_ClearAirway, ST_CPH);
|
||||
bc->addSlice(CPAP_Obstructive, COLOR_Obstructive, ST_CPH);
|
||||
bc->addSlice(CPAP_Apnea, COLOR_Apnea, ST_CPH);
|
||||
bc->addSlice(CPAP_Hypopnea, COLOR_Hypopnea, ST_CPH);
|
||||
|
||||
if (p_profile->general->calculateRDI()) {
|
||||
bc->addSlice(CPAP_RERA, COLOR_RERA, ST_CPH);
|
||||
}
|
||||
bc->addSlice(CPAP_UserFlag1, COLOR_UserFlag1, ST_CPH);
|
||||
bc->addSlice(CPAP_UserFlag2, COLOR_UserFlag2, ST_CPH);
|
||||
|
||||
|
||||
AHI->AddLayer(bc);
|
||||
|
||||
|
@ -179,7 +179,8 @@ SOURCES += \
|
||||
logger.cpp \
|
||||
welcome.cpp \
|
||||
SleepLib/machine_common.cpp \
|
||||
SleepLib/loader_plugins/weinmann_loader.cpp
|
||||
SleepLib/loader_plugins/weinmann_loader.cpp \
|
||||
Graphs/gdailysummary.cpp
|
||||
|
||||
HEADERS += \
|
||||
common_gui.h \
|
||||
@ -235,7 +236,8 @@ HEADERS += \
|
||||
SleepLib/loader_plugins/md300w1_loader.h \
|
||||
Graphs/gSessionTimesChart.h \
|
||||
logger.h \
|
||||
SleepLib/loader_plugins/weinmann_loader.h
|
||||
SleepLib/loader_plugins/weinmann_loader.h \
|
||||
Graphs/gdailysummary.h
|
||||
|
||||
FORMS += \
|
||||
daily.ui \
|
||||
|
Loading…
Reference in New Issue
Block a user