Backing up old changesfrom PC- 7
This commit is contained in:
parent
f8c4ad9410
commit
f3bb7b6af6
|
|
@ -9,12 +9,12 @@ from colorama import Fore, Back, Style
|
||||||
|
|
||||||
#Setup PushBullet
|
#Setup PushBullet
|
||||||
from pushbullet import Pushbullet
|
from pushbullet import Pushbullet
|
||||||
pb = Pushbullet("*")
|
pb = Pushbullet("<pushbulletapikey>")
|
||||||
elon_jet_channel = pb.get_channel('<channeltaghere>')
|
elon_jet_channel = pb.get_channel('<channeltaghere>')
|
||||||
|
|
||||||
#Setup OpenSKy
|
#Setup OpenSKy
|
||||||
from opensky_api import OpenSkyApi
|
from opensky_api import OpenSkyApi
|
||||||
opens_api = OpenSkyApi("*", "*")
|
opens_api = OpenSkyApi("<openskyusername>", "<openskypass>")
|
||||||
|
|
||||||
#Set Plane ICAO
|
#Set Plane ICAO
|
||||||
TRACK_PLANE = '<planeicaohere>'
|
TRACK_PLANE = '<planeicaohere>'
|
||||||
|
|
@ -22,8 +22,8 @@ TRACK_PLANE = '<planeicaohere>'
|
||||||
geo_altitude = None
|
geo_altitude = None
|
||||||
geo_alt_ft = None
|
geo_alt_ft = None
|
||||||
last_geo_alt_ft = None
|
last_geo_alt_ft = None
|
||||||
last_below_10k_ft = None
|
last_below_5k_ft = None
|
||||||
below_10k_ft = None
|
|
||||||
feeding = None
|
feeding = None
|
||||||
last_feeding = None
|
last_feeding = None
|
||||||
last_on_ground = None
|
last_on_ground = None
|
||||||
|
|
@ -35,11 +35,13 @@ geo_alt_m = None
|
||||||
running_Count = 0
|
running_Count = 0
|
||||||
icao = None
|
icao = None
|
||||||
callsign = None
|
callsign = None
|
||||||
|
takeoff_time = None
|
||||||
#Begin Looping program
|
#Begin Looping program
|
||||||
while True:
|
while True:
|
||||||
running_Count += 1
|
running_Count += 1
|
||||||
print (Back.MAGENTA, "--------", running_Count, "-------------------------------------------------------------", Style.RESET_ALL)
|
print (Back.MAGENTA, "--------", running_Count, "-------------------------------------------------------------", Style.RESET_ALL)
|
||||||
#Reset Variables
|
#Reset Variables
|
||||||
|
below_5k_ft = None
|
||||||
geo_alt_ft = None
|
geo_alt_ft = None
|
||||||
longitude = None
|
longitude = None
|
||||||
latitude = None
|
latitude = None
|
||||||
|
|
@ -61,8 +63,10 @@ while True:
|
||||||
latitude = (dataStates.latitude)
|
latitude = (dataStates.latitude)
|
||||||
on_ground = (dataStates.on_ground)
|
on_ground = (dataStates.on_ground)
|
||||||
geo_alt_m = (dataStates.geo_altitude)
|
geo_alt_m = (dataStates.geo_altitude)
|
||||||
if geo_alt_m != None :
|
if geo_alt_m != None:
|
||||||
geo_alt_ft = geo_alt_m * 3.281
|
geo_alt_ft = geo_alt_m * 3.281
|
||||||
|
elif geo_alt_m == None and on_ground:
|
||||||
|
geo_alt_ft = 0
|
||||||
print (Fore.CYAN)
|
print (Fore.CYAN)
|
||||||
print ("ICAO: ", icao)
|
print ("ICAO: ", icao)
|
||||||
print ("Callsign: ", callsign)
|
print ("Callsign: ", callsign)
|
||||||
|
|
@ -130,15 +134,15 @@ while True:
|
||||||
|
|
||||||
#Check if below 10k ft
|
#Check if below 10k ft
|
||||||
if geo_alt_ft is None:
|
if geo_alt_ft is None:
|
||||||
below_10k_ft = False
|
below_5k_ft = False
|
||||||
elif geo_alt_ft < 10000:
|
elif geo_alt_ft < 5000:
|
||||||
below_10k_ft = True
|
below_5k_ft = True
|
||||||
#Check if tookoff
|
#Check if tookoff
|
||||||
tookoff = bool(last_feeding is False and feeding and on_ground is False and invalid_Location is False and below_10k_ft)
|
tookoff = bool(invalid_Location is False and below_5k_ft and on_ground is False and ((last_feeding is False and feeding) or (last_on_ground)))
|
||||||
print ("Tookoff Just Now:", tookoff)
|
print ("Tookoff Just Now:", tookoff)
|
||||||
|
|
||||||
#Check if Landed
|
#Check if Landed
|
||||||
landed = bool((last_feeding and feeding is False and invalid_Location is False and (on_ground or last_below_10k_ft)) or (on_ground and last_on_ground is False))
|
landed = bool(last_below_5k_ft and invalid_Location is False and ((last_feeding and feeding is False) or (on_ground and last_on_ground is False)))
|
||||||
print ("Landed Just Now:", landed)
|
print ("Landed Just Now:", landed)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -159,7 +163,7 @@ while True:
|
||||||
last_feeding = feeding
|
last_feeding = feeding
|
||||||
last_geo_alt_ft = geo_alt_ft
|
last_geo_alt_ft = geo_alt_ft
|
||||||
last_on_ground = on_ground
|
last_on_ground = on_ground
|
||||||
last_below_10k_ft = below_10k_ft
|
last_below_5k_ft = below_5k_ft
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print ("Rechecking OpenSky")
|
print ("Rechecking OpenSky")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue