Пример #1
0
 def zoom(self, zoom, absolute=True):
     if manager.isActive():
         if absolute:
             self.scrzoom = zoom
         else:
             self.scrzoom *= zoom
         manager.sendEvent(PanZoomEvent(zoom=zoom, absolute=absolute))
Пример #2
0
    def send_route_data(self):
        if manager.isActive() and self.route_acid is not None:
            data = RouteDataEvent()
            data.acid = self.route_acid
            idx = bs.traf.id2idx(self.route_acid)
            if idx >= 0:
                route = bs.traf.ap.route[idx]
                data.iactwp = route.iactwp

                # We also need the corresponding aircraft position
                data.aclat = bs.traf.lat[idx]
                data.aclon = bs.traf.lon[idx]

                data.wplat = route.wplat
                data.wplon = route.wplon

                data.wpalt = route.wpalt
                data.wpspd = route.wpspd

                data.wpname = route.wpname

            manager.sendEvent(data)  # Send route data to GUI
            # Empty route acid string means no longer send route data
            if len(self.route_acid) == 0:
                self.route_acid = None
Пример #3
0
 def send_aman_data(self):
     if manager.isActive():
         # data            = AMANEvent()
         # data.ids        = bs.traf.AMAN.
         # data.iafs       = bs.traf.AMAN.
         # data.eats       = bs.traf.AMAN.
         # data.etas       = bs.traf.AMAN.
         # data.delays     = bs.traf.AMAN.
         # data.rwys       = bs.traf.AMAN.
         # data.spdratios  = bs.traf.AMAN.
         # manager.sendEvent(data)
         pass
Пример #4
0
    def pan(self, *args):
        ''' Move center of display, relative of to absolute position lat,lon '''
        if manager.isActive():
            if args[0] == "LEFT":
                self.ctrlon -= 0.5
            elif args[0] == "RIGHT":
                self.ctrlon += 0.5
            elif args[0] == "UP" or args[0] == "ABOVE":
                self.ctrlat += 0.5
            elif args[0] == "DOWN":
                self.ctrlat -= 0.5
            else:
                self.ctrlat, self.ctrlon = args

            manager.sendEvent(
                PanZoomEvent(pan=(self.ctrlat, self.ctrlon), absolute=True))
Пример #5
0
    def send_aircraft_data(self):
        if manager.isActive():
            data = ACDataEvent()
            data.simt = bs.sim.simt
            data.id = bs.traf.id
            data.lat = bs.traf.lat
            data.lon = bs.traf.lon
            data.alt = bs.traf.alt
            data.tas = bs.traf.tas
            data.cas = bs.traf.cas
            data.iconf = bs.traf.asas.iconf
            data.confcpalat = bs.traf.asas.latowncpa
            data.confcpalon = bs.traf.asas.lonowncpa
            data.trk = bs.traf.hdg

            # Trails, send only new line segments to be added
            data.swtrails = bs.traf.trails.active
            data.traillat0 = bs.traf.trails.newlat0
            data.traillon0 = bs.traf.trails.newlon0
            data.traillat1 = bs.traf.trails.newlat1
            data.traillon1 = bs.traf.trails.newlon1
            bs.traf.trails.clearnew()

            # Last segment which is being built per aircraft
            data.traillastlat = list(bs.traf.trails.lastlat)
            data.traillastlon = list(bs.traf.trails.lastlon)

            # Conflict statistics
            data.nconf_tot = len(bs.traf.asas.conflist_all)
            data.nlos_tot = len(bs.traf.asas.LOSlist_all)
            data.nconf_exp = len(bs.traf.asas.conflist_exp)
            data.nlos_exp = len(bs.traf.asas.LOSlist_exp)
            data.nconf_cur = len(bs.traf.asas.conflist_now)
            data.nlos_cur = len(bs.traf.asas.LOSlist_now)

            manager.sendEvent(data)
Пример #6
0
 def symbol(self):
     if manager.isActive():
         manager.sendEvent(DisplayFlagEvent('SYM'))
Пример #7
0
 def cmdline(self, text):
     if manager.isActive():
         manager.sendEvent(StackTextEvent(cmdtext=text))
Пример #8
0
 def echo(self, text):
     if manager.isActive():
         manager.sendEvent(StackTextEvent(disptext=text))
Пример #9
0
 def feature(self, switch, argument=''):
     if manager.isActive():
         manager.sendEvent(DisplayFlagEvent(switch, argument))
Пример #10
0
 def show_cmd_doc(self, cmd=''):
     if manager.isActive():
         manager.sendEvent(ShowDialogEvent(1, cmd=cmd))
Пример #11
0
 def show_file_dialog(self):
     if manager.isActive():
         manager.sendEvent(ShowDialogEvent())
     return ''
Пример #12
0
 def showssd(self, *param):
     ''' Conflict prevention display
         Show solution space diagram, indicating potential conflicts'''
     if manager.isActive():
         manager.sendEvent(DisplayFlagEvent('SSD', param))
Пример #13
0
 def trails(self, sw):
     if manager.isActive():
         manager.sendEvent(DisplayFlagEvent('TRAIL', sw))