fix missing code from bridge_gps_data.py

This commit is contained in:
KF7EEL 2021-03-11 08:02:24 -08:00
parent 1fb22d01c6
commit e6ace9e72d

View File

@ -165,13 +165,31 @@ def dashboard_loc_write(call, lat, lon, time, comment):
dash_entries = ast.literal_eval(os.popen('cat ' + loc_file).read())
# except:
# dash_entries = []
dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time, 'comment': comment})
list_index = 0
call_count = 0
new_dash_entries = []
for i in dash_entries:
if i['call'] == call:
if call_count >= 25:
print(call_count)
pass
else:
new_dash_entries.append(i)
call_count = call_count + 1
if call != i['call']:
print('Record call: |' + i['call'] + '|')
print('Filter Call: |' + call + '|')
new_dash_entries.append(i)
pass
list_index = list_index + 1
with open(loc_file, 'w') as user_loc_file:
user_loc_file.write(str(dash_entries[:200]))
user_loc_file.write(str(new_dash_entries[:500]))
user_loc_file.close()
logger.info('User location saved for dashboard')
#logger.info(dash_entries)
def dashboard_bb_write(call, dmr_id, time, bulletin):
#try:
dash_bb = ast.literal_eval(os.popen('cat ' + bb_file).read())