mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Make the default value for enabling Zero-Dotted layer
This commit is contained in:
parent
d487247c80
commit
c70e5d1bec
@ -8,7 +8,7 @@
|
|||||||
* for more details. */
|
* for more details. */
|
||||||
|
|
||||||
|
|
||||||
#define TEST_MACROS_ENABLEDoff
|
#define TEST_MACROS_ENABLED
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
#include "Graphs/gLineChart.h"
|
#include "Graphs/gLineChart.h"
|
||||||
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
QDataStream & operator<<(QDataStream & stream, const DottedLine & dot)
|
QDataStream & operator<<(QDataStream & stream, const DottedLine & dot)
|
||||||
{
|
{
|
||||||
|
if(dot.code==CPAP_FlowRate) DEBUGFW O("SAVING") NAME(dot.code) Q(dot.type) Q(dot.value) Q(dot.available) Q(dot.visible) ;
|
||||||
stream << dot.code;
|
stream << dot.code;
|
||||||
stream << dot.type;
|
stream << dot.type;
|
||||||
stream << dot.value;
|
stream << dot.value;
|
||||||
@ -44,10 +45,10 @@ QDataStream & operator>>(QDataStream & stream, DottedLine & dot)
|
|||||||
stream >> dot.visible;
|
stream >> dot.visible;
|
||||||
stream >> dot.available;
|
stream >> dot.available;
|
||||||
dot.type = (ChannelCalcType)tmp;
|
dot.type = (ChannelCalcType)tmp;
|
||||||
|
if(dot.code==CPAP_FlowRate) DEBUGFW O("RESTORED") NAME(dot.code) Q(dot.type) Q(dot.value) Q(dot.available) Q(dot.visible) ;
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QColor darken(QColor color, float p)
|
QColor darken(QColor color, float p)
|
||||||
{
|
{
|
||||||
int r = qMin(int(color.red() * p), 255);
|
int r = qMin(int(color.red() * p), 255);
|
||||||
@ -66,9 +67,27 @@ gLineChart::gLineChart(ChannelID code, bool square_plot, bool disable_accel)
|
|||||||
lines.reserve(50000);
|
lines.reserve(50000);
|
||||||
lasttime = 0;
|
lasttime = 0;
|
||||||
m_layertype = LT_LineChart;
|
m_layertype = LT_LineChart;
|
||||||
|
#if 1
|
||||||
|
if (code==CPAP_FlowRate) {
|
||||||
|
m_dot_enabled[code][Calc_Zero] = true;
|
||||||
|
bool val = m_dot_enabled[code][Calc_Zero];
|
||||||
|
DEBUGFW NAME(code) O("ENABLED calc_zero in constructor") Q(val);;
|
||||||
|
//if(code==CPAP_FlowRate) {
|
||||||
|
//DEBUGFW Q(m_dot_enabled[code][Calc_Zero] );
|
||||||
|
//#DEBUGTFW NAME(code) O(code) Q(type) Q(value) Q(available) Q(visible) QQ("type:Calc_Zero",Calc_Zero);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
gLineChart::~gLineChart()
|
gLineChart::~gLineChart()
|
||||||
{
|
{
|
||||||
|
#if 1
|
||||||
|
if (code()==CPAP_FlowRate) {
|
||||||
|
bool val = m_dot_enabled[code()][Calc_Zero];
|
||||||
|
DEBUGFW NAME(code()) O("ENABLED calc_zero in constructor") Q(val);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
for (auto fit = flags.begin(), end=flags.end(); fit != end; ++fit) {
|
for (auto fit = flags.begin(), end=flags.end(); fit != end; ++fit) {
|
||||||
// destroy any overlay bar from previous day
|
// destroy any overlay bar from previous day
|
||||||
delete fit.value();
|
delete fit.value();
|
||||||
@ -249,6 +268,7 @@ skipcheck:
|
|||||||
if (m_codes[0] == CPAP_Leak) {
|
if (m_codes[0] == CPAP_Leak) {
|
||||||
addDotLine(DottedLine(CPAP_Leak, Calc_UpperThresh, schema::channel[CPAP_Leak].calc[Calc_UpperThresh].enabled));
|
addDotLine(DottedLine(CPAP_Leak, Calc_UpperThresh, schema::channel[CPAP_Leak].calc[Calc_UpperThresh].enabled));
|
||||||
} else if (m_codes[0] == CPAP_FlowRate) {
|
} else if (m_codes[0] == CPAP_FlowRate) {
|
||||||
|
if(m_codes[0]==CPAP_FlowRate) DEBUGTFW O("calling AddDotLines with DottedLines Zero");
|
||||||
addDotLine(DottedLine(CPAP_FlowRate, Calc_Zero, schema::channel[CPAP_FlowRate].calc[Calc_Zero].enabled));
|
addDotLine(DottedLine(CPAP_FlowRate, Calc_Zero, schema::channel[CPAP_FlowRate].calc[Calc_Zero].enabled));
|
||||||
} else if (m_codes[0] == OXI_Pulse) {
|
} else if (m_codes[0] == OXI_Pulse) {
|
||||||
addDotLine(DottedLine(OXI_Pulse, Calc_UpperThresh, schema::channel[OXI_Pulse].calc[Calc_UpperThresh].enabled));
|
addDotLine(DottedLine(OXI_Pulse, Calc_UpperThresh, schema::channel[OXI_Pulse].calc[Calc_UpperThresh].enabled));
|
||||||
@ -559,7 +579,6 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
|||||||
painter.setPen(QPen(QBrush(color), lineThickness, Qt::DotLine));
|
painter.setPen(QPen(QBrush(color), lineThickness, Qt::DotLine));
|
||||||
EventDataType y=top + height + 1 - ((dot.value - miny) * ymult);
|
EventDataType y=top + height + 1 - ((dot.value - miny) * ymult);
|
||||||
painter.drawLine(left + 1, y, left + 1 + width, y);
|
painter.drawLine(left + 1, y, left + 1 + width, y);
|
||||||
DEBUGF NAME(dot.code) Q(dot.type) QQ(y,(int)y) Q(ratioX) O(QLine(left + 1, y, left + 1 + width, y)) Q(legendx) O(dot.value) ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user