Plugin system fixes

This commit is contained in:
Alexander Nozik 2016-11-23 14:52:21 +03:00
parent 228d4c1187
commit accff41291
3 changed files with 1 additions and 53 deletions

View File

@ -104,13 +104,6 @@ public class PrepareDataAction extends OneToOneAction<NumassData, Table> {
.reduce((d1, d2) -> d1 * d1 + d2 * d2).getAsDouble() .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 cr = wind / point.getLength() * correctionFactor;
double crErr; double crErr;
if (relativeCorrectionError == 0) { if (relativeCorrectionError == 0) {
@ -151,25 +144,6 @@ public class PrepareDataAction extends OneToOneAction<NumassData, Table> {
} }
// /**
// * 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 = "value", type = "[NUMBER, STRING]", info = "Value or function to multiply count rate")
@ValueDef(name = "err", type = "[NUMBER, STRING]", info = "error of the value") @ValueDef(name = "err", type = "[NUMBER, STRING]", info = "error of the value")
private Correction makeCorrection(Meta corrMeta) { private Correction makeCorrection(Meta corrMeta) {

View File

@ -170,7 +170,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
context.getLog().addListener(new FXReportListener(logPane)); context.getLog().addListener(new FXReportListener(logPane));
// display plots iside workbench // display plots iside workbench
PlotsPlugin.buildFrom(context).setPlotHolderDelegate(this); PlotsPlugin.buildFrom(context).setPlotHolder(this);
} }
private Tab findTabWithName(TabPane pane, String name) { private Tab findTabWithName(TabPane pane, String name) {

View File

@ -35,21 +35,6 @@ import java.net.URI;
*/ */
public class NumassPrepareTask extends AbstractTask<Table> { public class NumassPrepareTask extends AbstractTask<Table> {
/*
<action type="readStorage" uri="file://D:\Work\Numass\data\2016_04\T2_data\">
<include pattern="Fill_2*"/>
<exclude pattern="Fill_2_4_Empty*"/>
<exclude pattern="Fill_2_1.set_1*"/>
<exclude pattern="Fill_2_1.set_2*"/>
<exclude pattern="Fill_2_1.set_3*"/>
<exclude pattern="Fill_2_1.set_4*"/>
</action>
<action type="prepareData" lowerWindow="500" upperWindow="1700" deadTime="4.9534e-6 + 1.51139e-10*U">
<underflow function = "1.0 + 15.216 * Math.exp( - U / 2477.46 )" threshold = "14000"/>
</action>
<action type="monitor" monitorPoint="${numass.monitorPoint}" monitorFile="${numass.setName}_monitor"/>
<action type="merge" mergeName="${numass.setName}"/>
*/
@Override @Override
protected DataNode<Table> run(TaskModel model, ProgressCallback callback, DataNode<?> input) { protected DataNode<Table> run(TaskModel model, ProgressCallback callback, DataNode<?> input) {
Meta config = model.meta(); Meta config = model.meta();
@ -59,10 +44,6 @@ public class NumassPrepareTask extends AbstractTask<Table> {
Meta dataMeta = config.getMeta("data"); Meta dataMeta = config.getMeta("data");
URI storageUri = input.getCheckedData("dataRoot", URI.class).get(); URI storageUri = input.getCheckedData("dataRoot", URI.class).get();
DataSet.Builder<NumassData> dataBuilder = readData(callback, context, storageUri, dataMeta); DataSet.Builder<NumassData> dataBuilder = readData(callback, context, storageUri, dataMeta);
// if (config.hasMeta("empty")) {
// dataBuilder.putNode("empty", readData(callback, context, storageUri, config.getMeta("empty")).build());
// }
DataNode<NumassData> data = dataBuilder.build(); DataNode<NumassData> data = dataBuilder.build();
//preparing table data //preparing table data
@ -79,13 +60,6 @@ public class NumassPrepareTask extends AbstractTask<Table> {
DataTree.Builder<Table> resultBuilder = DataTree.builder(Table.class); DataTree.Builder<Table> resultBuilder = DataTree.builder(Table.class);
DataTree.Builder<Table> tablesForMerge = new DataTree.Builder<>(tables); DataTree.Builder<Table> tablesForMerge = new DataTree.Builder<>(tables);
// //extracting empty data
// if (config.hasMeta("empty")) {
// DataNode<Table> 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 -> { config.getMetaList("merge").forEach(mergeNode -> {
Meta mergeMeta = Template.compileTemplate(mergeNode, config); Meta mergeMeta = Template.compileTemplate(mergeNode, config);