Getting close to utec functionality.

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@520 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
Tgui 2007-02-16 06:19:26 +00:00
parent 95c778781f
commit 637ce32419
2 changed files with 16 additions and 6 deletions

View File

@ -103,8 +103,10 @@ public class UtecSerialConnection implements SerialPortEventListener{
//OutPut 2 ctrl-x to UTEC //OutPut 2 ctrl-x to UTEC
//this.sendDataToUtec('\u0018'); //this.sendDataToUtec('\u0018');
//this.sendDataToUtec('\u0018'); //this.sendDataToUtec('\u0018');
this.sendDataToUtec(33); System.out.println("Utec reset called.");
this.sendDataToUtec(33); this.sendDataToUtec(24);
this.sendDataToUtec(24);
this.sendDataToUtec(24);
} }
/** /**
@ -188,10 +190,12 @@ public class UtecSerialConnection implements SerialPortEventListener{
* @param charValue * @param charValue
*/ */
public void sendDataToUtec(int charValue){ public void sendDataToUtec(int charValue){
/*
if(this.sPort == null){ if(this.sPort == null){
System.err.println("No Port Selected."); System.err.println("No Port Selected.");
return; return;
} }
*/
try{ try{
outputToUtecStream.write(charValue); outputToUtecStream.write(charValue);
@ -211,11 +215,12 @@ public class UtecSerialConnection implements SerialPortEventListener{
* @throws SerialConnectionException * @throws SerialConnectionException
*/ */
public void openConnection() throws SerialConnectionException { public void openConnection() throws SerialConnectionException {
/*
if(sPort == null){ if(sPort == null){
System.err.println("No port selected."); System.err.println("No port selected.");
return; return;
} }
*/
// Obtain a CommPortIdentifier object for the port you want to open. // Obtain a CommPortIdentifier object for the port you want to open.
try { try {
@ -424,12 +429,15 @@ public class UtecSerialConnection implements SerialPortEventListener{
if (newData == -1) { if (newData == -1) {
break; break;
} }
if ('\r' == (char) newData) { if ('\r' == (char) newData) {
inputBuffer.append('\n'); inputBuffer.append('\n');
} else { } else {
inputBuffer.append((char) newData); inputBuffer.append((char) newData);
} }
//inputBuffer.append((char) newData);
} catch (IOException ex) { } catch (IOException ex) {
System.err.println(ex); System.err.println(ex);
@ -437,6 +445,8 @@ public class UtecSerialConnection implements SerialPortEventListener{
} }
} }
System.out.println(inputBuffer);
//Build new event with buffer data //Build new event with buffer data
CommEvent commEvent = null; CommEvent commEvent = null;
if(this.isMapFromUtec || this.isMapFromUtecPrep){ if(this.isMapFromUtec || this.isMapFromUtecPrep){

View File

@ -82,7 +82,7 @@ public class JutecGUI extends JFrame implements ActionListener,
// Main frame // Main frame
// Grid layout with a top and bottom, ie two rows // Grid layout with a top and bottom, ie two rows
super("UTEC Loggers"); super("UTEC Loggers");
this.setSize(800, 600); this.setSize(800, 620);
this.setResizable(false); this.setResizable(false);
this.setDefaultCloseOperation(setDefaultCloseOperation); this.setDefaultCloseOperation(setDefaultCloseOperation);
@ -180,11 +180,11 @@ public class JutecGUI extends JFrame implements ActionListener,
topTabbedPane.add("Graph Data", new RealTimeData()); topTabbedPane.add("Graph Data", new RealTimeData());
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setDividerLocation(435); splitPane.setDividerLocation(440);
splitPane.setTopComponent(topTabbedPane); splitPane.setTopComponent(topTabbedPane);
splitPane.setBottomComponent(bottomPanel); splitPane.setBottomComponent(bottomPanel);
splitPane.setPreferredSize(new Dimension(800, 600)); splitPane.setPreferredSize(new Dimension(800, 700));
totalPanel.add(commandPanel, BorderLayout.NORTH); totalPanel.add(commandPanel, BorderLayout.NORTH);
totalPanel.add(splitPane, BorderLayout.CENTER); totalPanel.add(splitPane, BorderLayout.CENTER);