mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-08 20:20:44 +00:00
Improve Viatom file selection on Windows.
Also remove a warning about unexpected data.
This commit is contained in:
parent
04121cc36e
commit
ad15655ffb
@ -303,11 +303,8 @@ bool ViatomFile::ParseHeader()
|
|||||||
//int spo2_avg = header[17];
|
//int spo2_avg = header[17];
|
||||||
//int spo2_min = header[18];
|
//int spo2_min = header[18];
|
||||||
//int spo2_3pct = header[19]; // number of events
|
//int spo2_3pct = header[19]; // number of events
|
||||||
int spo2_4pct = header[20]; // number of events
|
//int spo2_4pct = header[20]; // number of events
|
||||||
if (header[21] > spo2_4pct) {
|
//CHECK_VALUE(header[21], 0); // ??? sometimes nonzero; maybe pulse spike, not a threshold of SpO2 or pulse, not always smaller than spo2_4pct
|
||||||
//CHECK_VALUE(header[21], 0); // sometimes nonzero; maybe spo2_5pct or something like that?
|
|
||||||
UNEXPECTED_VALUE(header[21], "< drops over 4%");
|
|
||||||
}
|
|
||||||
//int time_under_90pct = header[22] | (header[23] << 8); // in seconds
|
//int time_under_90pct = header[22] | (header[23] << 8); // in seconds
|
||||||
//int events_under_90pct = header[24]; // number of distinct events
|
//int events_under_90pct = header[24]; // number of distinct events
|
||||||
//float o2_score = header[25] * 0.1;
|
//float o2_score = header[25] * 0.1;
|
||||||
|
@ -2504,10 +2504,17 @@ void MainWindow::on_actionImport_Viatom_Data_triggered()
|
|||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
// Windows can't handle this name filter.
|
// Windows can't handle this name filter.
|
||||||
w.setOption(QFileDialog::DontUseNativeDialog, true);
|
w.setOption(QFileDialog::DontUseNativeDialog, true);
|
||||||
|
// And since the non-native dialog can't select both directories and files,
|
||||||
|
// it needs the following to enable selecting multiple files.
|
||||||
|
w.setFileMode(QFileDialog::ExistingFiles);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (w.exec() == QFileDialog::Accepted) {
|
if (w.exec() == QFileDialog::Accepted) {
|
||||||
QString filename = w.selectedFiles()[0];
|
QString filename = w.selectedFiles()[0];
|
||||||
|
if (w.selectedFiles().size() > 1) {
|
||||||
|
// The user selected multiple files in a directory, so use the parent directory as the filename.
|
||||||
|
filename = QFileInfo(filename).absoluteDir().canonicalPath();
|
||||||
|
}
|
||||||
|
|
||||||
int c = viatom.Open(filename);
|
int c = viatom.Open(filename);
|
||||||
if (c > 0) {
|
if (c > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user