From 7d99294fc3ae30feaa42896fe68db06933f8e816 Mon Sep 17 00:00:00 2001 From: nzkarit Date: Sun, 25 Aug 2019 14:44:28 +1200 Subject: [PATCH] Speed with CSV --- ADSB_Encoder.py | 20 +++++++++++++++----- ModeS.py | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ADSB_Encoder.py b/ADSB_Encoder.py index da61008..4ef2f4c 100755 --- a/ADSB_Encoder.py +++ b/ADSB_Encoder.py @@ -140,15 +140,25 @@ def manyPlanes(arguments): prevtimestamp = int(row['timestamp']) logger.debug('Row from CSV: %s' % (row)) modes = ModeS() - (df17_even, df17_odd) = modes.df17_pos_rep_encode(row['capability'], row['icao'], row['typecode'], row['surveillancestatus'], row['nicsupplementb'], row['altitude'], row['time'], row['latitude'], row['longitude'], row['surface']) - + (df17_pos_even, df17_pos_odd) = modes.df17_pos_rep_encode(row['capability'], row['icao'], row['typecode'], row['surveillancestatus'], row['nicsupplementb'], row['altitude'], row['time'], row['latitude'], row['longitude'], row['surface']) + + df17_velocity = modes.vel_heading_encode(row['capability'], row['icao']) + ppm = PPM() - df17_array = ppm.frame_1090es_ppm_modulate(df17_even, df17_odd) + df17_array_position = ppm.frame_1090es_ppm_modulate(df17_pos_even, df17_pos_odd) + df17_array_velocity = ppm.frame_1090es_ppm_modulate(df17_velocity, df17_velocity) hackrf = HackRF() - samples_array = hackrf.hackrf_raw_IQ_format(df17_array) + #Position + samples_array = hackrf.hackrf_raw_IQ_format(df17_array_position) samples = samples+samples_array - gap_array = ppm.addGap(gap) + gap_array = ppm.addGap(arguments.intermessagegap) + samples_array = hackrf.hackrf_raw_IQ_format(gap_array) + samples = samples+samples_array + #Velocity + samples_array = hackrf.hackrf_raw_IQ_format(df17_array_velocity) + samples = samples+samples_array + gap_array = ppm.addGap(arguments.intermessagegap) samples_array = hackrf.hackrf_raw_IQ_format(gap_array) samples = samples+samples_array return samples diff --git a/ModeS.py b/ModeS.py index b087896..4b4a1ab 100644 --- a/ModeS.py +++ b/ModeS.py @@ -103,7 +103,7 @@ class ModeS: #ca = 5 #icao = 0xabcdef#0xa06703 #0x485020 # - + dfvel = [] dfvel.append((df << 3) | ca) dfvel.append((icao >> 16) & 0xff)