mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	desktop-widgets: replace variables from plannerModel to plannerShared
variables bottomsac decosac problemsolvingtime sacfactor are not set in diveplanner.cpp, but instead signals a slot in plannerModel. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									d8780fdd89
								
							
						
					
					
						commit
						413501bc61
					
				
					 2 changed files with 9 additions and 33 deletions
				
			
		|  | @ -288,16 +288,6 @@ void DivePlannerWidget::customSalinityChanged(double density) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void PlannerSettingsWidget::bottomSacChanged(const double bottomSac) |  | ||||||
| { |  | ||||||
| 	plannerModel->setBottomSac(bottomSac); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PlannerSettingsWidget::decoSacChanged(const double decosac) |  | ||||||
| { |  | ||||||
| 	plannerModel->setDecoSac(decosac); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PlannerSettingsWidget::disableDecoElements(int mode) | void PlannerSettingsWidget::disableDecoElements(int mode) | ||||||
| { | { | ||||||
| 	if (mode == RECREATIONAL) { | 	if (mode == RECREATIONAL) { | ||||||
|  | @ -366,7 +356,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) | ||||||
| 		ui.label_min_switch_duration->setDisabled(false); | 		ui.label_min_switch_duration->setDisabled(false); | ||||||
| 		ui.sacfactor->setDisabled(false); | 		ui.sacfactor->setDisabled(false); | ||||||
| 		ui.problemsolvingtime->setDisabled(false); | 		ui.problemsolvingtime->setDisabled(false); | ||||||
| 		ui.sacfactor->setValue(prefs.sacfactor / 100.0); | 		ui.sacfactor->setValue(plannerShared::sacfactor()); | ||||||
| 		ui.problemsolvingtime->setValue(prefs.problemsolvingtime); | 		ui.problemsolvingtime->setValue(prefs.problemsolvingtime); | ||||||
| 		ui.display_variations->setDisabled(false); | 		ui.display_variations->setDisabled(false); | ||||||
| 	} | 	} | ||||||
|  | @ -401,7 +391,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) | ||||||
| 		ui.label_min_switch_duration->setDisabled(false); | 		ui.label_min_switch_duration->setDisabled(false); | ||||||
| 		ui.sacfactor->setDisabled(false); | 		ui.sacfactor->setDisabled(false); | ||||||
| 		ui.problemsolvingtime->setDisabled(false); | 		ui.problemsolvingtime->setDisabled(false); | ||||||
| 		ui.sacfactor->setValue(prefs.sacfactor / 100.0); | 		ui.sacfactor->setValue(plannerShared::sacfactor()); | ||||||
| 		ui.problemsolvingtime->setValue(prefs.problemsolvingtime); | 		ui.problemsolvingtime->setValue(prefs.problemsolvingtime); | ||||||
| 		ui.display_variations->setDisabled(false); | 		ui.display_variations->setDisabled(false); | ||||||
| 	} | 	} | ||||||
|  | @ -445,7 +435,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) | ||||||
| 	ui.display_transitions->setChecked(prefs.display_transitions); | 	ui.display_transitions->setChecked(prefs.display_transitions); | ||||||
| 	ui.display_variations->setChecked(prefs.display_variations); | 	ui.display_variations->setChecked(prefs.display_variations); | ||||||
| 	ui.safetystop->setChecked(prefs.safetystop); | 	ui.safetystop->setChecked(prefs.safetystop); | ||||||
| 	ui.sacfactor->setValue(prefs.sacfactor / 100.0); | 	ui.sacfactor->setValue(plannerShared::sacfactor()); | ||||||
| 	ui.problemsolvingtime->setValue(prefs.problemsolvingtime); | 	ui.problemsolvingtime->setValue(prefs.problemsolvingtime); | ||||||
| 	ui.bottompo2->setValue(prefs.bottompo2 / 1000.0); | 	ui.bottompo2->setValue(prefs.bottompo2 / 1000.0); | ||||||
| 	ui.decopo2->setValue(prefs.decopo2 / 1000.0); | 	ui.decopo2->setValue(prefs.decopo2 / 1000.0); | ||||||
|  | @ -515,13 +505,13 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) | ||||||
| 	connect(ui.descRate, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_descrate(int))); | 	connect(ui.descRate, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_descrate(int))); | ||||||
| 	connect(ui.ascRateStops, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_ascratestops(int))); | 	connect(ui.ascRateStops, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_ascratestops(int))); | ||||||
| 	connect(ui.ascRateLast6m, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_ascratelast6m(int))); | 	connect(ui.ascRateLast6m, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_ascratelast6m(int))); | ||||||
| 	connect(ui.sacfactor, SIGNAL(valueChanged(double)), this, SLOT(sacFactorChanged(double))); | 	connect(ui.sacfactor, SIGNAL(valueChanged(double)), plannerShared::instance(), SLOT(set_sacfactor(double))); | ||||||
| 	connect(ui.problemsolvingtime, SIGNAL(valueChanged(int)), this, SLOT(problemSolvingTimeChanged(int))); | 	connect(ui.problemsolvingtime, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_problemsolvingtime(int))); | ||||||
| 	connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double))); | 	connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double))); | ||||||
| 	connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double))); | 	connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double))); | ||||||
| 	connect(ui.bestmixEND, SIGNAL(valueChanged(int)), this, SLOT(setBestmixEND(int))); | 	connect(ui.bestmixEND, SIGNAL(valueChanged(int)), this, SLOT(setBestmixEND(int))); | ||||||
| 	connect(ui.bottomSAC, SIGNAL(valueChanged(double)), this, SLOT(bottomSacChanged(double))); | 	connect(ui.bottomSAC, SIGNAL(valueChanged(double)), plannerShared::instance(), SLOT(sec_bottomsac(double))); | ||||||
| 	connect(ui.decoStopSAC, SIGNAL(valueChanged(double)), this, SLOT(decoSacChanged(double))); | 	connect(ui.decoStopSAC, SIGNAL(valueChanged(double)), plannerShared::instance(), SLOT(set_decosac(double))); | ||||||
| 
 | 
 | ||||||
