X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosuilib%2FAltosScanUI.java;h=fad1b2cde8ce72f9b7c4f2dec9cd5b734707804f;hp=1b30f99d64a092532e7eb9de702d17d0461b12fa;hb=297eb795b24ec31f6599f48bc8c3769557a7ec6f;hpb=8a2be4d36a3b116d82529805430c5fb665688267 diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index 1b30f99d..fad1b2cd 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.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,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_3; +package org.altusmetrum.altosuilib_13; import java.awt.*; import java.awt.event.*; @@ -25,7 +26,7 @@ import java.io.*; import java.util.*; import java.text.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altoslib_13.*; class AltosScanResult { String callsign; @@ -62,9 +63,18 @@ class AltosScanResult { rate = in_rate; } - public boolean equals(AltosScanResult other) { + public int hashCode() { + return serial ^ frequency.hashCode() ^ telemetry ^ rate; + } + + public boolean equals(Object o) { + if (o == null) + return false; + if (!(o instanceof AltosScanResult)) + return false; + AltosScanResult other = (AltosScanResult) o; return (serial == other.serial && - frequency.frequency == other.frequency.frequency && + frequency.equals(other.frequency) && telemetry == other.telemetry && rate == other.rate); } @@ -203,10 +213,11 @@ public class AltosScanUI if (state == null) continue; packet_count++; - if (state.flight != AltosLib.MISSING) { - final AltosScanResult result = new AltosScanResult(state.callsign, - state.serial, - state.flight, + AltosCalData cal_data = state.cal_data(); + if (cal_data.flight != AltosLib.MISSING) { + final AltosScanResult result = new AltosScanResult(cal_data.callsign, + cal_data.serial, + cal_data.flight, frequencies[frequency_index], telemetry, rate); @@ -254,9 +265,6 @@ public class AltosScanUI void next() throws InterruptedException, TimeoutException { reader.set_monitor(false); - /* Let any pending input from the last configuration drain out */ - Thread.sleep(100); - if (select_rate) { boolean wrapped = false; do { @@ -447,6 +455,7 @@ public class AltosScanUI } public AltosScanUI(AltosUIFrame in_owner, boolean in_select_telemetry) { + super(in_owner, "Scan Telemetry", false); owner = in_owner; select_telemetry = in_select_telemetry;