diff --git a/numass-control/msp/build.gradle b/numass-control/msp/build.gradle index 5f1eff99..03d17a92 100644 --- a/numass-control/msp/build.gradle +++ b/numass-control/msp/build.gradle @@ -10,7 +10,7 @@ mainClassName = mainClass dependencies { compile project(':numass-storage:numass-client') - compile project(':dataforge-plots') + compile project(':dataforge-plots:plots-jfc') compile project(':dataforge-fx') compile project(':dataforge-control') } \ No newline at end of file diff --git a/numass-control/vac/build.gradle b/numass-control/vac/build.gradle index 5f64fbcb..1c9e1ab0 100644 --- a/numass-control/vac/build.gradle +++ b/numass-control/vac/build.gradle @@ -10,7 +10,7 @@ mainClassName = mainClass dependencies { compile project(':numass-storage:numass-client') - compile project(':dataforge-plots') + compile project(':dataforge-plots:plots-jfc') compile project(':dataforge-control') compile project(':dataforge-fx') } \ No newline at end of file diff --git a/numass-main/build.gradle b/numass-main/build.gradle index 8dc430f5..6bbad030 100644 --- a/numass-main/build.gradle +++ b/numass-main/build.gradle @@ -5,7 +5,7 @@ if (!hasProperty('mainClass')) { } mainClassName = mainClass -description = """The main head of all numass projects""" +description = "Main numass project" dependencies { compile group: 'commons-cli', name: 'commons-cli', version: '1.+' diff --git a/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy b/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy index 6b3c1dca..af9424e8 100644 --- a/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy +++ b/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy @@ -1,14 +1,14 @@ package inr.numass -import hep.dataforge.grind.GrindLauncher import hep.dataforge.grind.GrindShell +import hep.dataforge.grind.GrindWorkspaceBuilder /** * Created by darksnake on 29-Aug-16. */ new GrindShell().start { - GrindLauncher numass = new GrindLauncher() + GrindWorkspaceBuilder numass = new GrindWorkspaceBuilder() .withSpec(NumassWorkspaceSpec) .from(new File("D:\\Work\\Numass\\sterile2016\\workspace.groovy")) bind("numass", numass) diff --git a/numass-main/src/main/groovy/inr/numass/scripts/workspace/TestWorkspace.groovy b/numass-main/src/main/groovy/inr/numass/scripts/workspace/TestWorkspace.groovy index 930aeb74..e46f2899 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/workspace/TestWorkspace.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/workspace/TestWorkspace.groovy @@ -1,13 +1,13 @@ package inr.numass.scripts.workspace -import hep.dataforge.grind.GrindLauncher +import hep.dataforge.grind.GrindWorkspaceBuilder /** * Created by darksnake on 11-Aug-16. */ -new GrindLauncher().from { +new GrindWorkspaceBuilder().from { new File("D:\\Work\\Numass\\sterile2016\\workspace.groovy") }.runTask("numass.prepare", "fill_2").computeAll() diff --git a/numass-main/src/main/java/inr/numass/Main.java b/numass-main/src/main/java/inr/numass/Main.java index 4d6f0738..968673d4 100644 --- a/numass-main/src/main/java/inr/numass/Main.java +++ b/numass-main/src/main/java/inr/numass/Main.java @@ -21,7 +21,6 @@ import hep.dataforge.data.FileDataFactory; import hep.dataforge.io.IOManager; import hep.dataforge.io.MetaFileReader; import hep.dataforge.meta.Meta; -import hep.dataforge.stat.fit.MINUITPlugin; import org.apache.commons.cli.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,7 +45,6 @@ public class Main { setDefault(Locale.US); Context context = Numass.buildContext(); - context.loadPlugin(new MINUITPlugin()); run(context, args); } diff --git a/numass-main/src/main/java/inr/numass/Numass.java b/numass-main/src/main/java/inr/numass/Numass.java index 293359f5..198d5664 100644 --- a/numass-main/src/main/java/inr/numass/Numass.java +++ b/numass-main/src/main/java/inr/numass/Numass.java @@ -24,6 +24,7 @@ import hep.dataforge.description.DescriptorUtils; import hep.dataforge.description.TextDescriptorFormatter; import hep.dataforge.exceptions.DescriptorException; import hep.dataforge.meta.Meta; + import java.io.PrintWriter; /** @@ -35,7 +36,7 @@ public class Numass { public static Context buildContext(Context parent, Meta meta) { Context numassContext = new Context(parent, "numass", meta); GlobalContext.registerContext(numassContext); - numassContext.loadPlugin("inr.numass:numass"); + numassContext.pluginManager().loadPlugin("inr.numass:numass"); return numassContext; } diff --git a/numass-main/src/main/java/inr/numass/NumassPlugin.java b/numass-main/src/main/java/inr/numass/NumassPlugin.java index a534f168..260a6799 100644 --- a/numass-main/src/main/java/inr/numass/NumassPlugin.java +++ b/numass-main/src/main/java/inr/numass/NumassPlugin.java @@ -72,6 +72,7 @@ public class NumassPlugin extends BasicPlugin { @Override public void attach(Context context) { // StorageManager.buildFrom(context); + super.attach(context); context.setIO(new NumassIO()); FitManager fm = context.provide("fitting", FitPlugin.class).getFitManager(); loadModels(fm.getModelManager()); @@ -96,6 +97,7 @@ public class NumassPlugin extends BasicPlugin { @Override public void detach() { //TODO clean up + super.detach(); } private void loadMath(MathPlugin math) { diff --git a/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java b/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java index f131b7ca..c01e7210 100644 --- a/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java +++ b/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java @@ -15,142 +15,16 @@ */ package inr.numass.run; -import hep.dataforge.context.GlobalContext; +import hep.dataforge.exceptions.NamingException; import hep.dataforge.stat.fit.MINUITPlugin; import hep.dataforge.stat.fit.ParamSet; -import hep.dataforge.exceptions.NamingException; import inr.numass.models.BetaSpectrum; import inr.numass.models.ModularSpectrum; + import java.io.File; import java.io.FileNotFoundException; import java.util.Locale; -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; -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; -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; -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; -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; -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; -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; -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; -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; /** @@ -165,8 +39,7 @@ public class NumassSpectrumTest { */ public static void main(String[] args) throws NamingException, FileNotFoundException { setDefault(Locale.US); - GlobalContext global = GlobalContext.instance(); - global.loadPlugin(new MINUITPlugin()); + new MINUITPlugin().startGlobal(); ParamSet allPars = new ParamSet();