mirror of https://github.com/rusefi/RomRaider.git
Initial intested support for pulling maps from the utec.
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@516 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
4ac3ced77f
commit
4108c5a157
|
@ -6,6 +6,7 @@ import java.awt.event.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import enginuity.logger.utec.commEvent.*;
|
import enginuity.logger.utec.commEvent.*;
|
||||||
|
import enginuity.logger.utec.mapData.GetMapFromUtecListener;
|
||||||
import enginuity.logger.utec.mapData.UtecMapData;
|
import enginuity.logger.utec.mapData.UtecMapData;
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,6 +35,8 @@ public class UtecControl implements SerialPortEventListener{
|
||||||
//Data from UTEC
|
//Data from UTEC
|
||||||
//private JTextArea messageAreaIn;
|
//private JTextArea messageAreaIn;
|
||||||
|
|
||||||
|
private GetMapFromUtecListener getMapFromUtecListener = null;
|
||||||
|
|
||||||
// Parameters used to define serial connection
|
// Parameters used to define serial connection
|
||||||
public SerialParameters parameters = new SerialParameters();
|
public SerialParameters parameters = new SerialParameters();
|
||||||
|
|
||||||
|
@ -80,6 +83,7 @@ public class UtecControl implements SerialPortEventListener{
|
||||||
open = false;
|
open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get UTEC to send logger data data
|
* Get UTEC to send logger data data
|
||||||
*
|
*
|
||||||
|
@ -112,17 +116,23 @@ public class UtecControl implements SerialPortEventListener{
|
||||||
*
|
*
|
||||||
* @param mapNumber
|
* @param mapNumber
|
||||||
*/
|
*/
|
||||||
public void pullMapData(int mapNumber){
|
public void pullMapData(int mapNumber, GetMapFromUtecListener listener){
|
||||||
// Put utec into a known state
|
|
||||||
this.resetUtec();
|
|
||||||
|
|
||||||
// Check bounds of map requested
|
// Check bounds of map requested
|
||||||
if(mapNumber < 1 || mapNumber > 5){
|
if(mapNumber < 1 || mapNumber > 5){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Null out any previously loaded map
|
||||||
|
this.currentMap = null;
|
||||||
|
|
||||||
|
// Who will get this map in the end?
|
||||||
|
this.getMapFromUtecListener = listener;
|
||||||
|
|
||||||
// Setup map transfer prep state
|
// Setup map transfer prep state
|
||||||
this.isMapFromUtecPrep = true;
|
this.isMapFromUtecPrep = true;
|
||||||
|
this.isMapFromUtec = false;
|
||||||
|
|
||||||
// Reset the UTEC
|
// Reset the UTEC
|
||||||
this.resetUtec();
|
this.resetUtec();
|
||||||
|
@ -380,6 +390,7 @@ public class UtecControl implements SerialPortEventListener{
|
||||||
while (newData != -1) {
|
while (newData != -1) {
|
||||||
try {
|
try {
|
||||||
newData = inputFromUtecStream.read();
|
newData = inputFromUtecStream.read();
|
||||||
|
|
||||||
if (newData == -1) {
|
if (newData == -1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -388,6 +399,8 @@ public class UtecControl implements SerialPortEventListener{
|
||||||
} else {
|
} else {
|
||||||
inputBuffer.append((char) newData);
|
inputBuffer.append((char) newData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
System.err.println(ex);
|
System.err.println(ex);
|
||||||
return;
|
return;
|
||||||
|
@ -408,11 +421,17 @@ public class UtecControl implements SerialPortEventListener{
|
||||||
|
|
||||||
// Append byte data from the UTEC
|
// Append byte data from the UTEC
|
||||||
this.currentMap.addRawData(newData);
|
this.currentMap.addRawData(newData);
|
||||||
|
System.out.println("Added:"+(char)newData);
|
||||||
|
|
||||||
// Detect the end of the map recieving
|
// Detect the end of the map recieving
|
||||||
if(inputBuffer.indexOf("[EOF]") != -1){
|
if(inputBuffer.indexOf("[EOF]") != -1){
|
||||||
this.isMapFromUtecPrep = false;
|
this.isMapFromUtecPrep = false;
|
||||||
this.currentMap.populateMapDataStructures();
|
this.currentMap.populateMapDataStructures();
|
||||||
|
|
||||||
|
// Notify listner if available
|
||||||
|
if(this.getMapFromUtecListener != null){
|
||||||
|
this.getMapFromUtecListener.mapRetrieved(this.currentMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@ import java.awt.event.*;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
//import javax.comm.CommPortIdentifier
|
//import javax.comm.CommPortIdentifier
|
||||||
import gnu.io.*;
|
import gnu.io.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import enginuity.logger.utec.gui.realtimeData.*;
|
import enginuity.logger.utec.gui.realtimeData.*;
|
||||||
|
import enginuity.logger.utec.mapData.GetMapFromUtecListener;
|
||||||
import enginuity.logger.utec.comm.*;
|
import enginuity.logger.utec.comm.*;
|
||||||
/**
|
/**
|
||||||
* @author emorgan
|
* @author emorgan
|
||||||
|
@ -26,7 +26,7 @@ import enginuity.logger.utec.comm.*;
|
||||||
* To change the template for this generated type comment go to
|
* To change the template for this generated type comment go to
|
||||||
* Window - Preferences - Java - Code Generation - Code and Comments
|
* Window - Preferences - Java - Code Generation - Code and Comments
|
||||||
*/
|
*/
|
||||||
public class CommInterface{
|
public class UtecInterface{
|
||||||
//Store string vector of known system comm ports
|
//Store string vector of known system comm ports
|
||||||
private static Vector portChoices = listPortChoices();
|
private static Vector portChoices = listPortChoices();
|
||||||
|
|
||||||
|
@ -34,17 +34,21 @@ public class CommInterface{
|
||||||
private static SerialParameters parameters = new SerialParameters();
|
private static SerialParameters parameters = new SerialParameters();
|
||||||
|
|
||||||
//Actual connection entity
|
//Actual connection entity
|
||||||
private static UtecControl connection = new UtecControl(parameters);
|
private static UtecControl utecControl = new UtecControl(parameters);
|
||||||
|
|
||||||
|
|
||||||
public static boolean ISOPEN = connection.isOpen();
|
public static boolean ISOPEN = utecControl.isOpen();
|
||||||
|
|
||||||
public static Vector getPortsVector(){
|
public static Vector getPortsVector(){
|
||||||
return portChoices;
|
return portChoices;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPortChoiceUsed(){
|
public static String getPortChoiceUsed(){
|
||||||
return connection.parameters.getPortName();
|
return utecControl.parameters.getPortName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getMap(int mapNumber, GetMapFromUtecListener listener){
|
||||||
|
utecControl.pullMapData(mapNumber, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,8 +57,13 @@ public class CommInterface{
|
||||||
* @param portName
|
* @param portName
|
||||||
*/
|
*/
|
||||||
public static void openConnection(){
|
public static void openConnection(){
|
||||||
|
if(utecControl.isOpen()){
|
||||||
|
System.out.println("Port is already open.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//No port yet chosen
|
//No port yet chosen
|
||||||
if(connection.parameters.getPortName().equalsIgnoreCase("")){
|
if(utecControl.parameters.getPortName().equalsIgnoreCase("")){
|
||||||
System.err.println("No Port Yet Chosen, nothing to open");
|
System.err.println("No Port Yet Chosen, nothing to open");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +78,7 @@ public class CommInterface{
|
||||||
|
|
||||||
//Attempt to make connection
|
//Attempt to make connection
|
||||||
try{
|
try{
|
||||||
connection.openConnection();
|
utecControl.openConnection();
|
||||||
}catch(SerialConnectionException e){
|
}catch(SerialConnectionException e){
|
||||||
System.err.println("Error opening serial port connection");
|
System.err.println("Error opening serial port connection");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -81,11 +90,11 @@ public class CommInterface{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void closeConnection(){
|
public static void closeConnection(){
|
||||||
connection.closeConnection();
|
utecControl.closeConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setPortChoice(String port){
|
public static void setPortChoice(String port){
|
||||||
connection.parameters.setPortName(port);
|
utecControl.parameters.setPortName(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -93,7 +102,7 @@ public class CommInterface{
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static void resetUtec(){
|
public static void resetUtec(){
|
||||||
connection.resetUtec();
|
utecControl.resetUtec();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,7 +110,7 @@ public class CommInterface{
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static void startDataLogFromUtec(){
|
public static void startDataLogFromUtec(){
|
||||||
connection.startLoggerDataFlow();
|
utecControl.startLoggerDataFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,12 +119,12 @@ public class CommInterface{
|
||||||
* @param o
|
* @param o
|
||||||
*/
|
*/
|
||||||
public static void addListener(Object o){
|
public static void addListener(Object o){
|
||||||
if(connection == null){
|
if(utecControl == null){
|
||||||
System.err.println("No Serial Connection defined yet.. DIZZoGG!");
|
System.err.println("No Serial Connection defined yet.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.addListener(o);
|
utecControl.addListener(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -16,13 +16,15 @@ import java.awt.*;
|
||||||
import enginuity.Settings;
|
import enginuity.Settings;
|
||||||
import enginuity.logger.utec.gui.realtimeData.*;
|
import enginuity.logger.utec.gui.realtimeData.*;
|
||||||
import enginuity.logger.utec.gui.bottomControl.*;
|
import enginuity.logger.utec.gui.bottomControl.*;
|
||||||
|
import enginuity.logger.utec.mapData.GetMapFromUtecListener;
|
||||||
|
import enginuity.logger.utec.mapData.UtecMapData;
|
||||||
import enginuity.tts.VoiceThread;
|
import enginuity.tts.VoiceThread;
|
||||||
import enginuity.logger.utec.commInterface.CommInterface;
|
import enginuity.logger.utec.commInterface.UtecInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author botman
|
* @author botman
|
||||||
*/
|
*/
|
||||||
public class JutecGUI extends JFrame implements ActionListener{
|
public class JutecGUI extends JFrame implements ActionListener, GetMapFromUtecListener{
|
||||||
//Top level desktop pane
|
//Top level desktop pane
|
||||||
public JLayeredPane desktop = null;
|
public JLayeredPane desktop = null;
|
||||||
|
|
||||||
|
@ -43,11 +45,20 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
|
|
||||||
|
|
||||||
//FileMenu Items
|
//FileMenu Items
|
||||||
public JMenuItem saveItem = new JMenuItem("Save");
|
public JMenuItem saveItem = new JMenuItem("Save Log");
|
||||||
|
public JMenuItem saveMapItem = new JMenuItem("Save Map To File");
|
||||||
public JMenuItem exitItem = new JMenuItem("Exit");
|
public JMenuItem exitItem = new JMenuItem("Exit");
|
||||||
|
|
||||||
|
public JMenuItem loadMapOne = new JMenuItem("Load Map #1");
|
||||||
|
public JMenuItem loadMapTwo = new JMenuItem("Load Map #2");
|
||||||
|
public JMenuItem loadMapThree = new JMenuItem("Load Map #3");
|
||||||
|
public JMenuItem loadMapFour = new JMenuItem("Load Map #4");
|
||||||
|
public JMenuItem loadMapFive = new JMenuItem("Load Map #5");
|
||||||
|
|
||||||
private static JutecGUI instance = null;
|
private static JutecGUI instance = null;
|
||||||
|
|
||||||
|
private UtecMapData currentMap = null;
|
||||||
|
|
||||||
public static JutecGUI getInstance(){
|
public static JutecGUI getInstance(){
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +86,7 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
System.out.println("JUTEC Exiting");
|
System.out.println("JUTEC Exiting");
|
||||||
|
|
||||||
//Use interface to close the connecetion to the Utec
|
//Use interface to close the connecetion to the Utec
|
||||||
CommInterface.closeConnection();
|
UtecInterface.closeConnection();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -92,19 +103,34 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
// Define the menu system
|
// Define the menu system
|
||||||
JMenu fileMenu = new JMenu("File");
|
JMenu fileMenu = new JMenu("File");
|
||||||
saveItem.addActionListener(this);
|
saveItem.addActionListener(this);
|
||||||
|
saveMapItem.addActionListener(this);
|
||||||
exitItem.addActionListener(this);
|
exitItem.addActionListener(this);
|
||||||
fileMenu.add(saveItem);
|
fileMenu.add(saveItem);
|
||||||
|
fileMenu.add(saveMapItem);
|
||||||
fileMenu.add(exitItem);
|
fileMenu.add(exitItem);
|
||||||
menuBar.add(fileMenu);
|
menuBar.add(fileMenu);
|
||||||
|
|
||||||
|
|
||||||
|
JMenu getMapsMenu = new JMenu("Load Map");
|
||||||
|
loadMapOne.addActionListener(this);
|
||||||
|
loadMapTwo.addActionListener(this);
|
||||||
|
loadMapThree.addActionListener(this);
|
||||||
|
loadMapFour.addActionListener(this);
|
||||||
|
loadMapFive.addActionListener(this);
|
||||||
|
getMapsMenu.add(loadMapOne);
|
||||||
|
getMapsMenu.add(loadMapTwo);
|
||||||
|
getMapsMenu.add(loadMapThree);
|
||||||
|
getMapsMenu.add(loadMapFour);
|
||||||
|
getMapsMenu.add(loadMapFive);
|
||||||
|
menuBar.add(getMapsMenu);
|
||||||
|
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
//Add a menu item for comm port selection
|
//Add a menu item for comm port selection
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
JMenu portsMenu =new JMenu("Ports");
|
JMenu portsMenu =new JMenu("Ports");
|
||||||
|
|
||||||
//Gather list of ports from interface
|
//Gather list of ports from interface
|
||||||
Vector portsVector =CommInterface.getPortsVector();
|
Vector portsVector =UtecInterface.getPortsVector();
|
||||||
|
|
||||||
Iterator portsIterator = portsVector.iterator();
|
Iterator portsIterator = portsVector.iterator();
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
@ -118,7 +144,7 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
portsMenu.add(item);
|
portsMenu.add(item);
|
||||||
if(counter == 1){
|
if(counter == 1){
|
||||||
defaultPort = theName;
|
defaultPort = theName;
|
||||||
CommInterface.setPortChoice(defaultPort);
|
UtecInterface.setPortChoice(defaultPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
menuBar.add(portsMenu);
|
menuBar.add(portsMenu);
|
||||||
|
@ -176,7 +202,7 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Start Capture
|
//Start Capture
|
||||||
else if (cmd.equals("Save")) {
|
else if (cmd.equals("Save Log")) {
|
||||||
String saveFileName = null;
|
String saveFileName = null;
|
||||||
System.out.println("Save action occuring");
|
System.out.println("Save action occuring");
|
||||||
fileChosen = fileChooser.showSaveDialog(this);
|
fileChosen = fileChooser.showSaveDialog(this);
|
||||||
|
@ -199,10 +225,58 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (cmd.equals("Save Map To File")) {
|
||||||
|
System.out.println("Saving map to file.");
|
||||||
|
if(this.currentMap != null){
|
||||||
|
|
||||||
|
String saveFileName = null;
|
||||||
|
System.out.println("Save map now.");
|
||||||
|
fileChosen = fileChooser.showSaveDialog(this);
|
||||||
|
if(fileChosen == JFileChooser.APPROVE_OPTION)
|
||||||
|
{
|
||||||
|
saveFileName = fileChooser.getSelectedFile().getPath();
|
||||||
|
this.currentMap.writeMapToFile(saveFileName);
|
||||||
|
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
System.out.println("Map is null.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (cmd.equals("Load Map #1")) {
|
||||||
|
System.out.println("Starting to get map 1");
|
||||||
|
UtecInterface.openConnection();
|
||||||
|
UtecInterface.getMap(1, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (cmd.equals("Load Map #2")) {
|
||||||
|
System.out.println("Starting to get map 2");
|
||||||
|
UtecInterface.openConnection();
|
||||||
|
UtecInterface.getMap(2, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (cmd.equals("Load Map #3")) {
|
||||||
|
System.out.println("Starting to get map 3");
|
||||||
|
UtecInterface.openConnection();
|
||||||
|
UtecInterface.getMap(3, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (cmd.equals("Load Map #4")) {
|
||||||
|
System.out.println("Starting to get map 4");
|
||||||
|
UtecInterface.openConnection();
|
||||||
|
UtecInterface.getMap(4, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (cmd.equals("Load Map #5")) {
|
||||||
|
System.out.println("Starting to get map 5");
|
||||||
|
UtecInterface.openConnection();
|
||||||
|
UtecInterface.getMap(5, this);
|
||||||
|
}
|
||||||
|
|
||||||
//Stop Capture
|
//Stop Capture
|
||||||
else if (cmd.equals("Exit")) {
|
else if (cmd.equals("Exit")) {
|
||||||
//Use interface to finally close the connection to the Utec
|
//Use interface to finally close the connection to the Utec
|
||||||
CommInterface.closeConnection();
|
UtecInterface.closeConnection();
|
||||||
System.out.println("Exit action occuring");
|
System.out.println("Exit action occuring");
|
||||||
|
|
||||||
//Close out the application
|
//Close out the application
|
||||||
|
@ -218,7 +292,7 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
String portChoice = theItem.getName();
|
String portChoice = theItem.getName();
|
||||||
System.out.println("Port chosen: "+portChoice);
|
System.out.println("Port chosen: "+portChoice);
|
||||||
currentPort = portChoice;
|
currentPort = portChoice;
|
||||||
CommInterface.setPortChoice(currentPort);
|
UtecInterface.setPortChoice(currentPort);
|
||||||
bottomPanel.setEnabled(true);
|
bottomPanel.setEnabled(true);
|
||||||
//Notify the infoPane of the current port choice
|
//Notify the infoPane of the current port choice
|
||||||
//infoPane.setPort(currentPort);
|
//infoPane.setPort(currentPort);
|
||||||
|
@ -244,4 +318,9 @@ public class JutecGUI extends JFrame implements ActionListener{
|
||||||
application.setVisible(true);
|
application.setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mapRetrieved(UtecMapData theMap) {
|
||||||
|
System.out.println("Got a map from the utec:"+theMap.getMapName());
|
||||||
|
this.currentMap = theMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ package enginuity.logger.utec.gui.bottomControl;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import enginuity.logger.utec.commInterface.CommInterface;
|
import enginuity.logger.utec.commInterface.UtecInterface;
|
||||||
import enginuity.logger.utec.gui.JutecGUI;
|
import enginuity.logger.utec.gui.JutecGUI;
|
||||||
import enginuity.logger.utec.commEvent.*;
|
import enginuity.logger.utec.commEvent.*;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public class BottomUtecControl extends JPanel implements ActionListener, CommLis
|
||||||
this.add(utecOutTextScroll);
|
this.add(utecOutTextScroll);
|
||||||
|
|
||||||
//Make this panel listen for comm events
|
//Make this panel listen for comm events
|
||||||
CommInterface.addListener(this);
|
UtecInterface.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +111,7 @@ public class BottomUtecControl extends JPanel implements ActionListener, CommLis
|
||||||
|
|
||||||
//Open Port
|
//Open Port
|
||||||
if (cmd.equals("OPEN PORT")) {
|
if (cmd.equals("OPEN PORT")) {
|
||||||
System.out.println("Opening connection to defined port: "+CommInterface.getPortChoiceUsed());
|
System.out.println("Opening connection to defined port: "+UtecInterface.getPortChoiceUsed());
|
||||||
|
|
||||||
//Don't allow use after first press, and until after close port has been pressed
|
//Don't allow use after first press, and until after close port has been pressed
|
||||||
openButton.setEnabled(false);
|
openButton.setEnabled(false);
|
||||||
|
@ -120,7 +120,7 @@ public class BottomUtecControl extends JPanel implements ActionListener, CommLis
|
||||||
stopButton.setEnabled(false);
|
stopButton.setEnabled(false);
|
||||||
|
|
||||||
//Use interface to open connection
|
//Use interface to open connection
|
||||||
CommInterface.openConnection();
|
UtecInterface.openConnection();
|
||||||
|
|
||||||
//VoiceThread vc = new VoiceThread("open port");
|
//VoiceThread vc = new VoiceThread("open port");
|
||||||
//vc.start();
|
//vc.start();
|
||||||
|
@ -131,7 +131,7 @@ public class BottomUtecControl extends JPanel implements ActionListener, CommLis
|
||||||
System.out.println("Closing connection to defined port");
|
System.out.println("Closing connection to defined port");
|
||||||
|
|
||||||
//Use interface to close the connection to the Utec
|
//Use interface to close the connection to the Utec
|
||||||
CommInterface.closeConnection();
|
UtecInterface.closeConnection();
|
||||||
|
|
||||||
//Set button states
|
//Set button states
|
||||||
openButton.setEnabled(true);
|
openButton.setEnabled(true);
|
||||||
|
@ -148,7 +148,7 @@ public class BottomUtecControl extends JPanel implements ActionListener, CommLis
|
||||||
System.out.println("Starting data capture from the UTEC");
|
System.out.println("Starting data capture from the UTEC");
|
||||||
|
|
||||||
//Use interface to pull logging data from the Utec
|
//Use interface to pull logging data from the Utec
|
||||||
CommInterface.startDataLogFromUtec();
|
UtecInterface.startDataLogFromUtec();
|
||||||
|
|
||||||
//Set button states
|
//Set button states
|
||||||
startButton.setEnabled(false);
|
startButton.setEnabled(false);
|
||||||
|
@ -168,7 +168,7 @@ public class BottomUtecControl extends JPanel implements ActionListener, CommLis
|
||||||
System.out.println("Stopping data capture from the UTEC");
|
System.out.println("Stopping data capture from the UTEC");
|
||||||
|
|
||||||
//Use interface to reset the state of the Utec
|
//Use interface to reset the state of the Utec
|
||||||
CommInterface.resetUtec();
|
UtecInterface.resetUtec();
|
||||||
|
|
||||||
//Set button states
|
//Set button states
|
||||||
startButton.setEnabled(true);
|
startButton.setEnabled(true);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import javax.swing.*;
|
||||||
import enginuity.logger.utec.gui.bottomControl.*;
|
import enginuity.logger.utec.gui.bottomControl.*;
|
||||||
import enginuity.tts.VoiceThread;
|
import enginuity.tts.VoiceThread;
|
||||||
import enginuity.logger.utec.commEvent.*;
|
import enginuity.logger.utec.commEvent.*;
|
||||||
import enginuity.logger.utec.commInterface.CommInterface;
|
import enginuity.logger.utec.commInterface.UtecInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author botman
|
* @author botman
|
||||||
|
@ -37,7 +37,7 @@ public class RealTimeData extends JComponent implements CommListener{
|
||||||
|
|
||||||
//Constructor
|
//Constructor
|
||||||
public RealTimeData() {
|
public RealTimeData() {
|
||||||
CommInterface.addListener(this);
|
UtecInterface.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,7 @@ public class RealTimeData extends JComponent implements CommListener{
|
||||||
* @param portChoice
|
* @param portChoice
|
||||||
*/
|
*/
|
||||||
public void setPort(String portChoice) {
|
public void setPort(String portChoice) {
|
||||||
CommInterface.setPortChoice(portChoice);
|
UtecInterface.setPortChoice(portChoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void paint(Graphics g) {
|
public void paint(Graphics g) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package enginuity.logger.utec.mapData;
|
||||||
|
|
||||||
|
public interface GetMapFromUtecListener {
|
||||||
|
public void mapRetrieved(UtecMapData theMap);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package enginuity.logger.utec.mapData;
|
||||||
|
|
||||||
|
public interface SaveMapToUtecListener {
|
||||||
|
public void mapSaved(boolean isSaved);
|
||||||
|
}
|
|
@ -419,4 +419,38 @@ public class UtecMapData {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Misc getters and setters.
|
||||||
|
|
||||||
|
public double[][] getBoostMap() {
|
||||||
|
return boostMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoostMap(double[][] boostMap) {
|
||||||
|
this.boostMap = boostMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double[][] getFuelMap() {
|
||||||
|
return fuelMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFuelMap(double[][] fuelMap) {
|
||||||
|
this.fuelMap = fuelMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double[][] getTimingMap() {
|
||||||
|
return timingMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimingMap(double[][] timingMap) {
|
||||||
|
this.timingMap = timingMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMapComment() {
|
||||||
|
return mapComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMapName() {
|
||||||
|
return mapName;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue