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
//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){

View File

@ -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);