mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Parse uemis cylinder data
This is some seriously crazy stuff. Instead of making sense as a divelog, the uemis xml makes more sense as a "dive computer settings dump". And I guess I can see why they'd do that. But it makes parsing it just incredibly annoying. The thing is more of a "these are the configurations I support as a dive computer thing" than a "this was the tank you were diving with". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									e007e70053
								
							
						
					
					
						commit
						e58fa7b9b5
					
				
					 2 changed files with 16 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								dive.h
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								dive.h
									
										
									
									
									
								
							|  | @ -108,7 +108,7 @@ struct sample { | ||||||
| 	int cylinderindex; | 	int cylinderindex; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #define MAX_CYLINDERS (4) | #define MAX_CYLINDERS (8) | ||||||
| 
 | 
 | ||||||
| struct dive { | struct dive { | ||||||
| 	time_t when; | 	time_t when; | ||||||
|  |  | ||||||
							
								
								
									
										15
									
								
								parse-xml.c
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								parse-xml.c
									
										
									
									
									
								
							|  | @ -587,6 +587,7 @@ static void uemis_time_zone(char *buffer, void *_when) | ||||||
| 	*when += tz * 3600; | 	*when += tz * 3600; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /* Christ. Uemis tank data is a total mess. */ | ||||||
| static int uemis_dive_match(struct dive *dive, const char *name, int len, char *buf) | static int uemis_dive_match(struct dive *dive, const char *name, int len, char *buf) | ||||||
| { | { | ||||||
| 	return	MATCH(".units.length", uemis_length_unit, &units) || | 	return	MATCH(".units.length", uemis_length_unit, &units) || | ||||||
|  | @ -599,6 +600,20 @@ static int uemis_dive_match(struct dive *dive, const char *name, int len, char * | ||||||
| 		MATCH(".date_time", uemis_date_time, &dive->when) || | 		MATCH(".date_time", uemis_date_time, &dive->when) || | ||||||
| 		MATCH(".time_zone", uemis_time_zone, &dive->when) || | 		MATCH(".time_zone", uemis_time_zone, &dive->when) || | ||||||
| 		MATCH(".ambient.temperature", decicelsius, &dive->airtemp) || | 		MATCH(".ambient.temperature", decicelsius, &dive->airtemp) || | ||||||
|  | 		MATCH(".air.bottom_tank.size", cylindersize, &dive->cylinder[0].type.size) || | ||||||
|  | 		MATCH(".air.bottom_tank.oxygen", percent, &dive->cylinder[0].gasmix.o2) || | ||||||
|  | 		MATCH(".nitrox_1.bottom_tank.size", cylindersize, &dive->cylinder[1].type.size) || | ||||||
|  | 		MATCH(".nitrox_1.bottom_tank.oxygen", percent, &dive->cylinder[1].gasmix.o2) || | ||||||
|  | 		MATCH(".nitrox_2.bottom_tank.size", cylindersize, &dive->cylinder[2].type.size) || | ||||||
|  | 		MATCH(".nitrox_2.bottom_tank.oxygen", percent, &dive->cylinder[2].gasmix.o2) || | ||||||
|  | 		MATCH(".nitrox_2.deco_tank.size", cylindersize, &dive->cylinder[3].type.size) || | ||||||
|  | 		MATCH(".nitrox_2.deco_tank.oxygen", percent, &dive->cylinder[3].gasmix.o2) || | ||||||
|  | 		MATCH(".nitrox_3.bottom_tank.size", cylindersize, &dive->cylinder[4].type.size) || | ||||||
|  | 		MATCH(".nitrox_3.bottom_tank.oxygen", percent, &dive->cylinder[4].gasmix.o2) || | ||||||
|  | 		MATCH(".nitrox_3.deco_tank.size", cylindersize, &dive->cylinder[5].type.size) || | ||||||
|  | 		MATCH(".nitrox_3.deco_tank.oxygen", percent, &dive->cylinder[5].gasmix.o2) || | ||||||
|  | 		MATCH(".nitrox_3.travel_tank.size", cylindersize, &dive->cylinder[6].type.size) || | ||||||
|  | 		MATCH(".nitrox_3.travel_tank.oxygen", percent, &dive->cylinder[6].gasmix.o2) || | ||||||
| 		0; | 		0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue