auto-sync
This commit is contained in:
parent
4c311856a0
commit
2b26316ce9
|
@ -22,9 +22,9 @@ public class SensorCentral {
|
|||
public static final String RPM_KEY = "rpm";
|
||||
private static final SensorCentral INSTANCE = new SensorCentral();
|
||||
|
||||
private final Map<Sensor, Double> values = new EnumMap<Sensor, Double>(Sensor.class);
|
||||
private final Map<Sensor, Double> values = new EnumMap<>(Sensor.class);
|
||||
|
||||
private final Map<Sensor, List<SensorListener>> allListeners = new EnumMap<Sensor, List<SensorListener>>(Sensor.class);
|
||||
private final Map<Sensor, List<SensorListener>> allListeners = new EnumMap<>(Sensor.class);
|
||||
|
||||
public static SensorCentral getInstance() {
|
||||
return INSTANCE;
|
||||
|
@ -73,6 +73,8 @@ public class SensorCentral {
|
|||
};
|
||||
|
||||
public void setValue(double value, final Sensor sensor) {
|
||||
Double oldValue = values.get(sensor);
|
||||
boolean isUpdated = oldValue == null || !oldValue.equals(value);
|
||||
values.put(sensor, value);
|
||||
List<SensorListener> listeners;
|
||||
synchronized (allListeners) {
|
||||
|
@ -90,6 +92,11 @@ public class SensorCentral {
|
|||
|
||||
|
||||
LoggerData d = new LoggerData() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return sensor.getName();
|
||||
|
@ -137,6 +144,7 @@ public class SensorCentral {
|
|||
};
|
||||
|
||||
r.setDataValue(d, value);
|
||||
if (isUpdated)
|
||||
TableUpdateHandler.getInstance().handleDataUpdate(r);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ public final class TableUpdateHandler implements DataUpdateHandler {
|
|||
if (tables != null && !tables.isEmpty()) {
|
||||
String formattedValue = loggerData.getSelectedConvertor().format(response.getDataValue(loggerData));
|
||||
for (Table table : tables) {
|
||||
table.clearLiveDataTrace();
|
||||
table.highlightLiveData(formattedValue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,6 +283,18 @@ public class Table1D extends Table {
|
|||
}
|
||||
}
|
||||
|
||||
boolean ec = false;
|
||||
|
||||
@Override
|
||||
public void clearLiveDataTrace() {
|
||||
super.clearLiveDataTrace();
|
||||
if (!ec) {
|
||||
ec = true;
|
||||
getAxisParent().clearLiveDataTrace();
|
||||
ec = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTableLabel() {
|
||||
this.getAxisParent().updateTableLabel();
|
||||
|
|
|
@ -34,7 +34,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
|||
* @see com.rusefi.StartupFrame
|
||||
*/
|
||||
public class Launcher {
|
||||
public static final int CONSOLE_VERSION = 20150310;
|
||||
public static final int CONSOLE_VERSION = 20150311;
|
||||
public static final boolean SHOW_STIMULATOR = false;
|
||||
public static final String TAB_INDEX = "main_tab";
|
||||
private final String port;
|
||||
|
|
Loading…
Reference in New Issue