projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch from GPLv2 to GPLv2+
[fw/altos]
/
altosui
/
AltosConfigTD.java
diff --git
a/altosui/AltosConfigTD.java
b/altosui/AltosConfigTD.java
index 397ed3db05b5e38a343353528e5a43dc8e784a85..13eced99dea325a40b366911f8bb05115095783a 100644
(file)
--- a/
altosui/AltosConfigTD.java
+++ b/
altosui/AltosConfigTD.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
*
* 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
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-21,8
+22,8
@@
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_
5
.*;
-import org.altusmetrum.altosuilib_
3
.*;
+import org.altusmetrum.altoslib_
11
.*;
+import org.altusmetrum.altosuilib_
11
.*;
public class AltosConfigTD implements ActionListener {
public class AltosConfigTD implements ActionListener {
@@
-183,14
+184,12
@@
public class AltosConfigTD implements ActionListener {
}
synchronized int telemetry_rate() {
}
synchronized int telemetry_rate() {
- System.out.printf("telemetry_rate: %d\n", telemetry_rate.get());
return telemetry_rate.get();
}
synchronized void set_telemetry_rate(int new_telemetry_rate){
int rate = telemetry_rate.get();
return telemetry_rate.get();
}
synchronized void set_telemetry_rate(int new_telemetry_rate){
int rate = telemetry_rate.get();
- System.out.printf("set_telemetry_rate %d\n", new_telemetry_rate);
if (rate >= 0)
telemetry_rate.set(new_telemetry_rate);
}
if (rate >= 0)
telemetry_rate.set(new_telemetry_rate);
}
@@
-225,8
+224,10
@@
public class AltosConfigTD implements ActionListener {
if (!config_version.get().equals("0.0"))
break;
been_there = true;
if (!config_version.get().equals("0.0"))
break;
been_there = true;
- config.serial_line.printf("C\n ");
- config.serial_line.flush_input();
+ if (config != null && config.serial_line != null) {
+ config.serial_line.printf("C\n ");
+ config.serial_line.flush_input();
+ }
}
} catch (InterruptedException ie) {
}
}
} catch (InterruptedException ie) {
}
@@
-279,8
+280,10
@@
public class AltosConfigTD implements ActionListener {
}
void abort() {
}
void abort() {
- serial_line.close();
- serial_line = null;
+ if (serial_line != null) {
+ serial_line.close();
+ serial_line = null;
+ }
JOptionPane.showMessageDialog(owner,
String.format("Connection to \"%s\" failed",
device.toShortString()),
JOptionPane.showMessageDialog(owner,
String.format("Connection to \"%s\" failed",
device.toShortString()),