fixes and cleanup

This commit is contained in:
Arjan Onwezen
2021-12-17 14:27:00 -05:00
parent 6c4dec59bb
commit 9792e13cbf
7 changed files with 10616 additions and 9507 deletions

1260
firmware/tools/make_airlines_db/airlinecodes.txt Executable file → Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -44,23 +44,18 @@ with open('aircraftDatabase.csv', 'rt') as csv_file:
if len(row[8]) == 3:
actype=row[8][:3].encode('ascii', 'ignore')
else:
actype=row[5][:4].encode('ascii', 'ignore')
actype=row[5][:4].encode('ascii', 'ignore')
owner=row[13][:32].encode('ascii', 'ignore')
operator=row[9][:32].encode('ascii', 'ignore')
#padding
registration_padding=bytearray()
manufacturer_padding=bytearray()
model_padding=bytearray()
actype_padding=bytearray()
owner_padding=bytearray()
# debug print(icao24_code,' - ', registration,' - ', manufacturer, '-', model, '-', actype, '-', owner)
icao24_codes=icao24_codes+bytearray(icao24_code+'\0', encoding='ascii')
registration_padding=bytearray('\0' * (8 - len(registration)), encoding='ascii')
manufacturer_padding=bytearray('\0' * (32 - len(manufacturer)), encoding='ascii')
model_padding=bytearray('\0' * (32 - len(model)), encoding='ascii')
actype_padding=bytearray('\0' * (4 - len(actype)), encoding='ascii')
owner_padding=bytearray('\0' * (32 - len(owner)), encoding='ascii')
data=data+bytearray(registration+registration_padding+manufacturer+manufacturer_padding+model+model_padding+actype+actype_padding+owner+owner_padding)
registration_padding=bytearray('\0' * (9 - len(registration)), encoding='ascii')
manufacturer_padding=bytearray('\0' * (33 - len(manufacturer)), encoding='ascii')
model_padding=bytearray('\0' * (33 - len(model)), encoding='ascii')
actype_padding=bytearray('\0' * (5 - len(actype)), encoding='ascii')
owner_padding=bytearray('\0' * (33 - len(owner)), encoding='ascii')
operator_padding=bytearray('\0' * (33 - len(operator)), encoding='ascii')
data=data+bytearray(registration+registration_padding+manufacturer+manufacturer_padding+model+model_padding+actype+actype_padding+owner+owner_padding+operator+operator_padding)
row_count+=1
database.write(icao24_codes+data)