Skip to content

Commit

Permalink
Formatting: all TAB characters changed to 4 spaces.
Browse files Browse the repository at this point in the history
Set Eclipse Editor defaults: Window > Preferences > General > Editors > Text Editors
Displayed Tab width: 4
Insert spaces for tabs: Checked
Show Print Margin: Checked
    Print margin column: 76 (no line in code should be longer than this value)
  • Loading branch information
dschultzca committed Jun 27, 2012
1 parent 2b816da commit fa92d5d
Show file tree
Hide file tree
Showing 131 changed files with 3,931 additions and 3,931 deletions.
102 changes: 51 additions & 51 deletions src/com/romraider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.Vector;

public class Settings implements Serializable {
private static final long serialVersionUID = 1026542922680475190L;

public static final String NEW_LINE = System.getProperty("line.separator");
Expand Down Expand Up @@ -114,13 +114,13 @@ public class Settings implements Serializable {
private ConnectionProperties loggerConnectionProperties;
private Map<String, EcuDefinition> loggerEcuDefinitionMap;
private Map<String, String> loggerPluginPorts;
private boolean loggerRefreshMode;
private byte loggerDestinationId = 0x10;
private boolean fastPoll = true;
private double loggerDividerLocation = 400;
private String loggerDebuggingLevel = "info";
private static String j2534Device;
private static String j2534Protocol = "ISO9141";
private boolean loggerRefreshMode;
private byte loggerDestinationId = 0x10;
private boolean fastPoll = true;
private double loggerDividerLocation = 400;
private String loggerDebuggingLevel = "info";
private static String j2534Device;
private static String j2534Protocol = "ISO9141";

private String tableClipboardFormat = DEFAULT_CLIPBOARD_FORMAT; // Currently 2 options. Default and Airboy. Custom is not hooked up.
private String tableHeader = DEFAULT_TABLE_HEADER;
Expand Down Expand Up @@ -491,68 +491,68 @@ public void setLoggerPluginPorts(Map<String, String> loggerPluginPorts) {
}

public void setLoggerParameterListState(boolean ShowListState) {
this.loggerParameterListState = ShowListState;
this.loggerParameterListState = ShowListState;
}

public boolean getLoggerParameterListState() {
return loggerParameterListState;
return loggerParameterListState;
}

public void setRefreshMode(boolean selected) {
this.loggerRefreshMode = selected;
}
public void setRefreshMode(boolean selected) {
this.loggerRefreshMode = selected;
}

public boolean getRefreshMode() {
return loggerRefreshMode;
public boolean getRefreshMode() {
return loggerRefreshMode;
}

public void setDestinationId(byte id) {
this.loggerDestinationId = id;
}
public void setDestinationId(byte id) {
this.loggerDestinationId = id;
}

public byte getDestinationId() {
return loggerDestinationId;
}
public byte getDestinationId() {
return loggerDestinationId;
}

public void setFastPoll(boolean state) {
this.fastPoll = state;
}
public void setFastPoll(boolean state) {
this.fastPoll = state;
}

public boolean isFastPoll() {
return fastPoll;
}
public boolean isFastPoll() {
return fastPoll;
}

public void setLogfileNameText(String text) {
this.logfileNameText = text;
}
public void setLogfileNameText(String text) {
this.logfileNameText = text;
}

public String getLogfileNameText() {
return logfileNameText;
}
public String getLogfileNameText() {
return logfileNameText;
}

public void setLoggerDebuggingLevel(String level) {
this.loggerDebuggingLevel = level;
}
public void setLoggerDebuggingLevel(String level) {
this.loggerDebuggingLevel = level;
}

public String getLoggerDebuggingLevel() {
return loggerDebuggingLevel;
}
public String getLoggerDebuggingLevel() {
return loggerDebuggingLevel;
}

public static void setJ2534Device(String j2534Device) {
Settings.j2534Device = j2534Device;
}
public static void setJ2534Device(String j2534Device) {
Settings.j2534Device = j2534Device;
}

public static String getJ2534Device() {
return j2534Device;
}
public static String getJ2534Device() {
return j2534Device;
}

public static void setJ2534Protocol(String j2534Protocol) {
Settings.j2534Protocol = j2534Protocol;
}
public static void setJ2534Protocol(String j2534Protocol) {
Settings.j2534Protocol = j2534Protocol;
}

public static String getJ2534Protocol() {
return j2534Protocol;
}
public static String getJ2534Protocol() {
return j2534Protocol;
}

public void setTableClipboardFormat(String formatString) {
this.tableClipboardFormat = formatString;
Expand Down
116 changes: 58 additions & 58 deletions src/com/romraider/io/connection/ConnectionManagerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,73 +41,73 @@ private ConnectionManagerFactory() {
}

public static ConnectionManager getManager(
String portName,
ConnectionProperties connectionProperties) {
String portName,
ConnectionProperties connectionProperties) {
ConnectionManager manager = manager(portName, connectionProperties);
if (ENABLE_TIMER) return proxy(manager, TimerWrapper.class);
return manager;
}

private static ConnectionManager manager(
String portName,
ConnectionProperties connectionProperties) {
try {
if (!isPlatform(WINDOWS))
throw new RuntimeException("J2534 is not support on this platform");
Set<J2534Library> libraries =
J2534DllLocator.listLibraries(
Settings.getJ2534Protocol().toUpperCase());
// if the J2534 device has not been previously defined, search for it
// else use the defined device
if (Settings.getJ2534Device() == null) {
for (J2534Library dll : libraries) {
LOGGER.info(String.format("Trying new J2534 %s connection: %s",
Settings.getJ2534Protocol(),
dll.getVendor()));
try {
Settings.setJ2534Device(dll.getLibrary());
return new J2534ConnectionManager(
connectionProperties,
dll.getLibrary());
}
catch (Throwable t) {
Settings.setJ2534Device(null);
LOGGER.info(String.format("%s is not available: %s",
dll.getVendor(), t.getMessage()));
}
}
}
else {
for (J2534Library dll : libraries) {
if (dll.getLibrary().toLowerCase().contains(
Settings.getJ2534Device().toLowerCase())) {
String portName,
ConnectionProperties connectionProperties) {
try {
if (!isPlatform(WINDOWS))
throw new RuntimeException("J2534 is not support on this platform");
Set<J2534Library> libraries =
J2534DllLocator.listLibraries(
Settings.getJ2534Protocol().toUpperCase());
// if the J2534 device has not been previously defined, search for it
// else use the defined device
if (Settings.getJ2534Device() == null) {
for (J2534Library dll : libraries) {
LOGGER.info(String.format("Trying new J2534 %s connection: %s",
Settings.getJ2534Protocol(),
dll.getVendor()));
try {
Settings.setJ2534Device(dll.getLibrary());
return new J2534ConnectionManager(
connectionProperties,
dll.getLibrary());
}
catch (Throwable t) {
Settings.setJ2534Device(null);
LOGGER.info(String.format("%s is not available: %s",
dll.getVendor(), t.getMessage()));
}
}
}
else {
for (J2534Library dll : libraries) {
if (dll.getLibrary().toLowerCase().contains(
Settings.getJ2534Device().toLowerCase())) {

LOGGER.info(String.format(
"Re-trying previous J2534 %s connection: %s",
Settings.getJ2534Protocol(),
dll.getVendor()));
try {
Settings.setJ2534Device(dll.getLibrary());
return new J2534ConnectionManager(
connectionProperties,
dll.getLibrary());
}
catch (Throwable t) {
Settings.setJ2534Device(null);
LOGGER.info(String.format("%s is not available: %s",
dll.getVendor(), t.getMessage()));
}
}
}
}
throw new RuntimeException("J2534 connection not available");
LOGGER.info(String.format(
"Re-trying previous J2534 %s connection: %s",
Settings.getJ2534Protocol(),
dll.getVendor()));
try {
Settings.setJ2534Device(dll.getLibrary());
return new J2534ConnectionManager(
connectionProperties,
dll.getLibrary());
}
catch (Throwable t) {
Settings.setJ2534Device(null);
LOGGER.info(String.format("%s is not available: %s",
dll.getVendor(), t.getMessage()));
}
}
}
}
throw new RuntimeException("J2534 connection not available");
} catch (Throwable t) {
Settings.setJ2534Device(null);
Settings.setJ2534Device(null);
LOGGER.info(String.format("%s, trying serial connection...",
t.getMessage()));
t.getMessage()));
return new SerialConnectionManager(portName, connectionProperties);
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/com/romraider/io/connection/ConnectionPropertiesImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ public int getSendTimeout() {
}

public String toString() {
final String properties = String.format(
"%s[baudRate=%d, dataBits=%d, stopBits=%d, parity=%d, " +
"connectTimeout=%d, sendTimeout=%d]",
getClass().getSimpleName(),
getBaudRate(),
getDataBits(),
getStopBits(),
getParity(),
getConnectTimeout(),
getSendTimeout()
);
final String properties = String.format(
"%s[baudRate=%d, dataBits=%d, stopBits=%d, parity=%d, " +
"connectTimeout=%d, sendTimeout=%d]",
getClass().getSimpleName(),
getBaudRate(),
getDataBits(),
getStopBits(),
getParity(),
getConnectTimeout(),
getSendTimeout()
);
return properties;
}
}
Loading

0 comments on commit fa92d5d

Please sign in to comment.