just Sensor rename

This commit is contained in:
rusefillc 2022-04-16 00:39:28 -04:00
parent 31c751d5cc
commit 24ebcc8989
6 changed files with 12 additions and 14 deletions

View File

@ -23,7 +23,7 @@ public class MiscTest extends RusefiTestBase {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
while (Double.isNaN(mcuTemp) && (System.currentTimeMillis() - start) < 5 * SECOND) { while (Double.isNaN(mcuTemp) && (System.currentTimeMillis() - start) < 5 * SECOND) {
Thread.sleep(100); Thread.sleep(100);
mcuTemp = SensorCentral.getInstance().getValue(Sensor.INT_TEMP); mcuTemp = SensorCentral.getInstance().getValue(Sensor.internalMcuTemperature);
} }
System.out.println("MCU temperature is " + mcuTemp + " deg C"); System.out.println("MCU temperature is " + mcuTemp + " deg C");

View File

@ -3,14 +3,12 @@ package com.rusefi.f4discovery;
import com.rusefi.autotest.ControllerConnectorState; import com.rusefi.autotest.ControllerConnectorState;
import com.rusefi.RusefiTestBase; import com.rusefi.RusefiTestBase;
import com.rusefi.Timeouts; import com.rusefi.Timeouts;
import com.rusefi.config.generated.Fields;
import com.rusefi.core.Sensor; import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral; import com.rusefi.core.SensorCentral;
import com.rusefi.enums.engine_type_e; import com.rusefi.enums.engine_type_e;
import com.rusefi.functional_tests.EcuTestHelper; import com.rusefi.functional_tests.EcuTestHelper;
import org.junit.Test; import org.junit.Test;
import static com.rusefi.IoUtil.getEnableCommand;
import static com.rusefi.binaryprotocol.BinaryProtocol.sleep; import static com.rusefi.binaryprotocol.BinaryProtocol.sleep;
import static com.rusefi.config.generated.Fields.*; import static com.rusefi.config.generated.Fields.*;
@ -39,14 +37,14 @@ public class VssHardwareLoopTest extends RusefiTestBase {
ecu.sendCommand(CMD_IDLE_PIN + " PD2"); ecu.sendCommand(CMD_IDLE_PIN + " PD2");
ecu.sendCommand("set idle_solenoid_freq 1000"); ecu.sendCommand("set idle_solenoid_freq 1000");
EcuTestHelper.assertSomewhatClose("VSS no input", 0, SensorCentral.getInstance().getValue(Sensor.VSS)); EcuTestHelper.assertSomewhatClose("VSS no input", 0, SensorCentral.getInstance().getValue(Sensor.vehicleSpeedKph));
// attaching VSS to idle output since there is a jumper on test discovery // attaching VSS to idle output since there is a jumper on test discovery
ecu.sendCommand("set " + CMD_VSS_PIN + " pa5"); ecu.sendCommand("set " + CMD_VSS_PIN + " pa5");
sleep(2 * Timeouts.SECOND); sleep(2 * Timeouts.SECOND);
EcuTestHelper.assertSomewhatClose("VSS with input", 92, SensorCentral.getInstance().getValue(Sensor.VSS)); EcuTestHelper.assertSomewhatClose("VSS with input", 92, SensorCentral.getInstance().getValue(Sensor.vehicleSpeedKph));
// not related to VSS test, just need to validate this somewhere, so this random test is as good as any // not related to VSS test, just need to validate this somewhere, so this random test is as good as any
if (ControllerConnectorState.firmwareVersion == null) if (ControllerConnectorState.firmwareVersion == null)

View File

@ -26,11 +26,11 @@ public enum Sensor {
// RPM, vss // RPM, vss
RPMValue(GAUGE_NAME_RPM, SensorCategory.SENSOR_INPUTS, FieldType.UINT16, 4, 1, 0, 8000, "RPM"), RPMValue(GAUGE_NAME_RPM, SensorCategory.SENSOR_INPUTS, FieldType.UINT16, 4, 1, 0, 8000, "RPM"),
SPEED2RPM("SpeedToRpm", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 6, 1.0 / PACK_MULT_PERCENT, 0, 5, "RPM/kph"), speedToRpmRatio("SpeedToRpm", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 6, 1.0 / PACK_MULT_PERCENT, 0, 5, "RPM/kph"),
VSS(GAUGE_NAME_VVS, SensorCategory.OPERATIONS, FieldType.UINT8, 10, 1, 0, 150, "kph"), vehicleSpeedKph(GAUGE_NAME_VVS, SensorCategory.OPERATIONS, FieldType.UINT8, 10, 1, 0, 150, "kph"),
// Temperatures // Temperatures
INT_TEMP(GAUGE_NAME_CPU_TEMP, SensorCategory.OPERATIONS, FieldType.INT8, 11, 1, 0, 5, "C"), internalMcuTemperature(GAUGE_NAME_CPU_TEMP, SensorCategory.OPERATIONS, FieldType.INT8, 11, 1, 0, 5, "C"),
CLT(GAUGE_NAME_CLT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 12, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), CLT(GAUGE_NAME_CLT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 12, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"),
IAT(GAUGE_NAME_IAT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 14, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), IAT(GAUGE_NAME_IAT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 14, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"),
AuxT1("AuxT1", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 16, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), AuxT1("AuxT1", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 16, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"),

View File

@ -20,7 +20,7 @@ public class BinarySensorLogSandbox {
BinarySensorLog l = new BinarySensorLog(valueProvider, BinarySensorLog l = new BinarySensorLog(valueProvider,
Sensor.TIME_SECONDS, Sensor.TIME_SECONDS,
Sensor.RPMValue, Sensor.RPMValue,
Sensor.VSS, Sensor.vehicleSpeedKph,
Sensor.TPS, Sensor.TPS,
Sensor.tpsAccelFuel, Sensor.tpsAccelFuel,
Sensor.PPS, Sensor.PPS,
@ -35,7 +35,7 @@ public class BinarySensorLogSandbox {
values.put(Sensor.TIME_SECONDS, 1.0); values.put(Sensor.TIME_SECONDS, 1.0);
values.put(Sensor.RPMValue, 0.0); values.put(Sensor.RPMValue, 0.0);
values.put(Sensor.VSS, 60.0); values.put(Sensor.vehicleSpeedKph, 60.0);
values.put(Sensor.FIRMWARE_VERSION, 20200101.0); values.put(Sensor.FIRMWARE_VERSION, 20200101.0);
values.put(Sensor.CLT, 29.0); values.put(Sensor.CLT, 29.0);

View File

@ -16,7 +16,7 @@ import java.util.List;
public class SensorLogger { public class SensorLogger {
protected static Sensor[] SENSORS = {Sensor.RPMValue, protected static Sensor[] SENSORS = {Sensor.RPMValue,
Sensor.TIME_SECONDS, Sensor.TIME_SECONDS,
Sensor.INT_TEMP, Sensor.internalMcuTemperature,
Sensor.engineMode, Sensor.engineMode,
Sensor.CLT, Sensor.CLT,
@ -70,8 +70,8 @@ public class SensorLogger {
Sensor.vvtTargetB2I, Sensor.vvtTargetB2I,
Sensor.vvtTargetB2E, Sensor.vvtTargetB2E,
Sensor.VSS, Sensor.vehicleSpeedKph,
Sensor.SPEED2RPM, Sensor.speedToRpmRatio,
Sensor.turboSpeed, Sensor.turboSpeed,
Sensor.accelerationX, Sensor.accelerationX,

View File

@ -43,7 +43,7 @@ public class GaugesPanel {
Sensor.lastErrorCode, Sensor.lastErrorCode,
Sensor.Lambda, Sensor.Lambda,
Sensor.VBATT, Sensor.VBATT,
Sensor.VSS, Sensor.vehicleSpeedKph,
}; };
private static final String GAUGES_ROWS = "gauges_rows"; private static final String GAUGES_ROWS = "gauges_rows";