auto-sync

This commit is contained in:
rusEfi 2016-01-13 22:01:30 -05:00
parent 9082467c64
commit a949e0db7d
7 changed files with 65 additions and 24 deletions

View File

@ -110,7 +110,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
// set_whole_fuel_map 5
setWholeFuelMap(5 PASS_ENGINE_PARAMETER);
setMap(config->veTable, 13.5);
setMap(config->afrTable, 13.5);
setSingleCoilDwell(engineConfiguration);
engineConfiguration->ignitionMode = IM_ONE_COIL;

View File

@ -0,0 +1,19 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ConstantConditions" enabled="false" level="WARNING" enabled_by_default="false">
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
</inspection_tool>
<inspection_tool class="EmptyStatementBody" enabled="false" level="WARNING" enabled_by_default="false">
<option name="m_reportEmptyBlocks" value="true" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="StringBufferReplaceableByString" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringConcatenationInsideStringBufferAppend" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

View File

@ -19,13 +19,13 @@
package com.romraider.maps;
import static com.romraider.util.ParamChecker.isNullOrEmpty;
import com.romraider.Settings;
import com.romraider.util.SettingsManager;
import com.rusefi.Launcher;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;
import javax.naming.NameNotFoundException;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.UnsupportedFlavorException;
@ -33,15 +33,7 @@ import java.awt.event.KeyListener;
import java.io.IOException;
import java.util.StringTokenizer;
import javax.naming.NameNotFoundException;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import com.romraider.Settings;
import com.romraider.editor.ecu.ECUEditorManager;
import com.romraider.util.SettingsManager;
import com.rusefi.Launcher;
import static com.romraider.util.ParamChecker.isNullOrEmpty;
/**
* A better implementation would be a composition of two Table1D - one for axis another one for data
@ -53,7 +45,6 @@ public class Table2D extends TableWithData {
private Table1D axis = new Table1D();
private JLabel axisLabel;
private CopyTable2DWorker copyTable2DWorker;
private CopySelection2DWorker copySelection2DWorker;
public Table2D() {
@ -269,7 +260,7 @@ public class Table2D extends TableWithData {
}
Launcher.getFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
copyTable2DWorker = new CopyTable2DWorker(this);
CopyTable2DWorker copyTable2DWorker = new CopyTable2DWorker(this);
copyTable2DWorker.execute();
}
@ -280,8 +271,7 @@ public class Table2D extends TableWithData {
try {
input = (String) Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null).getTransferData(DataFlavor.stringFlavor);
st = new StringTokenizer(input);
} catch (UnsupportedFlavorException ex) { /* wrong paste type -- do nothing */
} catch (IOException ex) {
} catch (UnsupportedFlavorException | IOException ex) { /* wrong paste type -- do nothing */
}
String pasteType = st.nextToken();

View File

@ -162,7 +162,7 @@ public class Table3D extends Table {
xAxis.populateTable(input, romRamOffset);
yAxis.populateTable(input, romRamOffset);
} catch (ArrayIndexOutOfBoundsException ex) {
throw new ArrayIndexOutOfBoundsException();
throw ex;
}
for (int x = 0; x < xAxis.getDataSize(); x++) {

View File

@ -140,7 +140,7 @@ public final class RomAttributeParser {
}
return output;
} catch (IndexOutOfBoundsException ex) {
throw new IndexOutOfBoundsException();
throw ex;
}
}

View File

@ -80,7 +80,10 @@ public class FormulasPane {
return;
int algorithm = ConfigField.getIntValue(ci, Fields.ALGORITHM);
engine_load_mode_e algo = engine_load_mode_e.values()[algorithm];
engine_load_mode_e[] values = engine_load_mode_e.values();
if (algorithm >= values.length)
throw new IllegalStateException("Unexpected "+ algorithm);
engine_load_mode_e algo = values[algorithm];
String acceleration = getAccelerationVariables(ci);

View File

@ -1,5 +1,8 @@
package com.rusefi.ui;
import com.romraider.Settings;
import com.romraider.maps.Scale;
import com.romraider.maps.Table3D;
import com.rusefi.BinarySearch;
import com.rusefi.FileLog;
import com.rusefi.autotune.FuelAutoTune;
@ -28,6 +31,7 @@ public class FuelTunePane {
private final List<FuelDataPoint> incomingDataPoints = new ArrayList<>();
private final double veLoadBins[] = new double[Fields.FUEL_LOAD_COUNT];
private final double veRpmBins[] = new double[Fields.FUEL_RPM_COUNT];
private final Table3D veTable = new Table3D();
public FuelTunePane() {
final JLabel incomingBufferSize = new JLabel();
@ -57,7 +61,22 @@ public class FuelTunePane {
timer.start();
content.add(topPanel, BorderLayout.NORTH);
// UiUtils.trueLayout(content.getParent());
// todo: which one is which?
veTable.setSizeX(Fields.FUEL_LOAD_COUNT);
veTable.setSizeY(Fields.FUEL_RPM_COUNT);
veTable.getXAxis().setDataSize(Fields.FUEL_LOAD_COUNT);
veTable.getYAxis().setDataSize(Fields.FUEL_RPM_COUNT);
veTable.getXAxis().setAxisParent(veTable);
veTable.getYAxis().setAxisParent(veTable);
content.add(veTable, BorderLayout.CENTER);
veTable.setBorder(BorderFactory.createLineBorder(Color.red));
veTable.addScale(new Scale());
veTable.getXAxis().addScale(new Scale());
veTable.getYAxis().addScale(new Scale());
}
private void doJob() {
@ -95,6 +114,16 @@ public class FuelTunePane {
loadArray(veLoadBins, Fields.VETABLE.getOffset() + Fields.FUEL_RPM_COUNT * Fields.FUEL_LOAD_COUNT * 4);
loadArray(veRpmBins, Fields.VETABLE.getOffset() + Fields.FUEL_RPM_COUNT * Fields.FUEL_LOAD_COUNT * 4 + Fields.FUEL_LOAD_COUNT * 4);
BinaryProtocol bp = BinaryProtocol.instance;
byte[] content = bp.getController().getContent();
veTable.setStorageAddress(Fields.VETABLE.getOffset());
veTable.setStorageType(Settings.STORAGE_TYPE_FLOAT);
veTable.populateTable(content, 0);
veTable.drawTable();
// UiUtils.trueLayout(content.getParent());
}
private void loadMap(double[][] map, int offset) {