Added 'Event Window' option in preferences to set how much surrounding data is shown when clicking on an event

This commit is contained in:
Mark Watkins 2011-11-18 18:33:31 +10:00
parent 89b6d09678
commit f13bfd8d77
4 changed files with 94 additions and 14 deletions

View File

@ -843,8 +843,10 @@ void Daily::on_treeWidget_itemSelectionChanged()
QDateTime d;
if (!item->text(1).isEmpty()) {
d=d.fromString(item->text(1),"yyyy-MM-dd HH:mm:ss");
double st=qint64((d.addSecs(-120)).toTime_t())*1000L;
double et=qint64((d.addSecs(120)).toTime_t())*1000L;
int winsize=PROFILE["EventWindowSize"].toInt()*60;
double st=qint64((d.addSecs(-(winsize/2))).toTime_t())*1000L;
double et=qint64((d.addSecs(winsize/2)).toTime_t())*1000L;
GraphView->SetXBounds(st,et);
}
}

View File

@ -113,6 +113,7 @@ MainWindow::MainWindow(QWidget *parent) :
if (!PROFILE.Exists("IgnoreShorterSessions")) PROFILE["IgnoreShorterSessions"]=0;
if (!PROFILE.Exists("CombineCloserSessions")) PROFILE["CombineCloserSessions"]=0;
if (!PROFILE.Exists("DaySplitTime")) PROFILE["DaySplitTime"]=QTime(12,0,0,0);
if (!PROFILE.Exists("EventWindowSize")) PROFILE["EventWindowSize"]=4;
//ui->actionUse_AntiAliasing->setChecked(PROFILE["UseAntiAliasing"].toBool());
ui->action_Link_Graph_Groups->setChecked(PROFILE["LinkGroups"].toBool());

View File

@ -74,6 +74,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
if (!(*profile).Exists("SquareWavePlots")) (*profile)["SquareWavePlots"]=true;
ui->squareWavePlots->setChecked((*profile)["SquareWavePlots"].toBool());
if (!(*profile).Exists("EventWindowSize")) (*profile)["EventWindowSize"]=4;
ui->eventWindowSlider->setValue((*profile)["EventWindowSize"].toInt());
ui->eventWindowLCD->display((*profile)["EventWindowSize"].toInt());
if (!PREF.Exists("Updates_AutoCheck")) PREF["Updates_AutoCheck"]=true;
ui->automaticallyCheckUpdates->setChecked(PREF["Updates_AutoCheck"].toBool());
@ -209,6 +213,8 @@ void PreferencesDialog::Save()
(*profile)["SyncOximetry"]=ui->oximetrySync->isChecked();
(*profile)["OximeterType"]=ui->oximetryType->currentText();
(*profile)["EventWindowSize"]=ui->eventWindowSlider->value();
if (ui->squareWavePlots->isChecked() != (*profile)["SquareWavePlots"].toBool()) {
needs_restart=true;
}

View File

@ -45,7 +45,7 @@
<string>&amp;CPAP/Visual</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -58,7 +58,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -71,7 +71,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -84,7 +84,7 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="intentionalLeakEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -102,7 +102,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="7" column="1">
<widget class="QComboBox" name="overlayFlagsCombo">
<property name="toolTip">
<string>The visual method of displaying waveform overlay flags.</string>
@ -119,7 +119,7 @@
</item>
</widget>
</item>
<item row="6" column="1">
<item row="9" column="1">
<widget class="QComboBox" name="unitCombo">
<item>
<property name="text">
@ -133,7 +133,7 @@
</item>
</widget>
</item>
<item row="9" column="0" colspan="3">
<item row="17" column="0" colspan="3">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -146,7 +146,7 @@
</property>
</spacer>
</item>
<item row="0" column="2">
<item row="3" column="2">
<widget class="QCheckBox" name="useGraphSnapshots">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -163,7 +163,7 @@ This takes extra space, and has been known to cause problems on certain computer
</property>
</widget>
</item>
<item row="4" column="2">
<item row="7" column="2">
<widget class="QCheckBox" name="useAntiAliasing">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -179,7 +179,7 @@ This takes extra space, and has been known to cause problems on certain computer
</property>
</widget>
</item>
<item row="6" column="2">
<item row="9" column="2">
<widget class="QCheckBox" name="useMultithreading">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -196,7 +196,7 @@ It has no effect on single cpu machines.</string>
</property>
</widget>
</item>
<item row="7" column="2">
<item row="10" column="2">
<widget class="QCheckBox" name="skipEmptyDays">
<property name="toolTip">
<string>Skip empty days with Prev &amp; Next buttons above daily view calendar</string>
@ -206,13 +206,65 @@ It has no effect on single cpu machines.</string>
</property>
</widget>
</item>
<item row="8" column="2">
<item row="11" column="2">
<widget class="QCheckBox" name="squareWavePlots">
<property name="text">
<string>Square Wave Plots</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Event Window</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QSlider" name="eventWindowSlider">
<property name="toolTip">
<string>This adjusts how much surrounding data is shown when an event is selected in Daily Views Event tab.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="eventWindowLCD">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="numDigits">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="sessionTab">
@ -353,6 +405,9 @@ It will be faster changing to days you've already been to if you leave it on. </
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="numDigits">
<number>5</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
@ -1211,5 +1266,21 @@ p, li { white-space: pre-wrap; }
</hint>
</hints>
</connection>
<connection>
<sender>eventWindowSlider</sender>
<signal>sliderMoved(int)</signal>
<receiver>eventWindowLCD</receiver>
<slot>display(int)</slot>
<hints>
<hint type="sourcelabel">
<x>286</x>
<y>56</y>
</hint>
<hint type="destinationlabel">
<x>465</x>
<y>56</y>
</hint>
</hints>
</connection>
</connections>
</ui>