X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosUI.java;h=62e612ed07d0fc9282e00e9ab0910f7951db6a6b;hb=adb7d345963ab9981c49c7cc68c6b4d7156dce46;hp=9b724fd7bd854c760f870e4ef48b74b6b988a385;hpb=11a2bb8e28df7ed87542f2ee726f877971f5d52a;p=fw%2Faltos diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 9b724fd7..62e612ed 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -26,7 +26,7 @@ import java.io.*; import java.util.*; import java.text.*; import java.util.prefs.*; -import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.*; import libaltosJNI.*; @@ -67,6 +67,16 @@ public class AltosUI extends JFrame { device.toShortString(), "Unkonwn I/O error", JOptionPane.ERROR_MESSAGE); + } catch (TimeoutException te) { + JOptionPane.showMessageDialog(this, + device.toShortString(), + "Timeout error", + JOptionPane.ERROR_MESSAGE); + } catch (InterruptedException ie) { + JOptionPane.showMessageDialog(this, + device.toShortString(), + "Interrupted exception", + JOptionPane.ERROR_MESSAGE); } } @@ -137,7 +147,7 @@ public class AltosUI extends JFrame { ExportData(); } }); - b = addButton(0, 1, "Configure TeleMetrum"); + b = addButton(0, 1, "Configure Altimeter"); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ConfigureTeleMetrum(); @@ -266,7 +276,7 @@ public class AltosUI extends JFrame { AltosRecordIterable iterable = chooser.runDialog(); if (iterable != null) { AltosFlightReader reader = new AltosReplayReader(iterable.iterator(), - chooser.filename()); + chooser.file()); new AltosFlightUI(voice, reader); } } @@ -300,7 +310,11 @@ public class AltosUI extends JFrame { AltosRecordIterable record_reader = chooser.runDialog(); if (record_reader == null) return; - new AltosGraphUI(record_reader); + try { + new AltosGraphUI(record_reader); + } catch (InterruptedException ie) { + } catch (IOException ie) { + } } private void ConfigureAltosUI() { @@ -417,7 +431,7 @@ public class AltosUI extends JFrame { } else { recs = new AltosTelemetryIterable(in); } - reader = new AltosReplayReader(recs.iterator(), filename); + reader = new AltosReplayReader(recs.iterator(), new File(filename)); AltosFlightUI flight_ui = new AltosFlightUI(new AltosVoice(), reader); flight_ui.set_exit_on_close(); return;