X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosTemperature.java;h=5a21ebd82474468aa198192c635c9cb3263cdeb4;hp=0105fe539f6f992e4e5f8820cd6b748e6d2acc5d;hb=ec46adee44ea08120b1940ca55a5fbdf56874bb1;hpb=5b976a6651f4eb05d30afc08b9e1f27c7e52ae00 diff --git a/altoslib/AltosTemperature.java b/altoslib/AltosTemperature.java index 0105fe53..5a21ebd8 100644 --- a/altoslib/AltosTemperature.java +++ b/altoslib/AltosTemperature.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_2; +package org.altusmetrum.altoslib_14; public class AltosTemperature extends AltosUnits { - public double value(double v) { - if (AltosConvert.imperial_units) + public double value(double v, boolean imperial_units) { + if (imperial_units) return AltosConvert.c_to_f(v); return v; } - public String show_units() { - if (AltosConvert.imperial_units) + public double inverse(double v, boolean imperial_units) { + if (imperial_units) + return AltosConvert.f_to_c(v); + return v; + } + + public String show_units(boolean imperial_units) { + if (imperial_units) return "°F"; return "°C"; } - public String say_units() { - if (AltosConvert.imperial_units) + public String say_units(boolean imperial_units) { + if (imperial_units) return "degrees farenheit"; return "degrees celsius"; } - public int show_fraction(int width) { + public int show_fraction(int width, boolean imperial_units) { return width / 3; } }