diff --git a/bridge_gps_data.py b/bridge_gps_data.py index d814ff8..8ee286d 100644 --- a/bridge_gps_data.py +++ b/bridge_gps_data.py @@ -1476,8 +1476,13 @@ class routerHBP(HBSYSTEM): lon_min = ba2num(bptc_decode(_data)[46:52]) lat_min_dec = str(ba2num(bptc_decode(_data)[24:38])).zfill(4) lon_min_dec = str(ba2num(bptc_decode(_data)[52:66])).zfill(4) - aprs_lat = str(str(lat_deg) + str(lat_min) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir - aprs_lon = str(str(lon_deg) + str(lon_min) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir + # Old MD-380 coordinate format, keep here until new is confirmed working. + #aprs_lat = str(str(lat_deg) + str(lat_min) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir + #aprs_lon = str(str(lon_deg) + str(lon_min) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir + # Fix for MD-380 by G7HIF + aprs_lat = str(str(lat_deg) + str(lat_min).zfill(2) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir + aprs_lon = str(str(lon_deg) + str(lon_min).zfill(2) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir + # Form APRS packet #logger.info(aprs_loc_packet) logger.info('Lat: ' + str(aprs_lat) + ' Lon: ' + str(aprs_lon)) diff --git a/gps_data.py b/gps_data.py index 39cf321..c2f7f0f 100644 --- a/gps_data.py +++ b/gps_data.py @@ -425,8 +425,13 @@ class DATA_SYSTEM(HBSYSTEM): lon_min = ba2num(bptc_decode(_data)[46:52]) lat_min_dec = str(ba2num(bptc_decode(_data)[24:38])).zfill(4) lon_min_dec = str(ba2num(bptc_decode(_data)[52:66])).zfill(4) - aprs_lat = str(str(lat_deg) + str(lat_min) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir - aprs_lon = str(str(lon_deg) + str(lon_min) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir + # Old MD-380 coordinate format, keep here until new is confirmed working. + #aprs_lat = str(str(lat_deg) + str(lat_min) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir + #aprs_lon = str(str(lon_deg) + str(lon_min) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir + # Fix for MD-380 by G7HIF + aprs_lat = str(str(lat_deg) + str(lat_min).zfill(2) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir + aprs_lon = str(str(lon_deg) + str(lon_min).zfill(2) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir + # Form APRS packet #logger.info(aprs_loc_packet) logger.info('Lat: ' + str(aprs_lat) + ' Lon: ' + str(aprs_lon)) diff --git a/scripts/dashboard/dashboard.py b/scripts/dashboard/dashboard.py index bdd8015..78e28b7 100644 --- a/scripts/dashboard/dashboard.py +++ b/scripts/dashboard/dashboard.py @@ -71,7 +71,7 @@ def get_loc_data(): last_known_loc_list.append(e['call']) display_number = display_number - 1 tmp_loc = tmp_loc + ''' - ''' + e['call'] + ''' + ''' + e['call'] + '''  ''' + str(e['lat']) + '''   ''' + str(e['lon']) + '''   ''' + e['time'] + '''  @@ -322,6 +322,77 @@ def view_map(): def map(): return render_template('map.html', title = dashboard_title, logo = logo) +@app.route('/user') +def user_settings(): + user_id = request.args.get('user_id') + if not user_id: + user_result = """ +
+ + + + + + + + + + + + +
+

+
+
+ +""" + else: + try: + #return render_template('map.html', title = dashboard_title, logo = logo) + user_settings = ast.literal_eval(os.popen('cat ../../user_settings.txt').read()) + call = user_settings[int(user_id)][0]['call'] + ssid = user_settings[int(user_id)][1]['ssid'] + icon = user_settings[int(user_id)][2]['icon'] + comment = user_settings[int(user_id)][3]['comment'] + if ssid == '': + ssid = aprs_ssid + if icon == '': + icon = '\[' + #for result in user_settings: + #return user_settings[int(user_id)][0] + #return user_id + #return user_settings + user_result = """

 Settings for ID: """ + user_id + """

+ + + + + + + + + + + + + + + + + + + +
Callsign:""" + user_settings[int(user_id)][0]['call'] + """
SSID:""" + ssid + """
Icon:""" + icon + """
Comment:""" + comment + """
+

+

+ """ + except: + user_result = '''

User ID not found.

+

+

''' + + return render_template('user_settings.html', title = dashboard_title, logo = logo, user_result = Markup(user_result)) + @app.route('/bulletin_rss.xml') def bb_rss(): try: diff --git a/scripts/dashboard/templates/header.html b/scripts/dashboard/templates/header.html index 0913a88..fbfbbcf 100644 --- a/scripts/dashboard/templates/header.html +++ b/scripts/dashboard/templates/header.html @@ -6,9 +6,11 @@ +
+ diff --git a/scripts/dashboard/templates/user_settings.html b/scripts/dashboard/templates/user_settings.html new file mode 100644 index 0000000..dc4ec6f --- /dev/null +++ b/scripts/dashboard/templates/user_settings.html @@ -0,0 +1,8 @@ +{% include 'page.html' %} +{% include 'header.html' %} +

 

+Use this tool to find the stored APRS settings for your DMR ID. When a position is sent, the stored settings will be used to format the APRS packet. +{{user_result}} +

 

+{% include 'footer.html' %} +