mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Divinglog import: include NDL information
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									5dd0b1bad5
								
							
						
					
					
						commit
						2ec9002beb
					
				
					 1 changed files with 15 additions and 1 deletions
				
			
		
							
								
								
									
										16
									
								
								parse-xml.c
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								parse-xml.c
									
										
									
									
									
								
							|  | @ -2882,7 +2882,7 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu | ||||||
| { | { | ||||||
| 	int sinterval = 0; | 	int sinterval = 0; | ||||||
| 	unsigned long i, len, lenprofile2 = 0; | 	unsigned long i, len, lenprofile2 = 0; | ||||||
| 	char *ptr, temp[4], pres[5], hbeat[4], stop[4]; | 	char *ptr, temp[4], pres[5], hbeat[4], stop[4], ndl[4]; | ||||||
| 	short oldcyl = -1; | 	short oldcyl = -1; | ||||||
| 
 | 
 | ||||||
| 	/* We do not have samples */ | 	/* We do not have samples */ | ||||||
|  | @ -2952,6 +2952,20 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu | ||||||
| 		if (data[4] && strlen(data[4])) { | 		if (data[4] && strlen(data[4])) { | ||||||
| 			memcpy(stop, &data[4][i * 9 + 6], 3); | 			memcpy(stop, &data[4][i * 9 + 6], 3); | ||||||
| 			cur_sample->stopdepth.mm = atoi(stop) * 1000; | 			cur_sample->stopdepth.mm = atoi(stop) * 1000; | ||||||
|  | 
 | ||||||
|  | 			/*
 | ||||||
|  | 			 * Following value is NDL when not in deco, and | ||||||
|  | 			 * either 0 or TTS when in deco. | ||||||
|  | 			 */ | ||||||
|  | 
 | ||||||
|  | 			memcpy(ndl, &data[4][i * 9 + 0], 3); | ||||||
|  | 			if (cur_sample->in_deco == false) | ||||||
|  | 				cur_sample->ndl.seconds = atoi(ndl) * 60; | ||||||
|  | 			else if (atoi(ndl)) | ||||||
|  | 				cur_sample->tts.seconds = atoi(ndl) * 60; | ||||||
|  | 
 | ||||||
|  | 			if (cur_sample->in_deco == true) | ||||||
|  | 				cur_sample->ndl.seconds = 0; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		ptr += 12; | 		ptr += 12; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue