| 
									
										
										
										
											2017-04-27 20:26:05 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2017-04-04 19:21:30 +02:00
										 |  |  | #ifndef TAB_DIVE_STATISTICS_H
 | 
					
						
							|  |  |  | #define TAB_DIVE_STATISTICS_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "TabBase.h"
 | 
					
						
							| 
									
										
										
										
											2020-02-03 19:33:06 +01:00
										 |  |  | #include "core/subsurface-qt/divelistnotifier.h"
 | 
					
						
							| 
									
										
										
										
											2017-04-04 19:21:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Ui { | 
					
						
							|  |  |  | 	class TabDiveStatistics; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TabDiveStatistics : public TabBase { | 
					
						
							|  |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2017-04-04 20:01:47 +02:00
										 |  |  | 	TabDiveStatistics(QWidget *parent = 0); | 
					
						
							| 
									
										
										
										
											2017-04-04 19:21:30 +02:00
										 |  |  | 	~TabDiveStatistics(); | 
					
						
							| 
									
										
										
										
											2018-09-29 22:13:44 +02:00
										 |  |  | 	void updateData() override; | 
					
						
							|  |  |  | 	void clear() override; | 
					
						
							| 
									
										
										
										
											2017-04-04 19:21:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-06 21:31:39 +02:00
										 |  |  | private slots: | 
					
						
							|  |  |  | 	void divesChanged(const QVector<dive *> &dives, DiveField field); | 
					
						
							| 
									
										
										
										
											2020-05-05 11:55:23 +02:00
										 |  |  | 	void cylinderChanged(dive *d); | 
					
						
							| 
									
										
										
										
											2019-10-06 21:31:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-04 19:21:30 +02:00
										 |  |  | private: | 
					
						
							|  |  |  | 	Ui::TabDiveStatistics *ui; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-26 17:05:37 +01:00
										 |  |  | // Widget describing, minimum, maximum and average value.
 | 
					
						
							|  |  |  | // Scheduled for removal in due course.
 | 
					
						
							|  |  |  | class QLabel; | 
					
						
							|  |  |  | class MinMaxAvgWidget : public QWidget { | 
					
						
							|  |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 	QLabel *avgIco, *avgValue; | 
					
						
							|  |  |  | 	QLabel *minIco, *minValue; | 
					
						
							|  |  |  | 	QLabel *maxIco, *maxValue; | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 	MinMaxAvgWidget(QWidget *parent); | 
					
						
							|  |  |  | 	double minimum() const; | 
					
						
							|  |  |  | 	double maximum() const; | 
					
						
							|  |  |  | 	double average() const; | 
					
						
							|  |  |  | 	void setMinimum(double minimum); | 
					
						
							|  |  |  | 	void setMaximum(double maximum); | 
					
						
							|  |  |  | 	void setAverage(double average); | 
					
						
							|  |  |  | 	void setMinimum(const QString &minimum); | 
					
						
							|  |  |  | 	void setMaximum(const QString &maximum); | 
					
						
							|  |  |  | 	void setAverage(const QString &average); | 
					
						
							|  |  |  | 	void overrideMinToolTipText(const QString &newTip); | 
					
						
							|  |  |  | 	void overrideAvgToolTipText(const QString &newTip); | 
					
						
							|  |  |  | 	void overrideMaxToolTipText(const QString &newTip); | 
					
						
							|  |  |  | 	void setAvgVisibility(bool visible); | 
					
						
							|  |  |  | 	void clear(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-04 19:21:30 +02:00
										 |  |  | #endif
 |