mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Slow down cube a bit to conserve resources.. Format Usage in Summary as time
This commit is contained in:
parent
77e92d4b16
commit
cda2e4d1aa
@ -2609,7 +2609,7 @@ void gGraphView::paintGL()
|
||||
|
||||
if (this->isVisible()) {
|
||||
if (m_limbo || m_inAnimation || (something_fun && !numgraphs)) {
|
||||
redrawtimer->setInterval(15);
|
||||
redrawtimer->setInterval(50);
|
||||
redrawtimer->setSingleShot(true);
|
||||
redrawtimer->start();
|
||||
} else {
|
||||
|
@ -478,6 +478,15 @@ void MainWindow::on_homeButton_clicked()
|
||||
{
|
||||
ui->webView->setUrl(QUrl("qrc:/docs/index.html"));
|
||||
}
|
||||
|
||||
QString formatTime(float time)
|
||||
{
|
||||
int hours=time;
|
||||
int seconds=time*3600.0;
|
||||
int minutes=(seconds / 60) % 60;
|
||||
seconds %= 60;
|
||||
return QString().sprintf("%02i:%02i",hours,minutes); //,seconds);
|
||||
}
|
||||
void MainWindow::on_summaryButton_clicked()
|
||||
{
|
||||
QString html=htmlHeader();
|
||||
@ -539,11 +548,11 @@ void MainWindow::on_summaryButton_clicked()
|
||||
|
||||
html+=QString("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td><td>%5</td><td>%6</td></tr>")
|
||||
.arg(tr("Usage (Average)"))
|
||||
.arg(p_profile->calcHours(MT_CPAP),0,'f',3)
|
||||
.arg(p_profile->calcHours(MT_CPAP,cpapweek,lastcpap)/float(cpapweekdays),0,'f',3)
|
||||
.arg(p_profile->calcHours(MT_CPAP,cpapmonth,lastcpap)/float(cpapmonthdays),0,'f',3)
|
||||
.arg(p_profile->calcHours(MT_CPAP,cpap6month,lastcpap)/float(cpap6monthdays),0,'f',3)
|
||||
.arg(p_profile->calcHours(MT_CPAP,cpapyear,lastcpap)/float(cpapyeardays),0,'f',3);
|
||||
.arg(formatTime(p_profile->calcHours(MT_CPAP)))
|
||||
.arg(formatTime(p_profile->calcHours(MT_CPAP,cpapweek,lastcpap)/float(cpapweekdays)))
|
||||
.arg(formatTime(p_profile->calcHours(MT_CPAP,cpapmonth,lastcpap)/float(cpapmonthdays)))
|
||||
.arg(formatTime(p_profile->calcHours(MT_CPAP,cpap6month,lastcpap)/float(cpap6monthdays)))
|
||||
.arg(formatTime(p_profile->calcHours(MT_CPAP,cpapyear,lastcpap)/float(cpapyeardays)));
|
||||
|
||||
html+=QString("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td><td>%5</td><td>%6</td></tr>")
|
||||
.arg(tr("Average Pressure"))
|
||||
|
Loading…
Reference in New Issue
Block a user