auto-sync

This commit is contained in:
rusEfi 2015-03-14 11:11:42 -05:00
parent 7046bc7302
commit a8772b1f8a
2 changed files with 1 additions and 11 deletions

View File

@ -150,17 +150,12 @@ public class SensorCentral {
TableUpdateHandler.getInstance().handleDataUpdate(r);
}
public static String getInternalAdcRepresentation(double value) {
double volts = value * 3.3 / 4096;
return String.format("%.2f (%.2fv)", value, volts);
}
public void addListener(Sensor sensor, SensorListener listener) {
List<SensorListener> listeners;
synchronized (allListeners) {
listeners = allListeners.get(sensor);
if (listeners == null)
listeners = new CopyOnWriteArrayList<SensorListener>();
listeners = new CopyOnWriteArrayList<>();
allListeners.put(sensor, listeners);
}
listeners.add(listener);

View File

@ -46,9 +46,4 @@ public class EngineStateTest {
es.processNewData("600\r");
assertEquals(600, rpmResult.get());
}
@Test
public void testAdcRepresentation() {
assertEquals("1025.00 (0.83v)", SensorCentral.getInternalAdcRepresentation(1025));
}
}