summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
aa5caf6)
Access the reader name directly from the reader object instead of a
local variable (which wasn't getting set anyways).
Signed-off-by: Keith Packard <keithp@keithp.com>
Frame parent;
IdleThread idle_thread;
AltosVoice voice;
Frame parent;
IdleThread idle_thread;
AltosVoice voice;
AltosFlightReader reader;
int crc_errors;
AltosFlightDisplay display;
AltosFlightReader reader;
int crc_errors;
AltosFlightDisplay display;
SwingUtilities.invokeLater(r);
}
SwingUtilities.invokeLater(r);
}
- void reading_error_internal(String name) {
+ void reading_error_internal() {
JOptionPane.showMessageDialog(parent,
JOptionPane.showMessageDialog(parent,
- String.format("Error reading from \"%s\"", name),
+ String.format("Error reading from \"%s\"", reader.name),
"Telemetry Read Error",
JOptionPane.ERROR_MESSAGE);
}
"Telemetry Read Error",
JOptionPane.ERROR_MESSAGE);
}
- void reading_error_safely(String in_name) {
- final String name = in_name;
+ void reading_error_safely() {
Runnable r = new Runnable() {
public void run() {
try {
Runnable r = new Runnable() {
public void run() {
try {
- reading_error_internal(name);
+ reading_error_internal();
} catch (Exception ex) {
}
}
} catch (Exception ex) {
}
}
} catch (InterruptedException ee) {
interrupted = true;
} catch (IOException ie) {
} catch (InterruptedException ee) {
interrupted = true;
} catch (IOException ie) {
- reading_error_safely(name);
+ reading_error_safely();
} finally {
if (!interrupted)
idle_thread.report(true);
} finally {
if (!interrupted)
idle_thread.report(true);