mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Detect DL7 depth units
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									74f0192711
								
							
						
					
					
						commit
						e31df43cde
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -471,10 +471,21 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) | |||
| 		ui->knownImports->setCurrentText("XP5"); | ||||
| 		blockSignals(false); | ||||
| 	} else if (firstLine.contains("FSH")) { | ||||
| 		QString units = "Metric"; | ||||
| 		dl7 = true; | ||||
| 		while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { | ||||
| 			/* DL7 actually defines individual units (e.g.  depth, temp, pressure, etc.)
 | ||||
| 			 * and there are quite a few other options as well, but let's use metric | ||||
| 			 * unless depth unit is clearly Imperial. */ | ||||
| 
 | ||||
| 			if (firstLine.contains("ThFt")) { | ||||
| 				units = "Imperial"; | ||||
| 			} | ||||
| 		} | ||||
| 		firstLine = "|Sample time|Sample depth||||||||"; | ||||
| 		blockSignals(true); | ||||
| 		ui->knownImports->setCurrentText("DAN DL7"); | ||||
| 		ui->CSVUnits->setCurrentText(units); | ||||
| 		blockSignals(false); | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue