mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-08 04:00:44 +00:00
Make Oximeter welcome page skippable and reaccessable.
This commit is contained in:
parent
83d8f1ea40
commit
66ed64be35
@ -207,6 +207,8 @@ const QString STR_OS_SPO2DropDuration = "SPO2DropDuration";
|
|||||||
const QString STR_OS_SPO2DropPercentage = "SPO2DropPercentage";
|
const QString STR_OS_SPO2DropPercentage = "SPO2DropPercentage";
|
||||||
const QString STR_OS_PulseChangeDuration = "PulseChangeDuration";
|
const QString STR_OS_PulseChangeDuration = "PulseChangeDuration";
|
||||||
const QString STR_OS_PulseChangeBPM = "PulseChangeBPM";
|
const QString STR_OS_PulseChangeBPM = "PulseChangeBPM";
|
||||||
|
const QString STR_OS_SkipOxiIntroScreen = "SkipOxiIntroScreen";
|
||||||
|
|
||||||
|
|
||||||
// CPAPSettings Strings
|
// CPAPSettings Strings
|
||||||
const QString STR_CS_ComplianceHours = "ComplianceHours";
|
const QString STR_CS_ComplianceHours = "ComplianceHours";
|
||||||
@ -413,6 +415,7 @@ class OxiSettings : public ProfileSettings
|
|||||||
initPref(STR_OS_SPO2DropPercentage, 3.0);
|
initPref(STR_OS_SPO2DropPercentage, 3.0);
|
||||||
initPref(STR_OS_PulseChangeDuration, 8.0);
|
initPref(STR_OS_PulseChangeDuration, 8.0);
|
||||||
initPref(STR_OS_PulseChangeBPM, 5.0);
|
initPref(STR_OS_PulseChangeBPM, 5.0);
|
||||||
|
initPref(STR_OS_SkipOxiIntroScreen, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oximetryEnabled() const { return getPref(STR_OS_EnableOximetry).toBool(); }
|
bool oximetryEnabled() const { return getPref(STR_OS_EnableOximetry).toBool(); }
|
||||||
@ -423,6 +426,8 @@ class OxiSettings : public ProfileSettings
|
|||||||
double spO2DropPercentage() const { return getPref(STR_OS_SPO2DropPercentage).toDouble(); }
|
double spO2DropPercentage() const { return getPref(STR_OS_SPO2DropPercentage).toDouble(); }
|
||||||
double pulseChangeDuration() const { return getPref(STR_OS_PulseChangeDuration).toDouble(); }
|
double pulseChangeDuration() const { return getPref(STR_OS_PulseChangeDuration).toDouble(); }
|
||||||
double pulseChangeBPM() const { return getPref(STR_OS_PulseChangeBPM).toDouble(); }
|
double pulseChangeBPM() const { return getPref(STR_OS_PulseChangeBPM).toDouble(); }
|
||||||
|
bool skipOxiIntroScreen() const { return getPref(STR_OS_SkipOxiIntroScreen).toBool(); }
|
||||||
|
|
||||||
|
|
||||||
void setOximetryEnabled(bool enabled) { setPref(STR_OS_EnableOximetry, enabled); }
|
void setOximetryEnabled(bool enabled) { setPref(STR_OS_EnableOximetry, enabled); }
|
||||||
void setSyncOximetry(bool synced) { setPref(STR_OS_SyncOximetry, synced); }
|
void setSyncOximetry(bool synced) { setPref(STR_OS_SyncOximetry, synced); }
|
||||||
@ -430,6 +435,7 @@ class OxiSettings : public ProfileSettings
|
|||||||
void setOxiDiscardThreshold(double thresh) { setPref(STR_OS_OxiDiscardThreshold, thresh); }
|
void setOxiDiscardThreshold(double thresh) { setPref(STR_OS_OxiDiscardThreshold, thresh); }
|
||||||
void setSpO2DropDuration(double duration) { setPref(STR_OS_SPO2DropDuration, duration); }
|
void setSpO2DropDuration(double duration) { setPref(STR_OS_SPO2DropDuration, duration); }
|
||||||
void setPulseChangeBPM(double bpm) { setPref(STR_OS_PulseChangeBPM, bpm); }
|
void setPulseChangeBPM(double bpm) { setPref(STR_OS_PulseChangeBPM, bpm); }
|
||||||
|
void setSkipOxiIntroScreen(bool skip) { setPref(STR_OS_SkipOxiIntroScreen, skip); }
|
||||||
void setSpO2DropPercentage(double percentage) {
|
void setSpO2DropPercentage(double percentage) {
|
||||||
setPref(STR_OS_SPO2DropPercentage, percentage);
|
setPref(STR_OS_SPO2DropPercentage, percentage);
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,18 @@ OximeterImport::OximeterImport(QWidget *parent) :
|
|||||||
ELplethy = nullptr;
|
ELplethy = nullptr;
|
||||||
|
|
||||||
pulse = spo2 = -1;
|
pulse = spo2 = -1;
|
||||||
|
|
||||||
|
|
||||||
|
ui->skipWelcomeCheckbox->setChecked(p_profile->oxi->skipOxiIntroScreen());
|
||||||
|
if (p_profile->oxi->skipOxiIntroScreen()) {
|
||||||
|
ui->stackedWidget->setCurrentWidget(ui->importSelectionPage);
|
||||||
|
ui->nextButton->setVisible(false);
|
||||||
|
ui->informationButton->setVisible(true);
|
||||||
|
} else {
|
||||||
|
ui->stackedWidget->setCurrentWidget(ui->welcomePage);
|
||||||
|
ui->nextButton->setVisible(true);
|
||||||
|
ui->informationButton->setVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OximeterImport::~OximeterImport()
|
OximeterImport::~OximeterImport()
|
||||||
@ -96,8 +108,12 @@ void OximeterImport::on_nextButton_clicked()
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ui->nextButton->setVisible(false);
|
ui->nextButton->setVisible(false);
|
||||||
|
ui->informationButton->setVisible(true);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
ui->informationButton->setVisible(true);
|
||||||
|
|
||||||
ui->nextButton->setVisible(true);
|
ui->nextButton->setVisible(true);
|
||||||
|
|
||||||
|
|
||||||
@ -167,6 +183,7 @@ SerialOximeter * OximeterImport::detectOximeter()
|
|||||||
|
|
||||||
void OximeterImport::on_directImportButton_clicked()
|
void OximeterImport::on_directImportButton_clicked()
|
||||||
{
|
{
|
||||||
|
ui->informationButton->setVisible(false);
|
||||||
ui->stackedWidget->setCurrentWidget(ui->directImportPage);
|
ui->stackedWidget->setCurrentWidget(ui->directImportPage);
|
||||||
|
|
||||||
oximodule = detectOximeter();
|
oximodule = detectOximeter();
|
||||||
@ -238,6 +255,7 @@ void OximeterImport::doUpdateProgress(int v, int t)
|
|||||||
|
|
||||||
void OximeterImport::on_fileImportButton_clicked()
|
void OximeterImport::on_fileImportButton_clicked()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
const QString documentsFolder = QDesktopServices::storageLocation(
|
const QString documentsFolder = QDesktopServices::storageLocation(
|
||||||
QDesktopServices::DocumentsLocation);
|
QDesktopServices::DocumentsLocation);
|
||||||
@ -266,6 +284,7 @@ void OximeterImport::on_fileImportButton_clicked()
|
|||||||
QMessageBox::warning(this, STR_MessageBox_Warning, tr("No Oximetery module could parse the given file:")+QString("\n\n%1").arg(filename), QMessageBox::Ok);
|
QMessageBox::warning(this, STR_MessageBox_Warning, tr("No Oximetery module could parse the given file:")+QString("\n\n%1").arg(filename), QMessageBox::Ok);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ui->informationButton->setVisible(false);
|
||||||
|
|
||||||
ui->stackedWidget->setCurrentWidget(ui->syncPage);
|
ui->stackedWidget->setCurrentWidget(ui->syncPage);
|
||||||
ui->syncSaveButton->setVisible(true);
|
ui->syncSaveButton->setVisible(true);
|
||||||
@ -278,6 +297,8 @@ void OximeterImport::on_fileImportButton_clicked()
|
|||||||
|
|
||||||
void OximeterImport::on_liveImportButton_clicked()
|
void OximeterImport::on_liveImportButton_clicked()
|
||||||
{
|
{
|
||||||
|
ui->informationButton->setVisible(false);
|
||||||
|
|
||||||
ui->stackedWidget->setCurrentWidget(ui->liveImportPage);
|
ui->stackedWidget->setCurrentWidget(ui->liveImportPage);
|
||||||
ui->liveImportPage->layout()->addWidget(ui->progressBar);
|
ui->liveImportPage->layout()->addWidget(ui->progressBar);
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -586,3 +607,16 @@ void OximeterImport::on_showLiveGraphs_clicked(bool checked)
|
|||||||
plethyGraph->setVisible(checked);
|
plethyGraph->setVisible(checked);
|
||||||
liveView->redraw();
|
liveView->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OximeterImport::on_skipWelcomeCheckbox_clicked(bool checked)
|
||||||
|
{
|
||||||
|
p_profile->oxi->setSkipOxiIntroScreen(checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OximeterImport::on_informationButton_clicked()
|
||||||
|
{
|
||||||
|
ui->stackedWidget->setCurrentWidget(ui->welcomePage);
|
||||||
|
ui->nextButton->setVisible(true);
|
||||||
|
ui->informationButton->setVisible(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -55,6 +55,10 @@ private slots:
|
|||||||
|
|
||||||
void on_showLiveGraphs_clicked(bool checked);
|
void on_showLiveGraphs_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_skipWelcomeCheckbox_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_informationButton_clicked();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void on_updatePlethy(QByteArray plethy);
|
void on_updatePlethy(QByteArray plethy);
|
||||||
void finishedRecording();
|
void finishedRecording();
|
||||||
|
@ -620,7 +620,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>3</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="welcomePage">
|
<widget class="QWidget" name="welcomePage">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@ -691,7 +691,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox">
|
<widget class="QCheckBox" name="skipWelcomeCheckbox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Skip this page next time.</string>
|
<string>Skip this page next time.</string>
|
||||||
</property>
|
</property>
|
||||||
@ -1476,7 +1476,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="buttonLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="cancelButton">
|
<widget class="QPushButton" name="cancelButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -1484,6 +1484,13 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="informationButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Information Page</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -1512,19 +1519,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="nextButton">
|
<widget class="QPushButton" name="syncSaveButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Start</string>
|
<string>&Save and Finish</string>
|
||||||
</property>
|
|
||||||
<property name="default">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="syncSaveButton">
|
<widget class="QPushButton" name="nextButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Save and Finish</string>
|
<string>&Start</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user