| 	settingsChanged(); | 	settingsChanged(); | ||||||
| 	ui.gflow->setValue(prefs.gflow); | 	ui.gflow->setValue(prefs.gflow); | ||||||
|  | @ -589,8 +579,8 @@ void PlannerSettingsWidget::settingsChanged() | ||||||
| 		ui.bottomSAC->setSingleStep(1); | 		ui.bottomSAC->setSingleStep(1); | ||||||
| 		ui.decoStopSAC->setDecimals(0); | 		ui.decoStopSAC->setDecimals(0); | ||||||
| 		ui.decoStopSAC->setSingleStep(1); | 		ui.decoStopSAC->setSingleStep(1); | ||||||
| 		ui.bottomSAC->setValue((double) prefs.bottomsac / 1000.0); | 		ui.bottomSAC->setValue(plannerShared::bottomsac()); | ||||||
| 		ui.decoStopSAC->setValue((double) prefs.decosac / 1000.0); | 		ui.decoStopSAC->setValue(plannerShared::decosac()); | ||||||
| 	} | 	} | ||||||
| 	if(get_units()->pressure == units::BAR) { | 	if(get_units()->pressure == units::BAR) { | ||||||
| 		ui.reserve_gas->setSuffix(tr("bar")); | 		ui.reserve_gas->setSuffix(tr("bar")); | ||||||
|  | @ -618,16 +608,6 @@ void PlannerSettingsWidget::printDecoPlan() | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void PlannerSettingsWidget::sacFactorChanged(const double factor) |  | ||||||
| { |  | ||||||
| 	plannerModel->setSacFactor(factor); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PlannerSettingsWidget::problemSolvingTimeChanged(const int minutes) |  | ||||||
| { |  | ||||||
| 	plannerModel->setProblemSolvingTime(minutes); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PlannerSettingsWidget::setBottomPo2(double po2) | void PlannerSettingsWidget::setBottomPo2(double po2) | ||||||
| { | { | ||||||
| 	qPrefDivePlanner::instance()->set_bottompo2((int) (po2 * 1000.0)); | 	qPrefDivePlanner::instance()->set_bottompo2((int) (po2 * 1000.0)); | ||||||
|  |  | ||||||
|  | @ -71,11 +71,7 @@ public: | ||||||
| public | public | ||||||
| slots: | slots: | ||||||
| 	void settingsChanged(); | 	void settingsChanged(); | ||||||
| 	void bottomSacChanged(const double bottomSac); |  | ||||||
| 	void decoSacChanged(const double decosac); |  | ||||||
| 	void printDecoPlan(); | 	void printDecoPlan(); | ||||||
| 	void sacFactorChanged(const double factor); |  | ||||||
| 	void problemSolvingTimeChanged(const int min); |  | ||||||
| 	void setBottomPo2(double po2); | 	void setBottomPo2(double po2); | ||||||
| 	void setDecoPo2(double po2); | 	void setDecoPo2(double po2); | ||||||
| 	void setBestmixEND(int depth); | 	void setBestmixEND(int depth); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue