X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosSpeed.java;h=af10ad274642666c53ccf2168108ec22fe9e319d;hp=af63ed17ebbefb79cbaf81f6c3ca51c2da98dabb;hb=eaf2ee0f498b519d64e1664a2b8c66c52ac1497c;hpb=e5a55dbf265354e7c94be3e2be53c2d5c8fba056 diff --git a/altoslib/AltosSpeed.java b/altoslib/AltosSpeed.java index af63ed17..af10ad27 100644 --- 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 - * 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 @@ -15,29 +16,35 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.AltosLib; +package org.altusmetrum.altoslib_13; public class AltosSpeed extends AltosUnits { - public double value(double v) { - if (AltosConvert.imperial_units) - return AltosConvert.meters_to_feet(v); + public double value(double v, boolean imperial_units) { + if (imperial_units) + return AltosConvert.mps_to_fps(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"; } - 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"; } - int show_fraction(int width) { + public int show_fraction(int width, boolean imperial_units) { return width / 9; } -} \ No newline at end of file +}