projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib/altosuilib: Update library version to 7
[fw/altos]
/
altosdroid
/
src
/
org
/
altusmetrum
/
AltosDroid
/
AltosVoice.java
diff --git
a/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
b/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
index b8def36750c7b83df79622186fa100a80c1e6c56..e79972e396fab2301e74ac078f36890fd1d6d5f8 100644
(file)
--- a/
altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
+++ b/
altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
@@
-21,7
+21,7
@@
package org.altusmetrum.AltosDroid;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
-import org.altusmetrum.altoslib_
5
.*;
+import org.altusmetrum.altoslib_
7
.*;
public class AltosVoice {
public class AltosVoice {
@@
-68,12
+68,14
@@
public class AltosVoice {
if ((old_state == null || old_state.state <= AltosLib.ao_flight_boost) &&
state.state > AltosLib.ao_flight_boost) {
if (state.max_speed() != AltosLib.MISSING)
if ((old_state == null || old_state.state <= AltosLib.ao_flight_boost) &&
state.state > AltosLib.ao_flight_boost) {
if (state.max_speed() != AltosLib.MISSING)
- speak(String.format("max speed: %d meters per second.", (int) (state.max_speed() + 0.5)));
+ speak(String.format("Max speed: %s.",
+ AltosConvert.speed.say_units(state.max_speed())));
spoke = true;
} else if ((old_state == null || old_state.state < AltosLib.ao_flight_drogue) &&
state.state >= AltosLib.ao_flight_drogue) {
if (state.max_height() != AltosLib.MISSING)
spoke = true;
} else if ((old_state == null || old_state.state < AltosLib.ao_flight_drogue) &&
state.state >= AltosLib.ao_flight_drogue) {
if (state.max_height() != AltosLib.MISSING)
- speak(String.format("max height: %d meters.", (int) (state.max_height() + 0.5)));
+ speak(String.format("Max height: %s.",
+ AltosConvert.height.say_units(state.max_height())));
spoke = true;
}
}
spoke = true;
}
}
@@
-126,17
+128,17
@@
public class AltosVoice {
position = state.from_pad;
if (position != null) {
position = state.from_pad;
if (position != null) {
- speak(String.format("Height %
d, bearing %s %d, elevation %d, range %d
.\n",
-
(int) (state.height() + 0.5
),
+ speak(String.format("Height %
s, bearing %s %d, elevation %d, range %s
.\n",
+
AltosConvert.height.say_units(state.height()
),
position.bearing_words(
AltosGreatCircle.BEARING_VOICE),
(int) (position.bearing + 0.5),
(int) (position.elevation + 0.5),
position.bearing_words(
AltosGreatCircle.BEARING_VOICE),
(int) (position.bearing + 0.5),
(int) (position.elevation + 0.5),
-
(int) (position.range + 0.5
)));
+
AltosConvert.distance.say_units(position.range
)));
}
} else if (state.state > AltosLib.ao_flight_pad) {
if (state.height() != AltosLib.MISSING)
}
} else if (state.state > AltosLib.ao_flight_pad) {
if (state.height() != AltosLib.MISSING)
- speak(
String.format("%d meters", (int) (state.height() + 0.5
)));
+ speak(
AltosConvert.height.say_units(state.height(
)));
} else {
reported_landing = 0;
}
} else {
reported_landing = 0;
}
@@
-155,9
+157,9
@@
public class AltosVoice {
else
speak("rocket may have crashed");
if (state.from_pad != null)
else
speak("rocket may have crashed");
if (state.from_pad != null)
- speak(String.format("Bearing %d degrees, range %
d meter
s.",
+ speak(String.format("Bearing %d degrees, range %s.",
(int) (state.from_pad.bearing + 0.5),
(int) (state.from_pad.bearing + 0.5),
-
(int) (state.from_pad.distance + 0.5
)));
+
AltosConvert.distance.say_units(state.from_pad.distance
)));
++reported_landing;
}
}
++reported_landing;
}
}