Esempio n. 1
0
 def on_simstream_received(self, streamname, data, sender_id):
     if streamname == b'ACDATA':
         self.acdata = ACDataEvent(data)
         self.update_aircraft_data(self.acdata)
     elif streamname[:9] == b'ROUTEDATA':
         self.routedata = RouteDataEvent(data)
         self.update_route_data(self.routedata)
Esempio n. 2
0
    def __init__(self, shareWidget=None):
        self.shaderset = radarShaders()
        self.width = self.height = 600
        self.viewport = (0, 0, 600, 600)
        self.panlat = 0.0
        self.panlon = 0.0
        self.zoom = 1.0
        self.ar = 1.0
        self.flat_earth = 1.0
        self.wraplon = int(-999)
        self.wrapdir = int(0)

        self.map_texture = Texture()
        self.naircraft = 0
        self.nwaypoints = 0
        self.ncustwpts = 0
        self.nairports = 0
        self.route_acid = ""
        self.apt_inrange = np.array([])
        self.asas_vmin = settings.asas_vmin
        self.asas_vmax = settings.asas_vmax
        self.initialized = False

        self.acdata = ACDataEvent()
        self.routedata = RouteDataEvent()

        self.panzoomchanged = False
        self.mousedragged = False
        self.mousepos = (0, 0)
        self.prevmousepos = (0, 0)

        # Load vertex data
        self.vbuf_asphalt, self.vbuf_concrete, self.vbuf_runways, self.vbuf_rwythr, \
            self.apt_ctrlat, self.apt_ctrlon, self.apt_indices = load_aptsurface()
        self.coastvertices, self.coastindices = load_coastlines()

        # Only initialize super class after loading data to avoid Qt starting
        # things before we are ready.
        super(RadarWidget, self).__init__(shareWidget=shareWidget)
        self.setAttribute(Qt.WA_AcceptTouchEvents, True)
        self.grabGesture(Qt.PanGesture)
        self.grabGesture(Qt.PinchGesture)
        # self.grabGesture(Qt.SwipeGesture)
        self.setMouseTracking(True)

        # Connect to the io client's activenode changed signal
        console.cmdline_stacked.connect(self.cmdline_stacked)
        bs.net.actnodedata_changed.connect(self.actnodedataChanged)
        bs.net.stream_received.connect(self.on_simstream_received)
Esempio n. 3
0
    def __init__(self, route=None):
        # Stack window
        self.echo_text = ''
        self.stackcmds = dict()
        self.stacksyn = dict()

        # Display pan and zoom
        self.pan = [0.0, 0.0]
        self.zoom = 1.0

        self.naircraft = 0
        self.acdata = ACDataEvent()
        self.routedata = RouteDataEvent()

        # Per-scenario data
        self.clear_scen_data()

        # Network route to this node
        self._route = route
Esempio n. 4
0
    def clear_scen_data(self):
        # Clear all scenario-specific data for sender node
        self.polys = dict()
        self.custacclr = dict()
        self.custgrclr = dict()
        self.custwplbl = ''
        self.custwplat = np.array([], dtype=np.float32)
        self.custwplon = np.array([], dtype=np.float32)

        self.naircraft = 0
        self.acdata = ACDataEvent()
        self.routedata = RouteDataEvent()

        # Filteralt settings
        self.filteralt = False

        # Create trail data
        self.traillat0 = []
        self.traillon0 = []
        self.traillat1 = []
        self.traillon1 = []

        # Reset transition level
        self.translvl = 4500.*ft

        # Display flags
        self.show_map      = True
        self.show_coast    = True
        self.show_traf     = True
        self.show_pz       = False
        self.show_fir      = True
        self.show_lbl      = 2
        self.show_wpt      = 1
        self.show_apt      = 1
        self.show_poly     = 1  # 0=invisible, 1=outline, 2=fill
        self.ssd_all       = False
        self.ssd_conflicts = False
        self.ssd_ownship   = set()
Esempio n. 5
0
 def setroutedata(self, data):
     self.routedata = RouteDataEvent(data)