telegps: use new eeprom reading code
[fw/altos] / altosuilib / AltosScanUI.java
index a20a7e141f501911857373f1cb4109f6685df2a4..8843429a6113b6be45d2cc8f1a974f11fec82561 100644 (file)
@@ -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_11;
 
 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_11.*;
 
 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);
        }
@@ -210,8 +220,6 @@ public class AltosScanUI
                                                                                                             frequencies[frequency_index],
                                                                                                             telemetry,
                                                                                                             rate);
-                                                       /* Reset the state so we don't get this data for another channel */
-                                                       state.init();
                                                        Runnable r = new Runnable() {
                                                                        public void run() {
                                                                                results.add(result);
@@ -446,6 +454,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;