Clean up code -- eliminate qDebug statements

This commit is contained in:
Seeker4 2019-09-02 22:10:36 -07:00
parent aeffae09fc
commit 6158d83935
3 changed files with 17 additions and 14 deletions

View File

@ -3364,7 +3364,7 @@ void gGraphView::resetLayout()
}
// Reset order of current graphs to new order, remove pinning
void gGraphView::resetGraphOrder(bool pinFirst, const QList<QString> graphOrder) {
qDebug() << "gGraphView::resetGraphOrder new order" << graphOrder;
// qDebug() << "gGraphView::resetGraphOrder new order" << graphOrder;
QList<gGraph *> new_graphs;
QList<gGraph *> old_graphs = m_graphs;
@ -3380,7 +3380,7 @@ void gGraphView::resetGraphOrder(bool pinFirst, const QList<QString> graphOrder)
new_graphs.append(graph);
int idx = old_graphs.indexOf(graph);
old_graphs.removeAt(idx);
qDebug() << "resetGraphOrder added to new graphs" << nextGraph;
// qDebug() << "resetGraphOrder added to new graphs" << nextGraph;
}
// If we didn't find everything, append anything extra we have
for (int i = 0; i < old_graphs.size(); i++) {
@ -3437,7 +3437,7 @@ void gGraphView::SaveSettings(QString title)
for (auto & graph : m_graphs) {
if (!graph) continue;
if (graph->isSnapshot()) continue;
qDebug() << "Saving graph" << title << graph->name();
// qDebug() << "Saving graph" << title << graph->name();
out << graph->name();
out << graph->height();
out << graph->visible();
@ -3511,7 +3511,7 @@ bool gGraphView::LoadSettings(QString title)
in >> vis;
in >> recminy;
in >> recmaxy;
qDebug() << "Loading graph" << title << name;
//qDebug() << "Loading graph" << title << name;
if (gvversion >= 1) {
in >> zoomy;
}

View File

@ -64,6 +64,7 @@ inline QString channelInfo(ChannelID code) {
// + (schema::channel[code].units() != "0" ? "\n("+schema::channel[code].units()+")" : "");
}
// Standard graph order
const QList<QString> standardGraphOrder = {STR_GRAPH_SleepFlags, STR_GRAPH_FlowRate, STR_GRAPH_Pressure, STR_GRAPH_LeakRate, STR_GRAPH_FlowLimitation,
STR_GRAPH_Snore, STR_GRAPH_TidalVolume, STR_GRAPH_MaskPressure, STR_GRAPH_RespRate, STR_GRAPH_MinuteVent,
@ -214,13 +215,13 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
graphlist[STR_GRAPH_SleepFlags] = SF = new gGraph(STR_GRAPH_SleepFlags, GraphView, STR_TR_EventFlags, STR_TR_EventFlags, default_height);
SF->setPinned(true);
ChannelID cpapcodes[] = {
const ChannelID cpapcodes[] = {
CPAP_FlowRate, CPAP_Pressure, CPAP_Leak, CPAP_FLG, CPAP_Snore, CPAP_TidalVolume,
CPAP_MaskPressure, CPAP_RespRate, CPAP_MinuteVent, CPAP_PTB, CPAP_RespEvent, CPAP_Ti, CPAP_Te,
/* CPAP_IE, */ ZEO_SleepStage, POS_Inclination, POS_Orientation, CPAP_Test1
};
ChannelID oximetercodes[] = {
const ChannelID oximetercodes[] = {
OXI_Pulse, OXI_SPO2, OXI_Perf, OXI_Plethy
};
@ -230,7 +231,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
for (int i=0; i < cpapsize; ++i) {
ChannelID code = cpapcodes[i];
graphlist[schema::channel[code].code()] = new gGraph(schema::channel[code].code(), GraphView, schema::channel[code].label(), channelInfo(code), default_height);
qDebug() << "Creating graph for code" << code << schema::channel[code].code();
// qDebug() << "Creating graph for code" << code << schema::channel[code].code();
}
// Add graphs from the Oximeter code list
@ -779,6 +780,7 @@ void Daily::UpdateCalendarDay(QDate date)
cpaponly.setFontWeight(QFont::Normal);
cpapjour.setForeground(QBrush(COLOR_Blue, Qt::SolidPattern));
cpapjour.setFontWeight(QFont::Bold);
// cpapjour.setFontUnderline(true);
oxiday.setForeground(QBrush(COLOR_Red, Qt::SolidPattern));
oxiday.setFontWeight(QFont::Normal);
oxicpap.setForeground(QBrush(COLOR_Red, Qt::SolidPattern));
@ -816,6 +818,9 @@ void Daily::UpdateCalendarDay(QDate date)
} else {
ui->calendar->setDateTextFormat(date, nodata);
}
// if (hasjournal) {
// ui->calendar->setDateTextFormat(date, cpapjour);
// }
ui->calendar->setHorizontalHeaderFormat(QCalendarWidget::ShortDayNames);
}
void Daily::LoadDate(QDate date)
@ -891,7 +896,7 @@ void Daily::ResetGraphOrder()
Day * day = p_profile->GetDay(previous_date,MT_CPAP);
int cpapMode = day->getCPAPMode();
qDebug() << "Daily::ResetGraphOrder cpapMode" << cpapMode;
// qDebug() << "Daily::ResetGraphOrder cpapMode" << cpapMode;
if (useAdvancedGraphs.contains(cpapMode))
GraphView->resetGraphOrder(true, advancedGraphOrder);
@ -902,7 +907,7 @@ void Daily::ResetGraphOrder()
for (int i=0;i<ui->graphCombo->count();i++) {
// If disabled, emulate a click to enable the graph
if (!ui->graphCombo->itemData(i,Qt::UserRole).toBool()) {
qDebug() << "resetting graph" << i;
// qDebug() << "resetting graph" << i;
Daily::on_graphCombo_activated(i);
}
}
@ -913,7 +918,7 @@ void Daily::ResetGraphOrder()
ChannelID code = ui->eventsCombo->itemData(i, Qt::UserRole).toUInt();
schema::Channel * chan = &schema::channel[code];
if (!chan->enabled()) {
qDebug() << "resetting event" << i;
// qDebug() << "resetting event" << i;
Daily::on_eventsCombo_activated(i);
}
}
@ -1407,7 +1412,7 @@ QString Daily::getSleepTime(Day * day)
}
QString Daily::getPieChart (float values, Day * day) {
qDebug() << "Daily:getPieChart, values" << values;
// qDebug() << "Daily:getPieChart, values" << values;
QString html = "<table cellspacing=0 cellpadding=0 border=0 width='100%'>";
if (values > 0) {
// html += "<tr><td align=center>&nbsp;</td></tr>";

View File

@ -888,7 +888,7 @@ QString Statistics::GenerateMachineList()
m = mach.at(i);
if (m->type() == MT_JOURNAL) { continue; }
//qDebug() << "Machine" << m->brand() << "series" << m->series() << "model" << m->model() << "model number" << m->modelnumber();
QDate d1 = m->FirstDay();
QDate d2 = m->LastDay();
QString mn = m->modelnumber();
@ -899,8 +899,6 @@ QString Statistics::GenerateMachineList()
.arg(m->serial())
.arg(d1.toString(MedDateFormat))
.arg(d2.toString(MedDateFormat));
// .arg(d1.toString(Qt::SystemLocaleShortDate))
// .arg(d2.toString(Qt::SystemLocaleShortDate));
}