Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Added autoclose if using config file and you are at your destination
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriei committed Apr 25, 2018
1 parent f3a77d4 commit ba7950a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions EDPlanetBearing.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def GetConfigFromFile(Startup=False): #Gets config from config file if exists an
global EDPBConfigFile
global AudioMode
global InfoHudLevel
global UsingConfigFile
if os.path.exists(EDPBConfigFile):
try:
with open(EDPBConfigFile) as f:
Expand Down Expand Up @@ -375,6 +376,7 @@ def GetConfigFromFile(Startup=False): #Gets config from config file if exists an

try:
AudioFeedBack.PingCycleMode(int(Configs["audio"]))
UsingConfigFile = True
except:
pass
if DstLat == -0:
Expand Down Expand Up @@ -406,6 +408,7 @@ def Calculate(event="None"):
LeftArrow = ""
RightArrow = ""
global InfoHudLevel
global UsingConfigFile
global PingPosX
global PingPosZ
global PingPitch
Expand Down Expand Up @@ -572,10 +575,10 @@ def Calculate(event="None"):
Distance = format(Distance, ",d")
DestDistance.set(str(Distance)+" "+DisScale)

if Distance_meters < 2000 and FlagSRV != 0:
AudioFeedBack.PingCycleMode(0)
elif Distance_meters < 250 and FlagSRV == 0:
if (Distance_meters + CurrentAlt < 2000 and FlagSRV != 0) or (Distance_meters < 250 and FlagSRV == 0):
AudioFeedBack.PingCycleMode(0)
if UsingConfigFile:
callback()

#Angle of descent
DescentAngle = - int(round(math.degrees(math.atan(CurrentAlt/Distance_meters)),0))
Expand Down Expand Up @@ -618,6 +621,7 @@ def Calculate(event="None"):


#Declaring variables
UsingConfigFile = False
DebugMode = False
SessionID = 0
CurrentLat = 0.0
Expand Down

0 comments on commit ba7950a

Please sign in to comment.