| 
									
										
										
										
											2019-12-08 19:30:39 +01:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							|  |  |  | #ifndef PLANNERSHARED_H
 | 
					
						
							|  |  |  | #define PLANNERSHARED_H
 | 
					
						
							|  |  |  | #include <QObject>
 | 
					
						
							| 
									
										
										
										
											2019-12-14 20:29:16 +01:00
										 |  |  | #include "core/pref.h"
 | 
					
						
							| 
									
										
										
										
											2019-12-08 19:30:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | // This is a shared class (mobile/desktop), and contains the core of the diveplanner
 | 
					
						
							|  |  |  | // without UI entanglement.
 | 
					
						
							|  |  |  | // It make variables and functions available to QML, these are referenced directly
 | 
					
						
							|  |  |  | // in the desktop version
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // The mobile diveplanner shows all diveplans, but the editing functionality is
 | 
					
						
							|  |  |  | // limited to keep the UI simpler.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-03 19:08:35 +01:00
										 |  |  | class PlannerShared: public QObject { | 
					
						
							| 
									
										
										
										
											2019-12-08 19:30:39 +01:00
										 |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2019-12-14 20:29:16 +01:00
										 |  |  | 	// Planning data
 | 
					
						
							|  |  |  | 	static deco_mode planner_deco_mode(); | 
					
						
							|  |  |  | 	static int reserve_gas(); | 
					
						
							| 
									
										
										
										
											2019-12-24 11:22:48 +01:00
										 |  |  | 	static bool dobailout(); | 
					
						
							| 
									
										
										
										
											2019-12-23 13:04:19 +01:00
										 |  |  | 	static bool doo2breaks(); | 
					
						
							| 
									
										
										
										
											2019-12-23 13:15:07 +01:00
										 |  |  | 	static int min_switch_duration(); | 
					
						
							| 
									
										
										
										
											2020-01-10 22:51:28 +01:00
										 |  |  | 	static int surface_segment(); | 
					
						
							| 
									
										
										
										
											2019-12-14 20:29:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-23 15:40:21 +01:00
										 |  |  | 	// Gas data
 | 
					
						
							|  |  |  | 	static double bottomsac(); | 
					
						
							|  |  |  | 	static double decosac(); | 
					
						
							|  |  |  | 	static double sacfactor(); | 
					
						
							| 
									
										
										
										
											2019-12-23 17:23:24 +01:00
										 |  |  | 	static bool o2narcotic(); | 
					
						
							| 
									
										
										
										
											2019-12-23 17:25:46 +01:00
										 |  |  | 	static double bottompo2(); | 
					
						
							|  |  |  | 	static double decopo2(); | 
					
						
							|  |  |  | 	static int bestmixend(); | 
					
						
							| 
									
										
										
										
											2019-12-23 15:40:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 20:01:38 +01:00
										 |  |  | public slots: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-14 20:29:16 +01:00
										 |  |  | 	// Planning data
 | 
					
						
							|  |  |  | 	static void set_planner_deco_mode(deco_mode value); | 
					
						
							|  |  |  | 	static void set_reserve_gas(int value); | 
					
						
							| 
									
										
										
										
											2019-12-24 11:22:48 +01:00
										 |  |  | 	static void set_dobailout(bool value); | 
					
						
							| 
									
										
										
										
											2019-12-23 13:04:19 +01:00
										 |  |  | 	static void set_doo2breaks(bool value); | 
					
						
							| 
									
										
										
										
											2019-12-23 13:15:07 +01:00
										 |  |  | 	static void set_min_switch_duration(int value); | 
					
						
							| 
									
										
										
										
											2020-01-10 22:51:28 +01:00
										 |  |  | 	static void set_surface_segment(int value); | 
					
						
							| 
									
										
										
										
											2019-12-14 20:29:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-23 15:40:21 +01:00
										 |  |  | 	// Gas data
 | 
					
						
							|  |  |  | 	static void set_bottomsac(double value); | 
					
						
							|  |  |  | 	static void set_decosac(double value); | 
					
						
							|  |  |  | 	static void set_sacfactor(double value); | 
					
						
							| 
									
										
										
										
											2019-12-23 17:23:24 +01:00
										 |  |  | 	static void set_o2narcotic(bool value); | 
					
						
							| 
									
										
										
										
											2019-12-23 17:25:46 +01:00
										 |  |  | 	static void set_bottompo2(double value); | 
					
						
							|  |  |  | 	static void set_decopo2(double value); | 
					
						
							|  |  |  | 	static void set_bestmixend(int value); | 
					
						
							| 
									
										
										
										
											2019-12-08 19:30:39 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // PLANNERSHARED_H
 |