Server fix.

This commit is contained in:
Alexander Nozik 2017-05-25 14:09:35 +03:00
parent 315e4f0811
commit 10f9753556
2 changed files with 19 additions and 24 deletions

View File

@ -105,7 +105,7 @@ public class PKT8PlotView extends DeviceViewConnection<PKT8Device> implements In
//Do not use view config here, it is applyed separately //Do not use view config here, it is applyed separately
channels.stream() channels.stream()
.filter(channel -> !plottables.has(channel.getName())) .filter(channel -> !plottables.has(channel.getName()))
.forEach(channel -> { .forEachOrdered(channel -> {
//plot config from device configuration //plot config from device configuration
TimePlottable plottable = new TimePlottable(channel.getName()); TimePlottable plottable = new TimePlottable(channel.getName());
plottable.configure(channel.meta()); plottable.configure(channel.meta());

View File

@ -22,7 +22,6 @@ import hep.dataforge.exceptions.ControlException;
import hep.dataforge.exceptions.PortException; import hep.dataforge.exceptions.PortException;
import hep.dataforge.fx.fragments.FragmentWindow; import hep.dataforge.fx.fragments.FragmentWindow;
import hep.dataforge.fx.fragments.LogFragment; import hep.dataforge.fx.fragments.LogFragment;
import hep.dataforge.meta.ConfigChangeListener;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder; import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.plots.data.TimePlottable; import hep.dataforge.plots.data.TimePlottable;
@ -35,7 +34,6 @@ import inr.numass.control.DeviceViewConnection;
import inr.numass.control.msp.MspDevice; import inr.numass.control.msp.MspDevice;
import inr.numass.control.msp.MspListener; import inr.numass.control.msp.MspListener;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
@ -55,7 +53,6 @@ import org.controlsfx.control.ToggleSwitch;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.time.Instant; import java.time.Instant;
import java.util.List;
import java.util.ResourceBundle; import java.util.ResourceBundle;
/** /**
@ -80,19 +77,19 @@ public class MspViewController extends DeviceViewConnection<MspDevice> implement
private JFreeChartFrame plot; private JFreeChartFrame plot;
private LogFragment logFragment; private LogFragment logFragment;
private final ConfigChangeListener viewConfigObserver = new ConfigChangeListener() { // private final ConfigChangeListener viewConfigObserver = new ConfigChangeListener() {
//
@Override // @Override
public void notifyElementChanged(String name, List<? extends Meta> oldItem, List<? extends Meta> newItem) { // public void notifyElementChanged(String name, List<? extends Meta> oldItem, List<? extends Meta> newItem) {
updatePlot(); // updatePlot();
} // }
//
@Override // @Override
public void notifyValueChanged(String name, Value oldItem, Value newItem) { // public void notifyValueChanged(String name, Value oldItem, Value newItem) {
updatePlot(); // updatePlot();
} // }
//
}; // };
@FXML @FXML
private BorderPane root; private BorderPane root;
@ -147,15 +144,13 @@ public class MspViewController extends DeviceViewConnection<MspDevice> implement
} }
}); });
BooleanBinding disabled = connectButton.selectedProperty().not(); fillamentButton.disableProperty().bind(connectButton.selectedProperty().not());
fillamentButton.disableProperty().bind(disabled); measureButton.disableProperty().bind(fillamentButton.selectedProperty().not());
measureButton.disableProperty().bind(disabled); storeButton.disableProperty().bind(measureButton.selectedProperty().not());
storeButton.disableProperty().bind(disabled);
} }
public Meta getViewConfig() { private Meta getViewConfig() {
return getDevice().meta().getMeta("plotConfig", getDevice().getMeta()); return getDevice().meta().getMeta("plotConfig", getDevice().getMeta());
} }
@ -183,7 +178,7 @@ public class MspViewController extends DeviceViewConnection<MspDevice> implement
container.setPlot(plot); container.setPlot(plot);
} }
public void updatePlot() { private void updatePlot() {
if (plot == null) { if (plot == null) {
initPlot(); initPlot();
} }