only:EPIC: Improve toolset for default tune canned tune generation #4871

This commit is contained in:
rusefillc 2023-11-26 00:01:34 -05:00
parent 720660e9e0
commit be06316e80
2 changed files with 2 additions and 6 deletions

View File

@ -80,7 +80,7 @@ public class CurveData {
return "static const float " +
getCannedName() + "[" + rawData.length + "] = " +
toString(rawData) +
";\n\n";
";\n";
}
@NotNull

View File

@ -45,12 +45,10 @@ public class TuneReadWriteTest {
CurveData xRpmCurve = CurveData.valueOf(TUNE_NAME, xRpmBinsName, model);
Assert.assertEquals("static const float hardCodedignitionIatCorrRpmBins[16] = " +
"{880.0, 1260.0, 1640.0, 2020.0, 2400.0, 2780.0, 3000.0, 3380.0, 3760.0, 4140.0, 4520.0, 5000.0, 5700.0, 6500.0, 7200.0, 8000.0};\n" +
"\n", xRpmCurve.getCsourceCode());
"{880.0, 1260.0, 1640.0, 2020.0, 2400.0, 2780.0, 3000.0, 3380.0, 3760.0, 4140.0, 4520.0, 5000.0, 5700.0, 6500.0, 7200.0, 8000.0};\n", xRpmCurve.getCsourceCode());
Assert.assertEquals("static void cannedignitionIatCorrRpmBins() {\n" +
"\tstatic const float hardCodedignitionIatCorrRpmBins[16] = {880.0, 1260.0, 1640.0, 2020.0, 2400.0, 2780.0, 3000.0, 3380.0, 3760.0, 4140.0, 4520.0, 5000.0, 5700.0, 6500.0, 7200.0, 8000.0};\n" +
"\n" +
"\tcopyArray(config->ignitionIatCorrRpmBins, hardCodedignitionIatCorrRpmBins);\n" +
"}\n" +
"\n", xRpmCurve.getCsourceMethod("config->"));
@ -83,9 +81,7 @@ public class TuneReadWriteTest {
public void testALotTogether() throws IOException {
String expected = "static void cannedveTable() {\n" +
"\tstatic const float hardCodedveRpmBins[16] = {650.0, 800.0, 1100.0, 1400.0, 1700.0, 2000.0, 2300.0, 2600.0, 2900.0, 3200.0, 3500.0, 3800.0, 4100.0, 4400.0, 4700.0, 7000.0};\n" +
"\n" +
"\tstatic const float hardCodedveLoadBins[16] = {10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0, 160.0};\n" +
"\n" +
"static const float hardCodedveTable[16][16] = {\n" +
"/*unittest*/\n" +
"{/* 0 10.000\t*//* 0 650.0*/80.000,\t/* 1 800.0*/80.000,\t/* 2 1100.0*/80.000,\t/* 3 1400.0*/80.000,\t/* 4 1700.0*/80.000,\t/* 5 2000.0*/80.000,\t/* 6 2300.0*/80.000,\t/* 7 2600.0*/80.000,\t/* 8 2900.0*/80.000,\t/* 9 3200.0*/80.000,\t/* 10 3500.0*/80.000,\t/* 11 3800.0*/80.000,\t/* 12 4100.0*/80.000,\t/* 13 4400.0*/80.000,\t/* 14 4700.0*/80.000,\t/* 15 7000.0*/80.000,\t},\n" +