This commit is contained in:
parent
1d799a5496
commit
b20e996a9b
|
@ -5,6 +5,8 @@ package com.rusefi.core;
|
|||
* (c) Andrey Belomutskiy
|
||||
*/
|
||||
public interface ISensorCentral {
|
||||
void initialize(EngineState es);
|
||||
|
||||
double getValue(Sensor sensor);
|
||||
|
||||
void setValue(double value, Sensor sensor);
|
||||
|
@ -15,5 +17,5 @@ public interface ISensorCentral {
|
|||
|
||||
void removeListener(Sensor sensor, SensorCentral.SensorListener listener);
|
||||
|
||||
void initialize(EngineState es);
|
||||
ValueSource getValueSource(Sensor sensor);
|
||||
}
|
||||
|
|
|
@ -87,6 +87,11 @@ public class SensorCentral implements ISensorCentral {
|
|||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSource getValueSource(Sensor sensor) {
|
||||
return () -> SensorCentral.this.getValue(sensor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(EngineState es) {
|
||||
addDoubleSensor(RPM_KEY, Sensor.RPM, es);
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package com.rusefi.core;
|
||||
|
||||
/**
|
||||
* 11/16/2017
|
||||
* (c) Andrey Belomutskiy
|
||||
*/
|
||||
public interface ValueSource {
|
||||
double getValue();
|
||||
}
|
Loading…
Reference in New Issue