From 39e371561469d8e5059638ffa4e7075f391de268 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 15 Nov 2010 23:14:51 +0800 Subject: altosui: add reboot button to telemetrum configuration UI This lets you reconfigure and reboot telemetrum, including over the radio link. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosConfig.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'ao-tools/altosui/AltosConfig.java') diff --git a/ao-tools/altosui/AltosConfig.java b/ao-tools/altosui/AltosConfig.java index 09e204a9..a0fdb623 100644 --- a/ao-tools/altosui/AltosConfig.java +++ b/ao-tools/altosui/AltosConfig.java @@ -198,12 +198,26 @@ public class AltosConfig implements Runnable, ActionListener { public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); - if (cmd.equals("save")) { + if (cmd.equals("Save")) { save_data(); set_ui(); - } else if (cmd.equals("reset")) { + } else if (cmd.equals("Reset")) { set_ui(); - } else if (cmd.equals("close")) { + } else if (cmd.equals("Reboot")) { + if (serial_line != null) { + try { + start_serial(); + serial_line.printf("r eboot\n"); + } catch (InterruptedException ie) { + } finally { + try { + stop_serial(); + } catch (InterruptedException ie) { + } + } + serial_line.close(); + } + } else if (cmd.equals("Close")) { if (serial_line != null) serial_line.close(); } -- cgit v1.2.3