| 
									
										
										
										
											2017-04-27 20:24:53 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2014-05-12 13:53:26 -03:00
										 |  |  | #ifndef DIVECOMPUTER_H
 | 
					
						
							|  |  |  | #define DIVECOMPUTER_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | #include <QMap>
 | 
					
						
							|  |  |  | #include <stdint.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DiveComputerNode { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 	DiveComputerNode(QString m, uint32_t d, QString s, QString f, QString n) | 
					
						
							|  |  |  | 	    : model(m), deviceId(d), serialNumber(s), firmware(f), nickName(n) {}; | 
					
						
							|  |  |  | 	bool operator==(const DiveComputerNode &a) const; | 
					
						
							|  |  |  | 	bool operator!=(const DiveComputerNode &a) const; | 
					
						
							|  |  |  | 	bool changesValues(const DiveComputerNode &b) const; | 
					
						
							| 
									
										
										
										
											2015-09-17 14:38:20 -07:00
										 |  |  | 	void showchanges(const QString &n, const QString &s, const QString &f) const; | 
					
						
							| 
									
										
										
										
											2014-05-12 13:53:26 -03:00
										 |  |  | 	QString model; | 
					
						
							|  |  |  | 	uint32_t deviceId; | 
					
						
							|  |  |  | 	QString serialNumber; | 
					
						
							|  |  |  | 	QString firmware; | 
					
						
							|  |  |  | 	QString nickName; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DiveComputerList { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 	DiveComputerList(); | 
					
						
							|  |  |  | 	~DiveComputerList(); | 
					
						
							| 
									
										
										
										
											2014-05-22 11:40:22 -07:00
										 |  |  | 	const DiveComputerNode *getExact(const QString &m, uint32_t d); | 
					
						
							|  |  |  | 	const DiveComputerNode *get(const QString &m); | 
					
						
							| 
									
										
										
										
											2015-09-17 14:38:20 -07:00
										 |  |  | 	void addDC(QString m, uint32_t d, QString n = QString(), QString s = QString(), QString f = QString()); | 
					
						
							| 
									
										
										
										
											2014-05-22 11:40:22 -07:00
										 |  |  | 	DiveComputerNode matchDC(const QString &m, uint32_t d); | 
					
						
							|  |  |  | 	DiveComputerNode matchModel(const QString &m); | 
					
						
							| 
									
										
										
										
											2014-05-12 13:53:26 -03:00
										 |  |  | 	QMultiMap<QString, DiveComputerNode> dcMap; | 
					
						
							|  |  |  | 	QMultiMap<QString, DiveComputerNode> dcWorkingMap; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern DiveComputerList dcList; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-29 14:00:19 -08:00
										 |  |  | #endif
 |