[no commit message]
This commit is contained in:
parent
96aa27758e
commit
f1eb4eba02
@ -118,7 +118,7 @@ public class VACFrame extends javax.swing.JFrame {
|
|||||||
initComponents();
|
initComponents();
|
||||||
split.getRightComponent().setMinimumSize(new Dimension());
|
split.getRightComponent().setMinimumSize(new Dimension());
|
||||||
split.setDividerLocation(1.0);
|
split.setDividerLocation(1.0);
|
||||||
GlobalContext.instance().attachIoManager(new BasicIOManager(new TextAreaOutputStream(consoleBox, "CONSOLE")));
|
GlobalContext.instance().setIO(new BasicIOManager(new TextAreaOutputStream(consoleBox, "CONSOLE")));
|
||||||
|
|
||||||
JTextAreaAppender app = new JTextAreaAppender(consoleBox);
|
JTextAreaAppender app = new JTextAreaAppender(consoleBox);
|
||||||
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||||
|
@ -18,14 +18,12 @@ package inr.numass;
|
|||||||
import hep.dataforge.actions.ActionUtils;
|
import hep.dataforge.actions.ActionUtils;
|
||||||
import hep.dataforge.context.Context;
|
import hep.dataforge.context.Context;
|
||||||
import static hep.dataforge.context.GlobalContext.out;
|
import static hep.dataforge.context.GlobalContext.out;
|
||||||
import hep.dataforge.data.DataNode;
|
|
||||||
import hep.dataforge.data.FileDataFactory;
|
import hep.dataforge.data.FileDataFactory;
|
||||||
import hep.dataforge.datafitter.MINUITPlugin;
|
import hep.dataforge.datafitter.MINUITPlugin;
|
||||||
import hep.dataforge.io.IOManager;
|
import hep.dataforge.io.IOManager;
|
||||||
import hep.dataforge.io.MetaFileReader;
|
import hep.dataforge.io.MetaFileReader;
|
||||||
import hep.dataforge.meta.Meta;
|
import hep.dataforge.meta.Meta;
|
||||||
import static inr.numass.NumassContext.printDescription;
|
import static inr.numass.NumassContext.printDescription;
|
||||||
import inr.numass.workbench.Workbench;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -53,7 +53,7 @@ public class NumassContext extends Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
attachIoManager(new NumassIO());
|
setIO(new NumassIO());
|
||||||
loadPlugin("inr.numass:numass");
|
loadPlugin("inr.numass:numass");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ import static java.lang.Math.sqrt;
|
|||||||
import org.apache.commons.math3.analysis.UnivariateFunction;
|
import org.apache.commons.math3.analysis.UnivariateFunction;
|
||||||
import org.apache.commons.math3.analysis.integration.SimpsonIntegrator;
|
import org.apache.commons.math3.analysis.integration.SimpsonIntegrator;
|
||||||
import org.apache.commons.math3.analysis.integration.UnivariateIntegrator;
|
import org.apache.commons.math3.analysis.integration.UnivariateIntegrator;
|
||||||
|
import static java.lang.Double.isNaN;
|
||||||
|
import static java.lang.Math.abs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -32,6 +32,14 @@ import static java.util.Locale.setDefault;
|
|||||||
import static java.util.Locale.setDefault;
|
import static java.util.Locale.setDefault;
|
||||||
import static java.util.Locale.setDefault;
|
import static java.util.Locale.setDefault;
|
||||||
import static java.util.Locale.setDefault;
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@ import hep.dataforge.data.FileDataFactory;
|
|||||||
import hep.dataforge.description.ActionDescriptor;
|
import hep.dataforge.description.ActionDescriptor;
|
||||||
import hep.dataforge.description.DescriptorUtils;
|
import hep.dataforge.description.DescriptorUtils;
|
||||||
import hep.dataforge.exceptions.NameNotFoundException;
|
import hep.dataforge.exceptions.NameNotFoundException;
|
||||||
|
import hep.dataforge.fx.FXProcessManager;
|
||||||
import hep.dataforge.fx.LogOutputPane;
|
import hep.dataforge.fx.LogOutputPane;
|
||||||
import hep.dataforge.fx.MetaEditor;
|
import hep.dataforge.fx.MetaEditor;
|
||||||
import hep.dataforge.fx.MetaTreeItem;
|
import hep.dataforge.fx.MetaTreeItem;
|
||||||
@ -30,6 +31,7 @@ import hep.dataforge.meta.MetaBuilder;
|
|||||||
import hep.dataforge.plots.PlotFrame;
|
import hep.dataforge.plots.PlotFrame;
|
||||||
import hep.dataforge.plots.PlotHolder;
|
import hep.dataforge.plots.PlotHolder;
|
||||||
import hep.dataforge.plots.PlotsPlugin;
|
import hep.dataforge.plots.PlotsPlugin;
|
||||||
|
import hep.dataforge.plots.fx.PlotContainer;
|
||||||
import hep.dataforge.utils.MetaFactory;
|
import hep.dataforge.utils.MetaFactory;
|
||||||
import hep.dataforge.values.Value;
|
import hep.dataforge.values.Value;
|
||||||
import inr.numass.NumassIO;
|
import inr.numass.NumassIO;
|
||||||
@ -48,13 +50,16 @@ import javafx.event.ActionEvent;
|
|||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Accordion;
|
import javafx.scene.control.Accordion;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TabPane;
|
import javafx.scene.control.TabPane;
|
||||||
import javafx.scene.control.TextArea;
|
import javafx.scene.control.TextArea;
|
||||||
import javafx.scene.control.TitledPane;
|
import javafx.scene.control.TitledPane;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
|
import javafx.stage.Stage;
|
||||||
import org.controlsfx.control.StatusBar;
|
import org.controlsfx.control.StatusBar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,6 +81,9 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
|
|||||||
|
|
||||||
Map<String, StagePane> stages = new ConcurrentHashMap<>();
|
Map<String, StagePane> stages = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
FXProcessManager processManager = new FXProcessManager();
|
||||||
|
Stage processManagerStage;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private StatusBar statusBar;
|
private StatusBar statusBar;
|
||||||
@FXML
|
@FXML
|
||||||
@ -126,7 +134,8 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
|
|||||||
|
|
||||||
private void buildContext(Meta config) {
|
private void buildContext(Meta config) {
|
||||||
this.context = this.contextFactory.build(parentContext, config);
|
this.context = this.contextFactory.build(parentContext, config);
|
||||||
context.attachIoManager(new WorkbenchIOManager(new NumassIO(), this));
|
context.setIO(new WorkbenchIOManager(new NumassIO(), this));
|
||||||
|
context.setProcessManager(processManager);
|
||||||
buildContextPane();
|
buildContextPane();
|
||||||
this.logPane.attachLog(context);
|
this.logPane.attachLog(context);
|
||||||
context.getLogger().addAppender(logPane.getLoggerAppender());
|
context.getLogger().addAppender(logPane.getLoggerAppender());
|
||||||
@ -136,6 +145,20 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
|
|||||||
((PlotsPlugin) context.provide("plots")).setPlotHolderDelegate(this);
|
((PlotsPlugin) context.provide("plots")).setPlotHolderDelegate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showTaskPane() {
|
||||||
|
if (processManagerStage == null) {
|
||||||
|
processManagerStage = new Stage();
|
||||||
|
processManagerStage.setWidth(400);
|
||||||
|
processManagerStage.setHeight(400);
|
||||||
|
AnchorPane pane = new AnchorPane();
|
||||||
|
processManager.show(pane);
|
||||||
|
Scene scene = new Scene(pane, 400, 400);
|
||||||
|
processManagerStage.setTitle("Task manager");
|
||||||
|
processManagerStage.setScene(scene);
|
||||||
|
}
|
||||||
|
processManagerStage.show();
|
||||||
|
}
|
||||||
|
|
||||||
private Tab findTabWithName(TabPane pane, String name) {
|
private Tab findTabWithName(TabPane pane, String name) {
|
||||||
return pane.getTabs().stream().filter((t) -> t.getText().equals(name)).findFirst().orElse(null);
|
return pane.getTabs().stream().filter((t) -> t.getText().equals(name)).findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
@ -304,6 +327,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void runActions() {
|
public void runActions() {
|
||||||
clearAllStages();
|
clearAllStages();
|
||||||
|
showTaskPane();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
DataNode data = new FileDataFactory().build(getContext(), getDataConfiguration());
|
DataNode data = new FileDataFactory().build(getContext(), getDataConfiguration());
|
||||||
if (data.isEmpty()) {
|
if (data.isEmpty()) {
|
||||||
|
@ -14,6 +14,7 @@ import javafx.scene.Parent;
|
|||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexander Nozik
|
* @author Alexander Nozik
|
||||||
|
@ -24,6 +24,7 @@ import java.io.File;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import static java.util.Locale.setDefault;
|
import static java.util.Locale.setDefault;
|
||||||
|
import static java.util.Locale.setDefault;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user