From accff41291459d7ea695681a32868d08c6440619 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 23 Nov 2016 14:52:21 +0300 Subject: [PATCH] Plugin system fixes --- .../inr/numass/actions/PrepareDataAction.java | 26 ------------------- .../workbench/NumassWorkbenchController.java | 2 +- .../numass/workspace/NumassPrepareTask.java | 26 ------------------- 3 files changed, 1 insertion(+), 53 deletions(-) diff --git a/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java b/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java index b0d3b0a1..b8f3fbb7 100644 --- a/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java +++ b/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java @@ -104,13 +104,6 @@ public class PrepareDataAction extends OneToOneAction { .reduce((d1, d2) -> d1 * d1 + d2 * d2).getAsDouble() ); -// // count rate after all corrections -// double cr = TritiumUtils.countRateWithDeadTime(point, a, b, deadTimeFunction.apply(point)); -// // count rate error after all corrections -// double crErr = TritiumUtils.countRateWithDeadTimeErr(point, a, b, deadTimeFunction.apply(point)); -// -// double correctionFactor = correction(getReport(name), point, meta); - double cr = wind / point.getLength() * correctionFactor; double crErr; if (relativeCorrectionError == 0) { @@ -151,25 +144,6 @@ public class PrepareDataAction extends OneToOneAction { } -// /** -// * The factor to correct for count below detector threshold -// * -// * @param log -// * @param point -// * @param meta -// * @return -// */ -// private double correction(Logable log, NMPoint point, Laminate meta) { -// if (meta.hasValue("correction")) { -//// log.report("Using correction from formula: {}", meta.getString("correction")); -// return evaluateExpression(point, meta.getString("correction")); -// } else if (meta.hasMeta("underflow")) { -// return new UnderflowCorrection().get(log, meta.getMeta("underflow"), point); -// } else { -// return 1; -// } -// } - @ValueDef(name = "value", type = "[NUMBER, STRING]", info = "Value or function to multiply count rate") @ValueDef(name = "err", type = "[NUMBER, STRING]", info = "error of the value") private Correction makeCorrection(Meta corrMeta) { diff --git a/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java b/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java index 50079f8b..e4ee2606 100644 --- a/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java +++ b/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java @@ -170,7 +170,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder context.getLog().addListener(new FXReportListener(logPane)); // display plots iside workbench - PlotsPlugin.buildFrom(context).setPlotHolderDelegate(this); + PlotsPlugin.buildFrom(context).setPlotHolder(this); } private Tab findTabWithName(TabPane pane, String name) { diff --git a/numass-main/src/main/java/inr/numass/workspace/NumassPrepareTask.java b/numass-main/src/main/java/inr/numass/workspace/NumassPrepareTask.java index 69120daf..311d2fe7 100644 --- a/numass-main/src/main/java/inr/numass/workspace/NumassPrepareTask.java +++ b/numass-main/src/main/java/inr/numass/workspace/NumassPrepareTask.java @@ -35,21 +35,6 @@ import java.net.URI; */ public class NumassPrepareTask extends AbstractTask { - /* - - - - - - - - - - - - - - */ @Override protected DataNode
run(TaskModel model, ProgressCallback callback, DataNode input) { Meta config = model.meta(); @@ -59,10 +44,6 @@ public class NumassPrepareTask extends AbstractTask
{ Meta dataMeta = config.getMeta("data"); URI storageUri = input.getCheckedData("dataRoot", URI.class).get(); DataSet.Builder dataBuilder = readData(callback, context, storageUri, dataMeta); -// if (config.hasMeta("empty")) { -// dataBuilder.putNode("empty", readData(callback, context, storageUri, config.getMeta("empty")).build()); -// } - DataNode data = dataBuilder.build(); //preparing table data @@ -79,13 +60,6 @@ public class NumassPrepareTask extends AbstractTask
{ DataTree.Builder
resultBuilder = DataTree.builder(Table.class); DataTree.Builder
tablesForMerge = new DataTree.Builder<>(tables); -// //extracting empty data -// if (config.hasMeta("empty")) { -// DataNode
emptySourceNode = tables.getCheckedNode("empty", Table.class); -// Meta emptyMergeMeta = new MetaBuilder("emptySource").setValue("mergeName", "emptySource"); -// resultBuilder.putData("merge.empty", runAction(new MergeDataAction(), callback, context, emptySourceNode, emptyMergeMeta).getData()); -// tablesForMerge.removeNode("empty"); -// } config.getMetaList("merge").forEach(mergeNode -> { Meta mergeMeta = Template.compileTemplate(mergeNode, config);