refactoring only #1076
This commit is contained in:
parent
b78e1b7a00
commit
ce0921cb78
|
@ -375,6 +375,7 @@
|
|||
#define CMD_ENABLE "enable"
|
||||
#define CMD_ENGINE_TYPE "engine_type"
|
||||
#define CMD_ETB_DUTY "set_etb_duty"
|
||||
#define CMD_FUNCTIONAL_TEST_MODE "test_mode"
|
||||
#define CMD_PINS "pins"
|
||||
#define CMD_REBOOT "reboot"
|
||||
#define CMD_REBOOT_DFU "reboot_dfu"
|
||||
|
|
|
@ -375,6 +375,7 @@
|
|||
#define CMD_ENABLE "enable"
|
||||
#define CMD_ENGINE_TYPE "engine_type"
|
||||
#define CMD_ETB_DUTY "set_etb_duty"
|
||||
#define CMD_FUNCTIONAL_TEST_MODE "test_mode"
|
||||
#define CMD_PINS "pins"
|
||||
#define CMD_REBOOT "reboot"
|
||||
#define CMD_REBOOT_DFU "reboot_dfu"
|
||||
|
|
|
@ -957,7 +957,7 @@ static void enableOrDisable(const char *param, bool isEnabled) {
|
|||
engineConfiguration->isAlternatorControlEnabled = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "sd")) {
|
||||
engineConfiguration->isSdCardEnabled = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "test_mode")) {
|
||||
} else if (strEqualCaseInsensitive(param, CMD_FUNCTIONAL_TEST_MODE)) {
|
||||
engine->isTestMode = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "can_read")) {
|
||||
engineConfiguration->canReadEnabled = isEnabled;
|
||||
|
|
|
@ -1301,7 +1301,8 @@ end_struct
|
|||
#define CMD_CALIBRATE_PEDAL_DOWN "calibrate_pedal_down"
|
||||
#define CMD_ETB_DUTY "set_etb_duty"
|
||||
|
||||
#define CMD_RESET_ENGINE_SNIFFER "reset_engine_chart"
|
||||
#define CMD_RESET_ENGINE_SNIFFER "reset_engine_chart"
|
||||
#define CMD_FUNCTIONAL_TEST_MODE "test_mode"
|
||||
|
||||
#define CMD_ENGINE_TYPE "engine_type"
|
||||
#define CMD_TRIGGERINFO "triggerinfo"
|
||||
|
|
|
@ -13,11 +13,11 @@ import com.rusefi.io.ConnectionStatus;
|
|||
import com.rusefi.waves.EngineChart;
|
||||
import com.rusefi.waves.EngineReport;
|
||||
|
||||
import static com.rusefi.IoUtil.sleep;
|
||||
import static com.rusefi.IoUtil.*;
|
||||
import static com.rusefi.IoUtil.getEnableCommand;
|
||||
import static com.rusefi.TestingUtils.*;
|
||||
import static com.rusefi.config.generated.Fields.CMD_PINS;
|
||||
import static com.rusefi.config.generated.Fields.MOCK_MAF_COMMAND;
|
||||
import static com.rusefi.io.CommandQueue.disableCommand;
|
||||
import static com.rusefi.waves.EngineReport.isCloseEnough;
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ public class AutoTest {
|
|||
bp.burn(Logger.CONSOLE);
|
||||
|
||||
sendCommand("fl 1"); // just in case it was disabled
|
||||
sendCommand(disableCommand(Fields.CMD_TRIGGER_HW_INPUT));
|
||||
sendCommand(getDisableCommand(Fields.CMD_TRIGGER_HW_INPUT));
|
||||
testCustomEngine();
|
||||
testMazdaMiata2003();
|
||||
test2003DodgeNeon();
|
||||
|
@ -140,7 +140,7 @@ public class AutoTest {
|
|||
currentEngineType = type;
|
||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, 30);
|
||||
sleep(10);
|
||||
sendCommand("enable self_stimulation");
|
||||
sendCommand(getEnableCommand("self_stimulation"));
|
||||
}
|
||||
|
||||
private static void testMazda626() {
|
||||
|
@ -203,7 +203,7 @@ public class AutoTest {
|
|||
assertWave(true, msg, chart, EngineChart.INJECTOR_3, 0.29233, 0.15, EngineReport.RATIO, x + 540);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_4, 0.29233, 0.15, 0.2, x);
|
||||
|
||||
sendCommand("enable trigger_only_front");
|
||||
sendCommand(getEnableCommand("trigger_only_front"));
|
||||
chart = nextChart();
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_1, 0.29233, 0.1, 0.2, x + 360);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_2, 0.29233, EngineReport.RATIO, 0.2, x + 180);
|
||||
|
|
|
@ -2,8 +2,7 @@ package com.rusefi;
|
|||
|
||||
import com.rusefi.config.generated.Fields;
|
||||
|
||||
import static com.rusefi.IoUtil.sendCommand;
|
||||
import static com.rusefi.IoUtil.sleep;
|
||||
import static com.rusefi.IoUtil.*;
|
||||
import static com.rusefi.RealHwTest.startRealHardwareTest;
|
||||
|
||||
public class EnduranceTest {
|
||||
|
@ -28,7 +27,7 @@ public class EnduranceTest {
|
|||
AutoTest.currentEngineType = 3;
|
||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 3, AutoTest.COMPLEX_COMMAND_RETRY, 60);
|
||||
sleep(2);
|
||||
sendCommand("enable self_stimulation");
|
||||
sendCommand(getEnableCommand("self_stimulation"));
|
||||
// IoUtil.changeRpm(1200);
|
||||
AutoTest.currentEngineType = 28;
|
||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + 28, AutoTest.COMPLEX_COMMAND_RETRY, 60);
|
||||
|
|
|
@ -29,6 +29,14 @@ public class IoUtil {
|
|||
sendCommand(command, CommandQueue.DEFAULT_TIMEOUT, Timeouts.CMD_TIMEOUT);
|
||||
}
|
||||
|
||||
public static String getEnableCommand(String settingName) {
|
||||
return Fields.CMD_ENABLE + " " + settingName;
|
||||
}
|
||||
|
||||
public static String getDisableCommand(String settingName) {
|
||||
return Fields.CMD_DISABLE + " " + settingName;
|
||||
}
|
||||
|
||||
static void sendCommand(String command, int retryTimeoutMs, int totalTimeoutSeconds) {
|
||||
final CountDownLatch responseLatch = new CountDownLatch(1);
|
||||
long time = System.currentTimeMillis();
|
||||
|
@ -156,5 +164,4 @@ public class IoUtil {
|
|||
if (connected.getCount() > 0)
|
||||
throw new IllegalStateException("Not connected in time");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -230,7 +230,4 @@ public class CommandQueue {
|
|||
void onCommand(String command);
|
||||
}
|
||||
|
||||
public static String disableCommand(String command) {
|
||||
return Fields.CMD_DISABLE + " " + command;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config.generated;
|
||||
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Dec 21 19:54:06 EST 2019
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Dec 21 20:09:07 EST 2019
|
||||
|
||||
// by class com.rusefi.output.FileJavaFieldsConsumer
|
||||
import com.rusefi.config.*;
|
||||
|
@ -242,6 +242,7 @@ public class Fields {
|
|||
public static final String CMD_ENABLE = "enable";
|
||||
public static final String CMD_ENGINE_TYPE = "engine_type";
|
||||
public static final String CMD_ETB_DUTY = "set_etb_duty";
|
||||
public static final String CMD_FUNCTIONAL_TEST_MODE = "test_mode";
|
||||
public static final String CMD_PINS = "pins";
|
||||
public static final String CMD_REBOOT = "reboot";
|
||||
public static final String CMD_REBOOT_DFU = "reboot_dfu";
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi.ui;
|
|||
|
||||
import com.rusefi.AverageAnglesUtil;
|
||||
import com.rusefi.FileLog;
|
||||
import com.rusefi.IoUtil;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.MessagesCentral;
|
||||
import com.rusefi.io.CommandQueue;
|
||||
|
@ -18,8 +19,9 @@ import java.util.*;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import static com.rusefi.IoUtil.getEnableCommand;
|
||||
import static com.rusefi.config.generated.Fields.CMD_TRIGGERINFO;
|
||||
import static com.rusefi.io.CommandQueue.disableCommand;
|
||||
import static com.rusefi.IoUtil.getDisableCommand;
|
||||
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||
|
||||
/**
|
||||
|
@ -126,13 +128,15 @@ public class RecentCommands {
|
|||
add(CANINFO);
|
||||
add(Fields.CMD_WRITECONFIG);
|
||||
add("rewriteconfig");
|
||||
add("enable injection");
|
||||
add(disableCommand("injection"));
|
||||
add("enable ignition");
|
||||
add(disableCommand("ignition"));
|
||||
|
||||
add("enable self_stimulation");
|
||||
add("disable self_stimulation");
|
||||
add(getEnableCommand("injection"));
|
||||
add(getDisableCommand("injection"));
|
||||
|
||||
add(getEnableCommand("ignition"));
|
||||
add(getDisableCommand("ignition"));
|
||||
|
||||
add(getEnableCommand("self_stimulation"));
|
||||
add(getDisableCommand("self_stimulation");
|
||||
|
||||
add("blipidle 80 2000");
|
||||
add("set_idle_position 50");
|
||||
|
|
Loading…
Reference in New Issue