something was broken?

This commit is contained in:
rusefi 2020-07-06 02:05:34 -04:00
parent 6eec10da81
commit 15731e29f9
10 changed files with 20 additions and 22 deletions

View File

@ -7,7 +7,7 @@ java -DSystemOut.name=gen_live_documentation \
-definition integration/pid_state.txt \ -definition integration/pid_state.txt \
-cache_zip_file tunerstudio/generated/cache.zip \ -cache_zip_file tunerstudio/generated/cache.zip \
-cache . \ -cache . \
-java_destination ../java_console/models/src/com/rusefi/config/generated/PidState.java \ -java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/PidState.java \
-c_destination controllers/generated/pid_state_generated.h -c_destination controllers/generated/pid_state_generated.h
java -DSystemOut.name=gen_live_documentation \ java -DSystemOut.name=gen_live_documentation \
@ -15,7 +15,7 @@ java -DSystemOut.name=gen_live_documentation \
-definition integration/engine_state.txt \ -definition integration/engine_state.txt \
-cache_zip_file tunerstudio/generated/cache.zip \ -cache_zip_file tunerstudio/generated/cache.zip \
-cache . \ -cache . \
-java_destination ../java_console/models/src/com/rusefi/config/generated/EngineState.java \ -java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/EngineState.java \
-c_destination controllers/generated/engine_state_generated.h -c_destination controllers/generated/engine_state_generated.h
java -DSystemOut.name=gen_live_documentation \ java -DSystemOut.name=gen_live_documentation \
@ -23,7 +23,7 @@ java -DSystemOut.name=gen_live_documentation \
-definition integration/trigger_central.txt \ -definition integration/trigger_central.txt \
-cache_zip_file tunerstudio/generated/cache.zip \ -cache_zip_file tunerstudio/generated/cache.zip \
-cache . \ -cache . \
-java_destination ../java_console/models/src/com/rusefi/config/generated/TriggerCentral.java \ -java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/TriggerCentral.java \
-c_destination controllers/generated/trigger_central_generated.h -c_destination controllers/generated/trigger_central_generated.h
java -DSystemOut.name=gen_live_documentation \ java -DSystemOut.name=gen_live_documentation \
@ -31,7 +31,7 @@ java -DSystemOut.name=gen_live_documentation \
-definition integration/trigger_state.txt \ -definition integration/trigger_state.txt \
-cache_zip_file tunerstudio/generated/cache.zip \ -cache_zip_file tunerstudio/generated/cache.zip \
-cache . \ -cache . \
-java_destination ../java_console/models/src/com/rusefi/config/generated/TriggerState.java \ -java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/TriggerState.java \
-c_destination controllers/generated/trigger_state_generated.h -c_destination controllers/generated/trigger_state_generated.h
java -DSystemOut.name=gen_live_documentation \ java -DSystemOut.name=gen_live_documentation \
@ -39,7 +39,7 @@ java -DSystemOut.name=gen_live_documentation \
-definition integration/wall_fuel_state.txt \ -definition integration/wall_fuel_state.txt \
-cache_zip_file tunerstudio/generated/cache.zip \ -cache_zip_file tunerstudio/generated/cache.zip \
-cache . \ -cache . \
-java_destination ../java_console/models/src/com/rusefi/config/generated/WallFuelState.java \ -java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/WallFuelState.java \
-c_destination controllers/generated/wall_fuel_generated.h -c_destination controllers/generated/wall_fuel_generated.h
java -DSystemOut.name=gen_live_documentation \ java -DSystemOut.name=gen_live_documentation \

View File

@ -15,7 +15,6 @@ float Tcharge_coff
floatms_t airFlow floatms_t airFlow
float manifoldAirPressureAccelerationAdjustment; float manifoldAirPressureAccelerationAdjustment;
float adjustedManifoldAirPressure; float adjustedManifoldAirPressure;

View File

@ -7,5 +7,4 @@ struct_no_prefix pid_state_s
float errorAmplificationCoef; float errorAmplificationCoef;
float previousError float previousError
end_struct end_struct

View File

@ -45,6 +45,8 @@
! needed to get a proper TunerStudio file ! needed to get a proper TunerStudio file
struct persistent_config_s struct persistent_config_s
struct_no_prefix engine_configuration_s struct_no_prefix engine_configuration_s

