refactor external sensor plugins; add mrf stealth gauge support

git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@286 38686702-15cf-42e4-a595-3071df8bf5ea
This commit is contained in:
kascade 2010-05-23 10:55:39 +00:00
parent fb6d1ccc61
commit f9f626b5f1
85 changed files with 471 additions and 334 deletions

View File

@ -1 +1 @@
datasource.class=com.romraider.logger.aem.plugin.AemDataSource
datasource.class=com.romraider.logger.external.aem.plugin.AemDataSource

View File

@ -1 +1 @@
datasource.class=com.romraider.logger.fourteenpoint7.plugin.NawDataSource
datasource.class=com.romraider.logger.external.fourteenpoint7.plugin.NawDataSource

View File

@ -1 +1 @@
datasource.class=com.romraider.logger.innovate.generic.serial.plugin.InnovateDataSource
datasource.class=com.romraider.logger.external.innovate.generic.serial.plugin.InnovateDataSource

View File

@ -1 +1 @@
datasource.class=com.romraider.logger.innovate.lm2.mts.plugin.Lm2MtsDataSource
datasource.class=com.romraider.logger.external.innovate.lm2.mts.plugin.Lm2MtsDataSource

1
plugins/mrf.plugin Normal file
View File

@ -0,0 +1 @@
datasource.class=com.romraider.logger.external.mrf.plugin.MrfDataSource

View File

@ -1 +1 @@
datasource.class=com.romraider.logger.plx.plugin.PlxDataSource
datasource.class=com.romraider.logger.external.plx.plugin.PlxDataSource

View File

@ -1 +1 @@
datasource.class=com.romraider.logger.zt2.plugin.ZT2DataSource
datasource.class=com.romraider.logger.external.zt2.plugin.ZT2DataSource

View File

@ -41,10 +41,6 @@ import com.romraider.logger.ecu.definition.ExternalData;
import com.romraider.logger.ecu.definition.ExternalDataImpl;
import com.romraider.logger.ecu.definition.LoggerData;
import com.romraider.logger.ecu.exception.PortNotFoundException;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.ecu.external.ExternalDataSourceLoader;
import com.romraider.logger.ecu.external.ExternalDataSourceLoaderImpl;
import com.romraider.logger.ecu.profile.UserProfile;
import com.romraider.logger.ecu.profile.UserProfileImpl;
import com.romraider.logger.ecu.profile.UserProfileItem;
@ -87,6 +83,10 @@ import com.romraider.logger.ecu.ui.tab.injector.InjectorTab;
import com.romraider.logger.ecu.ui.tab.injector.InjectorTabImpl;
import com.romraider.logger.ecu.ui.tab.maf.MafTab;
import com.romraider.logger.ecu.ui.tab.maf.MafTabImpl;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.core.ExternalDataSourceLoader;
import com.romraider.logger.external.core.ExternalDataSourceLoaderImpl;
import com.romraider.swing.AbstractFrame;
import static com.romraider.util.ParamChecker.checkNotNull;
import static com.romraider.util.ParamChecker.isNullOrEmpty;

View File

@ -21,9 +21,9 @@ package com.romraider.logger.ecu.definition;
import static com.romraider.logger.ecu.definition.EcuDataType.EXTERNAL;
import static com.romraider.logger.ecu.definition.xml.ConverterMaxMinDefaults.getMaxMin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.ecu.ui.handler.dash.GaugeMinMax;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import static com.romraider.util.ParamChecker.checkNotNull;
import java.text.DecimalFormat;

View File

@ -21,7 +21,6 @@ package com.romraider.logger.ecu.ui.swing.menubar;
import static com.romraider.Version.PRODUCT_NAME;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.ecu.ui.swing.menubar.action.DisconnectAction;
import com.romraider.logger.ecu.ui.swing.menubar.action.ExitAction;
import com.romraider.logger.ecu.ui.swing.menubar.action.LoadProfileAction;
@ -35,6 +34,7 @@ import com.romraider.logger.ecu.ui.swing.menubar.action.ResetEcuAction;
import com.romraider.logger.ecu.ui.swing.menubar.action.SaveProfileAction;
import com.romraider.logger.ecu.ui.swing.menubar.action.SaveProfileAsAction;
import com.romraider.logger.ecu.ui.swing.menubar.action.UpdateLoggerDefAction;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.swing.menubar.Menu;
import com.romraider.swing.menubar.MenuItem;
import com.romraider.swing.menubar.RadioButtonMenuItem;

View File

@ -22,7 +22,7 @@ package com.romraider.logger.ecu.ui.swing.menubar.action;
import com.romraider.io.serial.port.SerialPortDiscoverer;
import com.romraider.io.serial.port.SerialPortDiscovererImpl;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.swing.menubar.action.AbstractAction;
import gnu.io.CommPortIdentifier;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.io;
package com.romraider.logger.external.aem.io;
import com.romraider.io.connection.ConnectionProperties;

