projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Allow buttons to be high when pressed rather than low
[fw/altos]
/
altoslib
/
AltosSpeed.java
diff --git
a/altoslib/AltosSpeed.java
b/altoslib/AltosSpeed.java
index af63ed17ebbefb79cbaf81f6c3ca51c2da98dabb..465c190c43883770b1dc2cdb466e65c6f6c901d8 100644
(file)
--- a/
altoslib/AltosSpeed.java
+++ b/
altoslib/AltosSpeed.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,29
+16,35
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.
AltosLib
;
+package org.altusmetrum.
altoslib_11
;
public class AltosSpeed extends AltosUnits {
public class AltosSpeed extends AltosUnits {
- public double value(double v) {
- if (
AltosConvert.
imperial_units)
- return AltosConvert.m
eters_to_feet
(v);
+ public double value(double v
, boolean imperial_units
) {
+ if (imperial_units)
+ return AltosConvert.m
ps_to_fps
(v);
return v;
}
return v;
}
- public String show_units() {
- if (AltosConvert.imperial_units)
- return "ft/s";
+ public double inverse(double v, boolean imperial_units) {
+ if (imperial_units)
+ return AltosConvert.fps_to_mps(v);
+ return v;
+ }
+
+ public String show_units(boolean imperial_units) {
+ if (imperial_units)
+ return "fps";
return "m/s";
}
return "m/s";
}
- public String say_units() {
- if (
AltosConvert.
imperial_units)
+ public String say_units(
boolean imperial_units
) {
+ if (imperial_units)
return "feet per second";
return "meters per second";
}
return "feet per second";
return "meters per second";
}
-
int show_fraction(int width
) {
+
public int show_fraction(int width, boolean imperial_units
) {
return width / 9;
}
return width / 9;
}
-}
\ No newline at end of file
+}