auto-sync
This commit is contained in:
parent
298ec97a3f
commit
fd5c16dc65
|
@ -5,16 +5,16 @@
|
|||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602" moduleId="org.eclipse.cdt.core.settings" name="Debug_EMS">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602" name="Debug_EMS" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602" name="Debug_EMS" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.1168037802" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.2135519682" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
|
||||
|
@ -127,6 +127,7 @@
|
|||
<listOptionValue builtIn="false" value=""../development/hw_layer""/>
|
||||
<listOptionValue builtIn="false" value=""../hw_layer""/>
|
||||
<listOptionValue builtIn="false" value=""../hw_layer/lcd""/>
|
||||
<listOptionValue builtIn="false" value=""../hw_layer/mass_storage""/>
|
||||
<listOptionValue builtIn="false" value=""../hw_layer/serial_over_usb""/>
|
||||
<listOptionValue builtIn="false" value=""../config/system""/>
|
||||
<listOptionValue builtIn="false" value=""../config/stm32f4ems""/>
|
||||
|
@ -200,16 +201,16 @@
|
|||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1741644682" moduleId="org.eclipse.cdt.core.settings" name="Release_broken_original">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1741644682" name="Release_broken_original" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1741644682" name="Release_broken_original" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1741644682." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release.831183705" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.584468799" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.size" valueType="enumerated"/>
|
||||
|
@ -283,16 +284,16 @@
|
|||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.1044213654" moduleId="org.eclipse.cdt.core.settings" name="Debug_EGT2CAN">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.1044213654" name="Debug_EGT2CAN" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.1044213654" name="Debug_EGT2CAN" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.1044213654." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.377175633" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1589341452" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
|
||||
|
@ -569,16 +570,16 @@
|
|||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.160551264" moduleId="org.eclipse.cdt.core.settings" name="Release_EMS">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.160551264" name="Release_EMS" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.160551264" name="Release_EMS" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1034318602.160551264." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.1412440709" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.871834085" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
|
||||
|
|
|
@ -205,7 +205,7 @@ firing_order_e firingOrder;
|
|||
end_struct
|
||||
|
||||
specs_s specs
|
||||
float cylinderBore;+Cylinder diameter, in mm.
|
||||
float cylinderBore;+Cylinder diameter, in mm.;"mm", 1, 0, 0, 20000.0, 2
|
||||
int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM", 1, 0, 0,30000, 0
|
||||
int rpmHardLimit;;"rpm", 1, 0, 0, 20000.0, 2
|
||||
|
||||
|
|
|
@ -298,5 +298,5 @@ int getRusEfiVersion(void) {
|
|||
return 123; // this is here to make the compiler happy about the unused array
|
||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||
return 3211; // this is here to make the compiler happy about the unused array
|
||||
return 20160609;
|
||||
return 20160611;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jun 10 18:45:59 EDT 2016
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Jun 11 15:06:14 EDT 2016
|
||||
|
||||
pageSize = 17080
|
||||
page = 1
|
||||
|
@ -95,7 +95,7 @@ page = 1
|
|||
displacement = scalar, F32, 400, "L", 1, 0, 0, 1000.0, 2
|
||||
cylindersCount = bits, U32, 404, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
|
||||
firingOrder = bits, U32, 408, [0:3], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-5-3-6-2-4", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "fo13", "fo14", "INVALID"
|
||||
;skipping cylinderBore offset 412
|
||||
cylinderBore = scalar, F32, 412, "mm", 1, 0, 0, 20000.0, 2
|
||||
sensorSnifferRpmThreshold = scalar, S32, 416, "RPM", 1, 0, 0,30000, 0
|
||||
rpmHardLimit = scalar, S32, 420, "rpm", 1, 0, 0, 20000.0, 2
|
||||
algorithm = bits, U32, 424, [0:1], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY"
|
||||
|
@ -107,7 +107,7 @@ page = 1
|
|||
ignitionOffset = scalar, F32, 448, "RPM", 1, 0, 0, 3000.0, 0
|
||||
timingMode = bits, U32, 452 [0:0], "dynamic", "fixed"
|
||||
fixedModeTiming = scalar, F32, 456, "RPM", 1, 0, 0, 3000.0, 0
|
||||
globalTriggerAngleOffset = scalar, F32, 460, "deg", 1, 0, 0, 720, 0
|
||||
globalTriggerAngleOffset = scalar, F32, 460, "deg", 1, 0, -720, 720, 0
|
||||
analogInputDividerCoefficient = scalar, F32, 464, "coef", 1, 0, 0.01, 10.0, 2
|
||||
vbattDividerCoeff = scalar, F32, 468, "coef", 1, 0, 0.01, 20.0, 2
|
||||
vbattAdcChannel = bits, U32, 472, [0:4] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||
|
@ -1320,7 +1320,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01"
|
|||
field = "Trigger type", trigger_type
|
||||
field = "Operation mode", operationMode
|
||||
field = "With VR sensors only rising edge has reliable position"
|
||||
field = "use only rising edge", useOnlyFrontForTrigger
|
||||
field = "use only rising edge", useOnlyRisingEdgeForTrigger
|
||||
field = "Trigger Angle Offset", globalTriggerAngleOffset
|
||||
field = "#Custom Trigger"
|
||||
field = "Synchronization Needed?", trigger_customIsSynchronizationNeeded, {trigger_type == 0}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="TS2C ignitionTable" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.rusefi.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="MAIN_CLASS_NAME" value="com.rusefi.TS2C" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="currenttune.msq ignitionLoadBins ignitionRpmBins ignitionTable" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<module name="models" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -0,0 +1,22 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="TS2C veTable" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.rusefi.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="MAIN_CLASS_NAME" value="com.rusefi.TS2C" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="currenttune.msq veLoadBins veRpmBins veTable" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<module name="models" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -0,0 +1,133 @@
|
|||
package com.rusefi;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 12/27/2014
|
||||
* Andrey Belomutskiy, (c) 2012-2015
|
||||
*/
|
||||
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
|
||||
public class TS2C {
|
||||
// todo: replace with LOAD_COUNT & RPM_COUNT
|
||||
private static final int SIZE = 16;
|
||||
|
||||
private static int RPM_COUNT = 16;
|
||||
private static int LOAD_COUNT = 16;
|
||||
|
||||
static float loadBins[] = new float[LOAD_COUNT];
|
||||
static float rpmBins[] = new float[RPM_COUNT];
|
||||
static float table[][] = new float[SIZE][];
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
if (args.length != 4) {
|
||||
System.out.println("Four parameters expected: ");
|
||||
System.out.println(" INPUT_MSQ_FILE NAME LOAD_SECTION_NAME RPM_SECTION_NAME TABLE_NAME");
|
||||
System.out.println("for example");
|
||||
// section names are needed in order to generate comments about cell content
|
||||
System.out.println(" currenttune.msq veLoadBins veRpmBins veTable");
|
||||
System.exit(-1);
|
||||
}
|
||||
String fileName = args[0];
|
||||
String loadSectionName = args[1];
|
||||
String rpmSectionName = args[2];
|
||||
String tableName = args[3];
|
||||
|
||||
BufferedReader r = readAndScroll(fileName, loadSectionName);
|
||||
readAxle(loadBins, r);
|
||||
r = readAndScroll(fileName, rpmSectionName);
|
||||
readAxle(rpmBins, r);
|
||||
|
||||
for (int i = 0; i < SIZE; i++) {
|
||||
table[i] = new float[SIZE];
|
||||
}
|
||||
|
||||
r = readAndScroll(fileName, tableName);
|
||||
readTable(table, r);
|
||||
|
||||
BufferedWriter w = new BufferedWriter(new FileWriter("output.c"));
|
||||
writeTable(w, new ValueSource() {
|
||||
@Override
|
||||
public float getValue(int loadIndex, int rpmIndex) {
|
||||
return table[loadIndex][rpmIndex];
|
||||
}
|
||||
}, "TS2C");
|
||||
}
|
||||
|
||||
static void writeTable(BufferedWriter w, ValueSource valueSource, String toolName) throws IOException {
|
||||
w.write("/* Generated by " + toolName + " on " + new Date() + "*/\r\n");
|
||||
for (int loadIndex = 0; loadIndex < LOAD_COUNT; loadIndex++)
|
||||
writeLine(valueSource, w, loadIndex);
|
||||
w.close();
|
||||
}
|
||||
|
||||
private static BufferedReader readAndScroll(String fileName, String sectionName) throws IOException {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(fileName));
|
||||
System.out.println("Reading from " + fileName + ", scrolling to " + sectionName);
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (line.contains(sectionName)) {
|
||||
System.out.println("Found " + line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return reader;
|
||||
}
|
||||
|
||||
private static void writeLine(ValueSource valueSource, BufferedWriter w, int loadIndex) throws IOException {
|
||||
StringBuilder sb = new StringBuilder("{");
|
||||
|
||||
sb.append("/* " + loadIndex + " " + String.format("%3.3f", loadBins[loadIndex]) + "\t*/");
|
||||
for (int rpmIndex = 0; rpmIndex < RPM_COUNT; rpmIndex++) {
|
||||
sb.append("/* " + rpmIndex + " " + rpmBins[rpmIndex] + "*/" + String.format("%3.3f", valueSource.getValue(loadIndex, rpmIndex)) + ",\t");
|
||||
}
|
||||
sb.append("},\r\n");
|
||||
|
||||
w.write(sb.toString());
|
||||
}
|
||||
|
||||
interface ValueSource {
|
||||
float getValue(int loadIndex, int rpmIndex);
|
||||
}
|
||||
|
||||
private static void readTable(float[][] table, BufferedReader r) throws IOException {
|
||||
int index = 0;
|
||||
|
||||
while (index < SIZE) {
|
||||
String line = r.readLine();
|
||||
if (line == null)
|
||||
throw new IOException("End of file?");
|
||||
line = line.trim();
|
||||
if (line.isEmpty())
|
||||
continue;
|
||||
|
||||
String[] values = line.split(" ");
|
||||
if (values.length != SIZE)
|
||||
throw new IllegalStateException("Unexpected line: " + line);
|
||||
|
||||
for (int i = 0; i < SIZE; i++) {
|
||||
table[index][i] = Float.parseFloat(values[i]);
|
||||
}
|
||||
System.out.println("Got line " + index + ": " + Arrays.toString(table[index]));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
private static void readAxle(float[] bins, BufferedReader r) throws IOException {
|
||||
int index = 0;
|
||||
|
||||
while (index < SIZE) {
|
||||
String line = r.readLine();
|
||||
if (line == null)
|
||||
throw new IOException("End of file?");
|
||||
line = line.trim();
|
||||
if (line.isEmpty())
|
||||
continue;
|
||||
bins[index++] = Float.parseFloat(line);
|
||||
}
|
||||
|
||||
System.out.println("Got bins " + Arrays.toString(bins));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue