only:Split ConfigGenerator around trigger_defines.txt #5051
This commit is contained in:
parent
d2b2dcc11d
commit
cd4c78745e
|
@ -1233,7 +1233,6 @@
|
||||||
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
||||||
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
||||||
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
||||||
#define TRIGGERS_FILE_NAME "triggers.txt"
|
|
||||||
#define TriggerWheel_T_PRIMARY 0
|
#define TriggerWheel_T_PRIMARY 0
|
||||||
#define TriggerWheel_T_SECONDARY 1
|
#define TriggerWheel_T_SECONDARY 1
|
||||||
#define TRIM_SIZE 4
|
#define TRIM_SIZE 4
|
||||||
|
|
|
@ -1233,7 +1233,6 @@
|
||||||
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
||||||
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
||||||
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
||||||
#define TRIGGERS_FILE_NAME "triggers.txt"
|
|
||||||
#define TriggerWheel_T_PRIMARY 0
|
#define TriggerWheel_T_PRIMARY 0
|
||||||
#define TriggerWheel_T_SECONDARY 1
|
#define TriggerWheel_T_SECONDARY 1
|
||||||
#define TRIM_SIZE 4
|
#define TRIM_SIZE 4
|
||||||
|
|
|
@ -1185,7 +1185,6 @@
|
||||||
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
||||||
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
||||||
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
||||||
#define TRIGGERS_FILE_NAME "triggers.txt"
|
|
||||||
#define TriggerWheel_T_PRIMARY 0
|
#define TriggerWheel_T_PRIMARY 0
|
||||||
#define TriggerWheel_T_SECONDARY 1
|
#define TriggerWheel_T_SECONDARY 1
|
||||||
#define TRIM_SIZE 4
|
#define TRIM_SIZE 4
|
||||||
|
|
|
@ -1233,7 +1233,6 @@
|
||||||
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
#define TRIGGER_TYPE_WITH_SECOND_WHEEL trigger_type == 1 || trigger_type == 3 || trigger_type == 15 || trigger_type == 16 || trigger_type == 19 || trigger_type == 25 || trigger_type == 28 || trigger_type == 31 || trigger_type == 35 || trigger_type == 36 || trigger_type == 37 || trigger_type == 40 || trigger_type == 49 || trigger_type == 50 || trigger_type == 53 || trigger_type == 54 || trigger_type == 63 || trigger_type == 64
|
||||||
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
#define TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION trigger_type == 8 || trigger_type == 9 || trigger_type == 17 || trigger_type == 18 || trigger_type == 23 || trigger_type == 48 || trigger_type == 69 || trigger_type == 73 || trigger_type == 76
|
||||||
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
#define TRIGGER_WITH_SYNC "isSynchronizationNeeded"
|
||||||
#define TRIGGERS_FILE_NAME "triggers.txt"
|
|
||||||
#define TriggerWheel_T_PRIMARY 0
|
#define TriggerWheel_T_PRIMARY 0
|
||||||
#define TriggerWheel_T_SECONDARY 1
|
#define TriggerWheel_T_SECONDARY 1
|
||||||
#define TRIM_SIZE 4
|
#define TRIM_SIZE 4
|
||||||
|
|
|
@ -203,7 +203,6 @@ struct_no_prefix engine_configuration_s
|
||||||
|
|
||||||
#define CAN_DEFAULT_BASE 0x200
|
#define CAN_DEFAULT_BASE 0x200
|
||||||
|
|
||||||
#define TRIGGERS_FILE_NAME "triggers.txt"
|
|
||||||
#define TRIGGER_IS_CRANK_KEY "crankBased"
|
#define TRIGGER_IS_CRANK_KEY "crankBased"
|
||||||
#define TRIGGER_CYCLE_DURATION "cycleDuration"
|
#define TRIGGER_CYCLE_DURATION "cycleDuration"
|
||||||
#define TRIGGER_IS_SECOND_WHEEL_CAM "isSecondWheelCam"
|
#define TRIGGER_IS_SECOND_WHEEL_CAM "isSecondWheelCam"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
! todo: remove from rusefi_config.txt
|
||||||
|
|
||||||
|
#define TRIGGERS_FILE_NAME "triggers.txt"
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.rusefi;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class TriggerMetaGenerator {
|
||||||
|
public static void main(String[] a) throws IOException {
|
||||||
|
ReaderStateImpl reader = new ReaderStateImpl();
|
||||||
|
reader.setDefinitionInputFile("integration/rusefi_config_trigger.txt");
|
||||||
|
reader.addCHeaderDestination("../unit_tests/TriggerMeta.h");
|
||||||
|
reader.addJavaDestination("../java_tools/trigger-image/src/main/java/com/rusefi/config/generated/TriggerMeta.java");
|
||||||
|
|
||||||
|
reader.doJob();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,7 @@
|
||||||
package com.rusefi.ldmp;
|
package com.rusefi.ldmp;
|
||||||
|
|
||||||
import com.devexperts.logging.Logging;
|
import com.devexperts.logging.Logging;
|
||||||
import com.rusefi.EnumToString;
|
import com.rusefi.*;
|
||||||
import com.rusefi.InvokeReader;
|
|
||||||
import com.rusefi.ReaderState;
|
|
||||||
import com.rusefi.ReaderStateImpl;
|
|
||||||
import com.rusefi.output.*;
|
import com.rusefi.output.*;
|
||||||
import com.rusefi.util.LazyFile;
|
import com.rusefi.util.LazyFile;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
@ -51,6 +48,7 @@ public class LiveDataProcessor {
|
||||||
System.err.println("One parameter expected: name of live data yaml input file");
|
System.err.println("One parameter expected: name of live data yaml input file");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
|
TriggerMetaGenerator.main(null);
|
||||||
String yamlFileName = args[0];
|
String yamlFileName = args[0];
|
||||||
Yaml yaml = new Yaml();
|
Yaml yaml = new Yaml();
|
||||||
Map<String, Object> data = yaml.load(new FileReader(yamlFileName));
|
Map<String, Object> data = yaml.load(new FileReader(yamlFileName));
|
||||||
|
|
|
@ -39,8 +39,11 @@ public class FileJavaFieldsConsumer extends JavaFieldsConsumer {
|
||||||
javaFields.write(state.getVariableRegistry().getJavaConstants());
|
javaFields.write(state.getVariableRegistry().getJavaConstants());
|
||||||
javaFields.write(getContent());
|
javaFields.write(getContent());
|
||||||
|
|
||||||
|
if (allFields.length() > 0) {
|
||||||
|
javaFields.write("\tpublic static final Field[] VALUES = {" + EOL);
|
||||||
allFields.append("\t};" + EOL);
|
allFields.append("\t};" + EOL);
|
||||||
javaFields.write(allFields.toString());
|
javaFields.write(allFields.toString());
|
||||||
|
}
|
||||||
|
|
||||||
javaFields.write("}" + ToolUtil.EOL);
|
javaFields.write("}" + ToolUtil.EOL);
|
||||||
javaFields.close();
|
javaFields.close();
|
||||||
|
|
|
@ -14,7 +14,7 @@ public abstract class JavaFieldsConsumer implements ConfigurationConsumer {
|
||||||
protected final Set<String> existingJavaEnums = new HashSet<>();
|
protected final Set<String> existingJavaEnums = new HashSet<>();
|
||||||
|
|
||||||
private final StringBuilder content = new StringBuilder();
|
private final StringBuilder content = new StringBuilder();
|
||||||
protected final StringBuffer allFields = new StringBuffer("\tpublic static final Field[] VALUES = {" + EOL);
|
protected final StringBuffer allFields = new StringBuffer();
|
||||||
protected final ReaderState state;
|
protected final ReaderState state;
|
||||||
private final int baseOffset;
|
private final int baseOffset;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.rusefi.config.generated;
|
||||||
|
|
||||||
|
// this file was generated automatically by rusEFI tool enum_to_string.jar based on (unknown script) integration/rusefi_config_trigger.txt Sat Jun 17 22:36:04 EDT 2023
|
||||||
|
|
||||||
|
// by class com.rusefi.output.FileJavaFieldsConsumer
|
||||||
|
import com.rusefi.config.*;
|
||||||
|
|
||||||
|
public class TriggerMeta {
|
||||||
|
public static final String TRIGGERS_FILE_NAME = "triggers.txt";
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
// this section was generated automatically by rusEFI tool enum_to_string.jar based on (unknown script) integration/rusefi_config_trigger.txt Sat Jun 17 22:27:23 EDT 2023
|
||||||
|
// by class com.rusefi.output.CHeaderConsumer
|
||||||
|
// begin
|
||||||
|
#pragma once
|
||||||
|
#include "rusefi_types.h"
|
||||||
|
#define TRIGGERS_FILE_NAME "triggers.txt"
|
||||||
|
// end
|
||||||
|
// this section was generated automatically by rusEFI tool enum_to_string.jar based on (unknown script) integration/rusefi_config_trigger.txt Sat Jun 17 22:27:23 EDT 2023
|
|
@ -2,6 +2,7 @@
|
||||||
* @file test_all_triggers.cpp
|
* @file test_all_triggers.cpp
|
||||||
*/
|
*/
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
#include "TriggerMeta.h"
|
||||||
|
|
||||||
// uncomment to test starting from specific trigger
|
// uncomment to test starting from specific trigger
|
||||||
//#define TEST_FROM_TRIGGER_ID ((int)TT_MAZDA_MIATA_NA)
|
//#define TEST_FROM_TRIGGER_ID ((int)TT_MAZDA_MIATA_NA)
|
||||||
|
|
Loading…
Reference in New Issue