generate java enum from C enum? generate both C and java from yaml? #2102

This commit is contained in:
rusefillc 2021-10-24 08:46:27 -04:00
parent 383d8caad9
commit 6cbf18d824
3 changed files with 10 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package com.rusefi;
import com.rusefi.autotest.ControllerConnectorState; import com.rusefi.autotest.ControllerConnectorState;
import com.rusefi.config.generated.Fields; import com.rusefi.config.generated.Fields;
import com.rusefi.enums.engine_type_e;
import com.rusefi.functional_tests.EcuTestHelper; import com.rusefi.functional_tests.EcuTestHelper;
import com.rusefi.io.CommandQueue; import com.rusefi.io.CommandQueue;
import com.rusefi.io.LinkManager; import com.rusefi.io.LinkManager;
@ -25,12 +26,12 @@ public class EnduranceTestUtility {
CommandQueue commandQueue = linkManager.getCommandQueue(); CommandQueue commandQueue = linkManager.getCommandQueue();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
EcuTestHelper.currentEngineType = Fields.ET_FORD_ASPIRE; EcuTestHelper.currentEngineType = engine_type_e.FORD_ASPIRE_1996.ordinal();
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 3, Timeouts.SET_ENGINE_TIMEOUT, commandQueue); sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 3, Timeouts.SET_ENGINE_TIMEOUT, commandQueue);
sleepSeconds(2); sleepSeconds(2);
sendCommand(getEnableCommand("self_stimulation"), commandQueue); sendCommand(getEnableCommand("self_stimulation"), commandQueue);
// IoUtil.changeRpm(1200); // IoUtil.changeRpm(1200);
EcuTestHelper.currentEngineType = Fields.ET_DEFAULT_FRANKENSO; EcuTestHelper.currentEngineType = engine_type_e.DEFAULT_FRANKENSO.ordinal();
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 28, Timeouts.SET_ENGINE_TIMEOUT, commandQueue); sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 28, Timeouts.SET_ENGINE_TIMEOUT, commandQueue);
sleepSeconds(2); sleepSeconds(2);
FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ " + i + " +++++++++++++++"); FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ " + i + " +++++++++++++++");

View File

@ -6,6 +6,7 @@ import com.rusefi.Timeouts;
import com.rusefi.config.generated.Fields; import com.rusefi.config.generated.Fields;
import com.rusefi.core.Sensor; import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral; import com.rusefi.core.SensorCentral;
import com.rusefi.enums.engine_type_e;
import com.rusefi.functional_tests.EcuTestHelper; import com.rusefi.functional_tests.EcuTestHelper;
import org.junit.Test; import org.junit.Test;
@ -35,7 +36,7 @@ public class PwmHardwareTest extends RusefiTestBase {
@Test @Test
public void scheduleBurnDoesNotAffectTriggerIssue2839() { public void scheduleBurnDoesNotAffectTriggerIssue2839() {
ecu.setEngineType(ET_FORD_ASPIRE); ecu.setEngineType(engine_type_e.FORD_ASPIRE_1996);
ecu.sendCommand("set " + "trigger_type" + " " + TT_TT_TOOTHED_WHEEL_60_2); ecu.sendCommand("set " + "trigger_type" + " " + TT_TT_TOOTHED_WHEEL_60_2);
ecu.sendCommand(getDisableCommand(Fields.CMD_SELF_STIMULATION)); ecu.sendCommand(getDisableCommand(Fields.CMD_SELF_STIMULATION));
ecu.sendCommand(getEnableCommand(CMD_EXTERNAL_STIMULATION)); ecu.sendCommand(getEnableCommand(CMD_EXTERNAL_STIMULATION));

View File

@ -8,6 +8,7 @@ import com.rusefi.config.generated.Fields;
import com.rusefi.core.ISensorCentral; import com.rusefi.core.ISensorCentral;
import com.rusefi.core.Sensor; import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral; import com.rusefi.core.SensorCentral;
import com.rusefi.enums.engine_type_e;
import com.rusefi.io.CommandQueue; import com.rusefi.io.CommandQueue;
import com.rusefi.io.LinkManager; import com.rusefi.io.LinkManager;
import com.rusefi.waves.EngineReport; import com.rusefi.waves.EngineReport;
@ -115,6 +116,10 @@ public class EcuTestHelper {
IoUtil.changeRpm(commandQueue, rpm); IoUtil.changeRpm(commandQueue, rpm);
} }
public void setEngineType(engine_type_e engine_type_e) {
setEngineType(engine_type_e.ordinal());
}
public void setEngineType(int type) { public void setEngineType(int type) {
log.info("AUTOTEST setEngineType " + type); log.info("AUTOTEST setEngineType " + type);
currentEngineType = type; currentEngineType = type;