[no commit message]
This commit is contained in:
parent
fef472f22e
commit
2e0cbaee97
@ -3,7 +3,7 @@
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package inr.numass.readvac.test;
|
||||
package inr.numass.readvac.app;
|
||||
|
||||
import hep.dataforge.control.measurements.Sensor;
|
||||
import hep.dataforge.control.virtual.Virtual;
|
@ -11,7 +11,6 @@ import hep.dataforge.control.connections.Roles;
|
||||
import hep.dataforge.control.devices.annotations.RoleDef;
|
||||
import hep.dataforge.control.measurements.AbstractMeasurement;
|
||||
import hep.dataforge.control.measurements.Measurement;
|
||||
import hep.dataforge.control.measurements.MeasurementListener;
|
||||
import hep.dataforge.control.measurements.Sensor;
|
||||
import hep.dataforge.points.DataPoint;
|
||||
import hep.dataforge.exceptions.ControlException;
|
||||
@ -28,8 +27,6 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
package inr.numass.readvac.fx;
|
||||
|
||||
import de.jensd.shichimifx.utils.ConsoleDude;
|
||||
import hep.dataforge.control.connections.Connection;
|
||||
import hep.dataforge.control.connections.Roles;
|
||||
import hep.dataforge.control.devices.Device;
|
||||
@ -19,7 +20,6 @@ import hep.dataforge.exceptions.StorageException;
|
||||
import hep.dataforge.meta.Meta;
|
||||
import hep.dataforge.meta.MetaBuilder;
|
||||
import hep.dataforge.plots.PlotFrame;
|
||||
import hep.dataforge.plots.XYPlottable;
|
||||
import hep.dataforge.plots.data.DynamicPlottable;
|
||||
import hep.dataforge.plots.data.DynamicPlottableSet;
|
||||
import hep.dataforge.plots.fx.PlotContainer;
|
||||
@ -43,20 +43,22 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.stage.DirectoryChooser;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.WindowEvent;
|
||||
import javafx.util.Duration;
|
||||
import org.controlsfx.control.Notifications;
|
||||
import org.slf4j.Logger;
|
||||
@ -84,6 +86,9 @@ public class VacCollectorController implements Initializable, DeviceListener, Me
|
||||
private DynamicPlottableSet plottables;
|
||||
private BiFunction<VacCollectorDevice, Storage, PointLoader> loaderFactory;
|
||||
|
||||
private TextArea consolePane;
|
||||
private Stage consoleWindow;
|
||||
|
||||
@FXML
|
||||
private AnchorPane plotHolder;
|
||||
@FXML
|
||||
@ -116,6 +121,17 @@ public class VacCollectorController implements Initializable, DeviceListener, Me
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
consolePane = new TextArea();
|
||||
consolePane.setEditable(false);
|
||||
consolePane.setWrapText(true);
|
||||
ConsoleDude.hookStdStreams(consolePane);
|
||||
consoleWindow = new Stage();
|
||||
consoleWindow.setTitle("Vacuum measurement console");
|
||||
consoleWindow.setScene(new Scene(consolePane, 800, 200));
|
||||
consoleWindow.setOnHidden((WindowEvent event) -> {
|
||||
logButton.setSelected(false);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,6 +172,8 @@ public class VacCollectorController implements Initializable, DeviceListener, Me
|
||||
plottables.addPlottable(plot);
|
||||
});
|
||||
plottables.setEachConfigValue("thickness", 3);
|
||||
//TODO make history length edittable
|
||||
plottables.setMaxAge(3*60*60*1000);
|
||||
plotContainer.setPlot(setupPlot(plottables));
|
||||
}
|
||||
|
||||
@ -276,6 +294,11 @@ public class VacCollectorController implements Initializable, DeviceListener, Me
|
||||
|
||||
@FXML
|
||||
private void onLogToggle(ActionEvent event) {
|
||||
if (logButton.isSelected() && logButton.isSelected()!=consoleWindow.isShowing()) {
|
||||
consoleWindow.show();
|
||||
} else {
|
||||
consoleWindow.hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,9 +35,9 @@
|
||||
<Label text="Interval: " />
|
||||
<ChoiceBox fx:id="intervalSelector" prefWidth="150.0" />
|
||||
<Separator orientation="VERTICAL" />
|
||||
<Pane HBox.hgrow="ALWAYS" />
|
||||
<Pane HBox.hgrow="ALWAYS" />
|
||||
<Separator orientation="VERTICAL" />
|
||||
<ToggleButton fx:id="logButton" mnemonicParsing="false" onAction="#onLogToggle" text="Log" />
|
||||
<ToggleButton fx:id="logButton" mnemonicParsing="false" onAction="#onLogToggle" text="Console" />
|
||||
</items>
|
||||
</ToolBar>
|
||||
<AnchorPane fx:id="plotHolder" VBox.vgrow="ALWAYS" />
|
||||
|
@ -31,7 +31,6 @@ import hep.dataforge.meta.MetaBuilder;
|
||||
import hep.dataforge.plots.PlotFrame;
|
||||
import hep.dataforge.plots.PlotHolder;
|
||||
import hep.dataforge.plots.PlotsPlugin;
|
||||
import hep.dataforge.plots.fx.PlotContainer;
|
||||
import hep.dataforge.utils.MetaFactory;
|
||||
import hep.dataforge.values.Value;
|
||||
import inr.numass.NumassIO;
|
||||
|
Loading…
Reference in New Issue
Block a user