X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosMag.java;h=523a31a5edb90f8076a52db1863792c806fbfb4a;hb=171adbe7db8520f5ff52a5fe2c54fe165c6f91f8;hp=1fa8877b9c639b4d1b5bdd714be5687424dd70be;hpb=00ae706dab6e8fddef4c5730a17c433a022228b7;p=fw%2Faltos diff --git a/altoslib/AltosMag.java b/altoslib/AltosMag.java index 1fa8877b..523a31a5 100644 --- a/altoslib/AltosMag.java +++ b/altoslib/AltosMag.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,16 +16,17 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_5; +package org.altusmetrum.altoslib_11; import java.util.concurrent.*; +import java.io.*; public class AltosMag implements Cloneable { public int along; public int across; public int through; - public static double counts_per_gauss = 1090; + public static final double counts_per_gauss = 1090; public static double convert_gauss(double counts) { return counts / counts_per_gauss; @@ -70,12 +72,14 @@ public class AltosMag implements Cloneable { this.through = through; } - static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { try { AltosMag mag = new AltosMag(link); if (mag != null) - state.set_mag(mag); + listener.set_mag(cal_data.mag_along(mag.along), + cal_data.mag_across(mag.across), + cal_data.mag_through(mag.through)); } catch (TimeoutException te) { } }