mirror of https://github.com/rusefi/RomRaider.git
extended rom support
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@790 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
c57d198e46
commit
d719427753
|
@ -31,13 +31,8 @@ import static enginuity.util.TableAxisUtil.getLiveDataRangeForAxis;
|
|||
import enginuity.xml.RomAttributeParser;
|
||||
|
||||
import static javax.swing.BorderFactory.createLineBorder;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Toolkit;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
|
@ -50,6 +45,7 @@ public class Table3D extends Table {
|
|||
private Table1D xAxis = new Table1D(new Settings());
|
||||
private Table1D yAxis = new Table1D(new Settings());
|
||||
private DataCell[][] data = new DataCell[1][1];
|
||||
private boolean columnBased = false;
|
||||
private boolean swapXY = false;
|
||||
private boolean flipX = false;
|
||||
private boolean flipY = false;
|
||||
|
@ -76,7 +72,15 @@ public class Table3D extends Table {
|
|||
this.yAxis = yAxis;
|
||||
}
|
||||
|
||||
public boolean isSwapXY() {
|
||||
public boolean getColumnBased() {
|
||||
return columnBased;
|
||||
}
|
||||
|
||||
public void setColumnBased(boolean columnBased) {
|
||||
this.columnBased = columnBased;
|
||||
}
|
||||
|
||||
public boolean getSwapXY() {
|
||||
return swapXY;
|
||||
}
|
||||
|
||||
|
@ -139,17 +143,18 @@ public class Table3D extends Table {
|
|||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < xAxis.getDataSize(); i++) {
|
||||
centerPanel.add(xAxis.getDataCell(i));
|
||||
for (int x = 0; x < xAxis.getDataSize(); x++) {
|
||||
centerPanel.add(xAxis.getDataCell(x));
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
|
||||
for (int x = 0; x < yAxis.getDataSize(); x++) {
|
||||
centerPanel.add(yAxis.getDataCell(x));
|
||||
for (int y = 0; y < xAxis.getDataSize(); y++) {
|
||||
data[y][x] = new DataCell(scales.get(scaleIndex), settings.getCellSize());
|
||||
data[y][x].setTable(this);
|
||||
int iMax = columnBased ? xAxis.getDataSize() : yAxis.getDataSize();
|
||||
int jMax = columnBased ? yAxis.getDataSize() : xAxis.getDataSize();
|
||||
for (int i = 0; i < iMax; i++) {
|
||||
for (int j = 0; j < jMax; j++) {
|
||||
data[i][j] = new DataCell(scales.get(scaleIndex), settings.getCellSize());
|
||||
data[i][j].setTable(this);
|
||||
|
||||
// populate data cells
|
||||
if (storageType == STORAGE_TYPE_FLOAT) { //float storage type
|
||||
|
@ -158,10 +163,10 @@ public class Table3D extends Table {
|
|||
byteValue[1] = input[storageAddress + offset * 4 - ramOffset + 1];
|
||||
byteValue[2] = input[storageAddress + offset * 4 - ramOffset + 2];
|
||||
byteValue[3] = input[storageAddress + offset * 4 - ramOffset + 3];
|
||||
data[y][x].setBinValue(RomAttributeParser.byteToFloat(byteValue, endian));
|
||||
data[i][j].setBinValue(RomAttributeParser.byteToFloat(byteValue, endian));
|
||||
|
||||
} else { // integer storage type
|
||||
data[y][x].setBinValue(
|
||||
data[i][j].setBinValue(
|
||||
RomAttributeParser.parseByteValue(input,
|
||||
endian,
|
||||
storageAddress + offset * storageType - ramOffset,
|
||||
|
@ -170,17 +175,23 @@ public class Table3D extends Table {
|
|||
|
||||
// show locked cell
|
||||
if (tempLock) {
|
||||
data[y][x].setForeground(Color.GRAY);
|
||||
data[i][j].setForeground(Color.GRAY);
|
||||
}
|
||||
|
||||
centerPanel.add(data[y][x]);
|
||||
data[y][x].setXCoord(y);
|
||||
data[y][x].setYCoord(x);
|
||||
data[y][x].setOriginalValue(data[y][x].getBinValue());
|
||||
data[i][j].setXCoord(i);
|
||||
data[i][j].setYCoord(j);
|
||||
data[i][j].setOriginalValue(data[i][j].getBinValue());
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = 0; y < yAxis.getDataSize(); y++) {
|
||||
centerPanel.add(yAxis.getDataCell(y));
|
||||
for (int x = 0; x < xAxis.getDataSize(); x++) {
|
||||
centerPanel.add(data[x][y]);
|
||||
}
|
||||
}
|
||||
|
||||
// reset locked status
|
||||
locked = tempLock;
|
||||
|
||||
|
@ -484,18 +495,20 @@ public class Table3D extends Table {
|
|||
binData = yAxis.saveFile(binData);
|
||||
int offset = 0;
|
||||
|
||||
for (int x = 0; x < yAxis.getDataSize(); x++) {
|
||||
for (int y = 0; y < xAxis.getDataSize(); y++) {
|
||||
int iMax = columnBased ? xAxis.getDataSize() : yAxis.getDataSize();
|
||||
int jMax = columnBased ? yAxis.getDataSize() : xAxis.getDataSize();
|
||||
for (int i = 0; i < iMax; i++) {
|
||||
for (int j = 0; j < jMax; j++) {
|
||||
|
||||
// determine output byte values
|
||||
byte[] output;
|
||||
if (storageType != STORAGE_TYPE_FLOAT) {
|
||||
output = RomAttributeParser.parseIntegerValue((int) data[y][x].getBinValue(), endian, storageType);
|
||||
output = RomAttributeParser.parseIntegerValue((int) data[i][j].getBinValue(), endian, storageType);
|
||||
for (int z = 0; z < storageType; z++) {
|
||||
binData[offset * storageType + z + storageAddress - ramOffset] = output[z];
|
||||
}
|
||||
} else { // float
|
||||
output = RomAttributeParser.floatToByte((float) data[y][x].getBinValue(), endian);
|
||||
output = RomAttributeParser.floatToByte((float) data[i][j].getBinValue(), endian);
|
||||
for (int z = 0; z < 4; z++) {
|
||||
binData[offset * 4 + z + storageAddress - ramOffset] = output[z];
|
||||
}
|
||||
|
|
|
@ -4,15 +4,7 @@ package enginuity.xml;
|
|||
|
||||
import enginuity.ECUEditor;
|
||||
import enginuity.Settings;
|
||||
import enginuity.maps.DataCell;
|
||||
import enginuity.maps.Rom;
|
||||
import enginuity.maps.RomID;
|
||||
import enginuity.maps.Scale;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.maps.Table1D;
|
||||
import enginuity.maps.Table2D;
|
||||
import enginuity.maps.Table3D;
|
||||
import enginuity.maps.TableSwitch;
|
||||
import enginuity.maps.*;
|
||||
import enginuity.swing.DebugPanel;
|
||||
import enginuity.swing.JProgressPane;
|
||||
import enginuity.util.LogManager;
|
||||
|
@ -25,7 +17,7 @@ import static org.w3c.dom.Node.ELEMENT_NODE;
|
|||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.management.modelmbean.XMLParseException;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -373,6 +365,7 @@ public final class DOMRomUnmarshaller {
|
|||
table.setLogParam(unmarshallAttribute(tableNode, "logparam", table.getLogParam()));
|
||||
|
||||
if (table.getType() == Table.TABLE_3D) {
|
||||
((Table3D) table).setColumnBased(unmarshallAttribute(tableNode, "colbased", ((Table3D) table).getColumnBased()));
|
||||
((Table3D) table).setFlipX(unmarshallAttribute(tableNode, "flipx", ((Table3D) table).getFlipX()));
|
||||
((Table3D) table).setFlipY(unmarshallAttribute(tableNode, "flipy", ((Table3D) table).getFlipY()));
|
||||
((Table3D) table).setSizeX(unmarshallAttribute(tableNode, "sizex", ((Table3D) table).getSizeX()));
|
||||
|
|
Loading…
Reference in New Issue