|
|
|
@ -5,6 +5,8 @@ import time
|
|
|
|
|
from defADSBX import pullADSBX |
|
|
|
|
from colorama import Fore, Back, Style |
|
|
|
|
from planeClass import Plane |
|
|
|
|
from datetime import datetime |
|
|
|
|
import pytz |
|
|
|
|
main_config = configparser.ConfigParser() |
|
|
|
|
main_config.read('mainconf.ini') |
|
|
|
|
import os |
|
|
|
@ -20,10 +22,18 @@ if main_config.get('DATA', 'SOURCE') == "ADSBX":
|
|
|
|
|
elif main_config.get('DATA', 'SOURCE') == "OPENS": |
|
|
|
|
raise NotImplementedError |
|
|
|
|
running_Count = 0 |
|
|
|
|
try: |
|
|
|
|
tz = pytz.timezone(main_config.get('DATA', 'TZ')) |
|
|
|
|
except pytz.exceptions.UnknownTimeZoneError: |
|
|
|
|
tz = pytz.UTC |
|
|
|
|
|
|
|
|
|
while True: |
|
|
|
|
datetime_tz = datetime.now(tz) |
|
|
|
|
if datetime_tz.hour == 0 and datetime_tz.minute == 0: |
|
|
|
|
running_Count = 0 |
|
|
|
|
running_Count +=1 |
|
|
|
|
start_time = time.time() |
|
|
|
|
print (Back.GREEN, Fore.BLACK, "--------", running_Count, "-------------------------------------------------------", Style.RESET_ALL) |
|
|
|
|
print (Back.GREEN, Fore.BLACK, "--------", running_Count, "--------", datetime_tz.strftime("%I:%M:%S %p"), "-------------------------------------------------------", Style.RESET_ALL) |
|
|
|
|
if main_config.get('DATA', 'SOURCE') == "ADSBX": |
|
|
|
|
data, failed = pullADSBX(planes) |
|
|
|
|
if failed == False: |
|
|
|
@ -41,7 +51,8 @@ while True:
|
|
|
|
|
for obj in planes.values(): |
|
|
|
|
obj.run(None) |
|
|
|
|
elapsed_calc_time = time.time() - start_time |
|
|
|
|
print (Back.GREEN, Fore.BLACK, "--------", running_Count, "------------------------Elapsed Time-", elapsed_calc_time, " -------------------------------------", Style.RESET_ALL) |
|
|
|
|
datetime_tz = datetime.now(tz) |
|
|
|
|
print (Back.GREEN, Fore.BLACK, "--------", running_Count, "--------", datetime_tz.strftime("%I:%M:%S %p"), "------------------------Elapsed Time-", elapsed_calc_time, " -------------------------------------", Style.RESET_ALL) |
|
|
|
|
print(Back.RED, "Sleep 30", Style.RESET_ALL) |
|
|
|
|
time.sleep(30) |
|
|
|
|
|
|
|
|
|