mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Don't guess input cylinder size as cubic feet
That just screws up the good xml files that have everything in well-defined units and chose the sane metric units. So do the cuft -> liter conversion only if the input units are explicitly CUFT, or known ambiguous input (SUUNTO). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									e48cebc2d8
								
							
						
					
					
						commit
						ed4b739f5f
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		
							
								
								
									
										11
									
								
								parse-xml.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								parse-xml.c
									
										
									
									
									
								
							|  | @ -1053,11 +1053,12 @@ static void sanitize_cylinder_type(cylinder_type_t *type) | |||
| 	/* Ok, we have both size and pressure: try to match a description */ | ||||
| 	match_standard_cylinder(type); | ||||
| 
 | ||||
| 	/* .. and let's assume that the 'size' was cu ft of air */ | ||||
| 	volume_of_air = type->size.mliter * 28.317;	/* milli-cu ft to milliliter */ | ||||
| 	atm = type->workingpressure.mbar / 1013.25;	/* working pressure in atm */ | ||||
| 	volume = volume_of_air / atm;			/* milliliters at 1 atm: "true size" */ | ||||
| 	type->size.mliter = volume + 0.5; | ||||
| 	if (input_units.volume == CUFT || import_source == SUUNTO) { | ||||
| 		volume_of_air = type->size.mliter * 28.317;	/* milli-cu ft to milliliter */ | ||||
| 		atm = type->workingpressure.mbar / 1013.25;	/* working pressure in atm */ | ||||
| 		volume = volume_of_air / atm;			/* milliliters at 1 atm: "true size" */ | ||||
| 		type->size.mliter = volume + 0.5; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| static void sanitize_cylinder_info(struct dive *dive) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue