From 10f9753556826e7972fbeb2a31b9f891fd37acbd Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Thu, 25 May 2017 14:09:35 +0300 Subject: [PATCH] Server fix. --- .../inr/numass/cryotemp/PKT8PlotView.java | 2 +- .../control/msp/fx/MspViewController.java | 41 ++++++++----------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8PlotView.java b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8PlotView.java index 1ccb1c14..9d7b993d 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8PlotView.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8PlotView.java @@ -105,7 +105,7 @@ public class PKT8PlotView extends DeviceViewConnection implements In //Do not use view config here, it is applyed separately channels.stream() .filter(channel -> !plottables.has(channel.getName())) - .forEach(channel -> { + .forEachOrdered(channel -> { //plot config from device configuration TimePlottable plottable = new TimePlottable(channel.getName()); plottable.configure(channel.meta()); diff --git a/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java b/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java index e8d3cf18..4ffb6a52 100644 --- a/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java +++ b/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java @@ -22,7 +22,6 @@ import hep.dataforge.exceptions.ControlException; import hep.dataforge.exceptions.PortException; import hep.dataforge.fx.fragments.FragmentWindow; import hep.dataforge.fx.fragments.LogFragment; -import hep.dataforge.meta.ConfigChangeListener; import hep.dataforge.meta.Meta; import hep.dataforge.meta.MetaBuilder; 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.MspListener; import javafx.application.Platform; -import javafx.beans.binding.BooleanBinding; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.event.ActionEvent; @@ -55,7 +53,6 @@ import org.controlsfx.control.ToggleSwitch; import java.io.IOException; import java.net.URL; import java.time.Instant; -import java.util.List; import java.util.ResourceBundle; /** @@ -80,19 +77,19 @@ public class MspViewController extends DeviceViewConnection implement private JFreeChartFrame plot; private LogFragment logFragment; - private final ConfigChangeListener viewConfigObserver = new ConfigChangeListener() { - - @Override - public void notifyElementChanged(String name, List oldItem, List newItem) { - updatePlot(); - } - - @Override - public void notifyValueChanged(String name, Value oldItem, Value newItem) { - updatePlot(); - } - - }; +// private final ConfigChangeListener viewConfigObserver = new ConfigChangeListener() { +// +// @Override +// public void notifyElementChanged(String name, List oldItem, List newItem) { +// updatePlot(); +// } +// +// @Override +// public void notifyValueChanged(String name, Value oldItem, Value newItem) { +// updatePlot(); +// } +// +// }; @FXML private BorderPane root; @@ -147,15 +144,13 @@ public class MspViewController extends DeviceViewConnection implement } }); - BooleanBinding disabled = connectButton.selectedProperty().not(); - fillamentButton.disableProperty().bind(disabled); - measureButton.disableProperty().bind(disabled); - storeButton.disableProperty().bind(disabled); - + fillamentButton.disableProperty().bind(connectButton.selectedProperty().not()); + measureButton.disableProperty().bind(fillamentButton.selectedProperty().not()); + storeButton.disableProperty().bind(measureButton.selectedProperty().not()); } - public Meta getViewConfig() { + private Meta getViewConfig() { return getDevice().meta().getMeta("plotConfig", getDevice().getMeta()); } @@ -183,7 +178,7 @@ public class MspViewController extends DeviceViewConnection implement container.setPlot(plot); } - public void updatePlot() { + private void updatePlot() { if (plot == null) { initPlot(); }