projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosdroid: Don't crash when the map is touched
[fw/altos]
/
telegps
/
TeleGPS.java
diff --git
a/telegps/TeleGPS.java
b/telegps/TeleGPS.java
index 7117443632dcfa9553a706be58dba74fefaef2a2..307b56103091254848b3696dca027ab31adc657a 100644
(file)
--- a/
telegps/TeleGPS.java
+++ b/
telegps/TeleGPS.java
@@
-51,7
+51,7
@@
public class TeleGPS
}
AltosFlightReader reader;
}
AltosFlightReader reader;
-
AltosDisplayThread
thread;
+
TeleGPSDisplayThread
thread;
JMenuBar menu_bar;
JMenuBar menu_bar;
@@
-67,8
+67,9
@@
public class TeleGPS
JTabbedPane pane;
JTabbedPane pane;
- Altos
SiteMap site
map;
+ Altos
UIMap
map;
TeleGPSInfo gps_info;
TeleGPSInfo gps_info;
+ TeleGPSState gps_state;
AltosInfoTable info_table;
LinkedList<AltosFlightDisplay> displays;
AltosInfoTable info_table;
LinkedList<AltosFlightDisplay> displays;
@@
-167,7
+168,7
@@
public class TeleGPS
}
void load_maps() {
}
void load_maps() {
- new Altos
Site
MapPreload(this);
+ new Altos
UI
MapPreload(this);
}
void disconnect() {
}
void disconnect() {
@@
-323,6
+324,9
@@
public class TeleGPS
void add_frequency_menu(int serial, final AltosFlightReader reader) {
// Channel menu
void add_frequency_menu(int serial, final AltosFlightReader reader) {
// Channel menu
+ if (frequencies != null)
+ return;
+
frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial));
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial));
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
@@
-343,13
+347,14
@@
public class TeleGPS
void remove_frequency_menu() {
if (frequencies != null) {
menu_bar.remove(frequencies);
void remove_frequency_menu() {
if (frequencies != null) {
menu_bar.remove(frequencies);
+ menu_bar.repaint();
frequencies = null;
}
}
public void set_reader(AltosFlightReader reader) {
setTitle(String.format("TeleGPS %s", reader.name));
frequencies = null;
}
}
public void set_reader(AltosFlightReader reader) {
setTitle(String.format("TeleGPS %s", reader.name));
- thread = new
Altos
DisplayThread(this, voice(), this, reader);
+ thread = new
TeleGPS
DisplayThread(this, voice(), this, reader);
thread.start();
}
thread.start();
}
@@
-366,6
+371,7
@@
public class TeleGPS
}
private void close() {
}
private void close() {
+ disconnect();
AltosUIPreferences.unregister_font_listener(this);
AltosPreferences.unregister_units_listener(this);
setVisible(false);
AltosUIPreferences.unregister_font_listener(this);
AltosPreferences.unregister_units_listener(this);
setVisible(false);
@@
-438,14
+444,18
@@
public class TeleGPS
c.gridwidth = 2;
bag.add(pane, c);
c.gridwidth = 2;
bag.add(pane, c);
-
sitemap = new AltosSite
Map();
- pane.add(
"Site Map", site
map);
- displays.add(
site
map);
+
map = new AltosUI
Map();
+ pane.add(
map.getName(),
map);
+ displays.add(map);
gps_info = new TeleGPSInfo();
gps_info = new TeleGPSInfo();
- pane.add(
"Info"
, gps_info);
+ pane.add(
gps_info.getName()
, gps_info);
displays.add(gps_info);
displays.add(gps_info);
+ gps_state = new TeleGPSState();
+ pane.add(gps_state.getName(), gps_state);
+ displays.add(gps_state);
+
info_table = new AltosInfoTable();
pane.add("Table", info_table);
displays.add(info_table);
info_table = new AltosInfoTable();
pane.add("Table", info_table);
displays.add(info_table);
@@
-578,7
+588,7
@@
public class TeleGPS
} else {
double lat = Double.parseDouble(args[i+1]);
double lon = Double.parseDouble(args[i+2]);
} else {
double lat = Double.parseDouble(args[i+1]);
double lon = Double.parseDouble(args[i+2]);
- Altos
SiteMap.prefetchM
aps(lat, lon);
+ Altos
UIMap.prefetch_m
aps(lat, lon);
i += 2;
}
} else if (args[i].equals("--replay"))
i += 2;
}
} else if (args[i].equals("--replay"))