mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add dive: remove cylinder pressures from samples
These cylinder pressures are actually just artefacts of the way we track gas consumption in the code shared between planner and add dive. We don't want them in the actual dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									8bd16a7808
								
							
						
					
					
						commit
						81f8ed901f
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -734,6 +734,17 @@ void MainTab::acceptChanges()
 | 
			
		|||
	}
 | 
			
		||||
	if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
 | 
			
		||||
		// clean up the dive data (get duration, depth information from samples)
 | 
			
		||||
		// remove the pressures from the samples (as those prevent the user from
 | 
			
		||||
		// being able to manually set the start and end pressure)
 | 
			
		||||
		struct sample *sample = current_dc->sample;
 | 
			
		||||
		for (int i = 0; i < current_dc->samples; i++, sample++)
 | 
			
		||||
			sample->cylinderpressure.mbar = 0;
 | 
			
		||||
		for (int i = 0; i < MAX_CYLINDERS; i++) {
 | 
			
		||||
			cylinder_t *cyl = ¤t_dive->cylinder[i];
 | 
			
		||||
			cyl->start.mbar = cyl->sample_start.mbar;
 | 
			
		||||
			cyl->end.mbar = cyl->sample_end.mbar;
 | 
			
		||||
			cyl->sample_end.mbar = cyl->sample_start.mbar = 0;
 | 
			
		||||
		}
 | 
			
		||||
		fixup_dive(current_dive);
 | 
			
		||||
		if (dive_table.nr == 1)
 | 
			
		||||
			current_dive->number = 1;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue