parent
4cd41fce00
commit
f68610f83b
|
@ -144,8 +144,8 @@ void reconfigureSensors() {
|
||||||
|
|
||||||
// Mocking/testing helpers
|
// Mocking/testing helpers
|
||||||
static void initSensorCli() {
|
static void initSensorCli() {
|
||||||
addConsoleActionIF("set_sensor_mock", Sensor::setMockValue);
|
addConsoleActionIF(CMD_SET_SENSOR_MOCK, Sensor::setMockValue);
|
||||||
addConsoleAction("reset_sensor_mocks", Sensor::resetAllMocks);
|
addConsoleAction(CMD_RESET_SENSOR_MOCKS, Sensor::resetAllMocks);
|
||||||
addConsoleAction("show_sensors", Sensor::showAllSensorInfo);
|
addConsoleAction("show_sensors", Sensor::showAllSensorInfo);
|
||||||
addConsoleActionI("show_sensor",
|
addConsoleActionI("show_sensor",
|
||||||
[](int idx) {
|
[](int idx) {
|
||||||
|
|
|
@ -1816,10 +1816,6 @@ end_struct
|
||||||
#define CMD_SET_SENSOR_MOCK "set_sensor_mock"
|
#define CMD_SET_SENSOR_MOCK "set_sensor_mock"
|
||||||
#define CMD_RESET_SENSOR_MOCKS "reset_sensor_mocks"
|
#define CMD_RESET_SENSOR_MOCKS "reset_sensor_mocks"
|
||||||
|
|
||||||
! Pedal Position Sensor
|
|
||||||
#define MOCK_PPS_POSITION_COMMAND "mock_pps_position"
|
|
||||||
#define MOCK_PPS_VOLTAGE_COMMAND "mock_pps_voltage"
|
|
||||||
|
|
||||||
#define GAUGE_NAME_VERSION "firmware"
|
#define GAUGE_NAME_VERSION "firmware"
|
||||||
#define GAUGE_NAME_UPTIME "Uptime"
|
#define GAUGE_NAME_UPTIME "Uptime"
|
||||||
! WARNING! THIS GAUGE NAME IS PART of REO integration API
|
! WARNING! THIS GAUGE NAME IS PART of REO integration API
|
||||||
|
|
|
@ -14,6 +14,7 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import static com.rusefi.IoUtil.getEnableCommand;
|
import static com.rusefi.IoUtil.getEnableCommand;
|
||||||
import static com.rusefi.TestingUtils.assertNull;
|
import static com.rusefi.TestingUtils.assertNull;
|
||||||
|
import static com.rusefi.config.generated.Fields.CMD_SET_SENSOR_MOCK;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
@ -114,7 +115,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
// Alpha-N mode so that we actually inject some fuel (without mocking tons of sensors)
|
// Alpha-N mode so that we actually inject some fuel (without mocking tons of sensors)
|
||||||
ecu.sendCommand("set algorithm 2");
|
ecu.sendCommand("set algorithm 2");
|
||||||
// Set tps to 25% - make alpha-n happy
|
// Set tps to 25% - make alpha-n happy
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.Tps1.ordinal() + " 25");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Tps1.ordinal() + " 25");
|
||||||
ecu.sendCommand("set rpm_hard_limit 2500");
|
ecu.sendCommand("set rpm_hard_limit 2500");
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -205,8 +206,8 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
ecu.setEngineType(engine_type_e.DODGE_NEON_2003_CRANK);
|
ecu.setEngineType(engine_type_e.DODGE_NEON_2003_CRANK);
|
||||||
ecu.sendCommand("set wwaeTau 0");
|
ecu.sendCommand("set wwaeTau 0");
|
||||||
ecu.sendCommand("set wwaeBeta 0");
|
ecu.sendCommand("set wwaeBeta 0");
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.Map.ordinal() + " 69.12");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Map.ordinal() + " 69.12");
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.BatteryVoltage.ordinal() + " 12");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.BatteryVoltage.ordinal() + " 12");
|
||||||
ecu.sendCommand("disable cylinder_cleanup");
|
ecu.sendCommand("disable cylinder_cleanup");
|
||||||
EngineChart chart;
|
EngineChart chart;
|
||||||
String msg = "2003 Neon cranking ";
|
String msg = "2003 Neon cranking ";
|
||||||
|
@ -271,12 +272,12 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
public void testMazdaProtege() {
|
public void testMazdaProtege() {
|
||||||
ecu.setEngineType(engine_type_e.FORD_ESCORT_GT);
|
ecu.setEngineType(engine_type_e.FORD_ESCORT_GT);
|
||||||
EngineChart chart;
|
EngineChart chart;
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.BatteryVoltage.ordinal() + " 12");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.BatteryVoltage.ordinal() + " 12");
|
||||||
|
|
||||||
// Alpha-N mode so that we actually inject some fuel (without mocking tons of sensors)
|
// Alpha-N mode so that we actually inject some fuel (without mocking tons of sensors)
|
||||||
ecu.sendCommand("set algorithm 2");
|
ecu.sendCommand("set algorithm 2");
|
||||||
// Set tps to 25% - make alpha-n happy
|
// Set tps to 25% - make alpha-n happy
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.Tps1.ordinal() + " 25");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Tps1.ordinal() + " 25");
|
||||||
|
|
||||||
ecu.changeRpm(200);
|
ecu.changeRpm(200);
|
||||||
ecu.changeRpm(260);
|
ecu.changeRpm(260);
|
||||||
|
@ -320,7 +321,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
|
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
|
||||||
|
|
||||||
// switching to Speed Density
|
// switching to Speed Density
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.Map.ordinal() + " 69.12");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Map.ordinal() + " 69.12");
|
||||||
sendComplexCommand("set algorithm 0");
|
sendComplexCommand("set algorithm 0");
|
||||||
ecu.changeRpm(2600);
|
ecu.changeRpm(2600);
|
||||||
ecu.changeRpm(2000);
|
ecu.changeRpm(2000);
|
||||||
|
@ -349,8 +350,8 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
public void testFordAspire() {
|
public void testFordAspire() {
|
||||||
ecu.setEngineType(engine_type_e.FORD_ASPIRE_1996);
|
ecu.setEngineType(engine_type_e.FORD_ASPIRE_1996);
|
||||||
ecu.sendCommand("disable cylinder_cleanup");
|
ecu.sendCommand("disable cylinder_cleanup");
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.Map.ordinal() + " 69.12");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Map.ordinal() + " 69.12");
|
||||||
ecu.sendCommand("set_sensor_mock " + SensorType.BatteryVoltage.ordinal() + " 12");
|
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.BatteryVoltage.ordinal() + " 12");
|
||||||
String msg;
|
String msg;
|
||||||
EngineChart chart;
|
EngineChart chart;
|
||||||
// todo: interesting changeRpm(100);
|
// todo: interesting changeRpm(100);
|
||||||
|
|
Loading…
Reference in New Issue