mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Generate 'watertemp' field from samples if required
Sure, it's redundant, but it's convenient for the general dive info. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									f7fb74f3a7
								
							
						
					
					
						commit
						2cd2cafdf4
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -600,6 +600,11 @@ static void sample_end(void) | ||||||
| 	if (sample->depth.mm > dive->maxdepth.mm) | 	if (sample->depth.mm > dive->maxdepth.mm) | ||||||
| 		dive->maxdepth.mm = sample->depth.mm; | 		dive->maxdepth.mm = sample->depth.mm; | ||||||
| 
 | 
 | ||||||
|  | 	if (sample->temperature.mkelvin) { | ||||||
|  | 		if (!dive->watertemp.mkelvin || dive->watertemp.mkelvin > sample->temperature.mkelvin) | ||||||
|  | 			dive->watertemp = sample->temperature; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	sample = NULL; | 	sample = NULL; | ||||||
| 	dive->samples++; | 	dive->samples++; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue