From 637ce32419a69426b4e09562d123a1eb72eafbd5 Mon Sep 17 00:00:00 2001 From: Tgui Date: Fri, 16 Feb 2007 06:19:26 +0000 Subject: [PATCH] Getting close to utec functionality. git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@520 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d --- .../logger/utec/comm/UtecSerialConnection.java | 16 +++++++++++++--- src/enginuity/logger/utec/gui/JutecGUI.java | 6 +++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/enginuity/logger/utec/comm/UtecSerialConnection.java b/src/enginuity/logger/utec/comm/UtecSerialConnection.java index 9acaddf5..081fef95 100755 --- a/src/enginuity/logger/utec/comm/UtecSerialConnection.java +++ b/src/enginuity/logger/utec/comm/UtecSerialConnection.java @@ -103,8 +103,10 @@ public class UtecSerialConnection implements SerialPortEventListener{ //OutPut 2 ctrl-x to UTEC //this.sendDataToUtec('\u0018'); //this.sendDataToUtec('\u0018'); - this.sendDataToUtec(33); - this.sendDataToUtec(33); + System.out.println("Utec reset called."); + this.sendDataToUtec(24); + this.sendDataToUtec(24); + this.sendDataToUtec(24); } /** @@ -188,10 +190,12 @@ public class UtecSerialConnection implements SerialPortEventListener{ * @param charValue */ public void sendDataToUtec(int charValue){ + /* if(this.sPort == null){ System.err.println("No Port Selected."); return; } + */ try{ outputToUtecStream.write(charValue); @@ -211,11 +215,12 @@ public class UtecSerialConnection implements SerialPortEventListener{ * @throws SerialConnectionException */ public void openConnection() throws SerialConnectionException { - + /* if(sPort == null){ System.err.println("No port selected."); return; } + */ // Obtain a CommPortIdentifier object for the port you want to open. try { @@ -424,12 +429,15 @@ public class UtecSerialConnection implements SerialPortEventListener{ if (newData == -1) { break; } + + if ('\r' == (char) newData) { inputBuffer.append('\n'); } else { inputBuffer.append((char) newData); } + //inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); @@ -437,6 +445,8 @@ public class UtecSerialConnection implements SerialPortEventListener{ } } + System.out.println(inputBuffer); + //Build new event with buffer data CommEvent commEvent = null; if(this.isMapFromUtec || this.isMapFromUtecPrep){ diff --git a/src/enginuity/logger/utec/gui/JutecGUI.java b/src/enginuity/logger/utec/gui/JutecGUI.java index fbafba5c..d5f330a5 100755 --- a/src/enginuity/logger/utec/gui/JutecGUI.java +++ b/src/enginuity/logger/utec/gui/JutecGUI.java @@ -82,7 +82,7 @@ public class JutecGUI extends JFrame implements ActionListener, // Main frame // Grid layout with a top and bottom, ie two rows super("UTEC Loggers"); - this.setSize(800, 600); + this.setSize(800, 620); this.setResizable(false); this.setDefaultCloseOperation(setDefaultCloseOperation); @@ -180,11 +180,11 @@ public class JutecGUI extends JFrame implements ActionListener, topTabbedPane.add("Graph Data", new RealTimeData()); JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); - splitPane.setDividerLocation(435); + splitPane.setDividerLocation(440); splitPane.setTopComponent(topTabbedPane); splitPane.setBottomComponent(bottomPanel); - splitPane.setPreferredSize(new Dimension(800, 600)); + splitPane.setPreferredSize(new Dimension(800, 700)); totalPanel.add(commandPanel, BorderLayout.NORTH); totalPanel.add(splitPane, BorderLayout.CENTER);