mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Recmode: Allow the user to specify gas reserve.
Since most regulators have an intermediate pressure of 10bar the minimum value is 10 while the max is 99. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									695637dcff
								
							
						
					
					
						commit
						afea30fd8a
					
				
					 6 changed files with 49 additions and 13 deletions
				
			
		|  | @ -395,6 +395,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) | |||
| 	prefs.display_transitions = s.value("display_transitions", prefs.display_transitions).toBool(); | ||||
| 	prefs.recreational_mode = s.value("recreational_mode", prefs.recreational_mode).toBool(); | ||||
| 	prefs.safetystop = s.value("safetystop", prefs.safetystop).toBool(); | ||||
| 	prefs.reserve_gas = s.value("reserve_gas", prefs.reserve_gas).toInt(); | ||||
| 	prefs.ascrate75 = s.value("ascrate75", prefs.ascrate75).toInt(); | ||||
| 	prefs.ascrate50 = s.value("ascrate50", prefs.ascrate50).toInt(); | ||||
| 	prefs.ascratestops = s.value("ascratestops", prefs.ascratestops).toInt(); | ||||
|  | @ -418,6 +419,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) | |||
| 	ui.display_transitions->setChecked(prefs.display_transitions); | ||||
| 	ui.recreational_mode->setChecked(prefs.recreational_mode); | ||||
| 	ui.safetystop->setChecked(prefs.safetystop); | ||||
| 	ui.reserve_gas->setValue(prefs.reserve_gas / 1000); | ||||
| 	ui.bottompo2->setValue(prefs.bottompo2 / 1000.0); | ||||
| 	ui.decopo2->setValue(prefs.decopo2 / 1000.0); | ||||
| 	ui.backgasBreaks->setChecked(prefs.doo2breaks); | ||||
|  | @ -433,6 +435,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) | |||
| 	connect(ui.display_transitions, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayTransitions(bool))); | ||||
| 	connect(ui.safetystop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSafetyStop(bool))); | ||||
| 	connect(ui.recreational_mode, SIGNAL(toggled(bool)), plannerModel, SLOT(setRecreationalMode(bool))); | ||||
| 	connect(ui.reserve_gas, SIGNAL(valueChanged(int)), plannerModel, SLOT(setReserveGas(int))); | ||||
| 	connect(ui.ascRate75, SIGNAL(valueChanged(int)), this, SLOT(setAscRate75(int))); | ||||
| 	connect(ui.ascRate75, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged())); | ||||
| 	connect(ui.ascRate50, SIGNAL(valueChanged(int)), this, SLOT(setAscRate50(int))); | ||||
|  | @ -482,6 +485,7 @@ PlannerSettingsWidget::~PlannerSettingsWidget() | |||
| 	s.setValue("display_transitions", prefs.display_transitions); | ||||
| 	s.setValue("recreational_mode", prefs.recreational_mode); | ||||
| 	s.setValue("safetystop", prefs.safetystop); | ||||
| 	s.setValue("reserve_gas", prefs.reserve_gas); | ||||
| 	s.setValue("ascrate75", prefs.ascrate75); | ||||
| 	s.setValue("ascrate50", prefs.ascrate50); | ||||
| 	s.setValue("ascratestops", prefs.ascratestops); | ||||
|  | @ -881,6 +885,12 @@ void DivePlannerPointsModel::setSafetyStop(bool value) | |||
| 	emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1)); | ||||
| } | ||||
| 
 | ||||
| void DivePlannerPointsModel::setReserveGas(int reserve) | ||||
| { | ||||
| 	prefs.reserve_gas = reserve * 1000; | ||||
| 	emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1)); | ||||
| } | ||||
| 
 | ||||
| void DivePlannerPointsModel::setDropStoneMode(bool value) | ||||
| { | ||||
| 	prefs.drop_stone_mode = value; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue