diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/configuredivecomputerdialog.cpp | 26 | ||||
-rw-r--r-- | desktop-widgets/configuredivecomputerdialog.ui | 2 | ||||
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 6 | ||||
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 35 | ||||
-rw-r--r-- | desktop-widgets/diveplanner.h | 2 | ||||
-rw-r--r-- | desktop-widgets/maintab.cpp | 4 | ||||
-rw-r--r-- | desktop-widgets/plannerSettings.ui | 128 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_graph.ui | 2 |
8 files changed, 148 insertions, 57 deletions
diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp index 8b3a9a5e9..4ee61bb99 100644 --- a/desktop-widgets/configuredivecomputerdialog.cpp +++ b/desktop-widgets/configuredivecomputerdialog.cpp @@ -576,7 +576,7 @@ void ConfigureDiveComputerDialog::populateDeviceDetailsOSTC3() deviceDetails->dil4 = dil4; deviceDetails->dil5 = dil5; - //set set point details + //set setpoint details setpoint sp1; setpoint sp2; setpoint sp3; @@ -709,7 +709,7 @@ void ConfigureDiveComputerDialog::populateDeviceDetailsOSTC() deviceDetails->dil4 = dil4; deviceDetails->dil5 = dil5; - //set set point details + //set setpoint details setpoint sp1; setpoint sp2; setpoint sp3; @@ -750,7 +750,7 @@ void ConfigureDiveComputerDialog::populateDeviceDetailsSuuntoVyper() deviceDetails->lightEnabled = ui.lightCheckBox->isChecked(); deviceDetails->light = ui.lightSpinBox->value(); deviceDetails->alarmDepthEnabled = ui.alarmDepthCheckBox->isChecked(); - deviceDetails->alarmDepth = units_to_depth(ui.alarmDepthDoubleSpinBox->value()); + deviceDetails->alarmDepth = units_to_depth(ui.alarmDepthDoubleSpinBox->value()).mm; deviceDetails->alarmTimeEnabled = ui.alarmTimeCheckBox->isChecked(); deviceDetails->alarmTime = ui.alarmTimeSpinBox->value(); } @@ -945,23 +945,23 @@ void ConfigureDiveComputerDialog::reloadValuesOSTC3() ui.ostc3DilTable->setItem(4, 3, new QTableWidgetItem(QString::number(deviceDetails->dil5.type))); ui.ostc3DilTable->setItem(4, 4, new QTableWidgetItem(QString::number(deviceDetails->dil5.depth))); - //load set point 1 values + //load setpoint 1 values ui.ostc3SetPointTable->setItem(0, 1, new QTableWidgetItem(QString::number(deviceDetails->sp1.sp))); ui.ostc3SetPointTable->setItem(0, 2, new QTableWidgetItem(QString::number(deviceDetails->sp1.depth))); - //load set point 2 values + //load setpoint 2 values ui.ostc3SetPointTable->setItem(1, 1, new QTableWidgetItem(QString::number(deviceDetails->sp2.sp))); ui.ostc3SetPointTable->setItem(1, 2, new QTableWidgetItem(QString::number(deviceDetails->sp2.depth))); - //load set point 3 values + //load setpoint 3 values ui.ostc3SetPointTable->setItem(2, 1, new QTableWidgetItem(QString::number(deviceDetails->sp3.sp))); ui.ostc3SetPointTable->setItem(2, 2, new QTableWidgetItem(QString::number(deviceDetails->sp3.depth))); - //load set point 4 values + //load setpoint 4 values ui.ostc3SetPointTable->setItem(3, 1, new QTableWidgetItem(QString::number(deviceDetails->sp4.sp))); ui.ostc3SetPointTable->setItem(3, 2, new QTableWidgetItem(QString::number(deviceDetails->sp4.depth))); - //load set point 5 values + //load setpoint 5 values ui.ostc3SetPointTable->setItem(4, 1, new QTableWidgetItem(QString::number(deviceDetails->sp5.sp))); ui.ostc3SetPointTable->setItem(4, 2, new QTableWidgetItem(QString::number(deviceDetails->sp5.depth))); } @@ -1072,23 +1072,23 @@ setNumberOfDives ui.ostcDilTable->setItem(4, 3, new QTableWidgetItem(QString::number(deviceDetails->dil5.type))); ui.ostcDilTable->setItem(4, 4, new QTableWidgetItem(QString::number(deviceDetails->dil5.depth))); - //load set point 1 values + //load setpoint 1 values ui.ostcSetPointTable->setItem(0, 1, new QTableWidgetItem(QString::number(deviceDetails->sp1.sp))); ui.ostcSetPointTable->setItem(0, 2, new QTableWidgetItem(QString::number(deviceDetails->sp1.depth))); - //load set point 2 values + //load setpoint 2 values ui.ostcSetPointTable->setItem(1, 1, new QTableWidgetItem(QString::number(deviceDetails->sp2.sp))); ui.ostcSetPointTable->setItem(1, 2, new QTableWidgetItem(QString::number(deviceDetails->sp2.depth))); - //load set point 3 values + //load setpoint 3 values ui.ostcSetPointTable->setItem(2, 1, new QTableWidgetItem(QString::number(deviceDetails->sp3.sp))); ui.ostcSetPointTable->setItem(2, 2, new QTableWidgetItem(QString::number(deviceDetails->sp3.depth))); - //load set point 4 values + //load setpoint 4 values ui.ostcSetPointTable->setItem(3, 1, new QTableWidgetItem(QString::number(deviceDetails->sp4.sp))); ui.ostcSetPointTable->setItem(3, 2, new QTableWidgetItem(QString::number(deviceDetails->sp4.depth))); - //load set point 5 values + //load setpoint 5 values ui.ostcSetPointTable->setItem(4, 1, new QTableWidgetItem(QString::number(deviceDetails->sp5.sp))); ui.ostcSetPointTable->setItem(4, 2, new QTableWidgetItem(QString::number(deviceDetails->sp5.depth))); } diff --git a/desktop-widgets/configuredivecomputerdialog.ui b/desktop-widgets/configuredivecomputerdialog.ui index 4a4c3521f..3b78387df 100644 --- a/desktop-widgets/configuredivecomputerdialog.ui +++ b/desktop-widgets/configuredivecomputerdialog.ui @@ -1693,7 +1693,7 @@ <item row="1" column="0"> <widget class="QLabel" name="label_18"> <property name="text"> - <string>Max depth</string> + <string>Max. depth</string> </property> </widget> </item> diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 2c87c1188..5e65c8944 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -480,9 +480,9 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) QString units = "Metric"; dl7 = true; while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { - /* DL7 actually defines individual units (e.g. depth, temp, pressure, etc.) - * and there are quite a few other options as well, but let's use metric - * unless depth unit is clearly Imperial. */ + /* DL7 actually defines individual units (e.g. depth, temperature, + * pressure, etc.) and there are quite a few other options as well, + * but let's use metric unless depth unit is clearly Imperial. */ if (firstLine.contains("ThFt")) { units = "Imperial"; diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index e4ea71445..4fc38cd2a 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -113,6 +113,7 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg plannerModel->setRecalc(true); ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this)); ui.cylinderTableWidget->setTitle(tr("Available gases")); + ui.cylinderTableWidget->setBtnToolTip(tr("Add cylinder")); ui.cylinderTableWidget->setModel(CylindersModel::instance()); QTableView *view = ui.cylinderTableWidget->view(); view->setColumnHidden(CylindersModel::START, true); @@ -217,7 +218,7 @@ void DivePlannerWidget::atmPressureChanged(const int pressure) void DivePlannerWidget::heightChanged(const int height) { - int pressure = (int) (1013.0 * exp(- (double) units_to_depth((double) height) / 7800000.0)); + int pressure = (int) (1013.0 * exp(- (double) units_to_depth((double) height).mm / 7800000.0)); ui.ATMPressure->blockSignals(true); ui.ATMPressure->setValue(pressure); ui.ATMPressure->blockSignals(false); @@ -253,6 +254,14 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.vpmb_conservatism->setDisabled(true); ui.switch_at_req_stop->setDisabled(true); ui.min_switch_duration->setDisabled(true); + ui.sacfactor->setDisabled(true); + ui.problemsolvingtime->setDisabled(true); + ui.sacfactor->blockSignals(true); + ui.problemsolvingtime->blockSignals(true); + ui.sacfactor->setValue(2.0); + ui.problemsolvingtime->setValue(0); + ui.sacfactor->blockSignals(false); + ui.problemsolvingtime->blockSignals(false); } else if (mode == VPMB) { ui.gflow->setDisabled(true); @@ -265,6 +274,10 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.vpmb_conservatism->setDisabled(false); ui.switch_at_req_stop->setDisabled(false); ui.min_switch_duration->setDisabled(false); + ui.sacfactor->setDisabled(false); + ui.problemsolvingtime->setDisabled(false); + ui.sacfactor->setValue(prefs.sacfactor / 100.0); + ui.problemsolvingtime->setValue(prefs.problemsolvingtime); } else if (mode == BUEHLMANN) { ui.gflow->setDisabled(false); @@ -277,6 +290,10 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.vpmb_conservatism->setDisabled(true); ui.switch_at_req_stop->setDisabled(false); ui.min_switch_duration->setDisabled(false); + ui.sacfactor->setDisabled(false); + ui.problemsolvingtime->setDisabled(false); + ui.sacfactor->setValue(prefs.sacfactor / 100.0); + ui.problemsolvingtime->setValue(prefs.problemsolvingtime); } } @@ -300,6 +317,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) ui.display_runtime->setChecked(prefs.display_runtime); ui.display_transitions->setChecked(prefs.display_transitions); ui.safetystop->setChecked(prefs.safetystop); + ui.sacfactor->setValue(prefs.sacfactor / 100.0); + ui.problemsolvingtime->setValue(prefs.problemsolvingtime); ui.bottompo2->setValue(prefs.bottompo2 / 1000.0); ui.decopo2->setValue(prefs.decopo2 / 1000.0); ui.backgasBreaks->setChecked(prefs.doo2breaks); @@ -362,6 +381,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.descRate, SIGNAL(valueChanged(int)), this, SLOT(setDescRate(int))); connect(ui.ascRateStops, SIGNAL(valueChanged(int)), this, SLOT(setAscRateStops(int))); connect(ui.ascRateLast6m, SIGNAL(valueChanged(int)), this, SLOT(setAscRateLast6m(int))); + connect(ui.sacfactor, SIGNAL(valueChanged(double)), this, SLOT(sacFactorChanged(double))); + connect(ui.problemsolvingtime, SIGNAL(valueChanged(int)), this, SLOT(problemSolvingTimeChanged(int))); connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double))); connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double))); connect(ui.bestmixEND, SIGNAL(valueChanged(int)), this, SLOT(setBestmixEND(int))); @@ -480,6 +501,16 @@ void PlannerSettingsWidget::setDescRate(int rate) SettingsObjectWrapper::instance()->planner_settings->setDescrate(rate * UNIT_FACTOR); } +void PlannerSettingsWidget::sacFactorChanged(const double factor) +{ + plannerModel->setSacFactor(factor); +} + +void PlannerSettingsWidget::problemSolvingTimeChanged(const int minutes) +{ + plannerModel->setProblemSolvingTime(minutes); +} + void PlannerSettingsWidget::setBottomPo2(double po2) { SettingsObjectWrapper::instance()->planner_settings->setBottompo2((int) (po2 * 1000.0)); @@ -495,7 +526,7 @@ void PlannerSettingsWidget::setDecoPo2(double po2) void PlannerSettingsWidget::setBestmixEND(int depth) { - SettingsObjectWrapper::instance()->planner_settings->setBestmixend(units_to_depth(depth)); + SettingsObjectWrapper::instance()->planner_settings->setBestmixend(units_to_depth(depth).mm); } void PlannerSettingsWidget::setBackgasBreaks(bool dobreaks) diff --git a/desktop-widgets/diveplanner.h b/desktop-widgets/diveplanner.h index 91501ceb7..f0cae3e5b 100644 --- a/desktop-widgets/diveplanner.h +++ b/desktop-widgets/diveplanner.h @@ -78,6 +78,8 @@ slots: void setAscRateStops(int rate); void setAscRateLast6m(int rate); void setDescRate(int rate); + void sacFactorChanged(const double factor); + void problemSolvingTimeChanged(const int min); void setBottomPo2(double po2); void setDecoPo2(double po2); void setBestmixEND(int depth); diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp index b5a156d68..7a9ac5d2b 100644 --- a/desktop-widgets/maintab.cpp +++ b/desktop-widgets/maintab.cpp @@ -737,7 +737,7 @@ void MainTab::updateDiveInfo(bool clear) if (he_tot.mliter && o2_tot.mliter) gasUsedString.append(tr(" and ")); if (o2_tot.mliter) - gasUsedString.append(QString("O2: %2\n").arg(get_volume_string(o2_tot, true))); + gasUsedString.append(QString("O₂: %2\n").arg(get_volume_string(o2_tot, true))); } ui.gasConsumption->setText(gasUsedString); if(ui.locationTags->text().isEmpty()) @@ -1086,7 +1086,7 @@ void MainTab::acceptChanges() } if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) { // we just added or edited the dive, let fixup_dive() make - // sure we get the max depth right + // sure we get the max. depth right current_dive->maxdepth.mm = current_dc->maxdepth.mm = 0; fixup_dive(current_dive); set_dive_nr_for_current_dive(); diff --git a/desktop-widgets/plannerSettings.ui b/desktop-widgets/plannerSettings.ui index c6e16e54a..90331bdf6 100644 --- a/desktop-widgets/plannerSettings.ui +++ b/desktop-widgets/plannerSettings.ui @@ -402,7 +402,7 @@ </item> <item row="19" column="1"> <widget class="QComboBox" name="rebreathermode"> - <property name="currentText" stdset="0"> + <property name="currentText"> <string/> </property> <property name="maxVisibleItems"> @@ -530,7 +530,40 @@ <property name="spacing"> <number>2</number> </property> - <item row="5" column="0"> + <item row="1" column="1"> + <widget class="QDoubleSpinBox" name="decoStopSAC"> + <property name="suffix"> + <string>ℓ/min</string> + </property> + <property name="decimals"> + <number>0</number> + </property> + <property name="maximum"> + <double>99.000000000000000</double> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="decosac"> + <property name="text"> + <string>Deco SAC</string> + </property> + </widget> + </item> + <item row="8" column="0"> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="7" column="0"> <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -543,7 +576,7 @@ </property> </spacer> </item> - <item row="2" column="1"> + <item row="4" column="1"> <widget class="QDoubleSpinBox" name="bottompo2"> <property name="suffix"> <string>bar</string> @@ -572,7 +605,7 @@ </property> </widget> </item> - <item row="3" column="1"> + <item row="5" column="1"> <widget class="QDoubleSpinBox" name="decopo2"> <property name="suffix"> <string>bar</string> @@ -588,8 +621,11 @@ </property> </widget> </item> - <item row="4" column="1"> + <item row="6" column="1"> <widget class="QSpinBox" name="bestmixEND"> + <property name="toolTip"> + <string>Used to calculate best mix. Select best mix depth in 'Available gases' table by entering gas depth, followed by "B" (best trimix mix) or "BN" (best nitrox mix)</string> + </property> <property name="suffix"> <string>m</string> </property> @@ -602,9 +638,6 @@ <property name="value"> <number>30</number> </property> - <property name="toolTip"> - <string>Used to calculate best mix. Select best mix depth in 'Available gases' table by entering gas depth, followed by "B" (best trimix mix) or "BN" (best nitrox mix)</string> - </property> </widget> </item> <item row="0" column="0"> @@ -614,21 +647,21 @@ </property> </widget> </item> - <item row="2" column="0"> + <item row="4" column="0"> <widget class="QLabel" name="bottompO2"> <property name="text"> <string>Bottom pO₂</string> </property> </widget> </item> - <item row="4" column="0"> + <item row="6" column="0"> <widget class="QLabel" name="bestEND"> <property name="text"> <string>Best mix END</string> </property> </widget> </item> - <item row="6" column="0" colspan="2"> + <item row="8" column="0" colspan="2"> <widget class="QGroupBox" name="Notes"> <property name="title"> <string>Notes</string> @@ -692,45 +725,67 @@ </layout> </widget> </item> - <item row="1" column="1"> - <widget class="QDoubleSpinBox" name="decoStopSAC"> - <property name="suffix"> - <string>ℓ/min</string> + <item row="5" column="0"> + <widget class="QLabel" name="decopO2"> + <property name="text"> + <string>Deco pO₂</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="sacFactor"> + <property name="text"> + <string>SAC factor</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QDoubleSpinBox" name="sacfactor"> + <property name="toolTip"> + <string>Used to calculate minimum gas. Consider two divers with possibly increased SAC after OoG event.</string> </property> <property name="decimals"> - <number>0</number> + <number>1</number> + </property> + <property name="minimum"> + <double>2.000000000000000</double> </property> <property name="maximum"> - <double>99.000000000000000</double> + <double>10.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="value"> + <double>4.000000000000000</double> </property> </widget> </item> <item row="3" column="0"> - <widget class="QLabel" name="decopO2"> + <widget class="QLabel" name="problemSolvingTime"> <property name="text"> - <string>Deco pO₂</string> + <string>Problem solving time</string> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="decosac"> - <property name="text"> - <string>Deco SAC</string> + <item row="3" column="1"> + <widget class="QSpinBox" name="problemsolvingtime"> + <property name="toolTip"> + <string>Used to calculate minimum gas. Additional time at max. depth after OoG event.</string> </property> - </widget> - </item> - <item row="6" column="0"> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <property name="suffix"> + <string>min</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> + <property name="prefix"> + <string/> </property> - </spacer> + <property name="maximum"> + <number>10</number> + </property> + <property name="value"> + <number>4</number> + </property> + </widget> </item> </layout> </widget> @@ -755,6 +810,7 @@ <tabstop>gflow</tabstop> <tabstop>gfhigh</tabstop> <tabstop>vpmb_deco</tabstop> + <tabstop>vpmb_conservatism</tabstop> <tabstop>drop_stone_mode</tabstop> <tabstop>lastStop</tabstop> <tabstop>backgasBreaks</tabstop> @@ -763,6 +819,8 @@ <tabstop>rebreathermode</tabstop> <tabstop>bottomSAC</tabstop> <tabstop>decoStopSAC</tabstop> + <tabstop>sacfactor</tabstop> + <tabstop>problemsolvingtime</tabstop> <tabstop>bottompo2</tabstop> <tabstop>decopo2</tabstop> <tabstop>bestmixEND</tabstop> diff --git a/desktop-widgets/preferences/preferences_graph.ui b/desktop-widgets/preferences/preferences_graph.ui index 3e175b985..5deacc1fd 100644 --- a/desktop-widgets/preferences/preferences_graph.ui +++ b/desktop-widgets/preferences/preferences_graph.ui @@ -253,7 +253,7 @@ <item row="4" column="2" colspan="2"> <widget class="QCheckBox" name="gf_low_at_maxdepth"> <property name="text"> - <string>GFLow at max depth</string> + <string>GFLow at max. depth</string> </property> </widget> </item> |