mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Planner: don't track cylinder pressure if working pressure is 0
The pressure graph will go from 0 to negative - one could make a weak argument that this would at least tell you how much pressure you'd need in the cylinder to start with, but that's kinda lame. Fixes #615 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									387553f0b3
								
							
						
					
					
						commit
						912560f928
					
				
					 2 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -243,7 +243,7 @@ void reset_cylinders(struct dive *dive, bool track_gas)
 | 
			
		|||
			continue;
 | 
			
		||||
		if (cyl->depth.mm == 0) /* if the gas doesn't give a mod, assume conservative pO2 */
 | 
			
		||||
			cyl->depth = gas_mod(&cyl->gasmix, pO2, M_OR_FT(3,10));
 | 
			
		||||
		if (track_gas && cyl->type.workingpressure.mbar)
 | 
			
		||||
		if (track_gas)
 | 
			
		||||
			cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar;
 | 
			
		||||
		cyl->gas_used.mliter = 0;
 | 
			
		||||
		cyl->deco_gas_used.mliter = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -275,7 +275,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
 | 
			
		|||
	oldgasmix = cyl->gasmix;
 | 
			
		||||
	sample = prepare_sample(dc);
 | 
			
		||||
	sample->po2.mbar = dp->po2;
 | 
			
		||||
	if (track_gas)
 | 
			
		||||
	if (track_gas && cyl->type.workingpressure.mbar)
 | 
			
		||||
		sample->cylinderpressure.mbar = cyl->end.mbar;
 | 
			
		||||
	finish_sample(dc);
 | 
			
		||||
	while (dp) {
 | 
			
		||||
| 
						 | 
				
			
			@ -315,7 +315,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
 | 
			
		|||
			sample[-1].po2.mbar = po2;
 | 
			
		||||
			sample->time.seconds = lasttime + 1;
 | 
			
		||||
			sample->depth.mm = lastdepth;
 | 
			
		||||
			if (track_gas)
 | 
			
		||||
			if (track_gas && cyl->type.workingpressure.mbar)
 | 
			
		||||
				sample->cylinderpressure.mbar = cyl->sample_end.mbar;
 | 
			
		||||
			finish_sample(dc);
 | 
			
		||||
			oldgasmix = gasmix;
 | 
			
		||||
| 
						 | 
				
			
			@ -331,6 +331,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
 | 
			
		|||
		if (track_gas) {
 | 
			
		||||
			update_cylinder_pressure(&displayed_dive, sample[-1].depth.mm, depth, time - sample[-1].time.seconds,
 | 
			
		||||
					dp->entered ? diveplan->bottomsac : diveplan->decosac, cyl, !dp->entered);
 | 
			
		||||
			if (cyl->type.workingpressure.mbar)
 | 
			
		||||
				sample->cylinderpressure.mbar = cyl->end.mbar;
 | 
			
		||||
		}
 | 
			
		||||
		finish_sample(dc);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue