diff --git a/apps/modes_gui b/apps/modes_gui index 17ebcba..d5d21aa 100755 --- a/apps/modes_gui +++ b/apps/modes_gui @@ -118,8 +118,9 @@ class mainwindow(QtGui.QMainWindow): self.ui.list_aircraft.selectionModel().currentRowChanged.connect(self.dashboard_mapper.setCurrentModelIndex) self.ui.list_aircraft.selectionModel().currentRowChanged.connect(self.update_heading_widget) self.ui.list_aircraft.selectionModel().currentRowChanged.connect(self.update_bearing_widget) - self.datamodel.dataChanged.connect(self.unmapped_widgets_dataChanged) self.ui.list_aircraft.selectionModel().currentRowChanged.connect(self.update_rssi_widget) + self.ui.list_aircraft.selectionModel().currentRowChanged.connect(self.update_map_highlight) + self.datamodel.dataChanged.connect(self.unmapped_widgets_dataChanged) #hook up live data text box update signal self.live_data_changed_signal.connect(self.on_append_live_data) @@ -149,7 +150,7 @@ class mainwindow(QtGui.QMainWindow): if index.model() is not None: rssi = index.model().data(index.model().index(index.row(), 2)).toDouble()[0] self.ui.prog_rssi.setValue(rssi) - + def increment_reportspersec(self, msg): self.num_reports += 1 @@ -160,6 +161,12 @@ class mainwindow(QtGui.QMainWindow): self.ui.line_reports.setText("%i" % self.num_reports) self.num_reports = 0 + def update_map_highlight(self, index): + if index.model() is not None: + icaostr = index.model().data(index.model().index(index.row(), self.datamodel._colnames.index("icao"))).toString() + icao = int(str(icaostr), 16) + self.jsonpgen.set_highlight(icao) + ##################### dynamic option population ######################## #goes and gets valid antenna, sample rate options from the device and grays out appropriate things def populate_source_options(self): @@ -167,7 +174,7 @@ class mainwindow(QtGui.QMainWindow): self.rates = [] self.ratetext = [] self.antennas = [] - + if sourceid == "UHD": try: from gnuradio import uhd @@ -184,7 +191,7 @@ class mainwindow(QtGui.QMainWindow): self.ui.combo_ant.setEnabled(False) self.ui.combo_rate.setEnabled(False) self.ui.stack_source.setCurrentIndex(0) - + elif sourceid == "Osmocom": try: import osmosdr @@ -346,7 +353,7 @@ class mainwindow(QtGui.QMainWindow): cursor.movePosition(QtGui.QTextCursor.Start) cursor.select(QtGui.QTextCursor.LineUnderCursor) cursor.removeSelectedText() - + self.ui.text_livedata.append(msgstr) self.ui.text_livedata.verticalScrollBar().setSliderPosition(self.ui.text_livedata.verticalScrollBar().maximum()) diff --git a/python/html_template.py b/python/html_template.py index 068fd8e..9b789b6 100644 --- a/python/html_template.py +++ b/python/html_template.py @@ -5,7 +5,7 @@ def html_template(my_position, json_file): if my_position is None: my_position = [37, -122] - + return """
@@ -20,7 +20,7 @@ def html_template(my_position, json_file): font-size: 10px; font-weight: bold; text-align: center; - width: 40px; + width: 40px; border: 2px solid black; white-space: nowrap; } @@ -61,27 +61,33 @@ def html_template(my_position, json_file): type: results[i].type, ident: results[i].ident, speed: results[i].speed, - vertical: results[i].vertical + vertical: results[i].vertical, + highlight: results[i].highlight }; } refreshIcons(); } - + function refreshIcons() { for (var airplane in airplanes) { + if (airplanes[airplane].highlight != 0) { + icon_file = "http://www.nerdnetworks.org/~bistromath/airplane_sprite_highlight.png"; + } else { + icon_file = "http://www.nerdnetworks.org/~bistromath/airplane_sprite.png"; + }; var plane_icon = { - url: "http://www.nerdnetworks.org/~bistromath/airplane_sprite.png", + url: icon_file, size: new google.maps.Size(128,128), origin: new google.maps.Point(parseInt(airplanes[airplane].heading/10)*128,0), anchor: new google.maps.Point(64,64), //scaledSize: new google.maps.Size(4608,126) }; - + identstr = airplanes[airplane].ident; if (identstr === "" || !identstr) { identstr = airplanes[airplane].icao; }; - + var planeOptions = { map: map, position: airplanes[airplane].center, @@ -99,13 +105,13 @@ def html_template(my_position, json_file): function initialize() { - var myOptions = - { - zoom: defaultZoomLevel, - center: defaultLocation, - disableDefaultUI: true, - mapTypeId: google.maps.MapTypeId.TERRAIN - }; + var myOptions = + { + zoom: defaultZoomLevel, + center: defaultLocation, + disableDefaultUI: true, + mapTypeId: google.maps.MapTypeId.TERRAIN + }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); diff --git a/python/kml.py b/python/kml.py index cee605d..329f0d3 100644 --- a/python/kml.py +++ b/python/kml.py @@ -30,7 +30,7 @@ class output_kml(threading.Thread): self.my_coords = localpos self._timeout = timeout self._lock = lock - + self.shutdown = threading.Event() self.finished = threading.Event() self.setDaemon(1) @@ -41,7 +41,7 @@ class output_kml(threading.Thread): while self.shutdown.is_set() is False: self.writekml() time.sleep(self._timeout) - + self._db.close() self._db = None self.finished.set() @@ -52,8 +52,8 @@ class output_kml(threading.Thread): #there's a bug here where self._timeout is long and close() has #to wait for the sleep to expire before closing. we just bail #instead with the 0.2 param above. - - + + def writekml(self): kmlstr = self.genkml() if kmlstr is not None: @@ -64,7 +64,7 @@ class output_kml(threading.Thread): def locked_execute(self, c, query): with self._lock: c.execute(query) - + def draw_circle(self, center, rng): retstr = "" steps=30 @@ -91,7 +91,7 @@ class output_kml(threading.Thread): retstr = string.lstrip(retstr) return retstr - + def genkml(self): #first let's draw the static content retstr="""\n