Bug fix for ICAO from csv casting
This commit is contained in:
parent
72bddcabab
commit
3170515490
@ -87,13 +87,13 @@ def manyPlanes(arguments):
|
|||||||
logger.info('Processing CSV file')
|
logger.info('Processing CSV file')
|
||||||
logger.info('Repeating the message %s times' % (arguments.repeats))
|
logger.info('Repeating the message %s times' % (arguments.repeats))
|
||||||
samples = bytearray()
|
samples = bytearray()
|
||||||
print(arguments.repeats)
|
|
||||||
for i in range(0, arguments.repeats):
|
for i in range(0, arguments.repeats):
|
||||||
with open(arguments.csvfile, newline='') as csvfile:
|
with open(arguments.csvfile, newline='') as csvfile:
|
||||||
reader = csv.DictReader(csvfile, delimiter=',')
|
reader = csv.DictReader(csvfile, delimiter=',')
|
||||||
for row in reader:
|
for row in reader:
|
||||||
if not 'icao' in row.keys():
|
if not 'icao' in row.keys():
|
||||||
row['icao'] = arguments.icao
|
row['icao'] = arguments.icao
|
||||||
|
else:
|
||||||
row['icao'] = int(row['icao'], 0)
|
row['icao'] = int(row['icao'], 0)
|
||||||
if not 'latitude' in row.keys():
|
if not 'latitude' in row.keys():
|
||||||
row['latitude'] = arguments.latitude
|
row['latitude'] = arguments.latitude
|
||||||
@ -114,7 +114,6 @@ def manyPlanes(arguments):
|
|||||||
if not 'surface' in row.keys():
|
if not 'surface' in row.keys():
|
||||||
row['surface'] = arguments.surface
|
row['surface'] = arguments.surface
|
||||||
logger.debug('Row from CSV: %s' % (row))
|
logger.debug('Row from CSV: %s' % (row))
|
||||||
print(row)
|
|
||||||
modes = ModeS()
|
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_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'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user