mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Merge branch 'master' into prs1-improvements
This commit is contained in:
commit
9a1bccff57
@ -177,6 +177,11 @@ QString getGraphicsEngine()
|
||||
QString getBranchVersion()
|
||||
{
|
||||
QString version = STR_TR_AppVersion;
|
||||
|
||||
if (!((ReleaseStatus.compare("r", Qt::CaseInsensitive)==0) ||
|
||||
(ReleaseStatus.compare("release", Qt::CaseInsensitive)==0)))
|
||||
version += " ("+GIT_REVISION + ")";
|
||||
|
||||
if (GIT_BRANCH != "master") {
|
||||
version += " [Branch: " + GIT_BRANCH + "]";
|
||||
}
|
||||
|
@ -379,12 +379,11 @@ bool Session::StoreSummary()
|
||||
|
||||
bool Session::LoadSummary()
|
||||
{
|
||||
//static int sumcnt = 0;
|
||||
// static int sumcnt = 0;
|
||||
|
||||
if (s_summary_loaded) return true;
|
||||
QString filename = s_machine->getSummariesPath() + QString().sprintf("%08lx.000", s_session);
|
||||
|
||||
|
||||
if (filename.isEmpty()) {
|
||||
qDebug() << "Empty summary filename";
|
||||
return false;
|
||||
@ -398,7 +397,7 @@ bool Session::LoadSummary()
|
||||
}
|
||||
|
||||
|
||||
// qDebug() << "Loading" << s_machine->loaderName() << "Summary" << filename << sumcnt++;
|
||||
// qDebug() << "Loading" << s_machine->loaderName() << "Summary" << filename << sumcnt++;
|
||||
|
||||
QDataStream in(&file);
|
||||
in.setVersion(QDataStream::Qt_4_6);
|
||||
|
@ -1 +1 @@
|
||||
const int build_number = 1;
|
||||
const int build_number = 2;
|
||||
|
@ -432,7 +432,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
ui->ouncesSpinBox->setSuffix(STR_UNIT_OUNCE);
|
||||
} else {
|
||||
ui->ouncesSpinBox->setVisible(false);
|
||||
ui->weightSpinBox->setDecimals(3);
|
||||
ui->weightSpinBox->setDecimals(1);
|
||||
ui->weightSpinBox->setSuffix(STR_UNIT_KG);
|
||||
}
|
||||
|
||||
@ -588,6 +588,11 @@ void Daily::ReloadGraphs()
|
||||
// sleep(3);
|
||||
}
|
||||
|
||||
void Daily::updateLeftSidebar() {
|
||||
if (webView && !htmlLeftHeader.isEmpty())
|
||||
webView->setHtml(getLeftSidebar(true));
|
||||
}
|
||||
|
||||
void Daily::hideSpaceHogs()
|
||||
{
|
||||
if (AppSetting->calendarVisible()) {
|
||||
@ -830,7 +835,7 @@ void Daily::on_ReloadDay()
|
||||
ui->ouncesSpinBox->setSuffix(STR_UNIT_OUNCE);
|
||||
} else {
|
||||
ui->ouncesSpinBox->setVisible(false);
|
||||
ui->weightSpinBox->setDecimals(3);
|
||||
ui->weightSpinBox->setDecimals(1);
|
||||
ui->weightSpinBox->setSuffix(STR_UNIT_KG);
|
||||
}
|
||||
this->setCursor(Qt::ArrowCursor);
|
||||
@ -1545,7 +1550,7 @@ void Daily::Load(QDate date)
|
||||
for (int i=0; i < available.size(); ++i) {
|
||||
ChannelID code = available.at(i);
|
||||
schema::Channel & chan = schema::channel[code];
|
||||
if (!chan.enabled()) continue;
|
||||
// if (!chan.enabled()) continue;
|
||||
QString data;
|
||||
if (chan.type() == schema::SPAN) {
|
||||
val = (100.0 / hours)*(day->sum(code)/3600.0);
|
||||
@ -1688,7 +1693,7 @@ void Daily::Load(QDate date)
|
||||
double kg=journal->settings[Journal_Weight].toDouble(&ok);
|
||||
|
||||
if (p_profile->general->unitSystem()==US_Metric) {
|
||||
ui->weightSpinBox->setDecimals(3);
|
||||
ui->weightSpinBox->setDecimals(1);
|
||||
ui->weightSpinBox->blockSignals(true);
|
||||
ui->weightSpinBox->setValue(kg);
|
||||
ui->weightSpinBox->blockSignals(false);
|
||||
@ -1778,7 +1783,7 @@ void Daily::UnitsChanged()
|
||||
} else {
|
||||
kg=(ui->weightSpinBox->value()*(ounce_convert*16.0))+(ui->ouncesSpinBox->value()*ounce_convert);
|
||||
kg/=1000.0;
|
||||
ui->weightSpinBox->setDecimals(3);
|
||||
ui->weightSpinBox->setDecimals(1);
|
||||
ui->weightSpinBox->setValue(kg);
|
||||
ui->ouncesSpinBox->setVisible(false);
|
||||
ui->weightSpinBox->setSuffix(STR_UNIT_KG);
|
||||
@ -2276,6 +2281,10 @@ void Daily::on_weightSpinBox_valueChanged(double arg1)
|
||||
double bmi=kg/(height * height);
|
||||
ui->BMI->display(bmi);
|
||||
ui->BMI->setVisible(true);
|
||||
ui->BMIlabel->setVisible(true);
|
||||
} else {
|
||||
ui->BMI->setVisible(false);
|
||||
ui->BMIlabel->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2306,11 +2315,15 @@ void Daily::on_weightSpinBox_editingFinished()
|
||||
double bmi=kg/(height * height);
|
||||
ui->BMI->display(bmi);
|
||||
ui->BMI->setVisible(true);
|
||||
ui->BMIlabel->setVisible(true);
|
||||
journal->settings[Journal_BMI]=bmi;
|
||||
if (gv) {
|
||||
g=gv->findGraph(STR_GRAPH_BMI);
|
||||
if (g) g->setDay(nullptr);
|
||||
}
|
||||
} else {
|
||||
ui->BMI->setVisible(false);
|
||||
ui->BMIlabel->setVisible(false);
|
||||
}
|
||||
journal->SetChanged(true);
|
||||
}
|
||||
@ -2324,6 +2337,10 @@ void Daily::on_ouncesSpinBox_valueChanged(int arg1)
|
||||
double bmi=kg/(height * height);
|
||||
ui->BMI->display(bmi);
|
||||
ui->BMI->setVisible(true);
|
||||
ui->BMIlabel->setVisible(true);
|
||||
} else {
|
||||
ui->BMI->setVisible(false);
|
||||
ui->BMIlabel->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2348,12 +2365,16 @@ void Daily::on_ouncesSpinBox_editingFinished()
|
||||
double bmi=kg/(height * height);
|
||||
ui->BMI->display(bmi);
|
||||
ui->BMI->setVisible(true);
|
||||
ui->BMIlabel->setVisible(true);
|
||||
|
||||
journal->settings[Journal_BMI]=bmi;
|
||||
if (mainwin->getOverview()) {
|
||||
g=mainwin->getOverview()->graphView()->findGraph(STR_GRAPH_BMI);
|
||||
if (g) g->setDay(nullptr);
|
||||
}
|
||||
} else {
|
||||
ui->BMI->setVisible(false);
|
||||
ui->BMIlabel->setVisible(false);
|
||||
}
|
||||
journal->SetChanged(true);
|
||||
}
|
||||
|
@ -66,6 +66,11 @@ public:
|
||||
*/
|
||||
void ResetGraphLayout();
|
||||
|
||||
/*! \fn updateLeftSidebar()
|
||||
/brief Updtes left sidebar to reflect changes in pie chart visibility
|
||||
*/
|
||||
void updateLeftSidebar();
|
||||
|
||||
/*! \fn graphView()
|
||||
\returns the main graphView area for the Daily View
|
||||
*/
|
||||
|
@ -1227,6 +1227,9 @@ QToolButton:pressed {
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="weightSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>If height is greater than zero in Preferences Dialog, setting weight here will show Body Mass Index (BMI) value</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1499.000000000000000</double>
|
||||
</property>
|
||||
@ -1314,10 +1317,10 @@ QSlider::handle:horizontal {
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="smallDecimalPoint">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="digitCount">
|
||||
<number>5</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="segmentStyle">
|
||||
<enum>QLCDNumber::Flat</enum>
|
||||
|
@ -6,13 +6,27 @@
|
||||
Which was written and copyright 2011-2018 © Mark Watkins
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Changes and fixes in OSCAR v1.1.0-testing-2</b>
|
||||
<br/><b>NOTE: Translations have NOT yet been updated for these changes</b>
|
||||
<ul>
|
||||
<li>Portions of OSCAR are © 2019 by The OSCAR Team</li>
|
||||
<li>[new] Show progress bar when Statistics page has to refresh cache with more than 180 days in it</li>
|
||||
<li>[new] Romanian language is supported</li>
|
||||
<li>[fix] Show commit id in title bar for testing and beta builds</li>
|
||||
<li>[fix] Show BMI label and calculated value only when both weight and height are non-zero</li>
|
||||
<li>[fix] Improve BMI display in Daily/Notes</li>
|
||||
<li>[fix] Correct profile dialog to show height is measured in cm, not meters, when units system is metric</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Changes and fixes in OSCAR v1.1.0-testing-1</b>
|
||||
<br/><b>NOTE: Translations have NOT yet been updated for these changes</b>
|
||||
<ul>
|
||||
<li>Portions of OSCAR are © 2019 by The OSCAR Team</li>
|
||||
<li>[new] Offer migration if non-default directory is selected on first use</li>
|
||||
<li>[new] Press SHIFT key when starting OSCAR to use Software Graphics Engine</li>
|
||||
<li>[new] Hold SHIFT key down when starting OSCAR to use Software Graphics Engine</li>
|
||||
<li>[new] Support for DreamStation BiPAP autoSV (900X) should now be complete</li>
|
||||
<li>[new] Improved Dreamstation support</li>
|
||||
<li>[new] Improve oximeter import for CM550D+</li>
|
||||
|
@ -111,8 +111,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
}
|
||||
|
||||
bool setupRunning = false;
|
||||
|
||||
void MainWindow::SetupGUI()
|
||||
{
|
||||
setupRunning = true;
|
||||
QString version = getBranchVersion();
|
||||
setWindowTitle(STR_TR_OSCAR + QString(" %1").arg(version));
|
||||
|
||||
@ -241,6 +244,7 @@ void MainWindow::SetupGUI()
|
||||
help = new Help(this);
|
||||
ui->tabWidget->addTab(help, tr("Help Browser"));
|
||||
#endif
|
||||
setupRunning = false;
|
||||
}
|
||||
|
||||
void MainWindow::logMessage(QString msg)
|
||||
@ -2469,8 +2473,9 @@ void MainWindow::on_actionLine_Cursor_toggled(bool b)
|
||||
void MainWindow::on_actionPie_Chart_toggled(bool visible)
|
||||
{
|
||||
AppSetting->setShowPieChart(visible);
|
||||
if (daily && ui->tabWidget->currentWidget() == daily) {
|
||||
daily->ReloadGraphs();
|
||||
if (!setupRunning && daily) {
|
||||
daily->updateLeftSidebar();
|
||||
// daily->ReloadGraphs();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ NewProfile::NewProfile(QWidget *parent, const QString *user) :
|
||||
on_cpapModeCombo_activated(0);
|
||||
m_passwordHashed = false;
|
||||
ui->heightEdit2->setVisible(false);
|
||||
ui->heightEdit->setDecimals(2);
|
||||
ui->heightEdit->setDecimals(0);
|
||||
ui->heightEdit->setSuffix(STR_UNIT_CM);
|
||||
|
||||
{
|
||||
@ -397,8 +397,8 @@ void NewProfile::edit(const QString name)
|
||||
} else { // good wholesome metric
|
||||
ui->heightEdit->setValue(v);
|
||||
ui->heightEdit2->setVisible(false);
|
||||
ui->heightEdit->setDecimals(2);
|
||||
ui->heightEdit->setSuffix(STR_UNIT_M);
|
||||
ui->heightEdit->setDecimals(0);
|
||||
ui->heightEdit->setSuffix(STR_UNIT_CM);
|
||||
}
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ void NewProfile::on_heightCombo_currentIndexChanged(int index)
|
||||
if (index == 0) {
|
||||
//metric
|
||||
ui->heightEdit2->setVisible(false);
|
||||
ui->heightEdit->setDecimals(2);
|
||||
ui->heightEdit->setDecimals(0);
|
||||
ui->heightEdit->setSuffix(STR_UNIT_CM);
|
||||
double v = ui->heightEdit->value() * 30.48;
|
||||
v += ui->heightEdit2->value() * 2.54;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <QPrintDialog>
|
||||
#include <QPainter>
|
||||
#include <QMainWindow>
|
||||
#include <QProgressDialog>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "statistics.h"
|
||||
@ -158,6 +159,7 @@ bool rxAHILessThan(const RXItem * rx1, const RXItem * rx2)
|
||||
|
||||
void Statistics::updateRXChanges()
|
||||
{
|
||||
// qDebug() << "updateRXChanges called";
|
||||
rxitems.clear();
|
||||
|
||||
// Read the cache from disk
|
||||
@ -173,6 +175,23 @@ void Statistics::updateRXChanges()
|
||||
|
||||
quint64 tmp;
|
||||
|
||||
int numDays = p_profile->daylist.count();
|
||||
int daysProcessed = 0;
|
||||
int lastPctDone = 0;
|
||||
bool showProgress = (numDays > 180); // Show progress dialog if more than about 6 months of data
|
||||
|
||||
QProgressDialog * progress = nullptr;
|
||||
|
||||
if (showProgress) { // arbitrary guess about when we should bother with a progress dialog
|
||||
progress = new QProgressDialog(QObject::tr("Updating Statistics cache"),
|
||||
QString(), 0, numDays, 0,
|
||||
Qt::WindowSystemMenuHint | Qt::WindowTitleHint);
|
||||
progress->setValue(0);
|
||||
progress->setMinimumWidth(250);
|
||||
progress->show();
|
||||
// qDebug() << "Updating statistics rx cache dialog shown";
|
||||
}
|
||||
|
||||
// Scan through each daylist in ascending date order
|
||||
for (it = p_profile->daylist.begin(); it != it_end; ++it) {
|
||||
const QDate & date = it.key();
|
||||
@ -480,11 +499,25 @@ void Statistics::updateRXChanges()
|
||||
rxitems.insert(date, rx);
|
||||
}
|
||||
|
||||
// Update progress bar every percent change
|
||||
if (showProgress) {
|
||||
daysProcessed++;
|
||||
int pctDone = (100 * daysProcessed) / numDays;
|
||||
if (pctDone != lastPctDone) {
|
||||
lastPctDone = pctDone;
|
||||
progress->setValue(daysProcessed);
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Store RX cache to disk
|
||||
saveRXChanges();
|
||||
|
||||
|
||||
if (showProgress)
|
||||
progress->setValue(numDays); // Force progress bar to stop
|
||||
|
||||
// Now do the setup for the best worst highlighting
|
||||
QList<RXItem *> list;
|
||||
ri_end = rxitems.end();
|
||||
@ -641,7 +674,7 @@ QString Statistics::generateHeader(bool onScreen)
|
||||
html += "p,a,td,body { font-family: 'Helvetica'; }";
|
||||
// "p,a,td,body { font-size: 10px; }";
|
||||
}
|
||||
qDebug() << "generateHeader font" << html;
|
||||
// qDebug() << "generateHeader font" << html;
|
||||
html += "table.curved {" // Borders not supported without webkit
|
||||
// "border: 1px solid gray;"
|
||||
// "border-radius:10px;"
|
||||
|
Loading…
Reference in New Issue
Block a user