mirror of https://github.com/rusefi/RomRaider.git
White space cleanup
This commit is contained in:
parent
df69468c6c
commit
c15754e246
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2013 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -24,17 +24,17 @@ package com.romraider;
|
|||
import javax.swing.ImageIcon;
|
||||
|
||||
public final class Version {
|
||||
public static final String PRODUCT_NAME = "@name.package@";
|
||||
public static final String VERSION = "@version.major@.@version.minor@.@version.patch@ @version.extra@ @version.extra1@";
|
||||
public static final String BUILDNUMBER = "@version.buildnumber@";
|
||||
public static final String SUPPORT_URL = "@supporturl@";
|
||||
public static final String ROM_REVISION_URL = "@romrevisionurl@";
|
||||
public static final String ECU_DEFS_URL = "@ecudefsurl@";
|
||||
public static final String LOGGER_DEFS_URL = "@loggerdefsurl@";
|
||||
public static final String CARS_DEFS_URL = "@carsdefsurl@";
|
||||
public static final String RELEASE_NOTES = "@release_notes@";
|
||||
public static final ImageIcon ABOUT_ICON = new ImageIcon(Version.class.getClass().getResource("/graphics/romraider-ico-large.gif"));
|
||||
public static final int MIN_LOG_DEF_VERSION = @min.logger.def.version@;
|
||||
public static final String PRODUCT_NAME = "@name.package@";
|
||||
public static final String VERSION = "@version.major@.@version.minor@.@version.patch@ @version.extra@ @version.extra1@";
|
||||
public static final String BUILDNUMBER = "@version.buildnumber@";
|
||||
public static final String SUPPORT_URL = "@supporturl@";
|
||||
public static final String ROM_REVISION_URL = "@romrevisionurl@";
|
||||
public static final String ECU_DEFS_URL = "@ecudefsurl@";
|
||||
public static final String LOGGER_DEFS_URL = "@loggerdefsurl@";
|
||||
public static final String CARS_DEFS_URL = "@carsdefsurl@";
|
||||
public static final String RELEASE_NOTES = "@release_notes@";
|
||||
public static final ImageIcon ABOUT_ICON = new ImageIcon(Version.class.getClass().getResource("/graphics/romraider-ico-large.gif"));
|
||||
public static final int MIN_LOG_DEF_VERSION = @min.logger.def.version@;
|
||||
|
||||
private Version() {
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
private static final String LOG_TO_FILE_ICON = "/graphics/logger_log_to_file.png";
|
||||
private static final String LOG_TO_FILE_START = "Start file log";
|
||||
private static final String LOG_TO_FILE_STOP = "Stop file log";
|
||||
private static final String LOG_TO_FILE_TT_TEXT = "Start/stop file logging (F1)";
|
||||
private static final String LOG_TO_FILE_TT_TEXT = "Start/stop file logging (F1)";
|
||||
private static String target = "ECU";
|
||||
private static String loadResult = "";
|
||||
private String defVersion;
|
||||
|
@ -286,7 +286,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
new HashMap<String, Map<Transport, Collection<Module>>>();
|
||||
private Map<String, Object> componentList = new HashMap<String, Object>();
|
||||
private static boolean touchEnabled = false;
|
||||
|
||||
|
||||
public EcuLogger() {
|
||||
super(ECU_LOGGER_TITLE);
|
||||
construct();
|
||||
|
@ -303,11 +303,11 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
// fail until we actually try to use them since the logger requires
|
||||
// these libraries, this is a hard error here
|
||||
if (!JREChecker.is32bit()) {
|
||||
showMessageDialog(null,
|
||||
showMessageDialog(null,
|
||||
"Incompatible JRE detected.\n" +
|
||||
PRODUCT_NAME +
|
||||
" RomRaider Logger requires a 32-bit JRE.\nLogger will now exit.",
|
||||
"JRE Incompatibility Error",
|
||||
" RomRaider Logger requires a 32-bit JRE.\nLogger will now exit.",
|
||||
"JRE Incompatibility Error",
|
||||
ERROR_MESSAGE);
|
||||
// this will generate a NullPointerException because we never got
|
||||
// things started
|
||||
|
@ -897,48 +897,11 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
dashboardHandlerManager.addHandler(TableUpdateHandler.getInstance());
|
||||
}
|
||||
|
||||
private JComponent buildTabbedPane() {
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
addSplitPaneTab(
|
||||
"Data",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
dataTabParamListTableModel,
|
||||
dataTabSwitchListTableModel,
|
||||
dataTabExternalListTableModel),
|
||||
buildDataTab()),
|
||||
buildUnselectAllButton(),
|
||||
buildLtvButton());
|
||||
addSplitPaneTab(
|
||||
"Graph",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
graphTabParamListTableModel,
|
||||
graphTabSwitchListTableModel,
|
||||
graphTabExternalListTableModel),
|
||||
buildGraphTab()),
|
||||
buildUnselectAllButton(),
|
||||
buildLtvButton());
|
||||
addSplitPaneTab(
|
||||
"Dashboard",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
dashboardTabParamListTableModel,
|
||||
dashboardTabSwitchListTableModel,
|
||||
dashboardTabExternalListTableModel),
|
||||
buildDashboardTab()),
|
||||
buildUnselectAllButton(),
|
||||
buildLtvButton(),
|
||||
buildToggleGaugeStyleButton());
|
||||
tabbedPane.add("MAF", mafTab.getPanel());
|
||||
tabbedPane.add("Injector", injectorTab.getPanel());
|
||||
tabbedPane.add("Dyno", dynoTab.getPanel());
|
||||
}
|
||||
else
|
||||
{
|
||||
private JComponent buildTabbedPane() {
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
addSplitPaneTab(
|
||||
"<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Data" + "</body></html>",
|
||||
"Data",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
dataTabParamListTableModel,
|
||||
|
@ -948,7 +911,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
buildUnselectAllButton(),
|
||||
buildLtvButton());
|
||||
addSplitPaneTab(
|
||||
"<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Graph" + "</body></html>",
|
||||
"Graph",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
graphTabParamListTableModel,
|
||||
|
@ -958,7 +921,44 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
buildUnselectAllButton(),
|
||||
buildLtvButton());
|
||||
addSplitPaneTab(
|
||||
"<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Dashboard" + "</body></html>",
|
||||
"Dashboard",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
dashboardTabParamListTableModel,
|
||||
dashboardTabSwitchListTableModel,
|
||||
dashboardTabExternalListTableModel),
|
||||
buildDashboardTab()),
|
||||
buildUnselectAllButton(),
|
||||
buildLtvButton(),
|
||||
buildToggleGaugeStyleButton());
|
||||
tabbedPane.add("MAF", mafTab.getPanel());
|
||||
tabbedPane.add("Injector", injectorTab.getPanel());
|
||||
tabbedPane.add("Dyno", dynoTab.getPanel());
|
||||
}
|
||||
else
|
||||
{
|
||||
addSplitPaneTab(
|
||||
"<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Data" + "</body></html>",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
dataTabParamListTableModel,
|
||||
dataTabSwitchListTableModel,
|
||||
dataTabExternalListTableModel),
|
||||
buildDataTab()),
|
||||
buildUnselectAllButton(),
|
||||
buildLtvButton());
|
||||
addSplitPaneTab(
|
||||
"<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Graph" + "</body></html>",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
graphTabParamListTableModel,
|
||||
graphTabSwitchListTableModel,
|
||||
graphTabExternalListTableModel),
|
||||
buildGraphTab()),
|
||||
buildUnselectAllButton(),
|
||||
buildLtvButton());
|
||||
addSplitPaneTab(
|
||||
"<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Dashboard" + "</body></html>",
|
||||
buildSplitPane(
|
||||
buildParamListPane(
|
||||
dashboardTabParamListTableModel,
|
||||
|
@ -970,7 +970,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
buildToggleGaugeStyleButton());
|
||||
tabbedPane.add("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "MAF"+ "</body></html>", mafTab.getPanel());
|
||||
tabbedPane.add("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Injector"+ "</body></html>", injectorTab.getPanel());
|
||||
tabbedPane.add("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Dyno" + "</body></html>", dynoTab.getPanel());
|
||||
tabbedPane.add("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + "Dyno" + "</body></html>", dynoTab.getPanel());
|
||||
}
|
||||
return tabbedPane;
|
||||
}
|
||||
|
@ -1083,7 +1083,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
}
|
||||
else
|
||||
{
|
||||
button.setPreferredSize(new Dimension(56, 60));
|
||||
button.setPreferredSize(new Dimension(56, 60));
|
||||
}
|
||||
button.addActionListener(new LearningTableValuesAction(this));
|
||||
return button;
|
||||
|
@ -1102,7 +1102,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
}
|
||||
else
|
||||
{
|
||||
toggleListButton.setPreferredSize(new Dimension(56, 95));
|
||||
toggleListButton.setPreferredSize(new Dimension(56, 95));
|
||||
}
|
||||
toggleListButton.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(getKeyStroke("F11"), "toggleHideParams");
|
||||
toggleListButton.getActionMap().put("toggleHideParams", new AbstractAction() {
|
||||
|
@ -1140,11 +1140,11 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
JPanel tabControlPanel = new JPanel(new BetterFlowLayout(FlowLayout.CENTER, 1, 1));
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
tabControlPanel.setPreferredSize(new Dimension(25, 25));
|
||||
tabControlPanel.setPreferredSize(new Dimension(25, 25));
|
||||
}
|
||||
else
|
||||
{
|
||||
tabControlPanel.setPreferredSize(new Dimension(56, 25));
|
||||
tabControlPanel.setPreferredSize(new Dimension(56, 25));
|
||||
}
|
||||
tabControlPanel.add(toggleListButton);
|
||||
for (JComponent control : extraControls) tabControlPanel.add(control);
|
||||
|
@ -1161,33 +1161,33 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
JScrollPane externalList = new JScrollPane(buildParamListTable(externalListTableModel), VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
JScrollPane switchList = new JScrollPane(buildParamListTable(switchListTableModel), VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
|
||||
|
||||
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
tabs.addTab(HEADING_PARAMETERS, paramList);
|
||||
tabs.addTab(HEADING_SWITCHES, switchList);
|
||||
tabs.addTab("External Sensors", externalList);
|
||||
tabs.addTab(HEADING_PARAMETERS, paramList);
|
||||
tabs.addTab(HEADING_SWITCHES, switchList);
|
||||
tabs.addTab("External Sensors", externalList);
|
||||
}
|
||||
else
|
||||
{
|
||||
tabs.addTab("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + HEADING_PARAMETERS + "</body></html>", paramList);
|
||||
tabs.addTab("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + HEADING_PARAMETERS + "</body></html>", paramList);
|
||||
tabs.addTab("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>" + HEADING_SWITCHES + "</body></html>", switchList);
|
||||
tabs.addTab("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>External Sensors</body></html>", externalList);
|
||||
tabs.addTab("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>External Sensors</body></html>", externalList);
|
||||
}
|
||||
return tabs;
|
||||
}
|
||||
|
||||
private JTable buildParamListTable(ParameterListTableModel tableModel) {
|
||||
JTable paramListTable = new ParameterListTable(tableModel);
|
||||
|
||||
|
||||
if( touchEnabled == false)
|
||||
{
|
||||
changeColumnWidth(paramListTable, 0, 20, 55, 55);
|
||||
changeColumnWidth(paramListTable, 2, 50, 250, 130);
|
||||
changeColumnWidth(paramListTable, 0, 20, 55, 55);
|
||||
changeColumnWidth(paramListTable, 2, 50, 250, 130);
|
||||
}
|
||||
else
|
||||
{
|
||||
changeColumnWidth(paramListTable, 0, 20, 75, 75);
|
||||
changeColumnWidth(paramListTable, 0, 20, 75, 75);
|
||||
changeColumnWidth(paramListTable, 2, 50, 75, 75);
|
||||
}
|
||||
return paramListTable;
|
||||
|
@ -1253,14 +1253,14 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
private JSplitPane buildSplitPane(JComponent leftComponent, JComponent rightComponent) {
|
||||
splitPane = new JSplitPane(HORIZONTAL_SPLIT, leftComponent, rightComponent);
|
||||
splitPane.setDividerSize(5);
|
||||
|
||||
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
splitPane.setDividerLocation((int) getSettings().getDividerLocation());
|
||||
splitPane.setDividerLocation((int) getSettings().getDividerLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
splitPane.setDividerLocation((int) getSettings().getDividerLocation()+200);
|
||||
splitPane.setDividerLocation((int) getSettings().getDividerLocation()+200);
|
||||
}
|
||||
splitPane.addPropertyChangeListener(this);
|
||||
return splitPane;
|
||||
|
@ -1272,12 +1272,12 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
|
||||
private JPanel buildControlToolbar() {
|
||||
JPanel controlPanel = new JPanel(new BorderLayout());
|
||||
|
||||
|
||||
if (touchEnabled == true)
|
||||
{
|
||||
portsComboBox.setPreferredSize(new Dimension(100,50));
|
||||
portsComboBox.setPreferredSize(new Dimension(100,50));
|
||||
}
|
||||
|
||||
|
||||
controlPanel.add(buildPortsComboBox(), WEST);
|
||||
//TODO: Finish log playback stuff...
|
||||
// controlPanel.add(buildPlaybackControls(), CENTER);
|
||||
|
@ -1419,14 +1419,14 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
JPanel comboBoxPanel = new JPanel(new FlowLayout());
|
||||
comboBoxPanel.add(new JLabel("COM Port:"));
|
||||
comboBoxPanel.add(portsComboBox);
|
||||
|
||||
|
||||
final CustomButtonGroup moduleGroup = new CustomButtonGroup();
|
||||
for (Module module : getModuleList()) {
|
||||
final JCheckBox cb = new JCheckBox(module.getName().toUpperCase());
|
||||
if (touchEnabled == true)
|
||||
{
|
||||
cb.setPreferredSize(new Dimension(75, 50));
|
||||
}
|
||||
if (touchEnabled == true)
|
||||
{
|
||||
cb.setPreferredSize(new Dimension(75, 50));
|
||||
}
|
||||
final String tipText = String.format(
|
||||
"%s Polling. Uncheck all boxes for Externals logging only.",
|
||||
module.getDescription());
|
||||
|
@ -1459,11 +1459,11 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
componentList.put("reconnectButton", reconnectButton);
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
reconnectButton.setPreferredSize(new Dimension(25, 25));
|
||||
reconnectButton.setPreferredSize(new Dimension(25, 25));
|
||||
}
|
||||
else
|
||||
{
|
||||
reconnectButton.setPreferredSize(new Dimension(75, 50));
|
||||
reconnectButton.setPreferredSize(new Dimension(75, 50));
|
||||
}
|
||||
reconnectButton.setToolTipText("Reconnect to " + target);
|
||||
reconnectButton.addActionListener(new ActionListener() {
|
||||
|
@ -1481,13 +1481,13 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
componentList.put("disconnectButton", disconnectButton);
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
disconnectButton.setPreferredSize(new Dimension(25, 25));
|
||||
disconnectButton.setPreferredSize(new Dimension(25, 25));
|
||||
}
|
||||
else
|
||||
{
|
||||
disconnectButton.setPreferredSize(new Dimension(75, 50));
|
||||
disconnectButton.setPreferredSize(new Dimension(75, 50));
|
||||
}
|
||||
|
||||
|
||||
disconnectButton.setToolTipText("Disconnect from " + target);
|
||||
disconnectButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -1599,14 +1599,14 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
private JComponent buildDataTab() {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
JButton resetButton;
|
||||
|
||||
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
resetButton = new JButton("Reset Data");
|
||||
resetButton = new JButton("Reset Data");
|
||||
}
|
||||
else
|
||||
{
|
||||
resetButton = new JButton("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>Reset Data</body></html>");
|
||||
resetButton = new JButton("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>Reset Data</body></html>");
|
||||
}
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -1624,14 +1624,14 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
private JComponent buildGraphTab() {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
JButton resetButton;
|
||||
|
||||
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
resetButton = new JButton("Reset Data");
|
||||
resetButton = new JButton("Reset Data");
|
||||
}
|
||||
else
|
||||
{
|
||||
resetButton = new JButton("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>Reset Data</body></html>");
|
||||
resetButton = new JButton("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>Reset Data</body></html>");
|
||||
}
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -1649,14 +1649,14 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
private JComponent buildDashboardTab() {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
JButton resetButton;
|
||||
|
||||
|
||||
if (touchEnabled == false)
|
||||
{
|
||||
resetButton = new JButton("Reset Data");
|
||||
resetButton = new JButton("Reset Data");
|
||||
}
|
||||
else
|
||||
{
|
||||
resetButton = new JButton("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>Reset Data</body></html>");
|
||||
resetButton = new JButton("<html><body leftmargin=15 topmargin=15 marginwidth=15 marginheight=15>Reset Data</body></html>");
|
||||
}
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
@ -1772,7 +1772,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
getSettings().getLoggerEcuDefinitionMap(),
|
||||
ecuInit.getEcuId());
|
||||
final LearningTableValues learningTablesManager =
|
||||
LearningTableValuesFactory.getManager(
|
||||
LearningTableValuesFactory.getManager(
|
||||
getSettings().getLoggerProtocol());
|
||||
learningTablesManager.init(
|
||||
this,
|
||||
|
@ -1926,13 +1926,13 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
|
||||
public static boolean isTouchEnabled()
|
||||
{
|
||||
if( touchEnabled == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if( touchEnabled == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setRefreshMode(boolean refreshMode) {
|
||||
getSettings().setRefreshMode(refreshMode);
|
||||
refresher.setRefreshMode(refreshMode);
|
||||
|
@ -1969,8 +1969,8 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
}
|
||||
|
||||
public static void startLogger(int defaultCloseOperation, String... args) {
|
||||
touchEnabled = setTouchEnabled(args);
|
||||
EcuLogger ecuLogger = new EcuLogger();
|
||||
touchEnabled = setTouchEnabled(args);
|
||||
EcuLogger ecuLogger = new EcuLogger();
|
||||
boolean fullscreen = containsFullScreenArg(args);
|
||||
|
||||
createAndShowGui(defaultCloseOperation, ecuLogger, fullscreen);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2013 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -45,7 +45,7 @@ import java.util.Map;
|
|||
*/
|
||||
public final class EcuDefinitionHandler extends DefaultHandler {
|
||||
private static final Logger LOGGER = Logger.getLogger(EcuDefinitionHandler.class);
|
||||
private static final String TAG_ROM = "rom";
|
||||
private static final String TAG_ROM = "rom";
|
||||
private static final String TAG_ROMID = "romid";
|
||||
private static final String TAG_CALID = "internalidstring";
|
||||
private static final String TAG_ECUID = "ecuid";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2014 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -26,21 +26,21 @@ import javax.swing.ButtonModel;
|
|||
* Custom ButtonGroup allows none or only one button in the group to be selected.
|
||||
*/
|
||||
public class CustomButtonGroup extends ButtonGroup {
|
||||
private static final long serialVersionUID = 3271988244802054464L;
|
||||
private static final long serialVersionUID = 3271988244802054464L;
|
||||
|
||||
/**
|
||||
* Sets the selected value for the ButtonModel.
|
||||
* Only one button in the group may be selected at a time but this
|
||||
* override allows a selected button to be un-selected so none in the group
|
||||
* are selected.
|
||||
*/
|
||||
@Override
|
||||
public void setSelected(ButtonModel m, boolean b) {
|
||||
if (b && m != null && m != getSelection()) {
|
||||
super.setSelected(m, b);
|
||||
}
|
||||
else if (!b && m == getSelection()) {
|
||||
clearSelection();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the selected value for the ButtonModel.
|
||||
* Only one button in the group may be selected at a time but this
|
||||
* override allows a selected button to be un-selected so none in the group
|
||||
* are selected.
|
||||
*/
|
||||
@Override
|
||||
public void setSelected(ButtonModel m, boolean b) {
|
||||
if (b && m != null && m != getSelection()) {
|
||||
super.setSelected(m, b);
|
||||
}
|
||||
else if (!b && m == getSelection()) {
|
||||
clearSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2012 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -60,9 +60,9 @@ public final class UnitsComboBoxRenderer extends JComboBox implements TableCellR
|
|||
|
||||
class FontCellRenderer extends DefaultListCellRenderer {
|
||||
|
||||
private static final long serialVersionUID = 5963151264549169227L;
|
||||
private static final long serialVersionUID = 5963151264549169227L;
|
||||
|
||||
public Component getListCellRendererComponent(
|
||||
public Component getListCellRendererComponent(
|
||||
JList list,
|
||||
Object value,
|
||||
int index,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2012 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -33,21 +33,21 @@ import com.romraider.logger.external.core.Stoppable;
|
|||
import com.romraider.logger.external.txs.plugin.TxsDataItem;
|
||||
|
||||
public final class TxsRunner implements Stoppable{
|
||||
|
||||
|
||||
private static final Logger LOGGER = getLogger(TxsRunner.class);
|
||||
private static final ConnectionProperties CONNECTION_PROPS =
|
||||
new TxsConnectionProperties();
|
||||
private static final String WHITESPACE_REGEX = "\\s+";
|
||||
private static final String SPLIT_DELIMITER = " ";
|
||||
private static final byte[] EXIT = new byte[]{24};
|
||||
|
||||
|
||||
private final ArrayList<TxsDataItem> dataItems;
|
||||
private final SerialConnection connection;
|
||||
|
||||
|
||||
private boolean stop;
|
||||
private String txsLogger;
|
||||
private String txsDevice;
|
||||
|
||||
|
||||
public TxsRunner(
|
||||
String port,
|
||||
ArrayList<TxsDataItem> dataItems,
|
||||
|
@ -58,66 +58,66 @@ public final class TxsRunner implements Stoppable{
|
|||
this.txsLogger = logger;
|
||||
this.txsDevice = device;
|
||||
}
|
||||
|
||||
|
||||
public TxsRunner(ArrayList<TxsDataItem> dataItems)
|
||||
{
|
||||
this.connection = null;
|
||||
this.dataItems = dataItems;
|
||||
this.connection = null;
|
||||
this.dataItems = dataItems;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
LOGGER.trace("TXS Runner Begin.");
|
||||
|
||||
|
||||
LOGGER.trace("TXS Runner Begin.");
|
||||
|
||||
//Convert string into bytes[]
|
||||
byte[] device = txsDevice.getBytes();
|
||||
byte[] logger = this.txsLogger.getBytes();
|
||||
|
||||
LOGGER.trace("TXS Runner Send Exit to Main Screen.");
|
||||
|
||||
|
||||
//Exit to main screen
|
||||
connection.write(EXIT);
|
||||
|
||||
|
||||
LOGGER.trace("TXS Runner Sleep 250 ms to exit to main.");
|
||||
//wait for exit to complete.
|
||||
Thread.sleep(250L);
|
||||
|
||||
|
||||
LOGGER.trace("TXS Runner Readline 1.");
|
||||
String response = connection.readLine();
|
||||
|
||||
|
||||
if(response != null && response.trim().isEmpty() == false)
|
||||
{
|
||||
LOGGER.trace("TXS Runner Readline 1 Response: "+ response);
|
||||
LOGGER.trace("TXS Runner Readline 1 Response: "+ response);
|
||||
}
|
||||
|
||||
LOGGER.trace("TXS Runner Switching to Device. " + txsDevice);
|
||||
//Send command to switch device: utec / tuner.
|
||||
connection.write(device);
|
||||
|
||||
|
||||
//Read and Trace response switching device.
|
||||
response = connection.readLine();
|
||||
|
||||
|
||||
if(response != null && response.trim().isEmpty() == false)
|
||||
{
|
||||
LOGGER.trace("TXS Runner Readline 2 Response: "+ response);
|
||||
LOGGER.trace("TXS Runner Readline 2 Response: "+ response);
|
||||
}
|
||||
|
||||
|
||||
LOGGER.trace("TXS Runner Start Logger.");
|
||||
|
||||
|
||||
//Start device logger
|
||||
connection.write(logger);
|
||||
|
||||
|
||||
while (!stop) {
|
||||
//Get Response from TXS Device
|
||||
response = connection.readLine();
|
||||
connection.write(logger);
|
||||
|
||||
|
||||
//Continue if no data was received.
|
||||
if (isNullOrEmpty(response)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//Trace response
|
||||
LOGGER.trace("TXS Runner Response: " + response);
|
||||
//Split Values for parsing
|
||||
|
@ -138,7 +138,7 @@ public final class TxsRunner implements Stoppable{
|
|||
public void stop() {
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
String[] SplitUtecString(String value) {
|
||||
try {
|
||||
value = value.trim();
|
||||
|
@ -150,27 +150,27 @@ public final class TxsRunner implements Stoppable{
|
|||
return new String[]{};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetDataItemValues(String[] values) {
|
||||
for (TxsDataItem dataItem : dataItems)
|
||||
{
|
||||
if(dataItem != null)
|
||||
{
|
||||
//Set value to dataItem
|
||||
if(values.length <= dataItem.getItemIndex())
|
||||
{
|
||||
LOGGER.trace("TXS DataItem: " + dataItem.getName() + " Index requested: " + dataItem.getItemIndex() + " TXS data size: " + values.length);
|
||||
dataItem.setData(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.trace("TXS Setting DataItem: " + dataItem.getName());
|
||||
dataItem.setData(parseDouble(values[dataItem.getItemIndex()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (TxsDataItem dataItem : dataItems)
|
||||
{
|
||||
if(dataItem != null)
|
||||
{
|
||||
//Set value to dataItem
|
||||
if(values.length <= dataItem.getItemIndex())
|
||||
{
|
||||
LOGGER.trace("TXS DataItem: " + dataItem.getName() + " Index requested: " + dataItem.getItemIndex() + " TXS data size: " + values.length);
|
||||
dataItem.setData(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.trace("TXS Setting DataItem: " + dataItem.getName());
|
||||
dataItem.setData(parseDouble(values[dataItem.getItemIndex()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private double parseDouble(String value) {
|
||||
try {
|
||||
//try to parse value.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2012 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -41,9 +41,9 @@ public final class TxsDataItem implements ExternalDataItem, DataListener {
|
|||
}
|
||||
|
||||
public int getItemIndex(){
|
||||
return itemIndex;
|
||||
return itemIndex;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -63,4 +63,4 @@ public final class TxsDataItem implements ExternalDataItem, DataListener {
|
|||
public EcuDataConvertor[] getConvertors() {
|
||||
return convertors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||
* Copyright (C) 2006-2014 RomRaider.com
|
||||
* Copyright (C) 2006-2015 RomRaider.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -64,7 +64,7 @@ public class SettingsManager {
|
|||
else {
|
||||
sf = new File(USER_HOME + SETTINGS_FILE);
|
||||
settingsFileIn = new FileInputStream(sf);
|
||||
}
|
||||
}
|
||||
|
||||
final InputSource src = new InputSource(settingsFileIn);
|
||||
final DOMSettingsUnmarshaller domUms = new DOMSettingsUnmarshaller();
|
||||
|
@ -91,7 +91,7 @@ public class SettingsManager {
|
|||
final DOMSettingsBuilder builder = new DOMSettingsBuilder();
|
||||
try {
|
||||
final File newDir = new File(settingsDir);
|
||||
newDir.mkdir(); // Creates directory if it does not exist
|
||||
newDir.mkdir(); // Creates directory if it does not exist
|
||||
final File sf = new File(settingsDir + SETTINGS_FILE);
|
||||
builder.buildSettings(newSettings, sf, progress, VERSION);
|
||||
settings = newSettings;
|
||||
|
|
Loading…
Reference in New Issue