1414import keyboard
1515from audioplayer import AudioPlayer
1616
17+ ############ APP VERSION ###############
18+ version = "1.0"
19+
1720# Logging configuration
1821logging .basicConfig (filename = 'pbr.log' , filemode = 'w' , level = logging .DEBUG )
1922logging .basicConfig (level = logging .DEBUG )
@@ -222,7 +225,6 @@ def PBTbtnClickFunction3(lgth):
222225 pbtbtn6 .place (x = 205 , y = 210 )
223226 pbtbtn7 .place (x = 60 , y = 375 )
224227 pbtbtn8 .place (x = 205 , y = 375 )
225- print (length )
226228
227229# PBT Button 4 Template launch function
228230def PBTbtnClickFunction4 (fpath ):
@@ -476,8 +478,8 @@ def pb():
476478 if (pbk < 1.0 ):
477479 if settings ["tooltips" ] is True :
478480 sm .sendText ("Starting push back" )
479- pbphase (4 , True )
480481 time .sleep (4 )
482+ pbphaseEngineThd .start ()
481483 keyboard .add_hotkey ("left" , lambda : tug (((int (math .degrees (aq .get ("PLANE_HEADING_DEGREES_TRUE" ))) - 27 ) % 360 * 11930464 )))
482484 keyboard .add_hotkey ("left" , lambda : heading ('left' ))
483485 keyboard .add_hotkey ("right" , lambda : tug (((int (math .degrees (aq .get ("PLANE_HEADING_DEGREES_TRUE" ))) + 27 ) % 360 * 11930464 )))
@@ -713,8 +715,8 @@ def pbplay(fpath):
713715 if pbk < 1.0 :
714716 if settings ["tooltips" ] is True :
715717 sm .sendText ("Starting push back" )
716- pbphase (4 , True )
717718 time .sleep (4 )
719+ pbphaseEngineThd .start ()
718720 freezetgl ()
719721 start = time .time ()
720722 logging .info ("Tick-Timer started" )
@@ -803,8 +805,8 @@ def pbplayT(fpath):
803805 if pbk < 1.0 :
804806 if settings ["tooltips" ] is True :
805807 sm .sendText ("Starting push back" )
806- pbphase (4 , True )
807808 time .sleep (4 )
809+ pbphaseEngineThd .start ()
808810 freezetgl ()
809811 contact = 0
810812 except :
@@ -852,7 +854,7 @@ def pbplayT(fpath):
852854 except :
853855 logging .warning ("aq.get(" "BRAKE_PARKING_INDICATOR" ") return null" )
854856 pass
855- print (feets )
857+ # print(feets)
856858 logging .info ("Auto-Push back template ended" )
857859
858860# Push Back last steering direction
@@ -894,7 +896,15 @@ def pbphase(phase, wait):
894896 comms = AudioPlayer (appdir + "\\ Assets\\ Audio\\ " + str (phase )+ ".mp3" )
895897 comms .volume = volset
896898 comms .play (block = wait )
897- print (appdir + "\\ Assets\\ Audio\\ " + str (phase )+ ".mp3" )
899+ #print(appdir+"\\Assets\\Audio\\"+str(phase)+".mp3")
900+
901+ def pbphaseDelay (phase , wait ):
902+ global commsD
903+ time .sleep (wait )
904+ commsD = AudioPlayer (appdir + "\\ Assets\\ Audio\\ " + str (phase )+ ".mp3" )
905+ commsD .volume = volset
906+ commsD .play ()
907+ #print(appdir+"\\Assets\\Audio\\"+str(phase)+".mp3")
898908
899909def unfreeze ():
900910 if (aq .get ("IS_LATITUDE_LONGITUDE_FREEZE_ON" ) == 1.0 ):
@@ -917,7 +927,7 @@ def unfreeze():
917927except :
918928 root .geometry ('460x390' )
919929root .configure (background = '#6B6B6B' )
920- root .title ('Push Back Recorder' )
930+ root .title ('Push Back Recorder ' + version )
921931root .resizable (width = False , height = False )
922932root .attributes ('-topmost' , True )
923933root .iconbitmap (default = "AppIcon.ico" )
@@ -1008,6 +1018,7 @@ def unfreeze():
10081018
10091019# Declares a new threads
10101020smcheck = threading .Thread (target = simconnectLink )
1021+ pbphaseEngineThd = threading .Thread (target = pbphaseDelay , args = (4 , 8 ))
10111022
10121023# Local variables
10131024volset = 90
0 commit comments