mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Bye bye Graph Snapshots, hello Clone Graphs
This commit is contained in:
parent
4f53a7312f
commit
cbaf7abc7f
@ -50,7 +50,35 @@ public:
|
||||
bool mouseReleaseEvent(QMouseEvent *event, gGraph *graph);
|
||||
|
||||
virtual void recalcFinished();
|
||||
virtual Layer * Clone() {
|
||||
MinutesAtPressure * map = new MinutesAtPressure();
|
||||
Layer::CloneInto(map);
|
||||
CloneInto(map);
|
||||
return map;
|
||||
}
|
||||
|
||||
void CloneInto(MinutesAtPressure * layer) {
|
||||
mutex.lock();
|
||||
timelock.lock();
|
||||
layer->m_empty = m_empty;
|
||||
layer->m_minimum_height = m_minimum_height;
|
||||
layer->m_lastminx = m_lastminx;
|
||||
layer->m_lastmaxx = m_lastmaxx;
|
||||
layer->times = times;
|
||||
layer->chans = chans;
|
||||
layer->events = events;
|
||||
layer->maxtime = maxtime;
|
||||
layer->maxevents = maxevents;
|
||||
layer->m_presChannel = m_presChannel;
|
||||
layer->m_minpressure = m_minpressure;
|
||||
layer->m_maxpressure = m_maxpressure;
|
||||
layer->max_mins = max_mins;
|
||||
|
||||
layer->ahis = ahis;
|
||||
|
||||
mutex.unlock();
|
||||
timelock.unlock();
|
||||
}
|
||||
protected:
|
||||
QMutex timelock;
|
||||
QMutex mutex;
|
||||
|
@ -15,6 +15,7 @@
|
||||
gLabelArea::gLabelArea(Layer * layer)
|
||||
: gSpacer(20)
|
||||
{
|
||||
m_layertype = LT_Spacer;
|
||||
m_mainlayer = layer;
|
||||
}
|
||||
bool gLabelArea::mouseMoveEvent(QMouseEvent *event, gGraph *graph)
|
||||
|
@ -29,6 +29,17 @@ class gLabelArea: public gSpacer
|
||||
protected:
|
||||
Layer *m_mainlayer;
|
||||
virtual bool mouseMoveEvent(QMouseEvent *event, gGraph *graph);
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gLabelArea * layer = new gLabelArea(nullptr); //ouchie..
|
||||
Layer::CloneInto(layer);
|
||||
CloneInto(layer);
|
||||
return layer;
|
||||
}
|
||||
|
||||
void CloneInto(gLabelArea * ) {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -54,6 +65,22 @@ class gFlagsLine: public Layer
|
||||
|
||||
void setTotalLines(int i) { total_lines = i; }
|
||||
void setLineNum(int i) { line_num = i; }
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gFlagsLine * layer = new gFlagsLine(nullptr); //ouchie..
|
||||
Layer::CloneInto(layer);
|
||||
CloneInto(layer);
|
||||
return layer;
|
||||
}
|
||||
|
||||
void CloneInto(gFlagsLine * layer ) {
|
||||
layer->m_always_visible = m_always_visible;
|
||||
layer->total_lines = total_lines;
|
||||
layer->line_num = line_num;
|
||||
layer->m_lx = m_lx;
|
||||
layer->m_ly = m_ly;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool mouseMoveEvent(QMouseEvent *event, gGraph *graph);
|
||||
@ -100,6 +127,26 @@ class gFlagsGroup: public LayerGroup
|
||||
|
||||
void alwaysVisible(ChannelID code) { m_alwaysvisible.push_back(code); }
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gFlagsGroup * layer = new gFlagsGroup(); //ouchie..
|
||||
Layer::CloneInto(layer);
|
||||
CloneInto(layer);
|
||||
return layer;
|
||||
}
|
||||
|
||||
void CloneInto(gFlagsGroup * layer) {
|
||||
layer->m_alwaysvisible = m_alwaysvisible;
|
||||
layer->availableChans = availableChans;
|
||||
|
||||
for (int i=0; i<lvisible.size(); i++) {
|
||||
layer->lvisible.append(dynamic_cast<gFlagsLine *>(lvisible.at(i)->Clone()));
|
||||
}
|
||||
layer->m_barh = m_barh;
|
||||
layer->m_empty = m_empty;
|
||||
layer->m_rebuild_cpap = m_rebuild_cpap;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool mouseMoveEvent(QMouseEvent *event, gGraph *graph);
|
||||
|
||||
|
@ -129,7 +129,7 @@ gGraph::gGraph(QString name, gGraphView *graphview, QString title, QString units
|
||||
|
||||
m_layers.clear();
|
||||
|
||||
m_issnapshot = false;
|
||||
m_snapshot = false;
|
||||
f_miny = f_maxy = 0;
|
||||
rmin_x = rmin_y = 0;
|
||||
rmax_x = rmax_y = 0;
|
||||
@ -145,7 +145,8 @@ gGraph::gGraph(QString name, gGraphView *graphview, QString title, QString units
|
||||
timer = new QTimer(graphview);
|
||||
connect(timer, SIGNAL(timeout()), SLOT(Timeout()));
|
||||
} else {
|
||||
timer = nullptr;
|
||||
timer = new QTimer();
|
||||
connect(timer, SIGNAL(timeout()), SLOT(Timeout()));
|
||||
// know what I'm doing now.. ;)
|
||||
// qWarning() << "gGraph created without a gGraphView container.. Naughty programmer!! Bad!!!";
|
||||
}
|
||||
@ -217,10 +218,6 @@ bool gGraph::isSelected()
|
||||
|
||||
bool gGraph::isEmpty()
|
||||
{
|
||||
if (m_issnapshot) {
|
||||
return graphView()->isEmpty();
|
||||
}
|
||||
|
||||
bool empty = true;
|
||||
|
||||
for (QVector<Layer *>::iterator l = m_layers.begin(); l != m_layers.end(); l++) {
|
||||
@ -253,6 +250,9 @@ float gGraph::printScaleY() { return m_graphview->printScaleY(); }
|
||||
//}
|
||||
void gGraph::setDay(Day *day)
|
||||
{
|
||||
// Don't update for snapshots..
|
||||
if (m_snapshot) return;
|
||||
|
||||
m_day = day;
|
||||
|
||||
for (int i = 0; i < m_layers.size(); i++) {
|
||||
@ -312,18 +312,15 @@ void gGraph::paint(QPainter &painter, const QRegion ®ion)
|
||||
title_x = float(yh) ;
|
||||
|
||||
QString & txt = title();
|
||||
if (!m_issnapshot) {
|
||||
graphView()->AddTextQue(txt, marginLeft() + title_x + 8*printScaleX(), originY + height / 2 - y / 2, 90, Qt::black, mediumfont);
|
||||
}
|
||||
graphView()->AddTextQue(txt, marginLeft() + title_x + 8*printScaleX(), originY + height / 2 - y / 2, 90, Qt::black, mediumfont);
|
||||
|
||||
left += graphView()->titleWidth*printScaleX();
|
||||
} else { left = 0; }
|
||||
|
||||
|
||||
if (m_issnapshot) {
|
||||
painter.drawPixmap(QRect(0, originY,width,height), m_snapshot, m_snapshot.rect());
|
||||
if (m_snapshot) {
|
||||
QLinearGradient linearGrad(QPointF(100, 100), QPointF(width / 2, 100));
|
||||
linearGrad.setColorAt(0, QColor(255, 150, 150,30));
|
||||
linearGrad.setColorAt(0, QColor(255, 150, 150,50));
|
||||
linearGrad.setColorAt(1, QColor(255,255,255,20));
|
||||
|
||||
painter.fillRect(m_rect, QBrush(linearGrad));
|
||||
@ -333,11 +330,6 @@ void gGraph::paint(QPainter &painter, const QRegion ®ion)
|
||||
QString t = name().section(";", -1);
|
||||
|
||||
painter.drawText(m_rect, Qt::AlignHCenter | Qt::AlignTop, QObject::tr("Snapshot %1").arg(t));
|
||||
if (isPinned()) {
|
||||
painter.drawPixmap(-5, originY-10, m_graphview->pin_icon);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -524,6 +516,7 @@ int gGraph::flipY(int y)
|
||||
|
||||
void gGraph::ResetBounds()
|
||||
{
|
||||
if (m_snapshot) return;
|
||||
invalidate_xAxisImage = true;
|
||||
min_x = MinX();
|
||||
max_x = MaxX();
|
||||
@ -698,7 +691,6 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
|
||||
// this nag might be a little too much..
|
||||
ToolTip(tr("Snapshot"),x+15,y, TT_AlignLeft);
|
||||
timedRedraw(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1452,11 +1444,4 @@ void gGraph::dumpInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
void gGraph::setSnapshot(QPixmap &pixmap)
|
||||
{
|
||||
m_snapshot = pixmap;
|
||||
// m_snapshot = renderPixmap(m_rect.width(), m_rect.height(), false);
|
||||
m_issnapshot = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -284,8 +284,8 @@ class gGraph : public QObject
|
||||
bool isPinned() { return m_pinned; }
|
||||
void setPinned(bool b) { m_pinned = b; }
|
||||
|
||||
bool isSnapshot() { return m_issnapshot; }
|
||||
void setSnapshot(QPixmap &pixmap);
|
||||
bool isSnapshot() { return m_snapshot; }
|
||||
void setSnapshot(bool b) { m_snapshot = b; }
|
||||
|
||||
short left, right, top, bottom; // dirty magin hacks..
|
||||
|
||||
@ -384,8 +384,7 @@ class gGraph : public QObject
|
||||
|
||||
QString m_selDurString;
|
||||
|
||||
QPixmap m_snapshot;
|
||||
bool m_issnapshot;
|
||||
bool m_snapshot;
|
||||
|
||||
protected slots:
|
||||
//! \brief Deselects any highlights, and schedules a main gGraphView redraw
|
||||
|
@ -956,12 +956,12 @@ void gGraphView::ResetBounds(bool refresh) //short group)
|
||||
if (!m2 || m_graphs[i]->max_x > m2) { m2 = m_graphs[i]->max_x; }
|
||||
}
|
||||
|
||||
if (p_profile->general->linkGroups()) {
|
||||
for (int i = 0; i < m_graphs.size(); i++) {
|
||||
m_graphs[i]->SetMinX(m1);
|
||||
m_graphs[i]->SetMaxX(m2);
|
||||
}
|
||||
}
|
||||
// if (p_profile->general->linkGroups()) {
|
||||
// for (int i = 0; i < m_graphs.size(); i++) {
|
||||
// m_graphs[i]->SetMinX(m1);
|
||||
// m_graphs[i]->SetMaxX(m2);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!g) { g = m_graphs[0]; }
|
||||
|
||||
@ -980,7 +980,7 @@ void gGraphView::GetXBounds(qint64 &st, qint64 &et)
|
||||
void gGraphView::SetXBounds(qint64 minx, qint64 maxx, short group, bool refresh)
|
||||
{
|
||||
for (int i = 0; i < m_graphs.size(); i++) {
|
||||
if (p_profile->general->linkGroups() || (m_graphs[i]->group() == group)) {
|
||||
if ((m_graphs[i]->group() == group)) {
|
||||
m_graphs[i]->SetXBounds(minx, maxx);
|
||||
}
|
||||
}
|
||||
@ -1839,11 +1839,11 @@ void gGraphView::populateMenu(gGraph * graph)
|
||||
|
||||
|
||||
if (graph->isSnapshot()) {
|
||||
snap_action->setText(tr("Remove Snapshot"));
|
||||
snap_action->setText(tr("Remove Clone"));
|
||||
snap_action->setData(graph->name()+"|remove");
|
||||
// zoom100_action->setVisible(false);
|
||||
} else {
|
||||
snap_action->setText(tr("Snapshot Graph"));
|
||||
snap_action->setText(tr("Clone %1 Graph").arg(graph->title()));
|
||||
snap_action->setData(graph->name()+"|snapshot");
|
||||
// zoom100_action->setVisible(true);
|
||||
}
|
||||
@ -2089,102 +2089,99 @@ void gGraphView::onSnapshotGraphToggle()
|
||||
gGraph * graph = it.value();
|
||||
|
||||
if (cmd == "snapshot") {
|
||||
QString newname = name+";"+QDateTime::fromMSecsSinceEpoch(graph->min_x).toString(Qt::ISODate)+" "+QDateTime::fromMSecsSinceEpoch(graph->max_x).toString(Qt::ISODate);
|
||||
|
||||
it = m_graphsbyname.find(newname);
|
||||
if (it != m_graphsbyname.end()) {
|
||||
// already a snapshot.. :-/
|
||||
return;
|
||||
QString basename = name+";";
|
||||
if (graph->m_day) {
|
||||
QDateTime date = QDateTime::fromMSecsSinceEpoch(graph->min_x);
|
||||
basename += date.date().toString(Qt::SystemLocaleLongDate);
|
||||
}
|
||||
QString newname;
|
||||
|
||||
bool pinned = graph->isPinned();
|
||||
graph->setPinned(false);
|
||||
// Find a new name.. How many snapshots for each graph counts as stupid?
|
||||
for (int i=1;i < 100;i++) {
|
||||
newname = basename+" ("+QString::number(i)+")";
|
||||
|
||||
bool highres = p_profile->appearance->antiAliasing();
|
||||
QPixmap pm;
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
if (highres) {
|
||||
QFont *_defaultfont = defaultfont;
|
||||
QFont *_mediumfont = mediumfont;
|
||||
QFont *_bigfont = bigfont;
|
||||
|
||||
QFont fa = *defaultfont;
|
||||
QFont fb = *mediumfont;
|
||||
QFont fc = *bigfont;
|
||||
|
||||
|
||||
fa.setPointSize(fa.pointSize()*2.0);
|
||||
fb.setPointSize(fb.pointSize()*2.0);
|
||||
fc.setPointSize(fc.pointSize()*2.0);
|
||||
|
||||
defaultfont = &fa;
|
||||
mediumfont = &fb;
|
||||
bigfont = &fc;
|
||||
|
||||
|
||||
graph->m_printing = true;
|
||||
|
||||
bool pmc = p_profile->appearance->usePixmapCaching();
|
||||
p_profile->appearance->setUsePixmapCaching(false);
|
||||
setUsePixmapCache(false);
|
||||
|
||||
int w = graph->m_rect.width() * 2.0;
|
||||
int h = graph->m_rect.height() * 2.0;
|
||||
setPrintScaleX(2);
|
||||
setPrintScaleY(2);
|
||||
|
||||
pm = QPixmap(w,h);
|
||||
|
||||
QPainter painter(&pm);
|
||||
|
||||
QRect rec(0,0,w,h);
|
||||
painter.fillRect(rec,QBrush(QColor(Qt::white)));
|
||||
|
||||
float f = scaleY();
|
||||
QRegion region(rec);
|
||||
graph->paint(painter, region);
|
||||
DrawTextQue(painter);
|
||||
painter.end();
|
||||
|
||||
setUsePixmapCache(pmc);
|
||||
p_profile->appearance->setUsePixmapCaching(pmc);
|
||||
|
||||
setPrintScaleX(1);
|
||||
setPrintScaleY(1);
|
||||
graph->m_printing = false;
|
||||
defaultfont = _defaultfont;
|
||||
mediumfont = _mediumfont;
|
||||
bigfont = _bigfont;
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
} else {
|
||||
pm = graph->renderPixmap(width(), graph->m_rect.height(), false);
|
||||
it = m_graphsbyname.find(newname);
|
||||
if (it == m_graphsbyname.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
graph->setPinned(pinned);
|
||||
|
||||
|
||||
gGraph * newgraph = new gGraph(newname, nullptr, graph->title(), graph->units(), graph->height(), graph->group());
|
||||
newgraph->setSnapshot(pm);
|
||||
newgraph->setBlockSelect(true);
|
||||
newgraph->setHeight(pm.height()/(highres?2:1));
|
||||
//newgraph->setMinHeight(pm.height());
|
||||
// newgraph->setBlockSelect(true);
|
||||
newgraph->setHeight(graph->height());
|
||||
|
||||
short group = 0;
|
||||
m_graphs.insert(m_graphs.indexOf(graph)+1, newgraph);
|
||||
m_graphsbyname[newname] = newgraph;
|
||||
newgraph->m_graphview = this;
|
||||
|
||||
for (int i=0; i < graph->m_layers.size(); ++i) {
|
||||
Layer * layer = graph->m_layers.at(i)->Clone();
|
||||
if (layer) {
|
||||
newgraph->m_layers.append(layer);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<m_graphs.size();i++) {
|
||||
gGraph *g = m_graphs.at(i);
|
||||
group = qMax(g->group(), group);
|
||||
}
|
||||
newgraph->setGroup(group+1);
|
||||
//newgraph->setMinHeight(pm.height());
|
||||
|
||||
newgraph->setDay(graph->m_day);
|
||||
if (graph->m_day) {
|
||||
graph->m_day->incUseCounter();
|
||||
}
|
||||
newgraph->min_x = graph->min_x;
|
||||
newgraph->max_x = graph->max_x;
|
||||
if (graph->blockZoom()) {
|
||||
newgraph->setBlockZoom(graph->blockZoom());
|
||||
newgraph->setBlockSelect(true);
|
||||
}
|
||||
if (graph->blockSelect()) {
|
||||
newgraph->setBlockSelect(true);
|
||||
}
|
||||
|
||||
newgraph->setSnapshot(true);
|
||||
|
||||
|
||||
// addGraph(newgraph);
|
||||
updateScale();
|
||||
timedRedraw(0);
|
||||
} else if (cmd == "remove") {
|
||||
if (graph->m_day) {
|
||||
graph->m_day->decUseCounter();
|
||||
if (graph->m_day->useCounter() == 0) {
|
||||
}
|
||||
}
|
||||
m_graphsbyname.remove(graph->name());
|
||||
m_graphs.removeAll(it.value());
|
||||
delete graph;
|
||||
|
||||
|
||||
updateScale();
|
||||
timedRedraw(0);
|
||||
}
|
||||
qDebug() << cmd << name;
|
||||
}
|
||||
|
||||
bool gGraphView::hasSnapshots()
|
||||
{
|
||||
int size = m_graphs.size();
|
||||
bool snap = false;
|
||||
for (int i=0; i< size; ++i) {
|
||||
gGraph * graph = m_graphs.at(i);
|
||||
if (graph->isSnapshot()) {
|
||||
snap = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return snap;
|
||||
}
|
||||
|
||||
|
||||
void gGraphView::onPlotsClicked(QAction *action)
|
||||
{
|
||||
QString name = action->data().toString().section("|",0,0);
|
||||
|
@ -667,6 +667,8 @@ class gGraphView
|
||||
ResetBounds(true);
|
||||
}
|
||||
|
||||
bool hasSnapshots();
|
||||
|
||||
void togglePin();
|
||||
protected slots:
|
||||
void onLinesClicked(QAction *);
|
||||
|
@ -125,6 +125,31 @@ class gLineChart: public Layer
|
||||
QHash<ChannelID, bool> m_flags_enabled;
|
||||
QHash<ChannelID, QHash<quint32, bool> > m_dot_enabled;
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gLineChart * lc = new gLineChart(m_code);
|
||||
Layer::CloneInto(lc);
|
||||
CloneInto(lc);
|
||||
return lc;
|
||||
}
|
||||
|
||||
void CloneInto(gLineChart * layer) {
|
||||
layer->m_dotlines = m_dotlines;
|
||||
layer->m_flags_enabled = m_flags_enabled;
|
||||
layer->m_dot_enabled = m_dot_enabled;
|
||||
layer->m_report_empty = m_report_empty;
|
||||
layer->m_square_plot = m_square_plot;
|
||||
layer->m_disable_accel = m_disable_accel;
|
||||
layer->subtract_offset = layer->subtract_offset;
|
||||
layer->m_codes = layer->m_codes;
|
||||
layer->m_threshold = m_threshold;
|
||||
layer->m_square = m_square;
|
||||
layer->m_enabled = m_enabled;
|
||||
layer->lines = lines;
|
||||
layer->lasttext = lasttext;
|
||||
layer->lasttime = lasttime;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
//! \brief Mouse moved over this layers area (shows the hover-over tooltips here)
|
||||
virtual bool mouseMoveEvent(QMouseEvent *event, gGraph *graph);
|
||||
|
@ -471,7 +471,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
|
||||
barw = (float(width) / float(days));
|
||||
|
||||
graph = &w;
|
||||
// graph = &w;
|
||||
float px = left;
|
||||
l_left = w.marginLeft() + gYAxis::Margin;
|
||||
l_top = w.marginTop();
|
||||
|
@ -62,6 +62,48 @@ class SummaryChart: public Layer
|
||||
|
||||
//! \brief Returns the MachineType this SummaryChart is interested in
|
||||
MachineType machineType() { return m_machinetype; }
|
||||
|
||||
virtual Layer * Clone() {
|
||||
SummaryChart * sc = new SummaryChart(m_label);
|
||||
Layer::CloneInto(sc);
|
||||
CloneInto(sc);
|
||||
return sc;
|
||||
}
|
||||
|
||||
void CloneInto(SummaryChart * layer) {
|
||||
layer->m_orientation = m_orientation;
|
||||
layer->m_colors = m_colors;
|
||||
layer->m_codes = m_codes;
|
||||
layer->m_goodcodes = m_goodcodes;
|
||||
layer->m_type = m_type;
|
||||
layer->m_typeval = m_typeval;
|
||||
layer->m_values = m_values;
|
||||
layer->m_times = m_times;
|
||||
layer->m_hours = m_hours;
|
||||
layer->m_days = m_days;
|
||||
|
||||
layer->m_empty = m_empty;
|
||||
layer->m_fday = m_fday;
|
||||
layer->m_label = m_label;
|
||||
layer->barw = barw;
|
||||
layer->l_offset = l_offset;
|
||||
layer->offset = offset;
|
||||
layer->l_left = l_left;
|
||||
layer->l_top = l_top;
|
||||
layer->l_width= l_width;
|
||||
layer->l_height = l_height;
|
||||
layer->rtop = rtop;
|
||||
layer->l_minx = l_minx;
|
||||
layer->l_maxx = l_maxx;
|
||||
layer->hl_day = hl_day;
|
||||
layer->m_graphtype = m_graphtype;
|
||||
layer->m_machinetype = m_machinetype;
|
||||
layer->tz_offset = tz_offset;
|
||||
layer->tz_hours = tz_hours;
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
Qt::Orientation m_orientation;
|
||||
|
||||
@ -87,7 +129,7 @@ class SummaryChart: public Layer
|
||||
int rtop;
|
||||
qint64 l_minx, l_maxx;
|
||||
int hl_day;
|
||||
gGraph *graph;
|
||||
//gGraph *graph;
|
||||
GraphType m_graphtype;
|
||||
MachineType m_machinetype;
|
||||
int tz_offset;
|
||||
|
@ -37,6 +37,34 @@ class gXAxis: public Layer
|
||||
|
||||
void setRoundDays(bool b) { m_roundDays = b; }
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gXAxis * xaxis = new gXAxis();
|
||||
Layer::CloneInto(xaxis);
|
||||
CloneInto(xaxis);
|
||||
return xaxis;
|
||||
}
|
||||
|
||||
void CloneInto(gXAxis * layer) {
|
||||
layer->m_show_major_ticks = m_show_major_ticks;
|
||||
layer->m_show_minor_ticks = m_show_minor_ticks;
|
||||
layer->m_show_major_lines = m_show_major_lines;
|
||||
layer->m_show_minor_lines = m_show_minor_lines;
|
||||
layer->m_major_color = m_major_color;
|
||||
layer->m_minor_color = m_minor_color;
|
||||
layer->m_line_color = m_line_color;
|
||||
layer->m_text_color = m_text_color;
|
||||
|
||||
layer->m_utcfix = m_utcfix;
|
||||
layer->m_fadeout = m_fadeout;
|
||||
|
||||
layer->tz_offset = tz_offset;
|
||||
layer->tz_hours = tz_hours;
|
||||
|
||||
layer->m_image = m_image;
|
||||
layer->m_roundDays = m_roundDays;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
bool m_show_major_lines;
|
||||
bool m_show_minor_lines;
|
||||
|
@ -179,7 +179,7 @@ void gYAxis::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
painter.drawLine(0,top,100,top);
|
||||
#endif
|
||||
|
||||
double max_yticks = height / (y + 14.0); // plus spacing between lines
|
||||
double max_yticks = round(height / (y + 14.0)); // plus spacing between lines
|
||||
|
||||
double mxy = maxy; // MAX(fabs(maxy), fabs(miny));
|
||||
double mny = miny;
|
||||
|
@ -36,7 +36,22 @@ class gXGrid: public Layer
|
||||
|
||||
//! \brief Returns the visibility status of Major lines
|
||||
bool showMajorLines() { return m_show_major_lines; }
|
||||
protected:
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gXGrid * grid = new gXGrid();
|
||||
Layer::CloneInto(grid);
|
||||
CloneInto(grid);
|
||||
return grid;
|
||||
}
|
||||
|
||||
void CloneInto(gXGrid * layer) {
|
||||
layer->m_show_major_lines = m_show_major_lines;
|
||||
layer->m_show_minor_lines = m_show_minor_lines;
|
||||
layer->m_major_color = m_major_color;
|
||||
layer->m_minor_color = m_minor_color;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_show_major_lines;
|
||||
bool m_show_minor_lines;
|
||||
QColor m_major_color;
|
||||
@ -93,6 +108,22 @@ class gYAxis: public Layer
|
||||
virtual bool mouseDoubleClickEvent(QMouseEvent *event, gGraph *graph);
|
||||
|
||||
QImage m_image;
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gYAxis * yaxis = new gYAxis();
|
||||
Layer::CloneInto(yaxis);
|
||||
CloneInto(yaxis);
|
||||
return yaxis;
|
||||
}
|
||||
|
||||
void CloneInto(gYAxis * layer) {
|
||||
layer->m_show_major_ticks = m_show_major_ticks;
|
||||
layer->m_show_minor_ticks = m_show_minor_ticks;
|
||||
layer->m_line_color = m_line_color;
|
||||
layer->m_text_color = m_text_color;
|
||||
layer->m_image = m_image;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*! \class gYAxisTime
|
||||
@ -110,6 +141,19 @@ class gYAxisTime: public gYAxis
|
||||
|
||||
//! \brief Whether to format as 12 or 24 hour times
|
||||
bool show_12hr;
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gYAxisTime * yaxis = new gYAxisTime();
|
||||
Layer::CloneInto(yaxis);
|
||||
CloneInto(yaxis);
|
||||
return yaxis;
|
||||
}
|
||||
|
||||
void CloneInto(gYAxisTime * layer) {
|
||||
gYAxis::CloneInto(layer);
|
||||
layer->show_12hr = show_12hr;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -132,6 +176,18 @@ class gYAxisWeight: public gYAxis
|
||||
//! \brief Overrides gYAxis Format to display Time format
|
||||
virtual const QString Format(EventDataType v, int dp);
|
||||
UnitSystem m_unitsystem;
|
||||
|
||||
virtual Layer * Clone() {
|
||||
gYAxisWeight * yaxis = new gYAxisWeight();
|
||||
Layer::CloneInto(yaxis);
|
||||
CloneInto(yaxis);
|
||||
return yaxis;
|
||||
}
|
||||
|
||||
void CloneInto(gYAxisWeight * layer) {
|
||||
gYAxis::CloneInto(layer);
|
||||
layer->m_unitsystem = m_unitsystem;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -58,6 +58,31 @@ Layer::~Layer()
|
||||
// }
|
||||
//}
|
||||
|
||||
void Layer::CloneInto(Layer * layer)
|
||||
{
|
||||
layer->m_refcount = m_refcount;
|
||||
layer->m_day = m_day;
|
||||
layer->m_visible = m_visible;
|
||||
layer->m_movable = m_movable;
|
||||
layer->m_minx = m_minx;
|
||||
layer->m_maxx = m_maxx;
|
||||
layer->m_miny = m_miny;
|
||||
layer->m_maxy = m_maxy;
|
||||
layer->m_physmaxy = m_physmaxy;
|
||||
layer->m_physminy = m_physminy;
|
||||
layer->m_code = m_code;
|
||||
layer->m_width = m_width;
|
||||
layer->m_height = m_height;
|
||||
layer->m_X = m_X;
|
||||
layer->m_Y = m_Y;
|
||||
layer->m_order = m_order;
|
||||
layer->m_position = m_position;
|
||||
layer->m_rect = m_rect;
|
||||
layer->m_mouseover = m_mouseover;
|
||||
layer->m_recalculating = m_recalculating;
|
||||
layer->m_layertype = m_layertype;
|
||||
}
|
||||
|
||||
void Layer::SetDay(Day *d)
|
||||
{
|
||||
m_day = d;
|
||||
|
@ -26,7 +26,7 @@ enum LayerPosition { LayerLeft, LayerRight, LayerTop, LayerBottom, LayerCenter,
|
||||
|
||||
enum ToolTipAlignment { TT_AlignCenter, TT_AlignLeft, TT_AlignRight };
|
||||
|
||||
enum LayerType { LT_Other = 0, LT_LineChart, LT_SummaryChart, LT_EventFlags };
|
||||
enum LayerType { LT_Other = 0, LT_LineChart, LT_SummaryChart, LT_EventFlags, LT_Spacer };
|
||||
|
||||
/*! \class Layer
|
||||
\brief The base component for all individual Graph layers
|
||||
@ -57,6 +57,9 @@ class Layer
|
||||
virtual void recalculate(gGraph * graph) { Q_UNUSED(graph)}
|
||||
virtual ~Layer();
|
||||
|
||||
virtual Layer * Clone() { return nullptr; }
|
||||
void CloneInto(Layer *);
|
||||
|
||||
//! \brief This gets called on day selection, allowing this layer to precalculate any drawing data
|
||||
virtual void SetDay(Day *d);
|
||||
|
||||
|
@ -267,12 +267,17 @@ class Day
|
||||
|
||||
QHash<MachineType, Machine *> machines;
|
||||
|
||||
void incUseCounter() { d_useCounter++; }
|
||||
void decUseCounter() { d_useCounter--; if (d_useCounter<0) d_useCounter = 0; }
|
||||
int useCounter() { return d_useCounter; }
|
||||
|
||||
protected:
|
||||
//! \brief A Vector containing all sessions for this day
|
||||
QHash<ChannelID, QHash<EventDataType, EventDataType> > perc_cache;
|
||||
//qint64 d_first,d_last;
|
||||
private:
|
||||
bool d_firstsession;
|
||||
int d_useCounter;
|
||||
};
|
||||
|
||||
|
||||
|
@ -766,7 +766,7 @@ class UserSettings : public ProfileSettings
|
||||
initPref(STR_US_SkipEmptyDays, true);
|
||||
initPref(STR_US_RebuildCache, false); // FIXME: jedimark: can't remember...
|
||||
initPref(STR_US_ShowDebug, false);
|
||||
initPref(STR_US_LinkGroups, true); // FIXME: jedimark: can't remember...
|
||||
// initPref(STR_US_LinkGroups, true); // FIXME: jedimark: can't remember...
|
||||
initPref(STR_US_CalculateRDI, false);
|
||||
initPref(STR_US_ShowSerialNumbers, false);
|
||||
initPref(STR_US_PrefCalcMiddle, (int)0);
|
||||
@ -783,7 +783,7 @@ class UserSettings : public ProfileSettings
|
||||
bool skipEmptyDays() const { return getPref(STR_US_SkipEmptyDays).toBool(); }
|
||||
bool rebuildCache() const { return getPref(STR_US_RebuildCache).toBool(); }
|
||||
bool showDebug() const { return getPref(STR_US_ShowDebug).toBool(); }
|
||||
bool linkGroups() const { return getPref(STR_US_LinkGroups).toBool(); }
|
||||
// bool linkGroups() const { return getPref(STR_US_LinkGroups).toBool(); }
|
||||
bool calculateRDI() const { return getPref(STR_US_CalculateRDI).toBool(); }
|
||||
bool showSerialNumbers() const { return getPref(STR_US_ShowSerialNumbers).toBool(); }
|
||||
int prefCalcMiddle() const { return getPref(STR_US_PrefCalcMiddle).toInt(); }
|
||||
@ -799,7 +799,7 @@ class UserSettings : public ProfileSettings
|
||||
void setSkipEmptyDays(bool skip) { setPref(STR_US_SkipEmptyDays, skip); }
|
||||
void setRebuildCache(bool rebuild) { setPref(STR_US_RebuildCache, rebuild); }
|
||||
void setShowDebug(bool b) { setPref(STR_US_ShowDebug, b); }
|
||||
void setLinkGroups(bool link) { setPref(STR_US_LinkGroups, link); }
|
||||
// void setLinkGroups(bool link) { setPref(STR_US_LinkGroups, link); }
|
||||
void setCalculateRDI(bool rdi) { setPref(STR_US_CalculateRDI, rdi); }
|
||||
void setShowSerialNumbers(bool enabled) { setPref(STR_US_ShowSerialNumbers, enabled); }
|
||||
void setPrefCalcMiddle(int i) { setPref(STR_US_PrefCalcMiddle, i); }
|
||||
|
@ -215,11 +215,11 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
|
||||
|
||||
|
||||
GAHI->AddLayer(AddCPAP(evseg));
|
||||
GAHI->AddLayer(evseg);
|
||||
GAHI->setMargins(0,0,0,0);
|
||||
|
||||
gFlagsGroup *fg=new gFlagsGroup();
|
||||
SF->AddLayer(AddCPAP(fg));
|
||||
SF->AddLayer(fg);
|
||||
|
||||
|
||||
SF->setBlockZoom(true);
|
||||
@ -248,7 +248,6 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
|
||||
gLineChart *l;
|
||||
l=new gLineChart(CPAP_FlowRate,false,false);
|
||||
AddCPAP(l);
|
||||
|
||||
gGraph *FRW = graphlist[schema::channel[CPAP_FlowRate].code()];
|
||||
|
||||
@ -260,7 +259,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
|
||||
bool square=p_profile->appearance->squareWavePlots();
|
||||
gLineChart *pc=new gLineChart(CPAP_Pressure, square);
|
||||
graphlist[schema::channel[CPAP_Pressure].code()]->AddLayer(AddCPAP(pc));
|
||||
graphlist[schema::channel[CPAP_Pressure].code()]->AddLayer(pc);
|
||||
|
||||
// graphlist[schema::channel[CPAP_Pressure].code()]->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Ramp, COLOR_Ramp, schema::channel[CPAP_Ramp].label(), FT_Span)));
|
||||
|
||||
@ -272,15 +271,15 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
gGraph * TAP2;
|
||||
graphlist[STR_GRAPH_TAP] = TAP2 = new gGraph(STR_GRAPH_TAP, GraphView, QObject::tr("By Pressure"), QObject::tr("Statistics at Pressure"), default_height);
|
||||
MinutesAtPressure * map;
|
||||
TAP2->AddLayer(AddCPAP(map = new MinutesAtPressure()));
|
||||
TAP2->AddLayer(map = new MinutesAtPressure());
|
||||
TAP2->AddLayer(new gLabelArea(map),LayerLeft,gYAxis::Margin);
|
||||
TAP2->setBlockSelect(true);
|
||||
|
||||
if (p_profile->general->calculateRDI()) {
|
||||
AHI->AddLayer(AddCPAP(new gLineChart(CPAP_RDI, square)));
|
||||
AHI->AddLayer(new gLineChart(CPAP_RDI, square));
|
||||
// AHI->AddLayer(AddCPAP(new AHIChart(QColor("#37a24b"))));
|
||||
} else {
|
||||
AHI->AddLayer(AddCPAP(new gLineChart(CPAP_AHI, square)));
|
||||
AHI->AddLayer(new gLineChart(CPAP_AHI, square));
|
||||
}
|
||||
|
||||
// this is class wide because the leak redline can be reset in preferences..
|
||||
@ -293,37 +292,37 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
// schema::channel[CPAP_Leak].setUpperThresholdColor(Qt::red);
|
||||
// schema::channel[CPAP_Leak].setLowerThresholdColor(Qt::green);
|
||||
|
||||
graphlist[schema::channel[CPAP_Leak].code()]->AddLayer(AddCPAP(leakchart));
|
||||
graphlist[schema::channel[CPAP_Leak].code()]->AddLayer(leakchart);
|
||||
//LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_Leak, COLOR_Leak,square)));
|
||||
//LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_MaxLeak, COLOR_MaxLeak,square)));
|
||||
graphlist[schema::channel[CPAP_Snore].code()]->AddLayer(AddCPAP(new gLineChart(CPAP_Snore, true)));
|
||||
graphlist[schema::channel[CPAP_Snore].code()]->AddLayer(new gLineChart(CPAP_Snore, true));
|
||||
|
||||
graphlist[schema::channel[CPAP_PTB].code()]->AddLayer(AddCPAP(new gLineChart(CPAP_PTB, square)));
|
||||
graphlist[schema::channel[CPAP_Test1].code()]->AddLayer(AddCPAP(new gLineChart(CPAP_Test1, false)));
|
||||
graphlist[schema::channel[CPAP_PTB].code()]->AddLayer(new gLineChart(CPAP_PTB, square));
|
||||
graphlist[schema::channel[CPAP_Test1].code()]->AddLayer(new gLineChart(CPAP_Test1, false));
|
||||
|
||||
|
||||
gLineChart *lc = nullptr;
|
||||
graphlist[schema::channel[CPAP_MaskPressure].code()]->AddLayer(AddCPAP(new gLineChart(CPAP_MaskPressure, false)));
|
||||
graphlist[schema::channel[CPAP_RespRate].code()]->AddLayer(AddCPAP(lc=new gLineChart(CPAP_RespRate, false)));
|
||||
graphlist[schema::channel[CPAP_MaskPressure].code()]->AddLayer(new gLineChart(CPAP_MaskPressure, false));
|
||||
graphlist[schema::channel[CPAP_RespRate].code()]->AddLayer(lc=new gLineChart(CPAP_RespRate, false));
|
||||
|
||||
graphlist[schema::channel[POS_Inclination].code()]->AddLayer(AddPOS(new gLineChart(POS_Inclination)));
|
||||
graphlist[schema::channel[POS_Orientation].code()]->AddLayer(AddPOS(new gLineChart(POS_Orientation)));
|
||||
graphlist[schema::channel[POS_Inclination].code()]->AddLayer(new gLineChart(POS_Inclination));
|
||||
graphlist[schema::channel[POS_Orientation].code()]->AddLayer(new gLineChart(POS_Orientation));
|
||||
|
||||
graphlist[schema::channel[CPAP_MinuteVent].code()]->AddLayer(AddCPAP(lc=new gLineChart(CPAP_MinuteVent, false)));
|
||||
graphlist[schema::channel[CPAP_MinuteVent].code()]->AddLayer(lc=new gLineChart(CPAP_MinuteVent, false));
|
||||
lc->addPlot(CPAP_TgMV, square);
|
||||
|
||||
graphlist[schema::channel[CPAP_TidalVolume].code()]->AddLayer(AddCPAP(lc=new gLineChart(CPAP_TidalVolume, false)));
|
||||
graphlist[schema::channel[CPAP_TidalVolume].code()]->AddLayer(lc=new gLineChart(CPAP_TidalVolume, false));
|
||||
//lc->addPlot(CPAP_Test2,COLOR_DarkYellow,square);
|
||||
|
||||
//graphlist[schema::channel[CPAP_TidalVolume].code()]->AddLayer(AddCPAP(new gLineChart("TidalVolume2", square)));
|
||||
graphlist[schema::channel[CPAP_FLG].code()]->AddLayer(AddCPAP(new gLineChart(CPAP_FLG, true)));
|
||||
graphlist[schema::channel[CPAP_FLG].code()]->AddLayer(new gLineChart(CPAP_FLG, true));
|
||||
//graphlist[schema::channel[CPAP_RespiratoryEvent].code()]->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryEvent, true)));
|
||||
graphlist[schema::channel[CPAP_IE].code()]->AddLayer(AddCPAP(lc=new gLineChart(CPAP_IE, false)));
|
||||
graphlist[schema::channel[CPAP_Te].code()]->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Te, false)));
|
||||
graphlist[schema::channel[CPAP_Ti].code()]->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Ti, false)));
|
||||
graphlist[schema::channel[CPAP_IE].code()]->AddLayer(lc=new gLineChart(CPAP_IE, false));
|
||||
graphlist[schema::channel[CPAP_Te].code()]->AddLayer(lc=new gLineChart(CPAP_Te, false));
|
||||
graphlist[schema::channel[CPAP_Ti].code()]->AddLayer(lc=new gLineChart(CPAP_Ti, false));
|
||||
//lc->addPlot(CPAP_Test2,COLOR:DarkYellow,square);
|
||||
|
||||
graphlist[schema::channel[ZEO_SleepStage].code()]->AddLayer(AddSTAGE(new gLineChart(ZEO_SleepStage, true)));
|
||||
graphlist[schema::channel[ZEO_SleepStage].code()]->AddLayer(new gLineChart(ZEO_SleepStage, true));
|
||||
|
||||
// gLineOverlaySummary *los1=new gLineOverlaySummary(STR_UNIT_EventsPerHour,5,-4);
|
||||
// gLineOverlaySummary *los2=new gLineOverlaySummary(STR_UNIT_EventsPerHour,5,-4);
|
||||
@ -332,10 +331,10 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
// graphlist[schema::channel[OXI_SPO2].code()]->AddLayer(AddOXI(los2->add(new gLineOverlayBar(OXI_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2,FT_Span))));
|
||||
// graphlist[schema::channel[OXI_SPO2].code()]->AddLayer(AddOXI(los2));
|
||||
|
||||
graphlist[schema::channel[OXI_Pulse].code()]->AddLayer(AddOXI(new gLineChart(OXI_Pulse, square)));
|
||||
graphlist[schema::channel[OXI_SPO2].code()]->AddLayer(AddOXI(new gLineChart(OXI_SPO2, true)));
|
||||
graphlist[schema::channel[OXI_Perf].code()]->AddLayer(AddOXI(new gLineChart(OXI_Perf, false)));
|
||||
graphlist[schema::channel[OXI_Plethy].code()]->AddLayer(AddOXI(new gLineChart(OXI_Plethy, false)));
|
||||
graphlist[schema::channel[OXI_Pulse].code()]->AddLayer(new gLineChart(OXI_Pulse, square));
|
||||
graphlist[schema::channel[OXI_SPO2].code()]->AddLayer(new gLineChart(OXI_SPO2, true));
|
||||
graphlist[schema::channel[OXI_Perf].code()]->AddLayer(new gLineChart(OXI_Perf, false));
|
||||
graphlist[schema::channel[OXI_Plethy].code()]->AddLayer(new gLineChart(OXI_Plethy, false));
|
||||
|
||||
|
||||
// Fix me
|
||||
@ -1319,9 +1318,21 @@ void Daily::Load(QDate date)
|
||||
|
||||
// lastcpapday can get purged and be invalid
|
||||
if (lastcpapday && (lastcpapday!=day)) {
|
||||
for (QList<Session *>::iterator s=lastcpapday->begin();s!=lastcpapday->end();++s) {
|
||||
(*s)->TrashEvents();
|
||||
for (QMap<QDate, Day *>::iterator di = p_profile->daylist.begin(); di!= p_profile->daylist.end(); ++di) {
|
||||
Day * d = di.value();
|
||||
if (d->eventsLoaded()) {
|
||||
if (d->useCounter() == 0) {
|
||||
for (QList<Session *>::iterator s=d->begin();s!=d->end();++s) {
|
||||
(*s)->TrashEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (lastcpapday->useCounter() == 0) {
|
||||
// for (QList<Session *>::iterator s=lastcpapday->begin();s!=lastcpapday->end();++s) {
|
||||
// (*s)->TrashEvents();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1919,49 +1930,6 @@ Session * Daily::GetJournalSession(QDate date) // Get the first journal session
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Daily::UpdateCPAPGraphs(Day *day)
|
||||
{
|
||||
//if (!day) return;
|
||||
if (day) {
|
||||
day->OpenEvents();
|
||||
}
|
||||
for (QList<Layer *>::iterator g=CPAPData.begin();g!=CPAPData.end();g++) {
|
||||
(*g)->SetDay(day);
|
||||
}
|
||||
}
|
||||
void Daily::UpdateSTAGEGraphs(Day *day)
|
||||
{
|
||||
//if (!day) return;
|
||||
if (day) {
|
||||
day->OpenEvents();
|
||||
}
|
||||
for (QList<Layer *>::iterator g=STAGEData.begin();g!=STAGEData.end();g++) {
|
||||
(*g)->SetDay(day);
|
||||
}
|
||||
}
|
||||
|
||||
void Daily::UpdatePOSGraphs(Day *day)
|
||||
{
|
||||
//if (!day) return;
|
||||
if (day) {
|
||||
day->OpenEvents();
|
||||
}
|
||||
for (QList<Layer *>::iterator g=POSData.begin();g!=POSData.end();g++) {
|
||||
(*g)->SetDay(day);
|
||||
}
|
||||
}
|
||||
|
||||
void Daily::UpdateOXIGraphs(Day *day)
|
||||
{
|
||||
//if (!day) return;
|
||||
|
||||
if (day) {
|
||||
day->OpenEvents();
|
||||
}
|
||||
for (QList<Layer *>::iterator g=OXIData.begin();g!=OXIData.end();g++) {
|
||||
(*g)->SetDay(day);
|
||||
}
|
||||
}
|
||||
|
||||
void Daily::RedrawGraphs()
|
||||
{
|
||||
|
@ -324,24 +324,24 @@ private:
|
||||
|
||||
QHash<QString, gGraph *> graphlist;
|
||||
|
||||
QList<Layer *> OXIData;
|
||||
QList<Layer *> CPAPData;
|
||||
QList<Layer *> STAGEData;
|
||||
QList<Layer *> POSData;
|
||||
// QList<Layer *> OXIData;
|
||||
// QList<Layer *> CPAPData;
|
||||
// QList<Layer *> STAGEData;
|
||||
// QList<Layer *> POSData;
|
||||
QHash<QString,QPushButton *> GraphToggles;
|
||||
QVector<QAction *> GraphAction;
|
||||
QGLContext *offscreen_context;
|
||||
|
||||
QList<int> splitter_sizes;
|
||||
Layer * AddCPAP(Layer *d) { CPAPData.push_back(d); return d; }
|
||||
Layer * AddSTAGE(Layer *d) { STAGEData.push_back(d); return d; }
|
||||
Layer * AddPOS(Layer *d) { POSData.push_back(d); return d; }
|
||||
Layer * AddOXI(Layer *d) { OXIData.push_back(d); return d; }
|
||||
// Layer * AddCPAP(Layer *d) { CPAPData.push_back(d); return d; }
|
||||
// Layer * AddSTAGE(Layer *d) { STAGEData.push_back(d); return d; }
|
||||
// Layer * AddPOS(Layer *d) { POSData.push_back(d); return d; }
|
||||
// Layer * AddOXI(Layer *d) { OXIData.push_back(d); return d; }
|
||||
|
||||
void UpdateCPAPGraphs(Day *day);
|
||||
void UpdateOXIGraphs(Day *day);
|
||||
void UpdateSTAGEGraphs(Day *day);
|
||||
void UpdatePOSGraphs(Day *day);
|
||||
// void UpdateCPAPGraphs(Day *day);
|
||||
// void UpdateOXIGraphs(Day *day);
|
||||
// void UpdateSTAGEGraphs(Day *day);
|
||||
// void UpdatePOSGraphs(Day *day);
|
||||
|
||||
Ui::Daily *ui;
|
||||
QDate previous_date;
|
||||
|
@ -243,7 +243,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
#ifdef Q_OS_MAC
|
||||
p_profile->appearance->setAntiAliasing(false);
|
||||
#endif
|
||||
ui->action_Link_Graph_Groups->setChecked(p_profile->general->linkGroups());
|
||||
//ui->action_Link_Graph_Groups->setChecked(p_profile->general->linkGroups());
|
||||
|
||||
first_load = true;
|
||||
|
||||
@ -1629,13 +1629,6 @@ void MainWindow::on_action_Edit_Profile_triggered()
|
||||
delete newprof;
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Link_Graph_Groups_toggled(bool arg1)
|
||||
{
|
||||
p_profile->general->setLinkGroups(arg1);
|
||||
|
||||
if (daily) { daily->RedrawGraphs(); }
|
||||
}
|
||||
|
||||
void MainWindow::on_action_CycleTabs_triggered()
|
||||
{
|
||||
int i;
|
||||
|
@ -228,9 +228,6 @@ class MainWindow : public QMainWindow
|
||||
//! \brief Opens the Profile Editor
|
||||
void on_action_Edit_Profile_triggered();
|
||||
|
||||
//! \brief Toggled the LinkGraphGroups preference, which forces the link between Oximetry & CPAP days
|
||||
void on_action_Link_Graph_Groups_toggled(bool arg1);
|
||||
|
||||
//! \brief Selects the next view tab
|
||||
void on_action_CycleTabs_triggered();
|
||||
|
||||
|
@ -3160,7 +3160,6 @@ border-radius: 10px;
|
||||
<addaction name="action_Fullscreen"/>
|
||||
<addaction name="action_Screenshot"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Link_Graph_Groups"/>
|
||||
<addaction name="action_Reset_Graph_Layout"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionToggle_Line_Cursor"/>
|
||||
|
@ -415,7 +415,6 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
|
||||
if (!print_bookmarks) {
|
||||
for (int i = 0; i < gv->size(); i++) {
|
||||
g = (*gv)[i];
|
||||
if (g->isSnapshot()) continue;
|
||||
|
||||
if (g->isEmpty()) { continue; }
|
||||
|
||||
@ -509,7 +508,6 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
|
||||
|
||||
for (int i = 0; i < gv->size(); i++) {
|
||||
gGraph *g = (*gv)[i];
|
||||
if (g->isSnapshot()) continue;
|
||||
|
||||
if (g->isEmpty()) { continue; }
|
||||
|
||||
@ -531,7 +529,6 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
|
||||
if (g->isEmpty()) { continue; }
|
||||
|
||||
if (!g->visible()) { continue; }
|
||||
if (g->isSnapshot()) continue;
|
||||
|
||||
start.push_back(st);
|
||||
end.push_back(et);
|
||||
|
Loading…
Reference in New Issue
Block a user