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