simulator: sensor mocking UI is broken #5473 (#5474)

This commit is contained in:
rusefillc 2023-08-01 01:04:06 -04:00 committed by GitHub
parent 4cd41fce00
commit f68610f83b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 14 deletions

View File

@ -144,8 +144,8 @@ void reconfigureSensors() {
// Mocking/testing helpers
static void initSensorCli() {
addConsoleActionIF("set_sensor_mock", Sensor::setMockValue);
addConsoleAction("reset_sensor_mocks", Sensor::resetAllMocks);
addConsoleActionIF(CMD_SET_SENSOR_MOCK, Sensor::setMockValue);
addConsoleAction(CMD_RESET_SENSOR_MOCKS, Sensor::resetAllMocks);
addConsoleAction("show_sensors", Sensor::showAllSensorInfo);
addConsoleActionI("show_sensor",
[](int idx) {

View File

@ -1816,10 +1816,6 @@ end_struct
#define CMD_SET_SENSOR_MOCK "set_sensor_mock"
#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_UPTIME "Uptime"
! WARNING! THIS GAUGE NAME IS PART of REO integration API

View File

@ -14,6 +14,7 @@ import java.util.Arrays;
import static com.rusefi.IoUtil.getEnableCommand;
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.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)
ecu.sendCommand("set algorithm 2");
// 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");
{
@ -205,8 +206,8 @@ public class CommonFunctionalTest extends RusefiTestBase {
ecu.setEngineType(engine_type_e.DODGE_NEON_2003_CRANK);
ecu.sendCommand("set wwaeTau 0");
ecu.sendCommand("set wwaeBeta 0");
ecu.sendCommand("set_sensor_mock " + SensorType.Map.ordinal() + " 69.12");
ecu.sendCommand("set_sensor_mock " + SensorType.BatteryVoltage.ordinal() + " 12");
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Map.ordinal() + " 69.12");
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.BatteryVoltage.ordinal() + " 12");
ecu.sendCommand("disable cylinder_cleanup");
EngineChart chart;
String msg = "2003 Neon cranking ";
@ -271,12 +272,12 @@ public class CommonFunctionalTest extends RusefiTestBase {
public void testMazdaProtege() {
ecu.setEngineType(engine_type_e.FORD_ESCORT_GT);
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)
ecu.sendCommand("set algorithm 2");
// 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(260);
@ -320,7 +321,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
// 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");
ecu.changeRpm(2600);
ecu.changeRpm(2000);
@ -349,8 +350,8 @@ public class CommonFunctionalTest extends RusefiTestBase {
public void testFordAspire() {
ecu.setEngineType(engine_type_e.FORD_ASPIRE_1996);
ecu.sendCommand("disable cylinder_cleanup");
ecu.sendCommand("set_sensor_mock " + SensorType.Map.ordinal() + " 69.12");
ecu.sendCommand("set_sensor_mock " + SensorType.BatteryVoltage.ordinal() + " 12");
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.Map.ordinal() + " 69.12");
ecu.sendCommand(CMD_SET_SENSOR_MOCK + " " + SensorType.BatteryVoltage.ordinal() + " 12");
String msg;
EngineChart chart;
// todo: interesting changeRpm(100);