kopia lustrzana https://github.com/projecthorus/chasemapper
				
				
				
			Add bearing entry on main page
							rodzic
							
								
									a758375e82
								
							
						
					
					
						commit
						c4b613b648
					
				|  | @ -8,4 +8,4 @@ | |||
| 
 | ||||
| # Now using Semantic Versioning (https://semver.org/)  MAJOR.MINOR.PATCH | ||||
| 
 | ||||
| __version__ = "1.3.5" | ||||
| __version__ = "1.3.6" | ||||
|  |  | |||
|  | @ -171,8 +171,11 @@ class SerialGPS(object): | |||
|         # '12319.943281' | ||||
|         if not dm or dm == "0": | ||||
|             return 0.0 | ||||
| 
 | ||||
|         d, m = re.match(r"^(\d+)(\d\d\.\d+)$", dm).groups() | ||||
|         try: | ||||
|             d, m = re.match(r"^(\d+)(\d\d\.\d+)$", dm).groups() | ||||
|         except: | ||||
|             return 0.0 | ||||
|              | ||||
|         return float(d) + float(m) / 60 | ||||
| 
 | ||||
|     def parse_nmea(self, data): | ||||
|  |  | |||
|  | @ -56,6 +56,14 @@ html, body, #map { | |||
| 	width: 10em; | ||||
| } | ||||
| 
 | ||||
| .paramEntryLeft { | ||||
| 	display: inline-block; | ||||
| 	margin-left: auto; | ||||
| 	text-align: left; | ||||
| 	padding-right: 0.2em; | ||||
| 	width: 10em; | ||||
| } | ||||
| 
 | ||||
| .predictorModelValue { | ||||
| 	display: inline-block; | ||||
| 	margin-left: auto; | ||||
|  |  | |||
|  | @ -459,3 +459,18 @@ function calculateBearingOpacity(bearing_timestamp){ | |||
| 
 | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| function manualBearing(){ | ||||
| 	current_bearing = parseFloat($('#bearingManualEntry').val()); | ||||
| 
 | ||||
| 	_bearing_info = { | ||||
| 		'type': 'BEARING', | ||||
| 		'bearing_type': 'absolute', | ||||
| 		'source': 'EasyBearing', | ||||
| 		'latitude': chase_car_position.latest_data[0], | ||||
| 		'longitude': chase_car_position.latest_data[1], | ||||
| 		'bearing': current_bearing | ||||
| 	}; | ||||
| 
 | ||||
| 	socket.emit('add_manual_bearing', _bearing_info); | ||||
| } | ||||
|  |  | |||
|  | @ -981,6 +981,11 @@ | |||
|                     <button type="button" class="paramSelector" id="redrawBearingsBtn" onclick='redrawBearings();'>Redraw Bearings</button></br> | ||||
|                 </div> | ||||
| 
 | ||||
|                 <h3>Manual Bearing Entry</h3> | ||||
|                 <div class="paramRow"> | ||||
|                     <input type="text" id="bearingManualEntry" value="0"><br/><button type="button" class="paramSelector" id="manualBearingBtn" onclick='manualBearing();'>Plot</button></br> | ||||
|                 </div> | ||||
| 
 | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Mark Jessop
						Mark Jessop