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 bafced8c..bdc308eb 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 @@ -29,7 +29,7 @@ import hep.dataforge.meta.Configuration; import hep.dataforge.meta.Meta; import hep.dataforge.meta.MetaBuilder; import hep.dataforge.plots.data.DynamicPlottable; -import hep.dataforge.plots.data.DynamicPlottableSet; +import hep.dataforge.plots.data.DynamicPlottableGroup; import hep.dataforge.plots.fx.PlotContainer; import hep.dataforge.plots.jfreechart.JFreeChartFrame; import hep.dataforge.storage.api.Storage; @@ -77,7 +77,7 @@ public class MspViewController implements Initializable, MspListener { public static final String MSP_DEVICE_TYPE = "msp"; public static final String DEFAULT_CONFIG_LOCATION = "msp-config.xml"; - private final DynamicPlottableSet plottables = new DynamicPlottableSet(); + private final DynamicPlottableGroup plottables = new DynamicPlottableGroup(); private final String mspName = "msp"; private MspDevice device; private Configuration viewConfig; diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacCollectorController.java b/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacCollectorController.java index 08cbf84b..03b8aa59 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacCollectorController.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacCollectorController.java @@ -18,7 +18,7 @@ import hep.dataforge.fx.ConsoleFragment; import hep.dataforge.meta.Meta; import hep.dataforge.meta.MetaBuilder; import hep.dataforge.plots.data.DynamicPlottable; -import hep.dataforge.plots.data.DynamicPlottableSet; +import hep.dataforge.plots.data.DynamicPlottableGroup; import hep.dataforge.plots.fx.FXPlotFrame; import hep.dataforge.plots.fx.PlotContainer; import hep.dataforge.plots.jfreechart.JFreeChartFrame; @@ -75,7 +75,7 @@ public class VacCollectorController implements Initializable, DeviceListener, Me private LoaderConnection storageConnection; private VacCollectorDevice device; private PlotContainer plotContainer; - private DynamicPlottableSet plottables; + private DynamicPlottableGroup plottables; private BiFunction loaderFactory; @FXML private AnchorPane plotHolder; @@ -161,7 +161,7 @@ public class VacCollectorController implements Initializable, DeviceListener, Me private void setupView() { vacBoxHolder.getChildren().clear(); - plottables = new DynamicPlottableSet(); + plottables = new DynamicPlottableGroup(); views.stream().forEach((controller) -> { vacBoxHolder.getChildren().add(controller.getComponent()); DynamicPlottable plot = new DynamicPlottable(controller.getTitle(), @@ -175,7 +175,7 @@ public class VacCollectorController implements Initializable, DeviceListener, Me plotContainer.setPlot(setupPlot(plottables)); } - private FXPlotFrame setupPlot(DynamicPlottableSet plottables) { + private FXPlotFrame setupPlot(DynamicPlottableGroup plottables) { Meta plotConfig = new MetaBuilder("plotFrame") .setNode(new MetaBuilder("yAxis") .setValue("type", "log") diff --git a/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java b/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java index b3b24e1e..b2084225 100644 --- a/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java +++ b/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java @@ -311,7 +311,7 @@ public class NumassDataLoader extends AbstractLoader implements ObjectLoader { + return SetDirectionUtility.isReversed(getPath(), n -> { List points = getPoints(); if (getPoints().size() >= 2) { return readTime(points.get(0).meta()).isAfter(readTime(points.get(1).meta())); diff --git a/numass-viewer/src/main/java/inr/numass/viewer/MainViewerController.java b/numass-viewer/src/main/java/inr/numass/viewer/MainViewerController.java index 4feee2b9..a924bbc1 100644 --- a/numass-viewer/src/main/java/inr/numass/viewer/MainViewerController.java +++ b/numass-viewer/src/main/java/inr/numass/viewer/MainViewerController.java @@ -52,15 +52,13 @@ import java.util.logging.Logger; */ public class MainViewerController implements Initializable { -// private ConsoleFragment consoleFragment; -// private WorkManagerFragment processFragment = WorkManagerFragment.attachToContext(GlobalContext.instance()); @FXML private ToggleButton consoleButton; @FXML private Button loadDirectoryButton; + private MspViewController mspController; - // @FXML -// private AnchorPane mspContainer; + //main pane views @FXML private AnchorPane numassLoaderViewContainer; @@ -106,6 +104,9 @@ public class MainViewerController implements Initializable { consoleFragment.hookStd(); consoleFragment.bindTo(consoleButton); WorkManagerFragment.attachToContext(GlobalContext.instance()).bindTo(processManagerButton); + + mspController = new MspViewController(getContext()); + this.mspTab.setContent(mspController.getRoot()); } @FXML @@ -181,7 +182,7 @@ public class MainViewerController implements Initializable { callback.setProgressToMax(); }); - mspController = new MspViewController(getContext(), mspTab); + mspController.fillMspData(root); pressuresTab.getContent().setVisible(false); diff --git a/numass-viewer/src/main/java/inr/numass/viewer/MspViewController.java b/numass-viewer/src/main/java/inr/numass/viewer/MspViewController.java index ecc76991..b2307b4d 100644 --- a/numass-viewer/src/main/java/inr/numass/viewer/MspViewController.java +++ b/numass-viewer/src/main/java/inr/numass/viewer/MspViewController.java @@ -22,10 +22,11 @@ package inr.numass.viewer; */ import hep.dataforge.context.Context; +import hep.dataforge.context.Encapsulated; import hep.dataforge.names.Name; import hep.dataforge.plots.PlotUtils; import hep.dataforge.plots.data.DynamicPlottable; -import hep.dataforge.plots.data.DynamicPlottableSet; +import hep.dataforge.plots.data.DynamicPlottableGroup; import hep.dataforge.plots.fx.PlotContainer; import hep.dataforge.plots.jfreechart.JFreeChartFrame; import hep.dataforge.storage.api.PointLoader; @@ -37,8 +38,8 @@ import hep.dataforge.values.Value; import javafx.application.Platform; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; -import javafx.scene.control.Tab; import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.BorderPane; import org.slf4j.LoggerFactory; import java.io.IOException; @@ -53,29 +54,39 @@ import java.util.stream.StreamSupport; * * @author darksnake */ -public class MspViewController { +public class MspViewController implements Encapsulated { private final Context context; + private BorderPane root = new BorderPane(); + @FXML private AnchorPane mspPlotPane; - public MspViewController(Context context, Tab mspTab) { + public MspViewController(Context context) { this.context = context; FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/MspView.fxml")); loader.setController(this); + loader.setRoot(root); try { loader.load(); } catch (IOException e) { throw new Error(e); } - mspTab.setContent(loader.getRoot()); -// this.mspPlotPane = mspContainer; + } + + public BorderPane getRoot() { + return root; + } + + @Override + public Context getContext() { + return context; } /** * update detector pane with new data */ - private void updateMspPane(DynamicPlottableSet mspData) { + private void updateMspPane(DynamicPlottableGroup mspData) { JFreeChartFrame frame = new JFreeChartFrame(); PlotUtils.setYAxis(frame, "partial pressure", "mbar", "log"); frame.getConfig().setValue("yAxis.range.lower", 1e-10); @@ -103,7 +114,7 @@ public class MspViewController { } public void plotData(List loaders) { - DynamicPlottableSet plottables = new DynamicPlottableSet(); + DynamicPlottableGroup plottables = new DynamicPlottableGroup(); loaders.stream() .flatMap(loader -> getLoaderData(loader)) .distinct() @@ -183,7 +194,7 @@ public class MspViewController { //// List mspData = (List) loadProcess.getTask().get(); // // if (!mspData.isEmpty()) { -// DynamicPlottableSet plottables = new DynamicPlottableSet(); +// DynamicPlottableGroup plottables = new DynamicPlottableGroup(); // // for (DataPoint point : mspData) { // for (String name : point.names()) { diff --git a/numass-viewer/src/main/java/inr/numass/viewer/NumassLoaderViewComponent.java b/numass-viewer/src/main/java/inr/numass/viewer/NumassLoaderViewComponent.java index cc63ecfc..404655e6 100644 --- a/numass-viewer/src/main/java/inr/numass/viewer/NumassLoaderViewComponent.java +++ b/numass-viewer/src/main/java/inr/numass/viewer/NumassLoaderViewComponent.java @@ -244,7 +244,7 @@ public class NumassLoaderViewComponent extends AnchorPane implements Initializab Platform.runLater(() -> { if (t != null) { hvPlot.getPlot().plottables().clear(); - DynamicPlottableSet set = new DynamicPlottableSet(); + DynamicPlottableGroup set = new DynamicPlottableGroup(); for (DataPoint dp : t) { String block = dp.getString("block", "default"); if (!set.hasPlottable(block)) { diff --git a/numass-viewer/src/main/resources/fxml/MainView.fxml b/numass-viewer/src/main/resources/fxml/MainView.fxml index 0a539ccb..dbfe5af7 100644 --- a/numass-viewer/src/main/resources/fxml/MainView.fxml +++ b/numass-viewer/src/main/resources/fxml/MainView.fxml @@ -17,12 +17,22 @@ limitations under the License. --> - - + + + + + + + + + + + + - + + @@ -71,11 +81,7 @@ limitations under the License. - - - - - + diff --git a/numass-viewer/src/main/resources/fxml/MspView.fxml b/numass-viewer/src/main/resources/fxml/MspView.fxml index f26b4c48..812852ee 100644 --- a/numass-viewer/src/main/resources/fxml/MspView.fxml +++ b/numass-viewer/src/main/resources/fxml/MspView.fxml @@ -16,15 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - - -
- -
-
-
-
+ + + + + +
+ +
+