diff --git a/src/main/java/com/romraider/Version.java.template b/src/main/java/com/romraider/Version.java.template index 88732ede..d6d14460 100644 --- a/src/main/java/com/romraider/Version.java.template +++ b/src/main/java/com/romraider/Version.java.template @@ -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() { } diff --git a/src/main/java/com/romraider/logger/ecu/EcuLogger.java b/src/main/java/com/romraider/logger/ecu/EcuLogger.java index 74c088dd..32444eac 100644 --- a/src/main/java/com/romraider/logger/ecu/EcuLogger.java +++ b/src/main/java/com/romraider/logger/ecu/EcuLogger.java @@ -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>>(); private Map componentList = new HashMap(); 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( - "" + "Data" + "", + "Data", buildSplitPane( buildParamListPane( dataTabParamListTableModel, @@ -948,7 +911,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener { buildUnselectAllButton(), buildLtvButton()); addSplitPaneTab( - "" + "Graph" + "", + "Graph", buildSplitPane( buildParamListPane( graphTabParamListTableModel, @@ -958,7 +921,44 @@ public final class EcuLogger extends AbstractFrame implements MessageListener { buildUnselectAllButton(), buildLtvButton()); addSplitPaneTab( - "" + "Dashboard" + "", + "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( + "" + "Data" + "", + buildSplitPane( + buildParamListPane( + dataTabParamListTableModel, + dataTabSwitchListTableModel, + dataTabExternalListTableModel), + buildDataTab()), + buildUnselectAllButton(), + buildLtvButton()); + addSplitPaneTab( + "" + "Graph" + "", + buildSplitPane( + buildParamListPane( + graphTabParamListTableModel, + graphTabSwitchListTableModel, + graphTabExternalListTableModel), + buildGraphTab()), + buildUnselectAllButton(), + buildLtvButton()); + addSplitPaneTab( + "" + "Dashboard" + "", buildSplitPane( buildParamListPane( dashboardTabParamListTableModel, @@ -970,7 +970,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener { buildToggleGaugeStyleButton()); tabbedPane.add("" + "MAF"+ "", mafTab.getPanel()); tabbedPane.add("" + "Injector"+ "", injectorTab.getPanel()); - tabbedPane.add("" + "Dyno" + "", dynoTab.getPanel()); + tabbedPane.add("" + "Dyno" + "", 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("" + HEADING_PARAMETERS + "", paramList); + tabs.addTab("" + HEADING_PARAMETERS + "", paramList); tabs.addTab("" + HEADING_SWITCHES + "", switchList); - tabs.addTab("External Sensors", externalList); + tabs.addTab("External Sensors", 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("Reset Data"); + resetButton = new JButton("Reset Data"); } 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("Reset Data"); + resetButton = new JButton("Reset Data"); } 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("Reset Data"); + resetButton = new JButton("Reset Data"); } 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); diff --git a/src/main/java/com/romraider/logger/ecu/definition/xml/EcuDefinitionHandler.java b/src/main/java/com/romraider/logger/ecu/definition/xml/EcuDefinitionHandler.java index 99970369..d27bdf31 100644 --- a/src/main/java/com/romraider/logger/ecu/definition/xml/EcuDefinitionHandler.java +++ b/src/main/java/com/romraider/logger/ecu/definition/xml/EcuDefinitionHandler.java @@ -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"; diff --git a/src/main/java/com/romraider/logger/ecu/ui/CustomButtonGroup.java b/src/main/java/com/romraider/logger/ecu/ui/CustomButtonGroup.java index 138d3aa0..b80ce8bb 100644 --- a/src/main/java/com/romraider/logger/ecu/ui/CustomButtonGroup.java +++ b/src/main/java/com/romraider/logger/ecu/ui/CustomButtonGroup.java @@ -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(); + } + } } diff --git a/src/main/java/com/romraider/logger/ecu/ui/paramlist/UnitsComboBoxRenderer.java b/src/main/java/com/romraider/logger/ecu/ui/paramlist/UnitsComboBoxRenderer.java index 24cd5460..ff153f97 100644 --- a/src/main/java/com/romraider/logger/ecu/ui/paramlist/UnitsComboBoxRenderer.java +++ b/src/main/java/com/romraider/logger/ecu/ui/paramlist/UnitsComboBoxRenderer.java @@ -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, diff --git a/src/main/java/com/romraider/logger/external/txs/io/TxsRunner.java b/src/main/java/com/romraider/logger/external/txs/io/TxsRunner.java index f4813408..52f72bc2 100644 --- a/src/main/java/com/romraider/logger/external/txs/io/TxsRunner.java +++ b/src/main/java/com/romraider/logger/external/txs/io/TxsRunner.java @@ -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 dataItems; private final SerialConnection connection; - + private boolean stop; private String txsLogger; private String txsDevice; - + public TxsRunner( String port, ArrayList dataItems, @@ -58,66 +58,66 @@ public final class TxsRunner implements Stoppable{ this.txsLogger = logger; this.txsDevice = device; } - + public TxsRunner(ArrayList 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. diff --git a/src/main/java/com/romraider/logger/external/txs/plugin/TxsDataItem.java b/src/main/java/com/romraider/logger/external/txs/plugin/TxsDataItem.java index 471af88d..bbd7e634 100644 --- a/src/main/java/com/romraider/logger/external/txs/plugin/TxsDataItem.java +++ b/src/main/java/com/romraider/logger/external/txs/plugin/TxsDataItem.java @@ -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; } -} \ No newline at end of file +} diff --git a/src/main/java/com/romraider/util/SettingsManager.java b/src/main/java/com/romraider/util/SettingsManager.java index 9a2dd473..af980637 100644 --- a/src/main/java/com/romraider/util/SettingsManager.java +++ b/src/main/java/com/romraider/util/SettingsManager.java @@ -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;