altosui/telegps: Expose configurable APRS SSID
[fw/altos] / altoslib / AltosConfigData.java
index 563bef4b71ceaecc4804f35ae14a4b0f2cafd698..3bf8ea43d2ad4b0601fa975612947f0ea2ac5006 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_4;
+package org.altusmetrum.altoslib_5;
 
 import java.util.*;
 import java.text.*;
@@ -67,9 +67,11 @@ public class AltosConfigData implements Iterable<String> {
        public AltosPyro[]      pyros;
        public int              npyro;
        public int              pyro;
+       public double           pyro_firing_time;
 
        /* HAS_APRS */
        public int              aprs_interval;
+       public int              aprs_ssid;
 
        /* HAS_BEEP */
        public int              beep;
@@ -246,8 +248,10 @@ public class AltosConfigData implements Iterable<String> {
                pyro = 0;
                npyro = 0;
                pyros = null;
+               pyro_firing_time = -1;
 
                aprs_interval = -1;
+               aprs_ssid = -1;
 
                beep = -1;
 
@@ -327,9 +331,11 @@ public class AltosConfigData implements Iterable<String> {
                                        pyros[pyro++] = p;
                        } catch (Exception e) {}
                }
+               try { pyro_firing_time = get_int(line, "Pyro time:") / 100.0; } catch (Exception e) {}
 
                /* HAS_APRS */
                try { aprs_interval = get_int(line, "APRS interval:"); } catch (Exception e) {}
+               try { aprs_ssid = get_int(line, "APRS SSID:"); } catch (Exception e) {}
 
                /* HAS_BEEP */
                try { beep = get_int(line, "Beeper setting:"); } catch (Exception e) {}
@@ -450,10 +456,14 @@ public class AltosConfigData implements Iterable<String> {
                /* AO_PYRO_NUM */
                if (npyro > 0)
                        pyros = source.pyros();
+               if (pyro_firing_time >= 0)
+                       pyro_firing_time = source.pyro_firing_time();
 
                /* HAS_APRS */
                if (aprs_interval >= 0)
                        aprs_interval = source.aprs_interval();
+               if (aprs_ssid >= 0)
+                       aprs_ssid = source.aprs_ssid();
 
                /* HAS_BEEP */
                if (beep >= 0)
@@ -500,7 +510,9 @@ public class AltosConfigData implements Iterable<String> {
                        dest.set_pyros(pyros);
                else
                        dest.set_pyros(null);
+               dest.set_pyro_firing_time(pyro_firing_time);
                dest.set_aprs_interval(aprs_interval);
+               dest.set_aprs_ssid(aprs_ssid);
                dest.set_beep(beep);
                dest.set_tracker_motion(tracker_motion);
                dest.set_tracker_interval(tracker_interval);
@@ -565,10 +577,14 @@ public class AltosConfigData implements Iterable<String> {
                                                   pyros[p].toString());
                        }
                }
+               if (pyro_firing_time >= 0)
+                       link.printf("c I %d\n", (int) (pyro_firing_time * 100.0 + 0.5));
 
                /* HAS_APRS */
                if (aprs_interval >= 0)
                        link.printf("c A %d\n", aprs_interval);
+               if (aprs_ssid >= 0)
+                       link.printf("c S %d\n", aprs_ssid);
 
                /* HAS_BEEP */
                if (beep >= 0)