toolset progress
This commit is contained in:
parent
9d240fd536
commit
8bcc3aeb64
|
@ -43,6 +43,7 @@ java \
|
|||
-c_destination config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h \
|
||||
-signature tunerstudio/generated/signature_kin.txt \
|
||||
-signature_destination controllers/generated/signature_kin.h \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-prepend config/boards/kinetis/config/rusefi_config_kinetis.txt \
|
||||
-prepend config/boards/kinetis/config/tunerstudio/generated/kinetis_prefix.txt
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ cd ../../../..
|
|||
|
||||
java -DSystemOut.name=gen_enum_to_string_kinetis \
|
||||
-jar ../java_tools/enum2string.jar \
|
||||
-inputPath . \
|
||||
-outputPath config/boards/kinetis/config/controllers/algo \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-enumInputFile config/boards/kinetis/rusefi_hw_enums.h
|
||||
|
|
|
@ -43,6 +43,7 @@ java -DSystemOut.name=gen_config_board \
|
|||
-ts_output_name generated/rusefi_${SHORT_BOARDNAME}.ini \
|
||||
-signature tunerstudio/generated/signature_${SHORT_BOARDNAME}.txt \
|
||||
-signature_destination controllers/generated/signature_${SHORT_BOARDNAME}.h \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-prepend tunerstudio/generated/${BOARDNAME}_prefix.txt \
|
||||
-prepend config/boards/${BOARDNAME}/prepend.txt
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ java -DSystemOut.name=gen_config \
|
|||
-java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/Fields.java \
|
||||
-signature tunerstudio/generated/signature_all.txt \
|
||||
-signature_destination controllers/generated/signature_all.h \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-romraider_destination ../java_console/rusefi.xml
|
||||
|
||||
[ $? -eq 0 ] || { echo "ERROR generating default"; exit 1; }
|
||||
|
|
|
@ -6,7 +6,6 @@ rm gen_enum_to_string.log
|
|||
|
||||
java -DSystemOut.name=gen_enum_to_string \
|
||||
-jar ../java_tools/enum2string.jar \
|
||||
-inputPath . \
|
||||
-outputPath controllers/algo \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-enumInputFile controllers/algo/rusefi_hw_enums.h \
|
||||
|
|
|
@ -377,7 +377,31 @@ struct ThermistorConf @brief Thermistor curve parameters
|
|||
adc_channel_e adcChannel;
|
||||
end_struct
|
||||
|
||||
custom engine_type_e 4 bits, S32, @OFFSET@, [0:2], "AUDI_AAN", "DODGE_NEON_1995", "FORD_ASPIRE_1996", "FORD_FIESTA", "NISSAN_PRIMERA", "HONDA_ACCORD", "FORD_INLINE_6_1995", "GY6_139QMB"
|
||||
#define ET_DODGE_NEON_1995 2
|
||||
#define ET_FORD_ASPIRE 3
|
||||
#define ET_FORD_FIESTA 4
|
||||
#define ET_FORD_INLINE_6 7
|
||||
#define ET_ROVER_V8 10
|
||||
#define ET_BMW_E34 25
|
||||
#define ET_CAMARO 35
|
||||
|
||||
#define ET_MRE_MIATA_NA6_VAF 12
|
||||
#define ET_MRE_MIATA_NB2_MAP 11
|
||||
#define ET_MRE_MIATA_NB2_MAF 15
|
||||
#define ET_MRE_OLD_TEST_BOARD 30
|
||||
#define ET_MRE_NEW_TEST_BOARD 31
|
||||
#define ET_MRE_DEFAULTS 60
|
||||
#define ET_MRE_MIATA_NA6_MAP 66
|
||||
|
||||
#define ET_FRANKENSO_MIATA_NA6 41
|
||||
#define ET_FRANKENSO_MIATA_NB2 47
|
||||
#define ET_FRANKENSO_MIATA_NA6_VAF 57
|
||||
#define ET_BMW_M73_PROTEUS 63
|
||||
#define ET_CITROEN_TU3JP 65
|
||||
|
||||
|
||||
|
||||
custom engine_type_e 4 bits, S32, @OFFSET@, [0:6], @@engine_type_e_auto_enum@@
|
||||
engine_type_e engineType;http://rusefi.com/wiki/index.php?title=Manual:Engine_Type\nset engine_type X
|
||||
|
||||
int engineSnifferRpmThreshold;Engine sniffer would be disabled above this rpm\nset engineSnifferRpmThreshold X;"RPM", 1, 0, 0,30000, 0
|
||||
|
@ -1688,28 +1712,6 @@ end_struct
|
|||
#define PROTOCOL_COIL1_SHORT_NAME "c1"
|
||||
#define PROTOCOL_INJ1_SHORT_NAME "i1"
|
||||
|
||||
#define ET_DODGE_NEON_1995 2
|
||||
#define ET_FORD_ASPIRE 3
|
||||
#define ET_FORD_FIESTA 4
|
||||
#define ET_FORD_INLINE_6 7
|
||||
#define ET_ROVER_V8 10
|
||||
#define ET_BMW_E34 25
|
||||
#define ET_CAMARO 35
|
||||
|
||||
#define ET_MRE_MIATA_NA6_VAF 12
|
||||
#define ET_MRE_MIATA_NB2_MAP 11
|
||||
#define ET_MRE_MIATA_NB2_MAF 15
|
||||
#define ET_MRE_OLD_TEST_BOARD 30
|
||||
#define ET_MRE_NEW_TEST_BOARD 31
|
||||
#define ET_MRE_DEFAULTS 60
|
||||
#define ET_MRE_MIATA_NA6_MAP 66
|
||||
|
||||
#define ET_FRANKENSO_MIATA_NA6 41
|
||||
#define ET_FRANKENSO_MIATA_NB2 47
|
||||
#define ET_FRANKENSO_MIATA_NA6_VAF 57
|
||||
#define ET_BMW_M73_PROTEUS 63
|
||||
#define ET_CITROEN_TU3JP 65
|
||||
|
||||
! some board files override this value using prepend file
|
||||
#define ts_show_hip9011 true
|
||||
#define ts_show_main_relay true
|
||||
|
|
|
@ -417,9 +417,9 @@ public class BinaryProtocol implements BinaryProtocolCommands {
|
|||
// that's unusual - most of the protocol is LITTLE_ENDIAN
|
||||
bb.order(ByteOrder.BIG_ENDIAN);
|
||||
int crcFromController = bb.getInt();
|
||||
log.info(String.format("From rusEFI tune CRC32 %x %d\n", crcFromController, crcFromController));
|
||||
log.info(String.format("From rusEFI tune CRC32 0x%x %d\n", crcFromController, crcFromController));
|
||||
short crc16FromController = (short) crcFromController;
|
||||
log.info(String.format("From rusEFI tune CRC16 %x %d\n", crc16FromController, crc16FromController));
|
||||
log.info(String.format("From rusEFI tune CRC16 0x%x %d\n", crc16FromController, crc16FromController));
|
||||
if (crcOfLocallyCachedConfiguration == crcFromController) {
|
||||
return localCached;
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -104,64 +104,90 @@ public class ConfigDefinition {
|
|||
// disable the lazy checks because we use timestamps to detect changes
|
||||
LazyFile.setLazyFileEnabled(false);
|
||||
|
||||
EnumsReader enumsReader = new EnumsReader();
|
||||
ReaderState state = new ReaderState();
|
||||
|
||||
for (int i = 0; i < args.length - 1; i += 2) {
|
||||
String key = args[i];
|
||||
if (key.equals("-tool")) {
|
||||
ConfigDefinition.TOOL = args[i + 1];
|
||||
} else if (key.equals(KEY_DEFINITION)) {
|
||||
definitionInputFile = args[i + 1];
|
||||
inputFiles.add(definitionInputFile);
|
||||
} else if (key.equals(KEY_TS_DESTINATION)) {
|
||||
tsPath = args[i + 1];
|
||||
} else if (key.equals(KEY_C_DESTINATION)) {
|
||||
destCHeaderFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_C_FSIO_GETTERS)) {
|
||||
destCFsioGettersFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_C_FSIO_STRING)) {
|
||||
stringsCFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_C_FSIO_NAMES)) {
|
||||
namesCFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_C_FSIO_CONSTANTS)) {
|
||||
destCFsioConstantsFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_ZERO_INIT)) {
|
||||
needZeroInit = Boolean.parseBoolean(args[i + 1]);
|
||||
} else if (key.equals(KEY_WITH_C_DEFINES)) {
|
||||
CHeaderConsumer.withC_Defines = Boolean.parseBoolean(args[i + 1]);
|
||||
} else if (key.equals(KEY_C_DEFINES)) {
|
||||
destCDefinesFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_JAVA_DESTINATION)) {
|
||||
javaDestinationFileName = args[i + 1];
|
||||
} else if (key.equals(KEY_FIRING)) {
|
||||
firingEnumFileName = args[i + 1];
|
||||
inputFiles.add(firingEnumFileName);
|
||||
} else if (key.equals(KEY_ROMRAIDER_DESTINATION)) {
|
||||
romRaiderDestination = args[i + 1];
|
||||
} else if (key.equals(KEY_PREPEND)) {
|
||||
prependFiles.add(args[i + 1]);
|
||||
inputFiles.add(args[i + 1]);
|
||||
} else if (key.equals(KEY_SIGNATURE)) {
|
||||
signaturePrependFile = args[i + 1];
|
||||
prependFiles.add(args[i + 1]);
|
||||
// don't add this file to the 'inputFiles'
|
||||
} else if (key.equals(KEY_SIGNATURE_DESTINATION)) {
|
||||
signatureDestination = args[i + 1];
|
||||
} else if (key.equals(EnumToString.KEY_ENUM_INPUT_FILE)) {
|
||||
String inputFile = args[i + 1];
|
||||
enumsReader.process(".", inputFile);
|
||||
} else if (key.equals(KEY_CACHE)) {
|
||||
cachePath = args[i + 1];
|
||||
} else if (key.equals(KEY_CACHE_ZIP_FILE)) {
|
||||
cacheZipFile = args[i + 1];
|
||||
} else if (key.equals(KEY_SKIP)) {
|
||||
// is this now not needed in light if LazyFile surving the same goal of not changing output unless needed?
|
||||
skipRebuildFile = args[i + 1];
|
||||
} else if (key.equals("-ts_output_name")) {
|
||||
TSProjectConsumer.TS_FILE_OUTPUT_NAME = args[i + 1];
|
||||
} else if (key.equals(KEY_ROM_INPUT)) {
|
||||
String inputFilePath = args[i + 1];
|
||||
romRaiderInputFile = inputFilePath + File.separator + ROM_RAIDER_XML_TEMPLATE;
|
||||
inputFiles.add(romRaiderInputFile);
|
||||
switch (key) {
|
||||
case "-tool":
|
||||
ConfigDefinition.TOOL = args[i + 1];
|
||||
break;
|
||||
case KEY_DEFINITION:
|
||||
definitionInputFile = args[i + 1];
|
||||
inputFiles.add(definitionInputFile);
|
||||
break;
|
||||
case KEY_TS_DESTINATION:
|
||||
tsPath = args[i + 1];
|
||||
break;
|
||||
case KEY_C_DESTINATION:
|
||||
destCHeaderFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_GETTERS:
|
||||
destCFsioGettersFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_STRING:
|
||||
stringsCFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_NAMES:
|
||||
namesCFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_CONSTANTS:
|
||||
destCFsioConstantsFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_ZERO_INIT:
|
||||
needZeroInit = Boolean.parseBoolean(args[i + 1]);
|
||||
break;
|
||||
case KEY_WITH_C_DEFINES:
|
||||
CHeaderConsumer.withC_Defines = Boolean.parseBoolean(args[i + 1]);
|
||||
break;
|
||||
case KEY_C_DEFINES:
|
||||
destCDefinesFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_JAVA_DESTINATION:
|
||||
javaDestinationFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_FIRING:
|
||||
firingEnumFileName = args[i + 1];
|
||||
inputFiles.add(firingEnumFileName);
|
||||
break;
|
||||
case KEY_ROMRAIDER_DESTINATION:
|
||||
romRaiderDestination = args[i + 1];
|
||||
break;
|
||||
case KEY_PREPEND:
|
||||
prependFiles.add(args[i + 1]);
|
||||
inputFiles.add(args[i + 1]);
|
||||
break;
|
||||
case KEY_SIGNATURE:
|
||||
signaturePrependFile = args[i + 1];
|
||||
prependFiles.add(args[i + 1]);
|
||||
// don't add this file to the 'inputFiles'
|
||||
break;
|
||||
case KEY_SIGNATURE_DESTINATION:
|
||||
signatureDestination = args[i + 1];
|
||||
break;
|
||||
case EnumToString.KEY_ENUM_INPUT_FILE:
|
||||
String inputFile = args[i + 1];
|
||||
state.enumsReader.process(".", inputFile);
|
||||
SystemOut.println(state.enumsReader.getEnums() + " total enumsReader");
|
||||
break;
|
||||
case KEY_CACHE:
|
||||
cachePath = args[i + 1];
|
||||
break;
|
||||
case KEY_CACHE_ZIP_FILE:
|
||||
cacheZipFile = args[i + 1];
|
||||
break;
|
||||
case KEY_SKIP:
|
||||
// is this now not needed in light if LazyFile surving the same goal of not changing output unless needed?
|
||||
skipRebuildFile = args[i + 1];
|
||||
break;
|
||||
case "-ts_output_name":
|
||||
TSProjectConsumer.TS_FILE_OUTPUT_NAME = args[i + 1];
|
||||
break;
|
||||
case KEY_ROM_INPUT:
|
||||
String inputFilePath = args[i + 1];
|
||||
romRaiderInputFile = inputFilePath + File.separator + ROM_RAIDER_XML_TEMPLATE;
|
||||
inputFiles.add(romRaiderInputFile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,7 +243,6 @@ public class ConfigDefinition {
|
|||
readPrependValues(VariableRegistry.INSTANCE, prependFile);
|
||||
|
||||
BufferedReader definitionReader = new BufferedReader(new InputStreamReader(new FileInputStream(definitionInputFile), IoUtils.CHARSET.name()));
|
||||
ReaderState state = new ReaderState();
|
||||
|
||||
List<ConfigurationConsumer> destinations = new ArrayList<>();
|
||||
if (tsPath != null && needToUpdateTsFiles) {
|
||||
|
@ -278,7 +303,7 @@ public class ConfigDefinition {
|
|||
private static String getDefinitionMD5(String fullFileName) throws IOException {
|
||||
File source = new File(fullFileName);
|
||||
FileInputStream fileInputStream = new FileInputStream(fullFileName);
|
||||
byte content[] = new byte[(int) source.length()];
|
||||
byte[] content = new byte[(int) source.length()];
|
||||
if (fileInputStream.read(content) != content.length)
|
||||
return "";
|
||||
return getMd5(content);
|
||||
|
|
|
@ -31,6 +31,9 @@ public class ReaderState {
|
|||
public Map<String, String> tsCustomLine = new HashMap<>();
|
||||
public Map<String, ConfigStructure> structures = new HashMap<>();
|
||||
|
||||
public EnumsReader enumsReader = new EnumsReader();
|
||||
|
||||
|
||||
private static void handleBitLine(ReaderState state, String line) {
|
||||
line = line.substring(BIT.length() + 1).trim();
|
||||
|
||||
|
@ -44,7 +47,7 @@ public class ReaderState {
|
|||
bitName = line.substring(0, index);
|
||||
comment = line.substring(index + 1);
|
||||
}
|
||||
String bitNameParts[] = bitName.split(",");
|
||||
String[] bitNameParts = bitName.split(",");
|
||||
|
||||
String trueName = bitNameParts.length > 1 ? bitNameParts[1] : null;
|
||||
String falseName = bitNameParts.length > 2 ? bitNameParts[2] : null;
|
||||
|
@ -68,6 +71,12 @@ public class ReaderState {
|
|||
line = line.substring(CUSTOM.length() + 1).trim();
|
||||
int index = line.indexOf(' ');
|
||||
String name = line.substring(0, index);
|
||||
|
||||
String autoEnumOptions = VariableRegistry.getEnumOptionsForTunerStudio(state.enumsReader, VariableRegistry.INSTANCE, name);
|
||||
if (autoEnumOptions != null) {
|
||||
VariableRegistry.INSTANCE.register(name + "_auto_enum", autoEnumOptions);
|
||||
}
|
||||
|
||||
line = line.substring(index).trim();
|
||||
index = line.indexOf(' ');
|
||||
String customSize = line.substring(0, index);
|
||||
|
|
|
@ -36,9 +36,13 @@ public class VariableRegistry {
|
|||
public VariableRegistry() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static CharSequence getEnumOptionsForTunerStudio(EnumsReader enumsReader, VariableRegistry variableRegistry, TreeMap<Integer, String> valueNameById, String enumName) {
|
||||
for (Value value : enumsReader.getEnums().get(enumName).values()) {
|
||||
public static String getEnumOptionsForTunerStudio(EnumsReader enumsReader, VariableRegistry variableRegistry, String enumName) {
|
||||
TreeMap<Integer, String> valueNameById = new TreeMap<>();
|
||||
|
||||
Map<String, Value> stringValueMap = enumsReader.getEnums().get(enumName);
|
||||
if (stringValueMap == null)
|
||||
return null;
|
||||
for (Value value : stringValueMap.values()) {
|
||||
if (value.getValue().contains("ENUM_32_BITS"))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.junit.Test;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
|
@ -23,9 +22,8 @@ public class ConfigDefinitionTest {
|
|||
|
||||
ConfigDefinition.readPrependValues(variableRegistry, FIRMWARE + File.separator + "integration/rusefi_config.txt");
|
||||
|
||||
TreeMap<Integer, String> valueNameById = new TreeMap<>();
|
||||
|
||||
CharSequence sb = VariableRegistry.getEnumOptionsForTunerStudio(enumsReader, variableRegistry, valueNameById, "engine_type_e");
|
||||
String sb = VariableRegistry.getEnumOptionsForTunerStudio(enumsReader, variableRegistry, "engine_type_e");
|
||||
|
||||
System.out.println(sb);
|
||||
assertNotNull(sb);
|
||||
|
|
Loading…
Reference in New Issue