mirror of https://github.com/rusefi/RomRaider.git
Final changes
This commit is contained in:
parent
e0b9545162
commit
7ae56ea61d
|
@ -28,6 +28,7 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.romraider.Settings;
|
import com.romraider.Settings;
|
||||||
import com.romraider.Settings.Endian;
|
import com.romraider.Settings.Endian;
|
||||||
|
import com.romraider.editor.ecu.ECUEditorManager;
|
||||||
import com.romraider.util.ByteUtil;
|
import com.romraider.util.ByteUtil;
|
||||||
import com.romraider.util.JEPUtil;
|
import com.romraider.util.JEPUtil;
|
||||||
import com.romraider.util.NumberUtil;
|
import com.romraider.util.NumberUtil;
|
||||||
|
@ -292,7 +293,10 @@ public class DataCell {
|
||||||
if(!table.isStaticDataTable() && this.isSelected != selected) {
|
if(!table.isStaticDataTable() && this.isSelected != selected) {
|
||||||
this.isSelected = selected;
|
this.isSelected = selected;
|
||||||
|
|
||||||
if(view!=null) view.drawCell();
|
if(view!=null) {
|
||||||
|
ECUEditorManager.getECUEditor().getTableToolBar().updateTableToolBar(table);
|
||||||
|
view.drawCell();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,11 +311,13 @@ public class Rom extends DefaultMutableTreeNode implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Most of this function is useless now, since each Datacell is now responsible for each memory region
|
//Most of this function is useless now, since each Datacell is now responsible for each memory region
|
||||||
//It is only used in the Switch Tables, since those don't use DataCells
|
//It is only used to correct the Subaru Checksum. Should be moved somewhere else TODO
|
||||||
public byte[] saveFile() {
|
public byte[] saveFile() {
|
||||||
|
|
||||||
final List<TableTreeNode> checksumTables = new ArrayList<TableTreeNode>();
|
final List<TableTreeNode> checksumTables = new ArrayList<TableTreeNode>();
|
||||||
for (TableTreeNode tableNode : tableNodes) {
|
for (TableTreeNode tableNode : tableNodes) {
|
||||||
|
|
||||||
|
//Only used in BitwiseSwitch Table...
|
||||||
tableNode.getTable().saveFile(binData);
|
tableNode.getTable().saveFile(binData);
|
||||||
if (tableNode.getTable().getName().contains("Checksum Fix")) {
|
if (tableNode.getTable().getName().contains("Checksum Fix")) {
|
||||||
checksumTables.add(tableNode);
|
checksumTables.add(tableNode);
|
||||||
|
|
|
@ -27,9 +27,7 @@ import javax.naming.NameNotFoundException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.romraider.Settings;
|
import com.romraider.Settings;
|
||||||
import com.romraider.editor.ecu.ECUEditorManager;
|
|
||||||
import com.romraider.swing.TableFrame;
|
import com.romraider.swing.TableFrame;
|
||||||
import com.romraider.swing.TableToolBar;
|
|
||||||
import com.romraider.util.ByteUtil;
|
import com.romraider.util.ByteUtil;
|
||||||
import com.romraider.util.JEPUtil;
|
import com.romraider.util.JEPUtil;
|
||||||
import com.romraider.util.NumberUtil;
|
import com.romraider.util.NumberUtil;
|
||||||
|
@ -610,24 +608,14 @@ public abstract class Table implements Serializable {
|
||||||
if(y >= 0 && y < data.length) {
|
if(y >= 0 && y < data.length) {
|
||||||
clearSelection();
|
clearSelection();
|
||||||
data[y].setSelected(true);
|
data[y].setSelected(true);
|
||||||
if(tableView!=null) tableView.highlightY = y;
|
if(tableView!=null) tableView.highlightY = y;
|
||||||
|
|
||||||
TableToolBar bar = ECUEditorManager.getECUEditor().getTableToolBar();
|
|
||||||
|
|
||||||
if(bar!=null)
|
|
||||||
bar.updateTableToolBar(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectCellAtWithoutClear(int y) {
|
public void selectCellAtWithoutClear(int y) {
|
||||||
if(y >= 0 && y < data.length) {
|
if(y >= 0 && y < data.length) {
|
||||||
data[y].setSelected(true);
|
data[y].setSelected(true);
|
||||||
if(tableView!=null)tableView.highlightY = y;
|
if(tableView!=null)tableView.highlightY = y;
|
||||||
|
|
||||||
TableToolBar bar = ECUEditorManager.getECUEditor().getTableToolBar();
|
|
||||||
|
|
||||||
if(bar!=null)
|
|
||||||
bar.updateTableToolBar(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,11 +94,7 @@ public class Table2D extends Table {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] saveFile(byte[] binData) {
|
public byte[] saveFile(byte[] binData) {
|
||||||
/*
|
|
||||||
binData = super.saveFile(binData);
|
|
||||||
binData = axis.saveFile(binData);*/
|
|
||||||
|
|
||||||
return binData;
|
return binData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,11 @@ public class TableBitwiseSwitchView extends TableView {
|
||||||
|
|
||||||
public TableBitwiseSwitchView(TableBitwiseSwitch table) {
|
public TableBitwiseSwitchView(TableBitwiseSwitch table) {
|
||||||
super(table);
|
super(table);
|
||||||
|
this.table = table;
|
||||||
removeAll();
|
removeAll();
|
||||||
setLayout(new BorderLayout());
|
setLayout(new BorderLayout());
|
||||||
checkboxes = new ArrayList<JCheckBox>();
|
checkboxes = new ArrayList<JCheckBox>();
|
||||||
|
populateTableVisual();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.romraider.maps;
|
||||||
public class TableSwitchView extends Table1DView {
|
public class TableSwitchView extends Table1DView {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//Same as a Table1DView just hidden data
|
||||||
public TableSwitchView(TableSwitch t) {
|
public TableSwitchView(TableSwitch t) {
|
||||||
super(t, true);
|
super(t, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,6 +532,15 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
||||||
if (fc.showSaveDialog(parent) == JFileChooser.APPROVE_OPTION) {
|
if (fc.showSaveDialog(parent) == JFileChooser.APPROVE_OPTION) {
|
||||||
File selectedFile = fc.getSelectedFile();
|
File selectedFile = fc.getSelectedFile();
|
||||||
|
|
||||||
|
//Append suffix if user didn't set anything
|
||||||
|
if(!selectedFile.getName().contains(".")) {
|
||||||
|
Rom lastSelectedRom = ECUEditorManager.getECUEditor().getLastSelectedRom();
|
||||||
|
String lastFile = lastSelectedRom.getFileName().toLowerCase();
|
||||||
|
String format = ".bin";
|
||||||
|
if(lastFile.endsWith(".hex")) format=".hex";
|
||||||
|
selectedFile = new File(selectedFile + format);
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedFile.exists()) {
|
if (selectedFile.exists()) {
|
||||||
int option = showConfirmDialog(parent,
|
int option = showConfirmDialog(parent,
|
||||||
MessageFormat.format(
|
MessageFormat.format(
|
||||||
|
@ -543,16 +552,7 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Append suffix if user didnt set anything
|
|
||||||
if(!selectedFile.getName().contains(".")) {
|
|
||||||
Rom lastSelectedRom = ECUEditorManager.getECUEditor().getLastSelectedRom();
|
|
||||||
String lastFile = lastSelectedRom.getFileName().toLowerCase();
|
|
||||||
String format = ".bin";
|
|
||||||
if(lastFile.endsWith(".hex")) format=".hex";
|
|
||||||
selectedFile = new File(selectedFile + format);
|
|
||||||
}
|
|
||||||
|
|
||||||
return selectedFile;
|
return selectedFile;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue