X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosTelemetrySatellite.java;h=60bc4a51db41ba15cbb4ddcc1a1333094b6239bc;hp=fde3d86d133de914a8c01ff49a9634e87ba78399;hb=0da4e201041a4420f273c2e0cda77eea78099518;hpb=5b976a6651f4eb05d30afc08b9e1f27c7e52ae00 diff --git a/altoslib/AltosTelemetrySatellite.java b/altoslib/AltosTelemetrySatellite.java index fde3d86d..60bc4a51 100644 --- a/altoslib/AltosTelemetrySatellite.java +++ b/altoslib/AltosTelemetrySatellite.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,15 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_2; +package org.altusmetrum.altoslib_12; public class AltosTelemetrySatellite extends AltosTelemetryStandard { - int channels; - AltosGPSSat[] sats; + int channels() { return uint8(5); } - public AltosTelemetrySatellite(int[] bytes) { - super(bytes); + AltosGPSSat[] sats() { + int channels = channels(); + AltosGPSSat[] sats = null; - channels = uint8(5); if (channels > 12) channels = 12; if (channels == 0) @@ -37,14 +37,22 @@ public class AltosTelemetrySatellite extends AltosTelemetryStandard { sats[i] = new AltosGPSSat(svid, c_n_1); } } + return sats; + } + + public AltosTelemetrySatellite(int[] bytes) throws AltosCRCException { + super(bytes); } - public void update_state(AltosState state) { - super.update_state(state); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); + + AltosCalData cal_data = listener.cal_data(); + + AltosGPS gps = cal_data.make_temp_gps(tick(), true); - AltosGPS gps = state.make_temp_gps(true); - - gps.cc_gps_sat = sats; - state.set_temp_gps(); + gps.cc_gps_sat = sats(); + listener.set_gps(gps); + cal_data.reset_temp_gps(); } }