View File

@ -17,17 +17,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.io;
package com.romraider.logger.external.aem.io;
import com.romraider.logger.aem.plugin.RawDataListener;
import com.romraider.logger.external.core.RawDataListener;
import com.romraider.logger.external.core.Stoppable;
import com.romraider.logger.external.core.TerminalConnection;
import com.romraider.logger.external.core.TerminalConnectionImpl;
public final class AemRunnerImpl implements AemRunner {
private final AemConnection connection;
public final class AemRunner implements Stoppable {
private static final AemConnectionProperties CONNECTION_PROPS = new AemConnectionProperties();
private final TerminalConnection connection;
private final RawDataListener listener;
private boolean stop;
public AemRunnerImpl(String port, RawDataListener listener) {
connection = new AemConnectionImpl(port);
public AemRunner(String port, RawDataListener listener) {
this.connection = new TerminalConnectionImpl("AEM UEGO", port, CONNECTION_PROPS);
this.listener = listener;
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.plugin;
package com.romraider.logger.external.aem.plugin;
public interface AemConvertor {
double convert(byte[] bytes);

View File

@ -18,7 +18,7 @@
*/
package com.romraider.logger.aem.plugin;
package com.romraider.logger.external.aem.plugin;
import static com.romraider.util.HexUtil.asHex;
import static java.lang.Double.parseDouble;

View File

@ -17,9 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.plugin;
package com.romraider.logger.external.aem.plugin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.RawDataListener;
public final class AemDataItem implements ExternalDataItem, RawDataListener {
private final AemConvertor convertor = new AemConvertorImpl();

View File

@ -17,13 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.plugin;
package com.romraider.logger.external.aem.plugin;
import com.romraider.logger.aem.io.AemRunner;
import com.romraider.logger.aem.io.AemRunnerImpl;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.external.aem.io.AemRunner;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import static java.util.Arrays.asList;
import javax.swing.Action;
@ -43,7 +42,7 @@ public final class AemDataSource implements ExternalDataSource {
}
public String getVersion() {
return "0.02";
return "0.03";
}
public List<? extends ExternalDataItem> getDataItems() {
@ -63,7 +62,7 @@ public final class AemDataSource implements ExternalDataSource {
}
public void connect() {
runner = new AemRunnerImpl(port, dataItem);
runner = new AemRunner(port, dataItem);
runAsDaemon(runner);
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.plugin;
package com.romraider.logger.external.core;
public interface DataListener {
void setData(double data);

View File

@ -17,10 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.ecu.external;
package com.romraider.logger.external.core;
public interface ExternalDataItem {
String getName();
String getDescription();

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.ecu.external;
package com.romraider.logger.external.core;
import com.romraider.logger.ecu.EcuLogger;
import javax.swing.Action;

View File

@ -17,13 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.ecu.external;
package com.romraider.logger.external.core;
import java.util.List;
import java.util.Map;
public interface ExternalDataSourceLoader {
void loadExternalDataSources(Map<String, String> loggerPluginPorts);
List<ExternalDataSource> getExternalDataSources();

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.ecu.external;
package com.romraider.logger.external.core;
import com.romraider.logger.ecu.definition.plugin.PluginFilenameFilter;
import com.romraider.logger.ecu.exception.ConfigurationException;

View File

@ -17,10 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.ecu.external;
package com.romraider.logger.external.core;
import static com.romraider.util.ParamChecker.checkNotNull;
import com.romraider.util.Stoppable;
import static com.romraider.util.ThreadUtil.sleep;
import org.apache.log4j.Logger;
import static org.apache.log4j.Logger.getLogger;

View File

@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.ecu.external;
package com.romraider.logger.external.core;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.ui.swing.menubar.action.GenericPluginMenuAction;
import static com.romraider.util.ParamChecker.checkNotNull;
import com.romraider.util.Stoppable;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import org.apache.log4j.Logger;
import static org.apache.log4j.Logger.getLogger;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.plugin;
package com.romraider.logger.external.core;
public interface RawDataListener {
void setBytes(byte[] bytes);

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.util;
package com.romraider.logger.external.core;
public interface Stoppable extends Runnable {
void stop();

View File

@ -17,9 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.io;
package com.romraider.logger.external.core;
public interface AemConnection {
public interface TerminalConnection {
byte[] read();
void close();

View File

@ -17,32 +17,37 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.io;
package com.romraider.logger.external.core;
import com.romraider.io.connection.ConnectionProperties;
import com.romraider.io.serial.connection.SerialConnection;
import com.romraider.io.serial.connection.SerialConnectionImpl;
import com.romraider.logger.ecu.exception.SerialCommunicationException;
import static com.romraider.util.ParamChecker.checkNotNull;
import static com.romraider.util.ParamChecker.checkNotNullOrEmpty;
import static java.nio.charset.Charset.forName;
import org.apache.log4j.Logger;
import static org.apache.log4j.Logger.getLogger;
import java.nio.charset.Charset;
public final class AemConnectionImpl implements AemConnection {
private static final Logger LOGGER = getLogger(AemConnectionImpl.class);
public final class TerminalConnectionImpl implements TerminalConnection {
private static final Logger LOGGER = getLogger(TerminalConnectionImpl.class);
private static final Charset CHARSET_UTF8 = forName("UTF-8");
private final SerialConnection connection;
private final String deviceName;
public AemConnectionImpl(String port) {
public TerminalConnectionImpl(String deviceName, String port, ConnectionProperties connectionProperties) {
checkNotNullOrEmpty(deviceName, "deviceName");
checkNotNullOrEmpty(port, "port");
connection = serialConnection(port);
checkNotNull(connectionProperties, "connectionProperties");
this.connection = new SerialConnectionImpl(port, connectionProperties);
this.deviceName = deviceName;
}
public byte[] read() {
try {
String s = connection.readLine();
LOGGER.trace("AEM UEGO Response: " + s);
LOGGER.trace(deviceName + " Response: " + s);
return s.getBytes(CHARSET_UTF8);
} catch (Exception e) {
close();
@ -53,9 +58,4 @@ public final class AemConnectionImpl implements AemConnection {
public void close() {
connection.close();
}
private SerialConnectionImpl serialConnection(String port) {
ConnectionProperties connectionProperties = new AemConnectionProperties();
return new SerialConnectionImpl(port, connectionProperties);
}
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.io;
package com.romraider.logger.external.fourteenpoint7.io;
public interface NawConnection {
byte[] readBytes();

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.io;
package com.romraider.logger.external.fourteenpoint7.io;
import com.romraider.io.connection.ConnectionProperties;
import com.romraider.io.serial.connection.SerialConnection;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.io;
package com.romraider.logger.external.fourteenpoint7.io;
import com.romraider.io.connection.ConnectionProperties;

View File

@ -17,17 +17,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.io;
package com.romraider.logger.external.fourteenpoint7.io;
import com.romraider.logger.fourteenpoint7.plugin.NawDataListener;
import com.romraider.logger.external.core.RawDataListener;
import com.romraider.logger.external.core.Stoppable;
public final class NawRunnerImpl implements NawRunner {
public final class NawRunner implements Stoppable {
private static final byte[] NAW_PROMPT = {0x07};
private final NawConnection connection;
private final NawDataListener listener;
private final RawDataListener listener;
private boolean stop;
public NawRunnerImpl(String port, NawDataListener listener) {
public NawRunner(String port, RawDataListener listener) {
connection = new NawConnectionImpl(port);
this.listener = listener;
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.plugin;
package com.romraider.logger.external.fourteenpoint7.plugin;
public interface NawConvertor {
double convert(byte[] bytes);

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.plugin;
package com.romraider.logger.external.fourteenpoint7.plugin;
import static com.romraider.util.HexUtil.asHex;
import org.apache.log4j.Logger;

View File

@ -17,11 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.plugin;
package com.romraider.logger.external.fourteenpoint7.plugin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.RawDataListener;
public final class NawDataItem implements ExternalDataItem, NawDataListener {
public final class NawDataItem implements ExternalDataItem, RawDataListener {
private final NawConvertor convertor = new NawConvertorImpl();
private byte[] bytes;

View File

@ -17,13 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.plugin;
package com.romraider.logger.external.fourteenpoint7.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.fourteenpoint7.io.NawRunner;
import com.romraider.logger.fourteenpoint7.io.NawRunnerImpl;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.fourteenpoint7.io.NawRunner;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import static java.util.Arrays.asList;
import javax.swing.Action;
@ -43,7 +42,7 @@ public final class NawDataSource implements ExternalDataSource {
}
public String getVersion() {
return "0.01";
return "0.02";
}
public List<? extends ExternalDataItem> getDataItems() {
@ -63,7 +62,7 @@ public final class NawDataSource implements ExternalDataSource {
}
public void connect() {
runner = new NawRunnerImpl(port, dataItem);
runner = new NawRunner(port, dataItem);
runAsDaemon(runner);
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.io;
package com.romraider.logger.external.innovate.generic.mts.io;
import com4j.Com4jObject;
import com4j.IID;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.io;
package com.romraider.logger.external.innovate.generic.mts.io;
import com4j.DISPID;
import com4j.IID;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.io;
package com.romraider.logger.external.innovate.generic.mts.io;
import static com4j.COM4J.createInstance;

View File

@ -17,24 +17,25 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.io;
package com.romraider.logger.external.innovate.generic.mts.io;
import static com.romraider.logger.innovate.generic.mts.io.MTSFactory.createMTS;
import com.romraider.logger.innovate.generic.mts.plugin.DataListener;
import com.romraider.logger.external.core.DataListener;
import com.romraider.logger.external.core.Stoppable;
import static com.romraider.logger.external.innovate.generic.mts.io.MTSFactory.createMTS;
import static com.romraider.util.ThreadUtil.sleep;
import static java.lang.System.currentTimeMillis;
import org.apache.log4j.Logger;
import static org.apache.log4j.Logger.getLogger;
public final class MTSRunnerImpl implements MTSRunner {
private static final Logger LOGGER = getLogger(MTSRunnerImpl.class);
public final class MTSRunner implements Stoppable {
private static final Logger LOGGER = getLogger(MTSRunner.class);
private final DataListener listener;
private final int mtsInput = 0;
private final int mtsPort;
private boolean running;
private boolean stop;
public MTSRunnerImpl(int mtsPort, DataListener listener) {
public MTSRunner(int mtsPort, DataListener listener) {
this.mtsPort = mtsPort;
this.listener = listener;
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.io;
package com.romraider.logger.external.innovate.generic.mts.io;
import com4j.EventCookie;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.io;
package com.romraider.logger.external.innovate.generic.serial.io;
import com.romraider.io.connection.ConnectionProperties;

View File

@ -17,17 +17,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.io;
package com.romraider.logger.external.innovate.generic.serial.io;
import com.romraider.io.connection.ConnectionProperties;
import com.romraider.io.serial.connection.SerialConnection;
import com.romraider.io.serial.connection.SerialConnectionImpl;
import com.romraider.logger.innovate.generic.mts.plugin.DataListener;
import com.romraider.logger.external.core.DataListener;
import com.romraider.logger.external.core.Stoppable;
import static com.romraider.util.ByteUtil.matchOnes;
import static com.romraider.util.ByteUtil.matchZeroes;
import static com.romraider.util.HexUtil.asHex;
import static com.romraider.util.ParamChecker.checkNotNullOrEmpty;
import com.romraider.util.Stoppable;
import static java.lang.System.arraycopy;
import org.apache.log4j.Logger;
import static org.apache.log4j.Logger.getLogger;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.io;
package com.romraider.logger.external.innovate.generic.serial.io;
import com.romraider.io.serial.connection.SerialConnection;
import static com.romraider.util.HexUtil.asBytes;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.plugin;
package com.romraider.logger.external.innovate.generic.serial.plugin;
public interface DataConvertor {
double convert(byte[] bytes);

View File

@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.plugin;
package com.romraider.logger.external.innovate.generic.serial.plugin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.innovate.generic.mts.plugin.DataListener;
import com.romraider.logger.external.core.DataListener;
import com.romraider.logger.external.core.ExternalDataItem;
public final class InnovateDataItem implements ExternalDataItem, DataListener {
private double data;

View File

@ -17,12 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.plugin;
package com.romraider.logger.external.innovate.generic.serial.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.innovate.generic.serial.io.InnovateRunner;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.innovate.generic.serial.io.InnovateRunner;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import static java.util.Arrays.asList;
import javax.swing.Action;
@ -42,7 +42,7 @@ public final class InnovateDataSource implements ExternalDataSource {
}
public String getVersion() {
return "0.01";
return "0.02";
}
public List<? extends ExternalDataItem> getDataItems() {

View File

@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.lm2.mts.plugin;
package com.romraider.logger.external.innovate.lm2.mts.plugin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.innovate.generic.mts.plugin.DataListener;
import com.romraider.logger.external.core.DataListener;
import com.romraider.logger.external.core.ExternalDataItem;
public final class Lm2MtsDataItem implements ExternalDataItem, DataListener {
private double data;

View File

@ -17,13 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.lm2.mts.plugin;
package com.romraider.logger.external.innovate.lm2.mts.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.innovate.generic.mts.io.MTSRunner;
import com.romraider.logger.innovate.generic.mts.io.MTSRunnerImpl;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.innovate.generic.mts.io.MTSRunner;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import static java.lang.Integer.parseInt;
import static java.util.Arrays.asList;
@ -47,7 +46,7 @@ public final class Lm2MtsDataSource implements ExternalDataSource {
}
public String getVersion() {
return "0.01";
return "0.02";
}
public List<? extends ExternalDataItem> getDataItems() {
@ -67,7 +66,7 @@ public final class Lm2MtsDataSource implements ExternalDataSource {
}
public void connect() {
runner = new MTSRunnerImpl(mtsPort, dataItem);
runner = new MTSRunner(mtsPort, dataItem);
runAsDaemon(runner);
}

View File

@ -17,12 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.lm2.mts.plugin;
package com.romraider.logger.external.innovate.lm2.mts.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.innovate.generic.mts.io.MTS;
import static com.romraider.logger.innovate.generic.mts.io.MTSFactory.createMTS;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.innovate.generic.mts.io.MTS;
import static com.romraider.logger.external.innovate.generic.mts.io.MTSFactory.createMTS;
import com.romraider.swing.menubar.action.AbstractAction;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
import static javax.swing.JOptionPane.showInputDialog;

View File

@ -17,8 +17,32 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.io;
package com.romraider.logger.external.mrf.io;
public interface NawRunner extends Runnable {
void stop();
}
import com.romraider.io.connection.ConnectionProperties;
public final class MrfConnectionProperties implements ConnectionProperties {
public int getBaudRate() {
return 9600;
}
public int getDataBits() {
return 8;
}
public int getStopBits() {
return 1;
}
public int getParity() {
return 0;
}
public int getConnectTimeout() {
return 2000;
}
public int getSendTimeout() {
return 500;
}
}

View File

@ -0,0 +1,73 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.external.mrf.io;
import com.romraider.io.connection.ConnectionProperties;
import com.romraider.logger.external.core.Stoppable;
import com.romraider.logger.external.core.TerminalConnection;
import com.romraider.logger.external.core.TerminalConnectionImpl;
import com.romraider.logger.external.mrf.plugin.MrfDataItem;
import com.romraider.logger.external.mrf.plugin.MrfSensorType;
import static com.romraider.util.ParamChecker.isNullOrEmpty;
import static java.nio.charset.Charset.forName;
import java.nio.charset.Charset;
import java.util.Map;
public final class MrfRunner implements Stoppable {
private static final ConnectionProperties CONNECTION_PROPS = new MrfConnectionProperties();
private static final Charset CHARSET_UTF8 = forName("UTF-8");
private final Map<MrfSensorType, MrfDataItem> dataItems;
private final TerminalConnection connection;
private boolean stop;
public MrfRunner(String port, Map<MrfSensorType, MrfDataItem> dataItems) {
this.connection = new TerminalConnectionImpl("Mrf Stealth Gauge", port, CONNECTION_PROPS);
this.dataItems = dataItems;
}
public void run() {
try {
while (!stop) {
byte[] bytes = connection.read();
String response = new String(bytes, CHARSET_UTF8);
if (isNullOrEmpty(response)) continue;
String[] values = response.split(",");
for (int i = 0; i < values.length; i++) {
MrfDataItem dataItem = dataItems.get(MrfSensorType.valueOf(i));
if (dataItem != null) dataItem.setData(parseDouble(values[i]));
}
}
} finally {
connection.close();
}
}
public void stop() {
stop = true;
}
private double parseDouble(String value) {
try {
return Double.parseDouble(value);
} catch (Exception e) {
return 0.0;
}
}
}

View File

@ -0,0 +1,54 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.external.mrf.plugin;
import com.romraider.logger.external.core.DataListener;
import com.romraider.logger.external.core.ExternalDataItem;
public final class MrfDataItem implements ExternalDataItem, DataListener {
private final String units;
private final String name;
private double data;
public MrfDataItem(String name, String units) {
this.name = name;
this.units = units;
}
public String getName() {
return "Mrf Stealth Gauge " + name;
}
public String getDescription() {
return "Mrf Stealth Gauge " + name + " data";
}
public String getUnits() {
return units;
}
public double getData() {
return data;
}
public void setData(double data) {
this.data = data;
}
}

View File

@ -0,0 +1,88 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.external.mrf.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.mrf.io.MrfRunner;
import static com.romraider.logger.external.mrf.plugin.MrfSensorType.AFR;
import static com.romraider.logger.external.mrf.plugin.MrfSensorType.EGT;
import static com.romraider.logger.external.mrf.plugin.MrfSensorType.MAP;
import static com.romraider.logger.external.mrf.plugin.MrfSensorType.OIL_PRESS;
import static com.romraider.logger.external.mrf.plugin.MrfSensorType.OIL_TEMP;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import static java.util.Collections.unmodifiableList;
import javax.swing.Action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class MrfDataSource implements ExternalDataSource {
private final Map<MrfSensorType, MrfDataItem> dataItems = new HashMap<MrfSensorType, MrfDataItem>();
private MrfRunner runner;
private String port;
{
dataItems.put(AFR, new MrfDataItem("AFR", "AFR"));
dataItems.put(MAP, new MrfDataItem("MAP", "Vacuum(inHg)/Boost(PSI)"));
dataItems.put(EGT, new MrfDataItem("EGT", "?"));
dataItems.put(OIL_TEMP, new MrfDataItem("Oil Temp", "?"));
dataItems.put(OIL_PRESS, new MrfDataItem("Oil Press", "PSI"));
}
public String getId() {
return getClass().getName();
}
public String getName() {
return "Mrf Stealth Gauge";
}
public String getVersion() {
return "0.01";
}
public List<? extends ExternalDataItem> getDataItems() {
return unmodifiableList(new ArrayList<MrfDataItem>(dataItems.values()));
}
public Action getMenuAction(EcuLogger logger) {
return null;
}
public void setPort(String port) {
this.port = port;
}
public String getPort() {
return port;
}
public void connect() {
runner = new MrfRunner(port, dataItems);
runAsDaemon(runner);
}
public void disconnect() {
if (runner != null) runner.stop();
}
}

View File

@ -17,8 +17,29 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.aem.io;
package com.romraider.logger.external.mrf.plugin;
public interface AemRunner extends Runnable {
void stop();
public enum MrfSensorType {
OIL_TEMP(0),
EGT(1),
MAP(2),
OIL_PRESS(3),
AFR(4);
private final int index;
private MrfSensorType(int index) {
this.index = index;
}
public int getIndex() {
return index;
}
public static MrfSensorType valueOf(int index) {
for (MrfSensorType type : values()) {
if (type.getIndex() == index) return type;
}
return null;
}
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
public interface PlxConnection {
byte readByte();

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
import com.romraider.io.connection.ConnectionProperties;
import com.romraider.io.serial.connection.SerialConnection;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
import com.romraider.io.connection.ConnectionProperties;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
public interface PlxParser {
PlxResponse pushByte(byte b);

View File

@ -17,15 +17,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
import static com.romraider.logger.plx.io.PlxParserImpl.ParserState.EXPECTING_FIRST_HALF_OF_SENSOR_TYPE;
import static com.romraider.logger.plx.io.PlxParserImpl.ParserState.EXPECTING_FIRST_HALF_OF_VALUE;
import static com.romraider.logger.plx.io.PlxParserImpl.ParserState.EXPECTING_INSTANCE;
import static com.romraider.logger.plx.io.PlxParserImpl.ParserState.EXPECTING_SECOND_HALF_OF_SENSOR_TYPE;
import static com.romraider.logger.plx.io.PlxParserImpl.ParserState.EXPECTING_SECOND_HALF_OF_VALUE;
import static com.romraider.logger.plx.io.PlxParserImpl.ParserState.EXPECTING_START;
import static com.romraider.logger.plx.io.PlxSensorType.valueOf;
import static com.romraider.logger.external.plx.io.PlxParserImpl.ParserState.EXPECTING_FIRST_HALF_OF_SENSOR_TYPE;
import static com.romraider.logger.external.plx.io.PlxParserImpl.ParserState.EXPECTING_FIRST_HALF_OF_VALUE;
import static com.romraider.logger.external.plx.io.PlxParserImpl.ParserState.EXPECTING_INSTANCE;
import static com.romraider.logger.external.plx.io.PlxParserImpl.ParserState.EXPECTING_SECOND_HALF_OF_SENSOR_TYPE;
import static com.romraider.logger.external.plx.io.PlxParserImpl.ParserState.EXPECTING_SECOND_HALF_OF_VALUE;
import static com.romraider.logger.external.plx.io.PlxParserImpl.ParserState.EXPECTING_START;
import static com.romraider.logger.external.plx.io.PlxSensorType.valueOf;
public final class PlxParserImpl implements PlxParser {
private ParserState state = EXPECTING_START;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
public final class PlxResponse {
public PlxSensorType sensor;

View File

@ -17,19 +17,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
import static com.romraider.logger.plx.io.PlxSensorType.UNKNOWN;
import com.romraider.logger.plx.plugin.PlxDataItem;
import com.romraider.logger.external.core.Stoppable;
import static com.romraider.logger.external.plx.io.PlxSensorType.UNKNOWN;
import com.romraider.logger.external.plx.plugin.PlxDataItem;
import java.util.Map;
public final class PlxRunnerImpl implements PlxRunner {
public final class PlxRunner implements Stoppable {
private final Map<PlxSensorType, PlxDataItem> dataItems;
private final PlxConnection connection;
private boolean stop;
public PlxRunnerImpl(String port, Map<PlxSensorType, PlxDataItem> dataItems) {
connection = new PlxConnectionImpl(port);
public PlxRunner(String port, Map<PlxSensorType, PlxDataItem> dataItems) {
this.connection = new PlxConnectionImpl(port);
this.dataItems = dataItems;
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
public enum PlxSensorType {
WIDEBAND_AFR(0),

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
public enum PlxSensorUnits {
WIDEBAND_AFR_LAMBDA(0),

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
package com.romraider.logger.external.plx.io;
import com.romraider.io.serial.connection.SerialConnection;
import static com.romraider.util.ThreadUtil.sleep;

View File

@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.plugin;
package com.romraider.logger.external.plx.plugin;
import com.romraider.logger.plx.io.PlxSensorType;
import com.romraider.logger.plx.io.PlxSensorUnits;
import com.romraider.logger.external.plx.io.PlxSensorType;
import com.romraider.logger.external.plx.io.PlxSensorUnits;
public interface PlxConvertor {
double convert(int raw, PlxSensorType sensorType, PlxSensorUnits units);

View File

@ -17,21 +17,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.plugin;
package com.romraider.logger.external.plx.plugin;
import com.romraider.logger.plx.io.PlxSensorType;
import static com.romraider.logger.plx.io.PlxSensorType.EXHAUST_GAS_TEMPERATURE;
import static com.romraider.logger.plx.io.PlxSensorType.WIDEBAND_AFR;
import com.romraider.logger.plx.io.PlxSensorUnits;
import static com.romraider.logger.plx.io.PlxSensorUnits.EXHAUST_GAS_TEMPERATURE_CELSIUS;
import static com.romraider.logger.plx.io.PlxSensorUnits.EXHAUST_GAS_TEMPERATURE_FAHRENHEIT;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_CNG172;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_DIESEL146;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_ETHANOL90;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_GASOLINE147;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_LAMBDA;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_LPG155;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_METHANOL64;
import com.romraider.logger.external.plx.io.PlxSensorType;
import static com.romraider.logger.external.plx.io.PlxSensorType.EXHAUST_GAS_TEMPERATURE;
import static com.romraider.logger.external.plx.io.PlxSensorType.WIDEBAND_AFR;
import com.romraider.logger.external.plx.io.PlxSensorUnits;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.EXHAUST_GAS_TEMPERATURE_CELSIUS;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.EXHAUST_GAS_TEMPERATURE_FAHRENHEIT;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_CNG172;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_DIESEL146;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_ETHANOL90;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_GASOLINE147;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_LAMBDA;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_LPG155;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_METHANOL64;
public final class PlxConvertorImpl implements PlxConvertor {
public double convert(int raw, PlxSensorType sensorType, PlxSensorUnits units) {

View File

@ -17,9 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.plugin;
package com.romraider.logger.external.plx.plugin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataItem;
public interface PlxDataItem extends ExternalDataItem {
void setRaw(int raw);

View File

@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.plugin;
package com.romraider.logger.external.plx.plugin;
import com.romraider.logger.plx.io.PlxSensorType;
import com.romraider.logger.plx.io.PlxSensorUnits;
import com.romraider.logger.external.plx.io.PlxSensorType;
import com.romraider.logger.external.plx.io.PlxSensorUnits;
public final class PlxDataItemImpl implements PlxDataItem {
private final PlxConvertor convertor = new PlxConvertorImpl();

View File

@ -17,16 +17,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.plugin;
package com.romraider.logger.external.plx.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.plx.io.PlxRunner;
import com.romraider.logger.plx.io.PlxRunnerImpl;
import com.romraider.logger.plx.io.PlxSensorType;
import static com.romraider.logger.plx.io.PlxSensorType.WIDEBAND_AFR;
import static com.romraider.logger.plx.io.PlxSensorUnits.WIDEBAND_AFR_GASOLINE147;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.plx.io.PlxRunner;
import com.romraider.logger.external.plx.io.PlxSensorType;
import static com.romraider.logger.external.plx.io.PlxSensorType.WIDEBAND_AFR;
import static com.romraider.logger.external.plx.io.PlxSensorUnits.WIDEBAND_AFR_GASOLINE147;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import javax.swing.Action;
import java.util.ArrayList;
@ -53,7 +52,7 @@ public final class PlxDataSource implements ExternalDataSource {
}
public String getVersion() {
return "0.01";
return "0.02";
}
public List<? extends ExternalDataItem> getDataItems() {
@ -73,7 +72,7 @@ public final class PlxDataSource implements ExternalDataSource {
}
public void connect() {
runner = new PlxRunnerImpl(port, dataItems);
runner = new PlxRunner(port, dataItems);
runAsDaemon(runner);
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.io;
package com.romraider.logger.external.zt2.io;
public interface ZT2Connection {
byte readByte();

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.io;
package com.romraider.logger.external.zt2.io;
import com.romraider.io.connection.ConnectionProperties;
import com.romraider.io.serial.connection.SerialConnection;

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.io;
package com.romraider.logger.external.zt2.io;
import com.romraider.io.connection.ConnectionProperties;

View File

@ -17,25 +17,27 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.io;
package com.romraider.logger.external.zt2.io;
import static com.romraider.logger.zt2.io.ZT2SensorType.AFR;
import static com.romraider.logger.zt2.io.ZT2SensorType.EGT;
import static com.romraider.logger.zt2.io.ZT2SensorType.MAP;
import static com.romraider.logger.zt2.io.ZT2SensorType.RPM;
import static com.romraider.logger.zt2.io.ZT2SensorType.TPS;
import com.romraider.logger.zt2.plugin.ZT2DataItem;
import com.romraider.logger.external.core.Stoppable;
import com.romraider.logger.external.zt2.plugin.ZT2DataItem;
import com.romraider.logger.external.zt2.plugin.ZT2SensorType;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.AFR;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.EGT;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.MAP;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.RPM;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.TPS;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public final class ZT2RunnerImpl implements ZT2Runner {
public final class ZT2Runner implements Stoppable {
private final Map<ZT2SensorType, ZT2DataItem> dataItems;
private final ZT2Connection connection;
private boolean stop;
public ZT2RunnerImpl(String port, Map<ZT2SensorType, ZT2DataItem> dataItems) {
connection = new ZT2ConnectionImpl(port);
public ZT2Runner(String port, Map<ZT2SensorType, ZT2DataItem> dataItems) {
this.connection = new ZT2ConnectionImpl(port);
this.dataItems = dataItems;
}

View File

@ -17,9 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.plugin;
import com.romraider.logger.zt2.io.ZT2SensorType;
package com.romraider.logger.external.zt2.plugin;
public interface ZT2Converter {
double convert(ZT2SensorType sensorType, int... raw);

View File

@ -17,9 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.plugin;
package com.romraider.logger.external.zt2.plugin;
import com.romraider.logger.zt2.io.ZT2SensorType;
import static java.lang.Math.round;
public final class ZT2ConverterImpl implements ZT2Converter {

View File

@ -17,9 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.plugin;
package com.romraider.logger.external.zt2.plugin;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataItem;
public interface ZT2DataItem extends ExternalDataItem {
void setRaw(int... raw);

View File

@ -17,9 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.plugin;
import com.romraider.logger.zt2.io.ZT2SensorType;
package com.romraider.logger.external.zt2.plugin;
public final class ZT2DataItemImpl implements ZT2DataItem {
private final ZT2Converter converter = new ZT2ConverterImpl();

View File

@ -17,19 +17,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.plugin;
package com.romraider.logger.external.zt2.plugin;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.logger.ecu.external.ExternalDataItem;
import com.romraider.logger.ecu.external.ExternalDataSource;
import com.romraider.logger.zt2.io.ZT2Runner;
import com.romraider.logger.zt2.io.ZT2RunnerImpl;
import com.romraider.logger.zt2.io.ZT2SensorType;
import static com.romraider.logger.zt2.io.ZT2SensorType.AFR;
import static com.romraider.logger.zt2.io.ZT2SensorType.EGT;
import static com.romraider.logger.zt2.io.ZT2SensorType.MAP;
import static com.romraider.logger.zt2.io.ZT2SensorType.RPM;
import static com.romraider.logger.zt2.io.ZT2SensorType.TPS;
import com.romraider.logger.external.core.ExternalDataItem;
import com.romraider.logger.external.core.ExternalDataSource;
import com.romraider.logger.external.zt2.io.ZT2Runner;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.AFR;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.EGT;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.MAP;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.RPM;
import static com.romraider.logger.external.zt2.plugin.ZT2SensorType.TPS;
import static com.romraider.util.ThreadUtil.runAsDaemon;
import static java.util.Collections.unmodifiableList;
import javax.swing.Action;
@ -60,7 +58,7 @@ public final class ZT2DataSource implements ExternalDataSource {
}
public String getVersion() {
return "0.01";
return "0.02";
}
public List<? extends ExternalDataItem> getDataItems() {
@ -80,7 +78,7 @@ public final class ZT2DataSource implements ExternalDataSource {
}
public void connect() {
runner = new ZT2RunnerImpl(port, dataItems);
runner = new ZT2Runner(port, dataItems);
runAsDaemon(runner);
}

View File

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.io;
package com.romraider.logger.external.zt2.plugin;
public enum ZT2SensorType {
AFR,

View File

@ -1,24 +0,0 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.fourteenpoint7.plugin;
public interface NawDataListener {
void setBytes(byte[] bytes);
}

View File

@ -1,24 +0,0 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.mts.io;
public interface MTSRunner extends Runnable {
void stop();
}

View File

@ -1,24 +0,0 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.innovate.generic.serial.plugin;
public interface RawDataListener {
void setBytes(byte[] bytes);
}

View File

@ -1,24 +0,0 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.plx.io;
public interface PlxRunner extends Runnable {
void stop();
}

View File

@ -1,24 +0,0 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.romraider.logger.zt2.io;
public interface ZT2Runner extends Runnable {
void stop();
}