refactoring

This commit is contained in:
rusefillc 2022-10-28 02:41:44 -04:00
parent 2677da2105
commit 2cd5fab883
3 changed files with 11 additions and 2 deletions

View File

@ -6,10 +6,12 @@ import com.rusefi.core.EngineState;
import com.rusefi.core.ISensorCentral;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
import com.rusefi.enums.trigger_type_e;
import com.rusefi.io.CommandQueue;
import com.rusefi.io.ConnectionStateListener;
import com.rusefi.io.LinkManager;
import com.rusefi.io.tcp.TcpConnector;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@ -166,4 +168,9 @@ public class IoUtil {
throw new IllegalStateException("Not connected in time");
}
}
@NotNull
public static String setTriggerType(trigger_type_e triggerType) {
return "set " + "trigger_type" + " " + triggerType.ordinal();
}
}

View File

@ -1,6 +1,7 @@
package com.rusefi.f4discovery;
import com.devexperts.logging.Logging;
import com.rusefi.IoUtil;
import com.rusefi.RusefiTestBase;
import com.rusefi.Timeouts;
import com.rusefi.config.generated.Fields;
@ -37,7 +38,7 @@ public class PwmHardwareTest extends RusefiTestBase {
@Test
public void scheduleBurnDoesNotAffectTriggerIssue2839() {
ecu.setEngineType(engine_type_e.FORD_ASPIRE_1996);
ecu.sendCommand("set " + "trigger_type" + " " + com.rusefi.enums.trigger_type_e.TT_TOOTHED_WHEEL_60_2.ordinal());
ecu.sendCommand(IoUtil.setTriggerType(com.rusefi.enums.trigger_type_e.TT_TOOTHED_WHEEL_60_2));
ecu.sendCommand(getDisableCommand(Fields.CMD_SELF_STIMULATION));
ecu.sendCommand(getEnableCommand(CMD_EXTERNAL_STIMULATION));
ecu.changeRpm(1200);

View File

@ -29,6 +29,7 @@ public class VssHardwareLoopTest extends RusefiTestBase {
ecu.setEngineType(engine_type_e.FRANKENSO_MIATA_NA6_MAP);
ecu.changeRpm(1000);
// making output pins available
ecu.sendCommand(CMD_TRIGGER_SIMULATOR_PIN + " 0 none");
ecu.sendCommand(CMD_TRIGGER_SIMULATOR_PIN + " 1 none");
ecu.sendCommand(CMD_TRIGGER_PIN + " 1 none");
@ -40,7 +41,7 @@ public class VssHardwareLoopTest extends RusefiTestBase {
EcuTestHelper.assertSomewhatClose("VSS no input", 0, SensorCentral.getInstance().getValue(Sensor.vehicleSpeedKph));
// attaching VSS to idle output since there is a jumper on test discovery
ecu.sendCommand("set " + CMD_VSS_PIN + " pa5");
ecu.sendCommand("set " + CMD_VSS_PIN + " " + "pa5");
sleep(2 * Timeouts.SECOND);