only:EPIC: Improve toolset for default tune canned tune generation #4871
This commit is contained in:
parent
9093acf9a5
commit
4f4f4d1c00
|
@ -2,6 +2,7 @@ package com.rusefi.tools.tune;
|
|||
|
||||
import com.opensr5.ini.IniFileModel;
|
||||
import com.opensr5.ini.field.ArrayIniField;
|
||||
import com.opensr5.ini.field.IniField;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
@ -25,7 +26,12 @@ public class TableData implements HoHo {
|
|||
|
||||
@NotNull
|
||||
public static TableData readTable(String msqFileName, String tableName, IniFileModel model) throws IOException {
|
||||
ArrayIniField field = (ArrayIniField) model.allIniFields.get(tableName);
|
||||
IniField iniField = model.allIniFields.get(tableName);
|
||||
if (!(iniField instanceof ArrayIniField)) {
|
||||
// this could happen if older tune is not compatible with newer .ini
|
||||
return null;
|
||||
}
|
||||
ArrayIniField field = (ArrayIniField) iniField;
|
||||
|
||||
int rows = field.getRows();
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public class TuneCanTool {
|
|||
StringBuilder methods = new StringBuilder();
|
||||
|
||||
Msq defaultTune = Msq.readTune(defaultTuneFileName);
|
||||
StringBuilder sb = TuneCanTool.getTunePatch(defaultTune, custom, ini, defaultTuneFileName, methods);
|
||||
StringBuilder sb = TuneCanTool.getTunePatch(defaultTune, custom, ini, localFileName, methods);
|
||||
|
||||
String fileNameMethods = reportsOutputFolder + "/" + vehicleName + "_methods.md";
|
||||
try (FileWriter methodsWriter = new FileWriter(fileNameMethods)) {
|
||||
|
@ -195,6 +195,8 @@ public class TuneCanTool {
|
|||
|
||||
if (cf.getArraySizes().length == 2) {
|
||||
TableData tableData = TableData.readTable(currentTuneFileName, name, ini);
|
||||
if (tableData == null)
|
||||
continue;
|
||||
System.out.printf(" " + name);
|
||||
|
||||
methods.append(tableData.getCsourceMethod(parentReference));
|
||||
|
|
Loading…
Reference in New Issue