just Sensor rename
This commit is contained in:
parent
b2925f292a
commit
8d729b155c
|
@ -79,7 +79,7 @@ public class IoUtil {
|
|||
|
||||
final CountDownLatch rpmLatch = new CountDownLatch(1);
|
||||
|
||||
SensorCentral.ListenerToken listenerToken = SensorCentral.getInstance().addListener(Sensor.RPM, actualRpm -> {
|
||||
SensorCentral.ListenerToken listenerToken = SensorCentral.getInstance().addListener(Sensor.RPMValue, actualRpm -> {
|
||||
if (isCloseEnough(rpm, actualRpm))
|
||||
rpmLatch.countDown();
|
||||
});
|
||||
|
@ -94,7 +94,7 @@ public class IoUtil {
|
|||
// We don't need to listen to RPM anymore
|
||||
listenerToken.remove();
|
||||
|
||||
double actualRpm = SensorCentral.getInstance().getValue(Sensor.RPM);
|
||||
double actualRpm = SensorCentral.getInstance().getValue(Sensor.RPMValue);
|
||||
|
||||
if (!isCloseEnough(rpm, actualRpm))
|
||||
throw new IllegalStateException("rpm change did not happen: " + rpm + ", actual " + actualRpm);
|
||||
|
@ -107,7 +107,7 @@ public class IoUtil {
|
|||
final CountDownLatch startup = new CountDownLatch(1);
|
||||
long waitStart = System.currentTimeMillis();
|
||||
|
||||
ISensorCentral.ListenerToken listener = SensorCentral.getInstance().addListener(Sensor.RPM, value -> startup.countDown());
|
||||
ISensorCentral.ListenerToken listener = SensorCentral.getInstance().addListener(Sensor.RPMValue, value -> startup.countDown());
|
||||
startup.await(5, TimeUnit.SECONDS);
|
||||
listener.remove();
|
||||
FileLog.MAIN.logLine("Got first signal in " + (System.currentTimeMillis() - waitStart));
|
||||
|
|
|
@ -45,7 +45,7 @@ public class EcuTestHelper {
|
|||
AtomicReference<String> result = new AtomicReference<>();
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
ISensorCentral.ListenerToken listener = SensorCentral.getInstance().addListener(Sensor.RPM, actualRpm -> {
|
||||
ISensorCentral.ListenerToken listener = SensorCentral.getInstance().addListener(Sensor.RPMValue, actualRpm -> {
|
||||
if (!isCloseEnough(rpm, actualRpm)) {
|
||||
long seconds = (System.currentTimeMillis() - start) / 1000;
|
||||
result.set("Got " + actualRpm + " while trying to stay at " + rpm + " after " + seconds + " seconds");
|
||||
|
|
|
@ -105,11 +105,11 @@ public class BinaryProtocolLogger {
|
|||
}
|
||||
|
||||
public void start() {
|
||||
SensorCentral.getInstance().addListener(Sensor.RPM, rpmListener);
|
||||
SensorCentral.getInstance().addListener(Sensor.RPMValue, rpmListener);
|
||||
}
|
||||
|
||||
public void close() {
|
||||
SensorCentral.getInstance().removeListener(Sensor.RPM, rpmListener);
|
||||
SensorCentral.getInstance().removeListener(Sensor.RPMValue, rpmListener);
|
||||
closeComposites();
|
||||
Runtime.getRuntime().removeShutdownHook(hook);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class JniUnitTest {
|
|||
|
||||
engineLogic.setSensor(SensorType.Rpm.name(), 4000);
|
||||
engineLogic.invokePeriodicCallback();
|
||||
assertEquals(4000.0, getValue(engineLogic.getOutputs(), Sensor.RPM));
|
||||
assertEquals(4000.0, getValue(engineLogic.getOutputs(), Sensor.RPMValue));
|
||||
|
||||
assertEquals(18.11, getValue(engineLogic.getOutputs(), Sensor.runningFuel));
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public enum Sensor {
|
|||
*/
|
||||
|
||||
// RPM, vss
|
||||
RPM(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"),
|
||||
VSS(GAUGE_NAME_VVS, SensorCategory.OPERATIONS, FieldType.UINT8, 10, 1, 0, 150, "kph"),
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class AverageAnglePanel {
|
|||
uiContext.sensorSnifferCentral.addListener(new SensorSnifferCentral.AnalogChartListener() {
|
||||
@Override
|
||||
public void onAnalogChart(String message) {
|
||||
int rpm = (int) SensorCentral.getInstance().getValue(Sensor.RPM);
|
||||
int rpm = (int) SensorCentral.getInstance().getValue(Sensor.RPMValue);
|
||||
aa.add(rpm, message);
|
||||
showResults();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class BinarySensorLogRestarter implements SensorLog {
|
|||
|
||||
@Override
|
||||
public synchronized void writeSensorLogLine() {
|
||||
double rpm = SensorCentral.getInstance().getValue(Sensor.RPM);
|
||||
double rpm = SensorCentral.getInstance().getValue(Sensor.RPMValue);
|
||||
if (rpm > 200) {
|
||||
seenRunning = System.currentTimeMillis();
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class BinarySensorLogSandbox {
|
|||
|
||||
BinarySensorLog l = new BinarySensorLog(valueProvider,
|
||||
Sensor.TIME_SECONDS,
|
||||
Sensor.RPM,
|
||||
Sensor.RPMValue,
|
||||
Sensor.VSS,
|
||||
Sensor.TPS,
|
||||
Sensor.tpsAccelFuel,
|
||||
|
@ -34,7 +34,7 @@ public class BinarySensorLogSandbox {
|
|||
Sensor.CLT);
|
||||
|
||||
values.put(Sensor.TIME_SECONDS, 1.0);
|
||||
values.put(Sensor.RPM, 0.0);
|
||||
values.put(Sensor.RPMValue, 0.0);
|
||||
values.put(Sensor.VSS, 60.0);
|
||||
values.put(Sensor.FIRMWARE_VERSION, 20200101.0);
|
||||
values.put(Sensor.CLT, 29.0);
|
||||
|
@ -43,7 +43,7 @@ public class BinarySensorLogSandbox {
|
|||
|
||||
for (int i = 2; i < 10; i++) {
|
||||
values.put(Sensor.TIME_SECONDS, (double) i);
|
||||
values.put(Sensor.RPM, 180.0 + i);
|
||||
values.put(Sensor.RPMValue, 180.0 + i);
|
||||
values.put(Sensor.FIRMWARE_VERSION, 20200101.0);
|
||||
values.put(Sensor.CLT, 39.0);
|
||||
l.writeSensorLogLine();
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* 4/15/2016.
|
||||
*/
|
||||
public class SensorLogger {
|
||||
protected static Sensor[] SENSORS = {Sensor.RPM,
|
||||
protected static Sensor[] SENSORS = {Sensor.RPMValue,
|
||||
Sensor.TIME_SECONDS,
|
||||
Sensor.INT_TEMP,
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class GaugesGridElement {
|
|||
});
|
||||
|
||||
wrapper.add(new SensorLiveGraph(config.getChild("top"), defaultSensor, switchToGauge));
|
||||
wrapper.add(new SensorLiveGraph(config.getChild("bottom"), Sensor.RPM, switchToGauge));
|
||||
wrapper.add(new SensorLiveGraph(config.getChild("bottom"), Sensor.RPMValue, switchToGauge));
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
|||
*/
|
||||
public class GaugesPanel {
|
||||
private static final Sensor[] DEFAULT_LAYOUT = {
|
||||
Sensor.RPM,
|
||||
Sensor.RPMValue,
|
||||
Sensor.MAF,
|
||||
Sensor.CLT,
|
||||
Sensor.IAT,
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.rusefi.ui;
|
|||
import com.rusefi.core.Sensor;
|
||||
import com.rusefi.core.SensorCentral;
|
||||
import com.rusefi.io.ConnectionStatusLogic;
|
||||
import com.rusefi.io.LinkManager;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
@ -53,7 +52,7 @@ public class RpmLabel {
|
|||
@Override
|
||||
public void onConnectionStatus(boolean isConnected) {
|
||||
if (isConnected) {
|
||||
rpmValue.setText("" + SensorCentral.getInstance().getValue(Sensor.RPM));
|
||||
rpmValue.setText("" + SensorCentral.getInstance().getValue(Sensor.RPMValue));
|
||||
rpmValue.setForeground(Color.green);
|
||||
} else {
|
||||
rpmValue.setText(NO_CONNECTION);
|
||||
|
|
|
@ -27,7 +27,7 @@ public class RpmModel {
|
|||
}
|
||||
|
||||
private RpmModel() {
|
||||
SensorCentral.getInstance().addListener(Sensor.RPM, value -> setValue((int) value));
|
||||
SensorCentral.getInstance().addListener(Sensor.RPMValue, value -> setValue((int) value));
|
||||
}
|
||||
|
||||
public void setValue(int rpm) {
|
||||
|
|
|
@ -133,7 +133,7 @@ public class Wizard {
|
|||
|
||||
@Override
|
||||
public Component getContent() {
|
||||
double rpm = SensorCentral.getInstance().getValue(Sensor.RPM);
|
||||
double rpm = SensorCentral.getInstance().getValue(Sensor.RPMValue);
|
||||
if (rpm == 0) {
|
||||
return Wizard.this.getContent(nextStep);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.rusefi.ui.widgets;
|
||||
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.Sensor;
|
||||
import com.rusefi.io.CommandQueue;
|
||||
import com.rusefi.io.IMethodInvocation;
|
||||
|
@ -174,7 +173,7 @@ public class DetachedSensor {
|
|||
}
|
||||
|
||||
public static void create(UIContext uiContext, Node child) {
|
||||
Sensor sensor = Sensor.lookup(child.getProperty(NAME, Sensor.RPM.name()), Sensor.RPM);
|
||||
Sensor sensor = Sensor.lookup(child.getProperty(NAME, Sensor.RPMValue.name()), Sensor.RPMValue);
|
||||
int width = child.getIntProperty(WIDTH, 256);
|
||||
int xpos = child.getIntProperty(XPOS, 0);
|
||||
int ypos = child.getIntProperty(YPOS, 0);
|
||||
|
|
|
@ -33,7 +33,6 @@ import java.io.IOException;
|
|||
import java.net.BindException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static com.devexperts.logging.Logging.getLogging;
|
||||
|
@ -299,7 +298,7 @@ public class Backend implements Closeable {
|
|||
for (ControllerConnectionState client : clients) {
|
||||
// todo: at the moment we use current OutputChannel layout - a better way would be to take
|
||||
// todo: OutputChannel from .ini file based on controller signature
|
||||
int rpm = (int) client.getSensorsHolder().getValue(Sensor.RPM);
|
||||
int rpm = (int) client.getSensorsHolder().getValue(Sensor.RPMValue);
|
||||
double clt = client.getSensorsHolder().getValue(Sensor.CLT);
|
||||
UserDetails owner = client.getTwoKindSemaphore().getOwner();
|
||||
SessionDetails sessionDetails = client.getSessionDetails();
|
||||
|
|
Loading…
Reference in New Issue