View File

@ -9,6 +9,5 @@ int vvtCamCounter
int vvtEventRiseCounter int vvtEventRiseCounter
int vvtEventFallCounter int vvtEventFallCounter
end_struct end_struct

View File

@ -1,3 +1,3 @@
struct_no_prefix trigger_state_s struct_no_prefix trigger_state_s
float currentGap; float currentGap;
end_struct end_struct

View File

@ -3,3 +3,4 @@ float wallFuelCorrection;* fuel injection time correction to account for wall we
floatms_t wallFuel;Amount of fuel on the wall, in ms of injector open time, for each injector. floatms_t wallFuel;Amount of fuel on the wall, in ms of injector open time, for each injector.
! wall_fuel_state ! wall_fuel_state
end_struct end_struct

Binary file not shown.

View File

@ -23,6 +23,7 @@ import java.util.zip.ZipInputStream;
@SuppressWarnings("StringConcatenationInsideStringBufferAppend") @SuppressWarnings("StringConcatenationInsideStringBufferAppend")
public class ConfigDefinition { public class ConfigDefinition {
public static final String EOL = "\n"; public static final String EOL = "\n";
private static final String SIGNATURE_HASH = "SIGNATURE_HASH";
public static String MESSAGE; public static String MESSAGE;
public static String TOOL = "(unknown script)"; public static String TOOL = "(unknown script)";
@ -155,7 +156,7 @@ public class ConfigDefinition {
TSProjectConsumer.TS_FILE_OUTPUT_NAME = args[i + 1]; TSProjectConsumer.TS_FILE_OUTPUT_NAME = args[i + 1];
} else if (key.equals(KEY_ROM_INPUT)) { } else if (key.equals(KEY_ROM_INPUT)) {
String inputFilePath = args[i + 1]; String inputFilePath = args[i + 1];
romRaiderInputFile = inputFilePath + File.separator + ROM_RAIDER_XML_TEMPLATE; romRaiderInputFile = inputFilePath + File.separator + ROM_RAIDER_XML_TEMPLATE;
inputFiles.add(romRaiderInputFile); inputFiles.add(romRaiderInputFile);
} }
} }
@ -173,8 +174,7 @@ public class ConfigDefinition {
} }
SystemOut.println("Check the input/output other files:"); SystemOut.println("Check the input/output other files:");
boolean needToUpdateOtherFiles = checkIfOutputFilesAreOutdated(inputFiles, cachePath, cacheZipFile); boolean needToUpdateOtherFiles = checkIfOutputFilesAreOutdated(inputFiles, cachePath, cacheZipFile);
if (!needToUpdateTsFiles && !needToUpdateOtherFiles) if (!needToUpdateTsFiles && !needToUpdateOtherFiles) {
{
SystemOut.println("All output files are up-to-date, nothing to do here!"); SystemOut.println("All output files are up-to-date, nothing to do here!");
return; return;
} }
@ -188,7 +188,8 @@ public class ConfigDefinition {
} }
SystemOut.println("CRC32 from all input files = " + crc32); SystemOut.println("CRC32 from all input files = " + crc32);
// store the CRC32 as a built-in variable // store the CRC32 as a built-in variable
VariableRegistry.INSTANCE.register("SIGNATURE_HASH", "" + crc32); if (tsPath != null) // nasty trick - do not insert signature into live data files
VariableRegistry.INSTANCE.register(SIGNATURE_HASH, "" + crc32);
if (firingEnumFileName != null) { if (firingEnumFileName != null) {
SystemOut.println("Reading firing from " + firingEnumFileName); SystemOut.println("Reading firing from " + firingEnumFileName);
@ -221,7 +222,7 @@ public class ConfigDefinition {
VariableRegistry tmpRegistry = new VariableRegistry(); VariableRegistry tmpRegistry = new VariableRegistry();
// store the CRC32 as a built-in variable // store the CRC32 as a built-in variable
tmpRegistry.register("SIGNATURE_HASH", "" + crc32); tmpRegistry.register(SIGNATURE_HASH, "" + crc32);
readPrependValues(tmpRegistry, signaturePrependFile); readPrependValues(tmpRegistry, signaturePrependFile);
destinations.add(new SignatureConsumer(signatureDestination, tmpRegistry)); destinations.add(new SignatureConsumer(signatureDestination, tmpRegistry));
} }
@ -247,7 +248,6 @@ public class ConfigDefinition {
state.readBufferedReader(definitionReader, destinations); state.readBufferedReader(definitionReader, destinations);
if (destCDefinesFileName != null && needToUpdateOtherFiles) if (destCDefinesFileName != null && needToUpdateOtherFiles)
VariableRegistry.INSTANCE.writeDefinesToFile(destCDefinesFileName); VariableRegistry.INSTANCE.writeDefinesToFile(destCDefinesFileName);
@ -415,7 +415,7 @@ public class ConfigDefinition {
} else { } else {
SystemOut.println("* the file " + iFile + " is NOT changed!"); SystemOut.println("* the file " + iFile + " is NOT changed!");
} }
} catch(java.io.IOException e) { } catch (java.io.IOException e) {
SystemOut.println("* cannot validate the file " + iFile + ", so assuming it's changed."); SystemOut.println("* cannot validate the file " + iFile + ", so assuming it's changed.");
return true; return true;
} }
@ -467,16 +467,16 @@ public class ConfigDefinition {
file.delete(); file.delete();
} }
private static byte [] unzipFileContents(String zipFileName, String fileName) throws IOException { private static byte[] unzipFileContents(String zipFileName, String fileName) throws IOException {
ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName)); ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName));
ZipEntry zipEntry; ZipEntry zipEntry;
byte [] data = null; byte[] data = null;
while ((zipEntry = zis.getNextEntry()) != null) { while ((zipEntry = zis.getNextEntry()) != null) {
Path zippedName = Paths.get(zipEntry.getName()).normalize(); Path zippedName = Paths.get(zipEntry.getName()).normalize();
Path searchName = Paths.get(fileName).normalize(); Path searchName = Paths.get(fileName).normalize();
if (zippedName.equals(searchName) && zipEntry.getSize() >= 0) { if (zippedName.equals(searchName) && zipEntry.getSize() >= 0) {
int offset = 0; int offset = 0;
byte [] tmpData = new byte[(int)zipEntry.getSize()]; byte[] tmpData = new byte[(int) zipEntry.getSize()];
int bytesLeft = tmpData.length, bytesRead; int bytesLeft = tmpData.length, bytesRead;
while (bytesLeft > 0 && (bytesRead = zis.read(tmpData, offset, bytesLeft)) >= 0) { while (bytesLeft > 0 && (bytesRead = zis.read(tmpData, offset, bytesLeft)) >= 0) {
offset += bytesRead; offset += bytesRead;

View File

@ -24,8 +24,7 @@ public class CHeaderConsumer implements ConfigurationConsumer {
cHeader.write("// by " + getClass() + EOL); cHeader.write("// by " + getClass() + EOL);
cHeader.write("// begin" + EOL); cHeader.write("// begin" + EOL);
String id = destCHeader.replaceAll("[\\\\\\.\\/]", "_").toUpperCase(); String id = destCHeader.replaceAll("[\\\\\\.\\/]", "_").toUpperCase();
cHeader.write("#ifndef " + id + EOL); cHeader.write("#pragma once" + EOL);
cHeader.write("#define " + id + EOL);
cHeader.write("#include \"rusefi_types.h\"" + EOL); cHeader.write("#include \"rusefi_types.h\"" + EOL);
} }
@ -91,7 +90,6 @@ public class CHeaderConsumer implements ConfigurationConsumer {
if (withC_Defines) if (withC_Defines)
cHeader.write(VariableRegistry.INSTANCE.getDefinesSection()); cHeader.write(VariableRegistry.INSTANCE.getDefinesSection());
cHeader.write(content.toString()); cHeader.write(content.toString());
cHeader.write("#endif" + EOL);
cHeader.write("// end" + EOL); cHeader.write("// end" + EOL);
cHeader.write("// this section " + ConfigDefinition.MESSAGE + EOL); cHeader.write("// this section " + ConfigDefinition.MESSAGE + EOL);
cHeader.close(); cHeader.close();