public String toString() {
return String.format("%-9.9s serial %-4d flight %-4d (%s %s)",
callsign, serial, flight, frequency.toShortString(), Altos.telemetry_name(telemetry));
public String toString() {
return String.format("%-9.9s serial %-4d flight %-4d (%s %s)",
callsign, serial, flight, frequency.toShortString(), Altos.telemetry_name(telemetry));
- for (AltosScanResult old : this)
- if (old.equals(r))
+ int i = 0;
+ for (AltosScanResult old : this) {
+ if (old.equals(r)) {
+ if (!old.up_to_date(r))
+ changed (new ListDataEvent(this,
+ ListDataEvent.CONTENTS_CHANGED,
+ i, i));
- ListDataEvent de = new ListDataEvent(this,
- ListDataEvent.INTERVAL_ADDED,
- this.size() - 2, this.size() - 1);
- for (ListDataListener l : listeners)
- l.contentsChanged(de);
+ changed(new ListDataEvent(this,
+ ListDataEvent.INTERVAL_ADDED,
+ this.size() - 2, this.size() - 1));
implements ActionListener
{
AltosUI owner;
AltosDevice device;
AltosConfigData config_data;
AltosTelemetryReader reader;
implements ActionListener
{
AltosUI owner;
AltosDevice device;
AltosConfigData config_data;
AltosTelemetryReader reader;
private JLabel scanning_label;
private JLabel frequency_label;
private JLabel telemetry_label;
private JLabel scanning_label;
private JLabel frequency_label;
private JLabel telemetry_label;
- if ((record.seen & AltosRecord.seen_flight) != 0) {
- final AltosScanResult result = new AltosScanResult(record.callsign,
- record.serial,
- record.flight,
+ if (state.flight != AltosLib.MISSING) {
+ final AltosScanResult result = new AltosScanResult(state.callsign,
+ state.serial,
+ state.flight,
frequencies[frequency_index],
telemetry);
Runnable r = new Runnable() {
frequencies[frequency_index],
telemetry);
Runnable r = new Runnable() {
void set_frequency() throws InterruptedException, TimeoutException {
reader.set_frequency(frequencies[frequency_index].frequency);
void set_frequency() throws InterruptedException, TimeoutException {
reader.set_frequency(frequencies[frequency_index].frequency);
scanning_telemetry |= (1 << Altos.ao_telemetry_standard);
telemetry_boxes[Altos.ao_telemetry_standard - Altos.ao_telemetry_min].setSelected(true);
}
scanning_telemetry |= (1 << Altos.ao_telemetry_standard);
telemetry_boxes[Altos.ao_telemetry_standard - Altos.ao_telemetry_min].setSelected(true);
}
scanning_label = new JLabel("Scanning:");
frequency_label = new JLabel("");
telemetry_label = new JLabel("");
scanning_label = new JLabel("Scanning:");
frequency_label = new JLabel("");
telemetry_label = new JLabel("");
telemetry_boxes = new JCheckBox[Altos.ao_telemetry_max - Altos.ao_telemetry_min + 1];
for (int k = Altos.ao_telemetry_min; k <= Altos.ao_telemetry_max; k++) {
int j = k - Altos.ao_telemetry_min;
telemetry_boxes = new JCheckBox[Altos.ao_telemetry_max - Altos.ao_telemetry_min + 1];
for (int k = Altos.ao_telemetry_min; k <= Altos.ao_telemetry_max; k++) {
int j = k - Altos.ao_telemetry_min;
c.gridy = 3 + j;
pane.add(telemetry_boxes[j], c);
telemetry_boxes[j].setActionCommand("telemetry");
c.gridy = 3 + j;
pane.add(telemetry_boxes[j], c);
telemetry_boxes[j].setActionCommand("telemetry");
//Subclass JList to workaround bug 4832765, which can cause the
//scroll pane to not let the user easily scroll up to the beginning
//of the list. An alternative would be to set the unitIncrement
//Subclass JList to workaround bug 4832765, which can cause the
//scroll pane to not let the user easily scroll up to the beginning
//of the list. An alternative would be to set the unitIncrement