diff options
| author | Keith Packard <keithp@keithp.com> | 2010-04-22 16:25:35 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-04-22 16:25:38 -0700 | 
| commit | 97f4874d19ec05c81a04a3ecd06abffcf7fbfafc (patch) | |
| tree | 1b3247f5675685813d7f07a6101395e1a5659653 /ao-tools/altosui/AltosUI.java | |
| parent | e7dc7fab787df63a4de72c8450e94092eb04d7db (diff) | |
More ALtosUI changes
Diffstat (limited to 'ao-tools/altosui/AltosUI.java')
| -rw-r--r-- | ao-tools/altosui/AltosUI.java | 18 | 
1 files changed, 6 insertions, 12 deletions
| diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 7f008f3a..2952fcc0 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -26,6 +26,7 @@ import java.io.*;  import java.util.*;  import java.text.*;  import java.util.prefs.*; +import java.util.concurrent.LinkedBlockingQueue;  import gnu.io.*;  import altosui.AltosSerial; @@ -391,14 +392,6 @@ public class AltosUI extends JFrame {  		return true;  	} -	private void PickSerialDevice() { -		java.util.Enumeration<CommPortIdentifier> port_list = CommPortIdentifier.getPortIdentifiers(); -		while (port_list.hasMoreElements()) { -			CommPortIdentifier identifier = port_list.nextElement(); -			System.out.println("Serial port " + identifier.getName()); -		} -	} -  	class DisplayThread extends Thread {  		String read() throws InterruptedException { return null; } @@ -433,21 +426,22 @@ public class AltosUI extends JFrame {  	class DeviceThread extends DisplayThread {  		AltosSerial	serial; +		LinkedBlockingQueue<String> telem;  		String read() throws InterruptedException { -			System.out.println("Waiting for telemetry"); -			String s = serial.get_telem(); -			System.out.println("Got telemetry " + s); -			return s; +			return telem.take();  		}  		void close() {  			serial.close(); +			serial.remove_monitor(telem);  			System.out.println("DisplayThread done");  		}  		public DeviceThread(AltosSerial s) {  			serial = s; +			telem = new LinkedBlockingQueue<String>(); +			serial.add_monitor(telem);  		}  	} | 
