Changeset d3bfa78 for src/python/bin
- Timestamp:
- Sep 22, 2017, 8:29:35 AM (9 years ago)
- Branches:
- debian/bullseye, debian/jessie
- Children:
- 0027f53
- Parents:
- ecee2e6 (diff), 873002d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/python/bin
- Files:
-
- 3 edited
-
gnuboat (modified) (4 diffs)
-
gnuboat-data-generator (modified) (1 diff)
-
gnuboat-log-converter (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/python/bin/gnuboat
recee2e6 rd3bfa78 31 31 import pynmea2 32 32 import traceback 33 import math 33 34 34 35 from gnuboat import daemon … … 106 107 nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.RMC('GN', 'RMC', 107 108 (gpsTime.strftime("%H%M%S"), gpsStatus, 108 '{:02d}{ :s}'.format(latitude['degrees'], latitude['minutes']),109 '{:02d}{}'.format(latitude['degrees'], latitude['minutes']), 109 110 latitudeDirection, 110 '{:03d}{ :s}'.format(longitude['degrees'], longitude['minutes']),111 '{:03d}{}'.format(longitude['degrees'], longitude['minutes']), 111 112 longitudeDirection, 112 113 '{:04.1f}'.format(speedOverGround), '{:04.1f}'.format(courseOverGround), … … 120 121 121 122 def degreesDecimalToNmea(decimalDegrees): 122 degrees = math.floor(decimalDegrees)123 degrees = int(math.floor(decimalDegrees)) 123 124 minutes = 60.0 * (decimalDegrees - degrees) 124 125 return { 'degrees': degrees, 'minutes': minutes} … … 213 214 214 215 # update rrd database for the webservice 215 daemon.rrd_update(rrdfile, 'N:{ :s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}'.format(216 daemon.rrd_update(rrdfile, 'N:{}:{}:{}:{}:{}:{}:{}:{}'.format( 216 217 latitude, longitude, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix)) 217 218 -
src/python/bin/gnuboat-data-generator
recee2e6 rd3bfa78 103 103 gpsFix = 3 104 104 # update rrd database for the webservice 105 daemon.rrd_update(rrdfile, '{ :s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}'.format(105 daemon.rrd_update(rrdfile, '{}:{}:{}:{}:{}:{}:{}:{}:{}'.format( 106 106 current_time, latitude, longitude, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix)) 107 107 -
src/python/bin/gnuboat-log-converter
recee2e6 rd3bfa78 43 43 return int(string) 44 44 except ValueError as error: 45 print('INFO: Failed to convert value from line %s into numeric: {:s}\n Message: {:s}'.format(current_row, string, error))45 print('INFO: Failed to convert value from line {} into numeric: {}\n Message: {}'.format(current_row, string, error)) 46 46 return 0 47 47 … … 54 54 matches = regex_nmea_position.match(nmea_value) 55 55 if matches is None: 56 print('INFO: Failed to convert position value from line { :s} into decimal degrees: {:s}'.format(current_row, nmea_value))56 print('INFO: Failed to convert position value from line {} into decimal degrees: {}'.format(current_row, nmea_value)) 57 57 return 58 58 decimalDegrees = toFloat(matches.group(1), current_row) … … 109 109 'water_depth': None, 110 110 'water_temperature': None} 111 elif nmea_sentence.sentence_type == 'D BT' and last_row is not None:112 last_row['water_depth'] = toFloat(nmea_sentence.depth _meters, current_row)111 elif nmea_sentence.sentence_type == 'DPT' and last_row is not None: 112 last_row['water_depth'] = toFloat(nmea_sentence.depth, current_row) 113 113 elif nmea_sentence.sentence_type == 'MTW' and last_row is not None: 114 114 last_row['water_temperature'] = toFloat(nmea_sentence.temperature, current_row)
Note:
See TracChangeset
for help on using the changeset viewer.
