projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AltosSiteMap: refactor tile collection
[fw/altos]
/
ao-tools
/
altosui
/
AltosDisplayThread.java
diff --git
a/ao-tools/altosui/AltosDisplayThread.java
b/ao-tools/altosui/AltosDisplayThread.java
index b15472edf7393a5764b6066cc7ae8a124609249d..3e719130a6a7c67475f41d98a8740b9904e66e01 100644
(file)
--- a/
ao-tools/altosui/AltosDisplayThread.java
+++ b/
ao-tools/altosui/AltosDisplayThread.java
@@
-36,8
+36,12
@@
public class AltosDisplayThread extends Thread {
String name;
AltosFlightReader reader;
int crc_errors;
String name;
AltosFlightReader reader;
int crc_errors;
- AltosStatusTable flightStatus;
- AltosInfoTable flightInfo;
+ AltosFlightDisplay display;
+
+ synchronized void show(AltosState state, int crc_errors) {
+ if (state != null)
+ display.show(state, crc_errors);
+ }
class IdleThread extends Thread {
class IdleThread extends Thread {
@@
-65,8
+69,10
@@
public class AltosDisplayThread extends Thread {
state.state < Altos.ao_flight_landed &&
state.range >= 0)
{
state.state < Altos.ao_flight_landed &&
state.range >= 0)
{
- voice.speak("Height %d, bearing %d, elevation %d, range %d.\n",
+ voice.speak("Height %d, bearing %
s %
d, elevation %d, range %d.\n",
(int) (state.height + 0.5),
(int) (state.height + 0.5),
+ state.from_pad.bearing_words(
+ AltosGreatCircle.BEARING_VOICE),
(int) (state.from_pad.bearing + 0.5),
(int) (state.elevation + 0.5),
(int) (state.range + 0.5));
(int) (state.from_pad.bearing + 0.5),
(int) (state.elevation + 0.5),
(int) (state.range + 0.5));
@@
-94,6
+100,10
@@
public class AltosDisplayThread extends Thread {
(int) (state.from_pad.bearing + 0.5),
(int) (state.from_pad.distance + 0.5));
++reported_landing;
(int) (state.from_pad.bearing + 0.5),
(int) (state.from_pad.distance + 0.5));
++reported_landing;
+ if (state.state != Altos.ao_flight_landed) {
+ state.state = Altos.ao_flight_landed;
+ show(state, 0);
+ }
}
}
}
}
@@
-106,10
+116,6
@@
public class AltosDisplayThread extends Thread {
}
public void run () {
}
public void run () {
-
- reported_landing = 0;
- state = null;
- report_interval = 10000;
try {
for (;;) {
set_report_time();
try {
for (;;) {
set_report_time();
@@
-149,6
+155,12
@@
public class AltosDisplayThread extends Thread {
} else if (spoken)
set_report_time();
}
} else if (spoken)
set_report_time();
}
+
+ public IdleThread() {
+ state = null;
+ reported_landing = 0;
+ report_interval = 10000;
+ }
}
boolean tell(AltosState state, AltosState old_state) {
}
boolean tell(AltosState state, AltosState old_state) {
@@
-181,13
+193,6
@@
public class AltosDisplayThread extends Thread {
return ret;
}
return ret;
}
- void show(AltosState state, int crc_errors) {
- if (state != null) {
- flightStatus.set(state);
- flightInfo.show(state, crc_errors);
- }
- }
-
public void run() {
boolean interrupted = false;
String line;
public void run() {
boolean interrupted = false;
String line;
@@
-197,7
+202,7
@@
public class AltosDisplayThread extends Thread {
idle_thread = new IdleThread();
idle_thread = new IdleThread();
-
flightInfo.clear
();
+
display.reset
();
try {
for (;;) {
try {
try {
for (;;) {
try {
@@
-235,11
+240,10
@@
public class AltosDisplayThread extends Thread {
}
}
}
}
- public AltosDisplayThread(Frame in_parent, AltosVoice in_voice, Altos
StatusTable in_status, AltosInfoTable in_info
, AltosFlightReader in_reader) {
+ public AltosDisplayThread(Frame in_parent, AltosVoice in_voice, Altos
FlightDisplay in_display
, AltosFlightReader in_reader) {
parent = in_parent;
voice = in_voice;
parent = in_parent;
voice = in_voice;
- flightStatus = in_status;
- flightInfo = in_info;
+ display = in_display;
reader = in_reader;
}
}
reader = in_reader;
}
}