better handing of lack of port
This commit is contained in:
parent
2e4067c210
commit
2d9d0abb30
|
@ -1,5 +1,6 @@
|
|||
package com.rusefi;
|
||||
|
||||
import com.rusefi.autotest.ControllerConnectorState;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.functional_tests.EcuTestHelper;
|
||||
import com.rusefi.io.CommandQueue;
|
||||
|
|
|
@ -152,7 +152,7 @@ public class IoUtil {
|
|||
}
|
||||
}
|
||||
|
||||
static void realHardwareConnect(LinkManager linkManager, String port) {
|
||||
public static void realHardwareConnect(LinkManager linkManager, String port) {
|
||||
linkManager.getEngineState().registerStringValueAction(Fields.PROTOCOL_OUTPIN, (EngineState.ValueCallback<String>) EngineState.ValueCallback.VOID);
|
||||
linkManager.getEngineState().registerStringValueAction(AverageAnglesUtil.KEY, (EngineState.ValueCallback<String>) EngineState.ValueCallback.VOID);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import static com.rusefi.waves.EngineReport.isCloseEnough;
|
|||
public class TestingUtils {
|
||||
private static final Logging log = getLogging(TestingUtils.class);
|
||||
|
||||
static boolean isRealHardware;
|
||||
public static boolean isRealHardware;
|
||||
|
||||
static void assertTrue(String msg, boolean b) {
|
||||
if (!b)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.rusefi;
|
||||
package com.rusefi.autotest;
|
||||
|
||||
import com.rusefi.FileLog;
|
||||
import com.rusefi.IoUtil;
|
||||
import com.rusefi.TestingUtils;
|
||||
import com.rusefi.autodetect.PortDetector;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.EngineState;
|
||||
|
@ -33,8 +36,11 @@ public class ControllerConnectorState {
|
|||
TestingUtils.isRealHardware = true;
|
||||
FileLog.MAIN.start();
|
||||
String port = System.getProperty("ecu.port");
|
||||
if (port == null)
|
||||
port = PortDetector.autoDetectPort(null);
|
||||
if (port == null) {
|
||||
port = PortDetector.autoDetectSerial(null);
|
||||
if (port == null)
|
||||
throw new IllegalStateException("ECU serial not detected");
|
||||
}
|
||||
|
||||
IoUtil.realHardwareConnect(linkManager, port);
|
||||
ControllerConnectorState.linkManager = linkManager;
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.f4discovery;
|
||||
|
||||
import com.rusefi.ControllerConnectorState;
|
||||
import com.rusefi.autotest.ControllerConnectorState;
|
||||
import com.rusefi.RusefiTestBase;
|
||||
import com.rusefi.Timeouts;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
|
@ -10,7 +10,6 @@ import com.rusefi.functional_tests.EcuTestHelper;
|
|||
import org.junit.Test;
|
||||
|
||||
import static com.rusefi.IoUtil.getDisableCommand;
|
||||
import static com.rusefi.IoUtil.getEnableCommand;
|
||||
import static com.rusefi.binaryprotocol.BinaryProtocol.sleep;
|
||||
import static com.rusefi.config.generated.Fields.*;
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.rusefi.functional_tests;
|
||||
|
||||
import com.devexperts.logging.Logging;
|
||||
import com.rusefi.ControllerConnectorState;
|
||||
import com.rusefi.autotest.ControllerConnectorState;
|
||||
import com.rusefi.IoUtil;
|
||||
import com.rusefi.TestingUtils;
|
||||
import com.rusefi.Timeouts;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.ISensorCentral;
|
||||
|
|
Loading…
Reference in New Issue