mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Use gas_mod and fix fpe
When removing o2 from a gas, eg setting it to "", air, this code would raise a nice fpe. Fix that by using gas_mod instead. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									d1366257f0
								
							
						
					
					
						commit
						f0f60e1f84
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -253,7 +253,9 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in | |||
| 	case O2: | ||||
| 		if (CHANGED()) { | ||||
| 			cyl->gasmix.o2 = string_to_fraction(vString.toUtf8().data()); | ||||
| 			cyl->depth.mm = 1600 * 1000 / cyl->gasmix.o2.permille * 10 - 10000; | ||||
| 			pressure_t modppO2; | ||||
| 			modppO2.mbar = 1600; | ||||
| 			cyl->depth = gas_mod(&cyl->gasmix, modppO2); | ||||
| 			changed = true; | ||||
| 		} | ||||
| 		break; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue