mirror of https://github.com/rusefi/RomRaider.git
extended rom support
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@795 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
db23f50703
commit
58b023b8c4
|
@ -12,6 +12,7 @@
|
|||
<flashmethod>mitsukernelocp</flashmethod>
|
||||
</romid>
|
||||
|
||||
|
||||
<table type="3D" name="High Octane Fuel Map" category="Fuel" storagetype="uint8" endian="big" sizex="20"
|
||||
sizey="15" swapxy="true" userlevel="1">
|
||||
<scaling units="AFR" expression="14.7*128/x" to_byte="14.7*128/x" format="0.00" fineincrement="0.1"
|
||||
|
@ -27,6 +28,21 @@
|
|||
<description>High Octane Fuel Map</description>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="High Octane Ignition Map 1" category="Timing" storagetype="int8" endian="big" sizex="21"
|
||||
sizey="20" swapxy="true" userlevel="1">
|
||||
<scaling units="degrees" expression="x" to_byte="x" format="0.00" fineincrement="0.1"
|
||||
coarseincrement="1.0"/>
|
||||
<table type="X Axis" name="Engine Load" storagetype="uint16" endian="big">
|
||||
<scaling units="%" expression="x*10/32" to_byte="x*32/10" format="#" fineincrement="1"
|
||||
coarseincrement="5"/>
|
||||
</table>
|
||||
<table type="Y Axis" name="Engine Speed" storagetype="uint16" endian="big">
|
||||
<scaling units="RPM" expression="x*1000/256" to_byte="x*256/1000" format="#" fineincrement="50"
|
||||
coarseincrement="100"/>
|
||||
</table>
|
||||
<description>High Octane Ignition Map 1</description>
|
||||
</table>
|
||||
|
||||
<table type="2D" name="Turbo Boost Error Correction" category="Turbo Dynamics" storagetype="uint8" endian="big"
|
||||
sizey="17" userlevel="2">
|
||||
<scaling units="%" expression="(x-128)/2" to_byte="x*2+128" format="0.00" fineincrement="0.5"
|
||||
|
|
|
@ -845,17 +845,6 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
public void addKeyListener(KeyListener listener) {
|
||||
super.addKeyListener(listener);
|
||||
for (DataCell cell : data) {
|
||||
|
||||
// determine output byte values
|
||||
byte[] output;
|
||||
if (storageType != STORAGE_TYPE_FLOAT) {
|
||||
output = RomAttributeParser.parseIntegerValue((int) cell.getBinValue(), endian, storageType);
|
||||
} else { // float
|
||||
output = RomAttributeParser.floatToByte((float) cell.getBinValue(), endian);
|
||||
}
|
||||
|
||||
// Are we going to use the value output?
|
||||
|
||||
for (int z = 0; z < storageType; z++) {
|
||||
cell.addKeyListener(listener);
|
||||
}
|
||||
|
|
|
@ -26,31 +26,32 @@ import enginuity.util.Nameable;
|
|||
import java.io.Serializable;
|
||||
|
||||
public class Scale implements Nameable, Serializable {
|
||||
|
||||
|
||||
public static final int ENDIAN_BIG = 0;
|
||||
public static final int ENDIAN_LITTLE = 1;
|
||||
|
||||
|
||||
public static final int STORAGE_TYPE_INT8 = 0;
|
||||
public static final int STORAGE_TYPE_UINT8 = 1;
|
||||
public static final int STORAGE_TYPE_INT16 = 2;
|
||||
public static final int STORAGE_TYPE_UINT16 = 3;
|
||||
public static final int STORAGE_TYPE_FLOAT = 4;
|
||||
public static final int STORAGE_TYPE_HEX = 5;
|
||||
public static final int STORAGE_TYPE_CHAR = 6;;
|
||||
public static final int STORAGE_TYPE_CHAR = 6;
|
||||
public static final int STORAGE_TYPE_INT32 = 7;
|
||||
public static final int STORAGE_TYPE_UINT32 = 8;
|
||||
|
||||
|
||||
protected String description;
|
||||
protected Unit[] units;
|
||||
protected Unit[] units;
|
||||
protected int storageType;
|
||||
protected int endian;
|
||||
protected String logParam;
|
||||
protected int selectedUnit;
|
||||
protected String name;
|
||||
|
||||
|
||||
// Disallow default constructor
|
||||
private Scale() { }
|
||||
|
||||
private Scale() {
|
||||
}
|
||||
|
||||
public Scale(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
@ -86,10 +87,10 @@ public class Scale implements Nameable, Serializable {
|
|||
public void setLogParam(String logParam) {
|
||||
this.logParam = logParam;
|
||||
}
|
||||
|
||||
|
||||
public Unit getUnit() {
|
||||
return getUnits()[selectedUnit];
|
||||
}
|
||||
}
|
||||
|
||||
public Unit[] getUnits() {
|
||||
return units;
|
||||
|
@ -106,14 +107,14 @@ public class Scale implements Nameable, Serializable {
|
|||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public String toString() {
|
||||
String output = " --- SCALE: " + name + " ---" +
|
||||
"\n - Description: " + description +
|
||||
"\n - Storage Type: " + storageType +
|
||||
"\n - Endian: " + endian +
|
||||
"\n - Endian: " + endian +
|
||||
"\n - Log Param: " + logParam;
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -4,14 +4,7 @@ package enginuity.xml;
|
|||
|
||||
import static enginuity.maps.Scale.INVERSE;
|
||||
import static enginuity.maps.Scale.LINEAR;
|
||||
import static enginuity.maps.Table.ENDIAN_BIG;
|
||||
import static enginuity.maps.Table.ENDIAN_LITTLE;
|
||||
import static enginuity.maps.Table.STORAGE_TYPE_FLOAT;
|
||||
import static enginuity.maps.Table.TABLE_1D;
|
||||
import static enginuity.maps.Table.TABLE_2D;
|
||||
import static enginuity.maps.Table.TABLE_3D;
|
||||
import static enginuity.maps.Table.TABLE_X_AXIS;
|
||||
import static enginuity.maps.Table.TABLE_Y_AXIS;
|
||||
import static enginuity.maps.Table.*;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
@ -44,7 +37,7 @@ public final class RomAttributeParser {
|
|||
public static int parseStorageType(String input) {
|
||||
if (input.equalsIgnoreCase("float")) {
|
||||
return STORAGE_TYPE_FLOAT;
|
||||
} else if (input.length() > 4 && input.substring(0, 4).equalsIgnoreCase("uint")) {
|
||||
} else if (input.startsWith("uint")) {
|
||||
return Integer.parseInt(input.substring(4)) / 8;
|
||||
} else {
|
||||
return Integer.parseInt(input);
|
||||
|
@ -64,9 +57,11 @@ public final class RomAttributeParser {
|
|||
return TABLE_3D;
|
||||
} else if (input.equalsIgnoreCase("2D") || input.equalsIgnoreCase(String.valueOf(TABLE_2D))) {
|
||||
return TABLE_2D;
|
||||
} else if (input.equalsIgnoreCase("X Axis") || input.equalsIgnoreCase("Static X Axis") || input.equalsIgnoreCase(String.valueOf(TABLE_X_AXIS))) {
|
||||
} else
|
||||
if (input.equalsIgnoreCase("X Axis") || input.equalsIgnoreCase("Static X Axis") || input.equalsIgnoreCase(String.valueOf(TABLE_X_AXIS))) {
|
||||
return TABLE_X_AXIS;
|
||||
} else if (input.equalsIgnoreCase("Y Axis") || input.equalsIgnoreCase("Static Y Axis") || input.equalsIgnoreCase(String.valueOf(TABLE_Y_AXIS))) {
|
||||
} else
|
||||
if (input.equalsIgnoreCase("Y Axis") || input.equalsIgnoreCase("Static Y Axis") || input.equalsIgnoreCase(String.valueOf(TABLE_Y_AXIS))) {
|
||||
return TABLE_Y_AXIS;
|
||||
} else {
|
||||
return TABLE_1D;
|
||||
|
|
Loading…
Reference in New Issue