mirror of https://github.com/rusefi/rusefi-1.git
progress
This commit is contained in:
parent
4af0cec252
commit
a9c91a4079
|
@ -102,7 +102,7 @@ this is just too unreliable at this point :(
|
||||||
|
|
||||||
public static void assertRpmDoesNotJump(int rpm, int settleTime, int testDuration, Function<String, Object> callback) {
|
public static void assertRpmDoesNotJump(int rpm, int settleTime, int testDuration, Function<String, Object> callback) {
|
||||||
changeRpm(rpm);
|
changeRpm(rpm);
|
||||||
sleep(settleTime);
|
sleepSeconds(settleTime);
|
||||||
AtomicReference<String> result = new AtomicReference<>();
|
AtomicReference<String> result = new AtomicReference<>();
|
||||||
SensorCentral.SensorListener listener = new SensorCentral.SensorListener() {
|
SensorCentral.SensorListener listener = new SensorCentral.SensorListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -113,7 +113,7 @@ this is just too unreliable at this point :(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
SensorCentral.getInstance().addListener(Sensor.RPM, listener);
|
SensorCentral.getInstance().addListener(Sensor.RPM, listener);
|
||||||
sleep(testDuration);
|
sleepSeconds(testDuration);
|
||||||
callback.apply(result.get());
|
callback.apply(result.get());
|
||||||
SensorCentral.getInstance().removeListener(Sensor.RPM, listener);
|
SensorCentral.getInstance().removeListener(Sensor.RPM, listener);
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ this is just too unreliable at this point :(
|
||||||
currentEngineType = type;
|
currentEngineType = type;
|
||||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, Timeouts.SET_ENGINE_TIMEOUT);
|
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, Timeouts.SET_ENGINE_TIMEOUT);
|
||||||
// TODO: document the reason for this sleep?!
|
// TODO: document the reason for this sleep?!
|
||||||
sleep(1);
|
sleepSeconds(1);
|
||||||
sendCommand(getEnableCommand("self_stimulation"));
|
sendCommand(getEnableCommand("self_stimulation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.rusefi;
|
package com.rusefi;
|
||||||
|
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
import org.junit.rules.Timeout;
|
|
||||||
|
|
||||||
import static com.rusefi.IoUtil.*;
|
import static com.rusefi.IoUtil.*;
|
||||||
import static com.rusefi.RealHwTest.startRealHardwareTest;
|
import static com.rusefi.RealHwTest.startRealHardwareTest;
|
||||||
|
@ -27,12 +26,12 @@ public class EnduranceTest {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
AutoTest.currentEngineType = 3;
|
AutoTest.currentEngineType = 3;
|
||||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 3, AutoTest.COMPLEX_COMMAND_RETRY, Timeouts.SET_ENGINE_TIMEOUT);
|
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 3, AutoTest.COMPLEX_COMMAND_RETRY, Timeouts.SET_ENGINE_TIMEOUT);
|
||||||
sleep(2);
|
sleepSeconds(2);
|
||||||
sendCommand(getEnableCommand("self_stimulation"));
|
sendCommand(getEnableCommand("self_stimulation"));
|
||||||
// IoUtil.changeRpm(1200);
|
// IoUtil.changeRpm(1200);
|
||||||
AutoTest.currentEngineType = 28;
|
AutoTest.currentEngineType = 28;
|
||||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 28, AutoTest.COMPLEX_COMMAND_RETRY, Timeouts.SET_ENGINE_TIMEOUT);
|
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 28, AutoTest.COMPLEX_COMMAND_RETRY, Timeouts.SET_ENGINE_TIMEOUT);
|
||||||
sleep(2);
|
sleepSeconds(2);
|
||||||
FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ " + i + " +++++++++++++++");
|
FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ " + i + " +++++++++++++++");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class IoUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
static void sleep(int seconds) {
|
public static void sleepSeconds(int seconds) {
|
||||||
FileLog.MAIN.logLine("Sleeping " + seconds + " seconds");
|
FileLog.MAIN.logLine("Sleeping " + seconds + " seconds");
|
||||||
try {
|
try {
|
||||||
Thread.sleep(seconds * 1000L);
|
Thread.sleep(seconds * 1000L);
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.rusefi.autodetect;
|
||||||
|
|
||||||
|
import com.rusefi.IoUtil;
|
||||||
|
|
||||||
|
public class PortDetectorSandbox {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
while (true) {
|
||||||
|
String port = PortDetector.autoDetectSerial(null);
|
||||||
|
System.out.println("Detected " + port);
|
||||||
|
|
||||||
|
IoUtil.sleepSeconds(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue