X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosState.java;h=7b41e98dcbe50daea61776a6cc8265ea1545edab;hb=21d176f161b90f18f236ef887cef9676d712eee3;hp=8eacf97515d74f3f280dd12ed5d37609067c56d6;hpb=60b8bea12edb954e6140a92c8412364c9581e3c2;p=fw%2Faltos diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 8eacf975..7b41e98d 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -19,7 +19,7 @@ * Track flight state from telemetry or eeprom data stream */ -package org.altusmetrum.altoslib_7; +package org.altusmetrum.altoslib_10; import java.io.*; @@ -66,7 +66,7 @@ public class AltosState implements Cloneable, Serializable { void set_filtered(double new_value, double time) { if (prev_value != AltosLib.MISSING) { - double f = 1/Math.exp((time - prev_set_time) / filter_le); + double f = 1/Math.exp((time - prev_set_time) / filter_len); new_value = f * new_value + (1-f) * prev_value; } set(new_value, time); @@ -284,7 +284,7 @@ public class AltosState implements Cloneable, Serializable { } } - public int state; + private int state; public int flight; public int serial; public int altitude_32; @@ -1056,6 +1056,10 @@ public class AltosState implements Cloneable, Serializable { } } + public int state() { + return state; + } + public void set_device_type(int device_type) { this.device_type = device_type; switch (device_type) { @@ -1358,11 +1362,6 @@ public class AltosState implements Cloneable, Serializable { } } - public void make_companion (int nchannels) { - if (companion == null) - companion = new AltosCompanion(nchannels); - } - public void set_companion(AltosCompanion companion) { this.companion = companion; }