mirror of https://github.com/rusefi/RomRaider.git
updated ramtune test app
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@639 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
6325da9494
commit
f767a98b7e
|
@ -1,8 +1,12 @@
|
|||
package enginuity.ramtune;
|
||||
package enginuity.ramtune.test;
|
||||
|
||||
import enginuity.Settings;
|
||||
import enginuity.io.port.SerialPortRefresher;
|
||||
import enginuity.logger.ecu.ui.SerialPortComboBox;
|
||||
import enginuity.ramtune.test.command.Command;
|
||||
import enginuity.ramtune.test.command.EcuInitCommand;
|
||||
import enginuity.ramtune.test.command.ReadCommand;
|
||||
import enginuity.ramtune.test.command.WriteCommand;
|
||||
import enginuity.swing.LookAndFeelManager;
|
||||
import static enginuity.util.ThreadUtil.runAsDaemon;
|
||||
import static enginuity.util.ThreadUtil.sleep;
|
||||
|
@ -164,7 +168,7 @@ public final class RamTuneTestApp extends JFrame implements WindowListener {
|
|||
}
|
||||
|
||||
private JComboBox buildCommandComboBox() {
|
||||
return new JComboBox(new Object[] {"ECU Init", "Read", "Write"});
|
||||
return new JComboBox(new Command[] {new EcuInitCommand(), new ReadCommand(), new WriteCommand()});
|
||||
}
|
||||
|
||||
private Component buildOutputPanel() {
|
|
@ -0,0 +1,6 @@
|
|||
package enginuity.ramtune.test.command;
|
||||
|
||||
public interface Command {
|
||||
|
||||
byte[] constructCommandRequest(byte[] address, byte[] data);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package enginuity.ramtune.test.command;
|
||||
|
||||
import enginuity.io.protocol.Protocol;
|
||||
import enginuity.io.protocol.SSMProtocol;
|
||||
|
||||
public final class EcuInitCommand implements Command {
|
||||
private final Protocol protocol = new SSMProtocol();
|
||||
|
||||
public byte[] constructCommandRequest(byte[] address, byte[] data) {
|
||||
return protocol.constructEcuInitRequest();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ECU Init";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package enginuity.ramtune.test.command;
|
||||
|
||||
import enginuity.io.protocol.Protocol;
|
||||
import enginuity.io.protocol.SSMProtocol;
|
||||
|
||||
public final class ReadCommand implements Command {
|
||||
private final Protocol protocol = new SSMProtocol();
|
||||
|
||||
public byte[] constructCommandRequest(byte[] address, byte[] data) {
|
||||
return protocol.constructReadAddressRequest(new byte[][] {address});
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Read";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package enginuity.ramtune.test.command;
|
||||
|
||||
import enginuity.io.protocol.Protocol;
|
||||
import enginuity.io.protocol.SSMProtocol;
|
||||
|
||||
public final class WriteCommand implements Command {
|
||||
private final Protocol protocol = new SSMProtocol();
|
||||
|
||||
public byte[] constructCommandRequest(byte[] address, byte[] data) {
|
||||
return protocol.constructWriteMemoryRequest(address, data);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Write";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue