Permalink
Browse files

Added support to reset the TCU. The reset target is selected via the …

…action bar Checkbox items ECU or TCU just like logging.

Added post-install scripts to move existing settings and profile backup to the new user directory.

git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@367 38686702-15cf-42e4-a595-3071df8bf5ea
  • Loading branch information...
1 parent de9210e commit ed3a7be42a2952562263e06d5de6b8d13e8a7e51 @dschultzca dschultzca committed Oct 28, 2011
View
12 post-install-tasks.bat
@@ -0,0 +1,12 @@
+@ECHO OFF
+IF NOT EXIST "%HOMEPATH%\.RomRaider" (
+ MKDIR "%HOMEPATH%\.RomRaider"
+)
+IF NOT EXIST "%HOMEPATH%\.RomRaider\settings.xml" (
+ IF EXIST %1\settings.xml (
+ MOVE /Y %1\settings.xml "%HOMEPATH%\.RomRaider\"
+ MOVE /Y %1\profile_backup.xml "%HOMEPATH%\.RomRaider\"
+ )
+)
+DEL /F %1\rr_system.log %1\romraider.log > NUL 2>&1
+EXIT 0
View
15 post-install-tasks.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+if [ ! -d "$HOME/.romraider" ]
+then
+ mkdir "$HOME/.romraider"
+fi
+if [ ! -e "$HOME/.romraider/settings.xml" ]
+then
+ if [ -e $1/settings.xml ]
+ then
+ mv -f $1/settings.xml "$HOME/.romraider/"
+ mv -f $1/profile_backup.xml "$HOME/.romraider/"
+ fi
+fi
+rm -f $1/rr_system.log $1/romraider.log > nul 2>&1
+exit 0
View
2 release_notes.txt
@@ -93,6 +93,8 @@ This is the first beta release of the upcoming official 0.5.4b release.
may show as a border rather than a fill.
- Moved settings.xml & profile_backup.xml to the /.RomRaider/ directory under the
users home directory.
+- Added support to reset the TCU. The reset target is selected via the action bar
+ Checkbox items ECU or TCU just like logging.
--- Editor ---
- Set JInternalFrame.isPalette in TableFarme.java so table titles are visible on
Mac OS.
View
5 run.bat
@@ -1 +1,4 @@
-start javaw -Djava.library.path=lib/windows -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -jar RomRaider.jar 1>>romraider_sout.log 2>&1
+rem start javaw -Djava.library.path=lib/windows -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -jar RomRaider.jar 1>>"%HOMEPATH%\.RomRaider\romraider_sout.log" 2>&1
+start javaw -Djava.library.path=lib/windows -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -jar RomRaider.jar
+rem start javaw -Djava.library.path=lib/windows -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -jar RomRaider.jar -logger.fullscreen
+rem start javaw -Djava.library.path=lib/windows -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -jar RomRaider.jar -logger
View
4 run.sh
@@ -5,6 +5,8 @@ if [ -z "$JAVA_HOME" ]; then
exit 1
fi
-$JAVA_HOME/bin/java -Djava.library.path=lib/linux -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -XX:-UseParallelGC -XX:CompileThreshold=10000 -jar RomRaider.jar >> romraider_sout.log 2>&1
+$JAVA_HOME/bin/java -Djava.library.path=lib/linux -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -XX:-UseParallelGC -XX:CompileThreshold=10000 -jar RomRaider.jar >> "$HOME/.romraider/romraider_sout.log" 2>&1
+#$JAVA_HOME/bin/java -Djava.library.path=lib/linux -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -XX:-UseParallelGC -XX:CompileThreshold=10000 -jar RomRaider.jar -logger >> "$HOME/.romraider/romraider_sout.log" 2>&1
+#$JAVA_HOME/bin/java -Djava.library.path=lib/linux -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=false -Xms64M -Xmx512M -XX:-UseParallelGC -XX:CompileThreshold=10000 -jar RomRaider.jar -logger.fullscreen >> "$HOME/.romraider/romraider_sout.log" 2>&1
exit 0
View
2 src/com/romraider/io/protocol/Protocol.java
@@ -43,7 +43,7 @@
EcuInit parseEcuInitResponse(byte[] processedResponse);
- byte[] constructEcuResetRequest();
+ byte[] constructEcuResetRequest(byte id);
void checkValidEcuResetResponse(byte[] processedResponse);
View
4 src/com/romraider/io/protocol/ssm/SSMProtocol.java
@@ -121,9 +121,11 @@ public EcuInit parseEcuInitResponse(byte[] processedResponse) {
return new SSMEcuInit(parseResponseData(processedResponse));
}
- public byte[] constructEcuResetRequest() {
+ public byte[] constructEcuResetRequest(byte id) {
// 80 10 F0 05 B8 00 00 60 40 DD
//FIXME: Create a buildWriteAddressRequest() method
+ checkNotNullOrEmpty(String.valueOf(id), "ECU_ID");
+ SSMProtocol.ECU_ID = id;
byte[] resetDataBytes = new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x60, (byte) 0x40};
return buildRequest(WRITE_ADDRESS_COMMAND, false, resetDataBytes);
}
View
7 src/com/romraider/logger/ecu/EcuLogger.java
@@ -986,7 +986,7 @@ private String buildEcuInfoLabelText(String label, String value) {
private JSplitPane buildSplitPane(JComponent leftComponent, JComponent rightComponent) {
splitPane = new JSplitPane(HORIZONTAL_SPLIT, leftComponent, rightComponent);
- splitPane.setDividerSize(2);
+ splitPane.setDividerSize(5);
splitPane.setDividerLocation((int) settings.getDividerLocation());
splitPane.addPropertyChangeListener(this);
return splitPane;
@@ -1186,6 +1186,10 @@ private void setTargetTcu() {
settings.setDestinationId(TCU_ID);
target = "TCU";
}
+
+ public String getTarget() {
+ return target;
+ }
public void restartLogging() {
stopLogging();
@@ -1341,6 +1345,7 @@ private void backupCurrentProfile() {
}
private void cleanUpUpdateHandlers() {
+ fileUpdateHandler.cleanUp();
dataHandlerManager.cleanUp();
graphHandlerManager.cleanUp();
dashboardHandlerManager.cleanUp();
View
2 src/com/romraider/logger/ecu/comms/io/connection/LoggerConnection.java
@@ -25,7 +25,7 @@
import java.util.Collection;
public interface LoggerConnection {
- void ecuReset();
+ void ecuReset(byte id);
void ecuInit(EcuInitCallback callback, byte id);
View
4 src/com/romraider/logger/ecu/comms/io/connection/SSMLoggerConnection.java
@@ -43,8 +43,8 @@ public SSMLoggerConnection(ConnectionManager manager) {
this.manager = manager;
}
- public void ecuReset() {
- byte[] request = protocol.constructEcuResetRequest();
+ public void ecuReset(byte id) {
+ byte[] request = protocol.constructEcuResetRequest(id);
LOGGER.debug("Ecu Reset Request ---> " + asHex(request));
byte[] response = manager.send(request, SEND_TIMEOUT);
byte[] processedResponse = protocol.preprocessResponse(request, response, new PollingStateImpl());
View
2 src/com/romraider/logger/ecu/comms/io/protocol/LoggerProtocol.java
@@ -28,7 +28,7 @@
byte[] constructEcuInitRequest(byte id);
- byte[] constructEcuResetRequest();
+ byte[] constructEcuResetRequest(byte id);
byte[] constructReadAddressRequest(byte id, Collection<EcuQuery> queries);
View
4 src/com/romraider/logger/ecu/comms/io/protocol/SSMLoggerProtocol.java
@@ -47,8 +47,8 @@
return protocol.constructEcuInitRequest(id);
}
- public byte[] constructEcuResetRequest() {
- return protocol.constructEcuResetRequest();
+ public byte[] constructEcuResetRequest(byte id) {
+ return protocol.constructEcuResetRequest(id);
}
public byte[] constructReadAddressRequest(byte id, Collection<EcuQuery> queries) {
View
12 src/com/romraider/logger/ecu/comms/reset/ResetManagerImpl.java
@@ -38,20 +38,22 @@ public ResetManagerImpl(Settings settings, MessageListener messageListener) {
}
public boolean resetEcu() {
+ String target = "ECU";
try {
LoggerConnection connection = getConnection(settings.getLoggerProtocol(), settings.getLoggerPort(),
settings.getLoggerConnectionProperties());
try {
- messageListener.reportMessage("Sending ECU Reset...");
- connection.ecuReset();
- messageListener.reportMessage("Sending ECU Reset...done.");
+ if (settings.getDestinationId() == 0x18) target = "TCU";
+ messageListener.reportMessage("Sending " + target + " Reset...");
+ connection.ecuReset(settings.getDestinationId());
+ messageListener.reportMessage("Sending " + target + " Reset...done.");
return true;
} finally {
connection.close();
}
} catch (Exception e) {
- messageListener.reportMessage("Unable to reset ecu - check correct serial port has been selected, cable is connected and ignition is on.");
- LOGGER.error("Error sending ecu reset", e);
+ messageListener.reportMessage("Unable to reset " + target + " - check correct serial port has been selected, cable is connected and ignition is on.");
+ LOGGER.error("Error sending " + target + " reset", e);
return false;
}
}
View
2 src/com/romraider/logger/ecu/ui/swing/menubar/EcuLoggerMenuBar.java
@@ -114,7 +114,7 @@ public EcuLoggerMenuBar(EcuLogger logger, List<ExternalDataSource> externalDataS
// tools menu items
JMenu toolsMenu = new Menu("Tools", VK_T);
- toolsMenu.add(new MenuItem("Reset ECU", new ResetEcuAction(logger), VK_R, getKeyStroke(VK_F7, 0)));
+ toolsMenu.add(new MenuItem("Reset ECU/TCU", new ResetEcuAction(logger), VK_R, getKeyStroke(VK_F7, 0)));
add(toolsMenu);
// plugins menu items
View
10 src/com/romraider/logger/ecu/ui/swing/menubar/action/ResetEcuAction.java
@@ -45,24 +45,24 @@ public void actionPerformed(ActionEvent actionEvent) {
}
private int showConfirmation() {
- return showConfirmDialog(logger, "Do you want to reset the ECU?", "Reset ECU", YES_NO_OPTION, WARNING_MESSAGE);
+ return showConfirmDialog(logger, "Do you want to reset the " + logger.getTarget() + "?", "Reset " + logger.getTarget(), YES_NO_OPTION, WARNING_MESSAGE);
}
private void resetEcu() {
if (doReset()) {
showMessageDialog(logger, "Reset Successful!\nTurn your ignition OFF and then\nback ON to complete the process.",
- "Reset ECU", INFORMATION_MESSAGE);
+ "Reset " + logger.getTarget(), INFORMATION_MESSAGE);
} else {
- showMessageDialog(logger, "Error performing ECU reset.\nCheck the following:\n* Correct COM port selected\n" +
- "* Cable is connected properly\n* Ignition is ON\n* Logger is stopped", "Reset ECU", ERROR_MESSAGE);
+ showMessageDialog(logger, "Error performing " + logger.getTarget() + " reset.\nCheck the following:\n* Correct COM port selected\n" +
+ "* Cable is connected properly\n* Ignition is ON\n* Logger is stopped", "Reset " + logger.getTarget(), ERROR_MESSAGE);
}
}
private boolean doReset() {
try {
return logger.resetEcu();
} catch (Exception e) {
- logger.reportError("Error performing ECU reset", e);
+ logger.reportError("Error performing " + logger.getTarget() + " reset", e);
return false;
}
}
View
2 src/com/romraider/logger/ecu/ui/tab/dyno/DynoControlPanel.java
@@ -1530,7 +1530,7 @@ private void loadCars() {
openURL(CARS_DEFS_URL);
} else {
showMessageDialog(parent, MISSING_CAR_DEF +
- " file from installation directory.", "Error", ERROR_MESSAGE);
+ " file from the installation directory.\nDyno feature will not be available until this file is present.", "Notice", WARNING_MESSAGE);
}
carTypeArr = new String[]{MISSING_CAR_DEF};
t.printStackTrace();
View
9 src/com/romraider/logger/external/innovate/generic/mts/io/MTSConnector.java
@@ -30,8 +30,8 @@
public final class MTSConnector {
private static final Logger LOGGER = getLogger(MTSConnector.class);
- private MTS mts;
- private int[] ports;
+ private static MTS mts;
+ private static int[] ports;
{
createMts();
}
@@ -42,7 +42,7 @@
* across all the found ports.
*/
public MTSConnector() {
- try {
+ try {
setMtsPorts();
}
catch (NullPointerException e){
@@ -73,10 +73,11 @@ public void dispose() {
private void createMts() {
// create mts interface
try {
- this.mts = createMTS();
+ mts = createMTS();
mts.disconnect();
}
catch (com4j.ExecutionException e) {
+ LOGGER.error("COM4J error creating MTS interface: " + e);
}
}
View
9 templates/install-linux.xml.template
@@ -49,6 +49,8 @@
<file src="logger.dtd" targetdir="$INSTALL_PATH"/>
<file src="profile.dtd" targetdir="$INSTALL_PATH"/>
+ <file src="post-install-tasks.sh" targetdir="$INSTALL_PATH"/>
+
<file src="plugins/aem.plugin" targetdir="$INSTALL_PATH/plugins"/>
<file src="plugins/aem2.plugin" targetdir="$INSTALL_PATH/plugins"/>
<file src="plugins/fourteenpoint7.plugin" targetdir="$INSTALL_PATH/plugins"/>
@@ -75,6 +77,13 @@
<exclude name="plugins/zt2.plugin"/>
</updatecheck>
+ <executable targetfile="$INSTALL_PATH/post-install-tasks.sh" stage="postinstall"
+ failure="abort" keep="false">
+ <args>
+ <arg value="$INSTALL_PATH" />
+ </args>
+ </executable>
+
</pack>
<pack name="Source Files" required="no">
View
9 templates/install-windows.xml.template
@@ -50,6 +50,8 @@
<file src="logger.dtd" targetdir="$INSTALL_PATH"/>
<file src="profile.dtd" targetdir="$INSTALL_PATH"/>
+ <file src="post-install-tasks.bat" targetdir="$INSTALL_PATH"/>
+
<file src="plugins/aem.plugin" targetdir="$INSTALL_PATH/plugins"/>
<file src="plugins/aem2.plugin" targetdir="$INSTALL_PATH/plugins"/>
<file src="plugins/fourteenpoint7.plugin" targetdir="$INSTALL_PATH/plugins"/>
@@ -78,6 +80,13 @@
<exclude name="plugins/zt2.plugin"/>
</updatecheck>
+ <executable targetfile="$INSTALL_PATH/post-install-tasks.bat" stage="postinstall"
+ failure="abort" keep="false">
+ <args>
+ <arg value="$INSTALL_PATH" />
+ </args>
+ </executable>
+
</pack>
<pack name="Source Files" required="no">

0 comments on commit ed3a7be

Please sign in to comment.