mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Hide Overview print report..
This commit is contained in:
parent
94c0dc3702
commit
a15ad7befa
@ -204,9 +204,9 @@ EventDataType Day::wavg(ChannelID code)
|
|||||||
qint64 Day::total_time()
|
qint64 Day::total_time()
|
||||||
{
|
{
|
||||||
qint64 d_totaltime=0;
|
qint64 d_totaltime=0;
|
||||||
for (QVector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
|
for (QVector<Session *>::iterator s=begin();s!=end();s++) {
|
||||||
Session & sess=*(*s);
|
Session & sess=*(*s);
|
||||||
d_totaltime+=sess.last()-sess.first();
|
d_totaltime+=sess.length();
|
||||||
}
|
}
|
||||||
return d_totaltime;
|
return d_totaltime;
|
||||||
}
|
}
|
||||||
|
12
daily.cpp
12
daily.cpp
@ -806,11 +806,11 @@ void Daily::Load(QDate date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
html+="<tr><td align='center'><b>Date</b></td><td align='center'><b>"+tr("Sleep")+"</b></td><td align='center'><b>"+tr("Wake")+"</b></td><td align='center'><b>"+tr("Hours")+"</b></td></tr>";
|
html+="<tr><td align='center'><b>Date</b></td><td align='center'><b>"+tr("Sleep")+"</b></td><td align='center'><b>"+tr("Wake")+"</b></td><td align='center'><b>"+tr("Hours")+"</b></td></tr>";
|
||||||
int tt=cpap->total_time()/1000.0;
|
int tt=qint64(cpap->total_time())/1000L;
|
||||||
QDateTime date=QDateTime::fromTime_t(cpap->first()/1000);
|
QDateTime date=QDateTime::fromTime_t(cpap->first()/1000L);
|
||||||
QDateTime date2=QDateTime::fromTime_t(cpap->last()/1000);
|
QDateTime date2=QDateTime::fromTime_t(cpap->last()/1000L);
|
||||||
|
|
||||||
int h=tt/3600.0;
|
int h=tt/3600;
|
||||||
int m=(tt/60)%60;
|
int m=(tt/60)%60;
|
||||||
int s=tt % 60;
|
int s=tt % 60;
|
||||||
html+=QString("<tr><td align='center'>%1</td><td align='center'>%2</td><td align='center'>%3</td><td align='center'>%4</td></tr>\n"
|
html+=QString("<tr><td align='center'>%1</td><td align='center'>%2</td><td align='center'>%3</td><td align='center'>%4</td></tr>\n"
|
||||||
@ -946,8 +946,8 @@ void Daily::Load(QDate date)
|
|||||||
QDateTime fd,ld;
|
QDateTime fd,ld;
|
||||||
bool corrupted_waveform=false;
|
bool corrupted_waveform=false;
|
||||||
for (QVector<Session *>::iterator s=cpap->begin();s!=cpap->end();s++) {
|
for (QVector<Session *>::iterator s=cpap->begin();s!=cpap->end();s++) {
|
||||||
fd=QDateTime::fromTime_t((*s)->first()/1000);
|
fd=QDateTime::fromTime_t((*s)->first()/1000L);
|
||||||
ld=QDateTime::fromTime_t((*s)->last()/1000);
|
ld=QDateTime::fromTime_t((*s)->last()/1000L);
|
||||||
QHash<ChannelID,QVariant>::iterator i=(*s)->settings.find(CPAP_BrokenWaveform);
|
QHash<ChannelID,QVariant>::iterator i=(*s)->settings.find(CPAP_BrokenWaveform);
|
||||||
if ((i!=(*s)->settings.end()) && i.value().toBool()) corrupted_waveform=true;
|
if ((i!=(*s)->settings.end()) && i.value().toBool()) corrupted_waveform=true;
|
||||||
tmp.sprintf(("<tr><td align=center>%08i</td><td align=center>"+fd.date().toString(Qt::SystemLocaleShortDate)+"</td><td align=center>"+fd.toString("HH:mm ")+"</td><td align=center>"+ld.toString("HH:mm")+"</td></tr>").toLatin1(),(*s)->session());
|
tmp.sprintf(("<tr><td align=center>%08i</td><td align=center>"+fd.date().toString(Qt::SystemLocaleShortDate)+"</td><td align=center>"+fd.toString("HH:mm ")+"</td><td align=center>"+ld.toString("HH:mm")+"</td></tr>").toLatin1(),(*s)->session());
|
||||||
|
16
overview.cpp
16
overview.cpp
@ -14,7 +14,7 @@
|
|||||||
#include "Graphs/gLineChart.h"
|
#include "Graphs/gLineChart.h"
|
||||||
#include "Graphs/gYAxis.h"
|
#include "Graphs/gYAxis.h"
|
||||||
|
|
||||||
const int default_height=220;
|
const int default_height=180;
|
||||||
|
|
||||||
Overview::Overview(QWidget *parent,Profile * _profile,gGraphView * shared) :
|
Overview::Overview(QWidget *parent,Profile * _profile,gGraphView * shared) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
@ -170,24 +170,26 @@ void Overview::on_printButton_clicked()
|
|||||||
|
|
||||||
if (!report) {
|
if (!report) {
|
||||||
report=new Report(this,profile,m_shared,this);
|
report=new Report(this,profile,m_shared,this);
|
||||||
|
//report->setMinimumSize(ui->graphArea->width(),ui->graphArea->height());
|
||||||
|
//report->setMaximumSize(ui->graphArea->width(),ui->graphArea->height());
|
||||||
|
//report->setMinimumSize(1280,800);
|
||||||
|
//report->setMaximumSize(1280,800);
|
||||||
|
report->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (report) {
|
if (report) {
|
||||||
report->setMinimumSize(ui->graphArea->width(),ui->graphArea->height());
|
|
||||||
report->setMaximumSize(ui->graphArea->width(),ui->graphArea->height());
|
|
||||||
bc->deselect();
|
bc->deselect();
|
||||||
uc->deselect();
|
uc->deselect();
|
||||||
pr->deselect();
|
pr->deselect();
|
||||||
lk->deselect();
|
lk->deselect();
|
||||||
npb->deselect();
|
npb->deselect();
|
||||||
|
|
||||||
GraphView->hide();
|
//GraphView->hide();
|
||||||
report->show();
|
//report->show();
|
||||||
report->ReloadGraphs();
|
report->ReloadGraphs();
|
||||||
report->GenerateReport(ui->dateStart->date(),ui->dateEnd->date());
|
report->GenerateReport(ui->dateStart->date(),ui->dateEnd->date());
|
||||||
report->on_printButton_clicked();
|
report->on_printButton_clicked();
|
||||||
report->hide();
|
//GraphView->show();
|
||||||
GraphView->show();
|
|
||||||
//report->connect(report->webview(),SIGNAL(loadFinished(bool)),this,SLOT(readyToPrint(bool)));
|
//report->connect(report->webview(),SIGNAL(loadFinished(bool)),this,SLOT(readyToPrint(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
report.cpp
13
report.cpp
@ -19,8 +19,15 @@ Report::Report(QWidget *parent, Profile * _profile, gGraphView * shared, Overvie
|
|||||||
Q_ASSERT(profile!=NULL);
|
Q_ASSERT(profile!=NULL);
|
||||||
|
|
||||||
GraphView=new gGraphView(this,shared);
|
GraphView=new gGraphView(this,shared);
|
||||||
|
setMaximumSize(1280,800);
|
||||||
|
setMinimumSize(1280,800);
|
||||||
|
GraphView->setMaximumSize(1280,graph_height);
|
||||||
|
GraphView->setMinimumSize(1280,graph_height);
|
||||||
|
|
||||||
|
|
||||||
GraphView->hide();
|
GraphView->hide();
|
||||||
|
|
||||||
|
|
||||||
// Reusing the layer data from overview screen,
|
// Reusing the layer data from overview screen,
|
||||||
// (Can't reuse the graphs objects without breaking things)
|
// (Can't reuse the graphs objects without breaking things)
|
||||||
|
|
||||||
@ -81,9 +88,9 @@ void Report::ReloadGraphs()
|
|||||||
}
|
}
|
||||||
void Report::resizeEvent(QResizeEvent *event)
|
void Report::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent(event);
|
// QWidget::resizeEvent(event);
|
||||||
GraphView->setMinimumSize(1280,graph_height);
|
//GraphView->setMinimumSize(1280,graph_height);
|
||||||
GraphView->setMaximumSize(1280,graph_height);
|
//GraphView->setMaximumSize(1280,graph_height);
|
||||||
//GenerateReport(startDate,endDate);
|
//GenerateReport(startDate,endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user