diff --git a/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt index 835dfb75..a29b8ddf 100644 --- a/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt @@ -24,7 +24,7 @@ import kotlin.streams.toList */ class BoardController() : Controller(), AutoCloseable { - val contextProperty = SimpleObjectProperty(Global.instance()) + val contextProperty = SimpleObjectProperty(Global) var context: Context by contextProperty private set @@ -38,14 +38,14 @@ class BoardController() : Controller(), AutoCloseable { fun configure(meta: Meta) { - Context.build("NUMASS", Global.instance(), meta.getMeta("context", meta)).apply { + Context.build("NUMASS", Global, meta.getMeta("context", meta)).apply { val numassRun = meta.optMeta("numass").map { ClientUtils.getRunName(it) }.orElse("") meta.useMeta("storage") { - pluginManager.getOrLoad(StorageManager::class.java).configure(it); + pluginManager.load(StorageManager::class.java).configure(it); } - val rootStorage = pluginManager.getOrLoad(StorageManager::class.java).defaultStorage + val rootStorage = pluginManager.load(StorageManager::class.java).defaultStorage val storage = if (!numassRun.isEmpty()) { logger.info("Run information found. Selecting run {}", numassRun) @@ -66,7 +66,7 @@ class BoardController() : Controller(), AutoCloseable { }.also { runLater { context = it - devices.setAll(context.getFeature(DeviceManager::class.java).devices.toList()); + devices.setAll(context.get(DeviceManager::class.java).devices.toList()); } } } diff --git a/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy b/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy index 53539bdd..3d31ad92 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy @@ -40,7 +40,7 @@ import static java.util.Locale.setDefault setDefault(Locale.US); new NumassPlugin().startGlobal() -FitManager fm = Global.instance().getFeature(FitManager) +FitManager fm = Global.instance().get(FitManager) SterileNeutrinoSpectrum sp = new SterileNeutrinoSpectrum(Global.instance(), Meta.empty()); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/models/TristanModel.groovy b/numass-main/src/main/groovy/inr/numass/scripts/models/TristanModel.groovy index 88af28dd..b8850782 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/models/TristanModel.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/models/TristanModel.groovy @@ -2,7 +2,7 @@ package inr.numass.scripts.models import hep.dataforge.context.Context import hep.dataforge.context.Global -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.grind.GrindShell import hep.dataforge.grind.helpers.PlotHelper import hep.dataforge.meta.Meta @@ -26,7 +26,7 @@ import inr.numass.utils.DataModelUtils import static hep.dataforge.grind.Grind.morph Context ctx = Global.instance() -ctx.getPluginManager().load(PlotManager) +ctx.getPluginManager().load(FXPlotManager) ctx.getPluginManager().load(NumassPlugin) new GrindShell(ctx).eval { @@ -94,7 +94,7 @@ new GrindShell(ctx).eval { FitState state = new FitState(data, model, params); - def fm = ctx.getFeature(FitManager) + def fm = ctx.get(FitManager) def res = fm.runStage(state, "MINUIT", FitStage.TASK_RUN, "N", "bkg", "E0", "U2"); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/temp/JoinSpectra.groovy b/numass-main/src/main/groovy/inr/numass/scripts/temp/JoinSpectra.groovy index d421271a..ffbb781f 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/temp/JoinSpectra.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/temp/JoinSpectra.groovy @@ -3,7 +3,7 @@ package inr.numass.scripts.temp import hep.dataforge.context.Context import hep.dataforge.context.Global import hep.dataforge.description.Descriptors -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.grind.Grind import hep.dataforge.grind.GrindShell import hep.dataforge.grind.helpers.PlotHelper @@ -21,7 +21,7 @@ import inr.numass.data.storage.NumassStorage import inr.numass.data.storage.NumassStorageFactory Context ctx = Global.instance() -ctx.getPluginManager().load(PlotManager) +ctx.getPluginManager().load(FXPlotManager) ctx.getPluginManager().load(NumassPlugin.class) diff --git a/numass-main/src/main/groovy/inr/numass/scripts/temp/RemoteStorage.groovy b/numass-main/src/main/groovy/inr/numass/scripts/temp/RemoteStorage.groovy index f532e3cb..b6ad930f 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/temp/RemoteStorage.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/temp/RemoteStorage.groovy @@ -12,6 +12,6 @@ new GrindShell().eval { def storageMeta = Grind.buildMeta(type: "numass", path: "sftp://192.168.111.1/home/trdat/data/2017_11", userName: "trdat", password: "Anomaly") - Storage storage = ctx.loadFeature("hep.dataforge:storage", StorageManager).buildStorage(storageMeta); + Storage storage = ctx.load("hep.dataforge:storage", StorageManager).buildStorage(storageMeta); } \ No newline at end of file diff --git a/numass-main/src/main/groovy/inr/numass/scripts/temp/TestFXExit.groovy b/numass-main/src/main/groovy/inr/numass/scripts/temp/TestFXExit.groovy index f78978ff..607c0237 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/temp/TestFXExit.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/temp/TestFXExit.groovy @@ -18,12 +18,12 @@ package inr.numass.scripts.temp import hep.dataforge.context.Context import hep.dataforge.context.Global -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.grind.GrindShell import hep.dataforge.grind.helpers.PlotHelper Context ctx = Global.instance() -ctx.getPluginManager().load(PlotManager) +ctx.getPluginManager().load(FXPlotManager) new GrindShell(ctx).eval { (plots as PlotHelper).plotFunction(0,1){Math.sin it} diff --git a/numass-main/src/main/groovy/inr/numass/scripts/times/AnalyzePoint.groovy b/numass-main/src/main/groovy/inr/numass/scripts/times/AnalyzePoint.groovy index 01359375..1f95f56c 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/times/AnalyzePoint.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/times/AnalyzePoint.groovy @@ -3,7 +3,7 @@ package inr.numass.scripts.times import hep.dataforge.context.Context import hep.dataforge.context.Global import hep.dataforge.data.DataSet -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.grind.Grind import hep.dataforge.grind.GrindShell import hep.dataforge.meta.Meta @@ -21,7 +21,7 @@ import inr.numass.data.storage.NumassStorageFactory Context ctx = Global.instance() -ctx.getPluginManager().load(PlotManager) +ctx.getPluginManager().load(FXPlotManager) ctx.getPluginManager().load(NumassPlugin) new GrindShell(ctx).eval { diff --git a/numass-main/src/main/groovy/inr/numass/scripts/times/TestAnalyzer.groovy b/numass-main/src/main/groovy/inr/numass/scripts/times/TestAnalyzer.groovy index ffd270b5..ea7ba249 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/times/TestAnalyzer.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/times/TestAnalyzer.groovy @@ -2,7 +2,7 @@ package inr.numass.scripts.times import hep.dataforge.context.Context import hep.dataforge.context.Global -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.grind.GrindShell import hep.dataforge.meta.Meta import inr.numass.NumassPlugin @@ -19,7 +19,7 @@ import java.time.Instant Context ctx = Global.instance() -ctx.getPluginManager().load(PlotManager) +ctx.getPluginManager().load(FXPlotManager) ctx.getPluginManager().load(NumassPlugin.class) new GrindShell(ctx).eval { diff --git a/numass-main/src/main/groovy/inr/numass/scripts/underflow/Underflow.groovy b/numass-main/src/main/groovy/inr/numass/scripts/underflow/Underflow.groovy index 11eb0054..cdb8eccf 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/underflow/Underflow.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/underflow/Underflow.groovy @@ -10,7 +10,7 @@ import hep.dataforge.cache.CachePlugin import hep.dataforge.context.Context import hep.dataforge.context.Global import hep.dataforge.data.DataNode -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.grind.GrindShell import hep.dataforge.grind.helpers.PlotHelper import hep.dataforge.io.ColumnedDataWriter @@ -30,7 +30,7 @@ import static inr.numass.data.analyzers.NumassAnalyzer.CHANNEL_KEY import static inr.numass.data.analyzers.NumassAnalyzer.COUNT_RATE_KEY Context ctx = Global.instance() -ctx.getPluginManager().load(PlotManager) +ctx.getPluginManager().load(FXPlotManager) ctx.getPluginManager().load(NumassPlugin) ctx.getPluginManager().load(CachePlugin) diff --git a/numass-main/src/main/java/inr/numass/Main.java b/numass-main/src/main/java/inr/numass/Main.java index b51cc990..68ea48fb 100644 --- a/numass-main/src/main/java/inr/numass/Main.java +++ b/numass-main/src/main/java/inr/numass/Main.java @@ -119,7 +119,7 @@ public class Main { dataDir = new File(workDir, dataPath); } if (dataDir.exists() && dataDir.isDirectory()) { - context.setValue(FileDataFactory.DATA_DIR_KEY, dataDir.getAbsolutePath()); + context.setValue(FileDataFactory.Companion.getDATA_DIR_KEY(), dataDir.getAbsolutePath()); } else { throw new FileNotFoundException("Data directory not found"); } diff --git a/numass-main/src/main/java/inr/numass/Numass.java b/numass-main/src/main/java/inr/numass/Numass.java index 5804cbf3..7b41c4cf 100644 --- a/numass-main/src/main/java/inr/numass/Numass.java +++ b/numass-main/src/main/java/inr/numass/Numass.java @@ -55,7 +55,7 @@ public class Numass { .ln(); - ActionManager am = context.getFeature(ActionManager.class); + ActionManager am = context.get(ActionManager.class); am.getAllActions() .map(name -> am.optAction(name).get()) diff --git a/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt b/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt index 6364663f..ec80a164 100644 --- a/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt +++ b/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt @@ -51,10 +51,10 @@ class NumassPlugin : BasicPlugin() { // StorageManager.buildFrom(context); super.attach(context) context.pluginManager.load(NumassIO()) - loadModels(context.getFeature(ModelManager::class.java)) + loadModels(context.get(ModelManager::class.java)) loadMath(MathPlugin.buildFrom(context)) - context.getFeature(ActionManager::class.java).apply { + context.get(ActionManager::class.java).apply { putTask(NumassFitScanTask::class.java) putTask(NumassFitScanSummaryTask::class.java) putTask(NumassFitSummaryTask::class.java) @@ -267,9 +267,8 @@ class NumassPlugin : BasicPlugin() { } class Factory : PluginFactory { - - override fun getTag(): PluginTag { - return Plugin.resolveTag(NumassPlugin::class.java) + override fun type(): Class { + return NumassPlugin::class.java } override fun build(meta: Meta): Plugin { diff --git a/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt b/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt index 880002c1..b381eae0 100644 --- a/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt +++ b/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt @@ -89,6 +89,14 @@ object NumassUtils { return res * 1E-23 } + fun wrap(obj: T, meta: Meta = Meta.empty(), serializer: OutputStream.(T) -> Unit): EnvelopeBuilder { + return EnvelopeBuilder().setMeta(meta).setData { serializer.invoke(it, obj) } + } + + fun wrap(obj: Markedup, meta: Meta = Meta.empty()): EnvelopeBuilder { + return wrap(obj,meta){SimpleMarkupRenderer(this).render(it.markup(meta))} + } + /** * Write an envelope wrapping given data to given stream diff --git a/numass-main/src/main/kotlin/inr/numass/actions/AnalyzeDataAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/AnalyzeDataAction.kt index b8369652..e44a4f9b 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/AnalyzeDataAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/AnalyzeDataAction.kt @@ -27,7 +27,9 @@ class AnalyzeDataAction : OneToOneAction() { //TODO add processor here val analyzer = NumassAnalyzer.DEFAULT_ANALYZER val res = analyzer.analyzeSet(input, inputMeta) - output(context, name) { stream -> NumassUtils.write(stream, inputMeta, res) } + + push(context, name, NumassUtils.wrap(res, inputMeta)) +// output(context, name) { stream -> NumassUtils.write(stream, inputMeta, res) } return res } } diff --git a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt index 4ef5f303..73a98826 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt @@ -41,7 +41,7 @@ class TimeAnalyzerAction : OneToOneAction() { //val t0 = inputMeta.getDouble("t0", 30e3); // val loChannel = inputMeta.getInt("window.lo", 500); // val upChannel = inputMeta.getInt("window.up", 10000); - val pm = context.getFeature(PlotPlugin::class.java); + val pm = context.get(PlotPlugin::class.java); val trueCR = analyzer.analyze(input, inputMeta).getDouble("cr") diff --git a/numass-main/src/main/kotlin/inr/numass/actions/TimeSpectrumAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/TimeSpectrumAction.kt index f6bf1464..201de95a 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/TimeSpectrumAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/TimeSpectrumAction.kt @@ -42,7 +42,7 @@ class TimeSpectrumAction : OneToOneAction() { val t0 = inputMeta.getDouble("t0", 30e3); val loChannel = inputMeta.getInt("window.lo", 500); val upChannel = inputMeta.getInt("window.up", 10000); - val pm = context.getFeature(PlotPlugin::class.java); + val pm = context.get(PlotPlugin::class.java); val trueCR = analyzer.analyze(input, buildMeta { diff --git a/numass-main/src/main/kotlin/inr/numass/models/mc/BetaSampler.kt b/numass-main/src/main/kotlin/inr/numass/models/mc/BetaSampler.kt index c1f2e779..85919d3a 100644 --- a/numass-main/src/main/kotlin/inr/numass/models/mc/BetaSampler.kt +++ b/numass-main/src/main/kotlin/inr/numass/models/mc/BetaSampler.kt @@ -1,8 +1,7 @@ package inr.numass.models.mc -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.kodex.buildMeta -import hep.dataforge.kodex.global import hep.dataforge.maths.chain.Chain import hep.dataforge.plots.XYFunctionPlot import hep.dataforge.stat.PolynomialDistribution @@ -17,7 +16,7 @@ fun sampleBeta(params: ParamSet): Chain { fun main(args: Array) { NumassPlugin().startGlobal() - val pm = PlotManager().apply { startGlobal() } + val pm = FXPlotManager().apply { startGlobal() } val meta = buildMeta("model") { "fast" to true node("resolution") { diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/Bunches.kt b/numass-main/src/main/kotlin/inr/numass/scripts/Bunches.kt index 37400d53..a4703b7d 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/Bunches.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/Bunches.kt @@ -1,6 +1,6 @@ package inr.numass.scripts -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.kodex.buildMeta import inr.numass.actions.TimeAnalyzerAction import inr.numass.data.api.SimpleNumassPoint @@ -12,7 +12,7 @@ import java.time.Instant fun main(args: Array) { - PlotManager().startGlobal() + FXPlotManager().startGlobal() val cr = 10.0 val length = 1e12.toLong() diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/DifferentialSpectrum.kt b/numass-main/src/main/kotlin/inr/numass/scripts/DifferentialSpectrum.kt index 73d3428d..5c977e3c 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/DifferentialSpectrum.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/DifferentialSpectrum.kt @@ -17,7 +17,7 @@ package inr.numass.scripts import hep.dataforge.description.Descriptors -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.kodex.buildContext import hep.dataforge.kodex.buildMeta import hep.dataforge.kodex.replaceColumn @@ -32,7 +32,7 @@ import inr.numass.data.storage.NumassStorageFactory fun main(args: Array) { - val context = buildContext("NUMASS", NumassPlugin::class.java, PlotManager::class.java) { + val context = buildContext("NUMASS", NumassPlugin::class.java, FXPlotManager::class.java) { rootDir = "D:\\Work\\Numass\\sterile\\2017_11" dataDir = "D:\\Work\\Numass\\data\\2017_11" } @@ -58,7 +58,7 @@ fun main(args: Array) { "window.up" to 1600 } - val plots = context.getFeature(PlotManager::class.java) + val plots = context.get(FXPlotManager::class.java) val frame = plots.getPlotFrame("differential").apply { this.plots.descriptor = Descriptors.buildDescriptor(DataPlot::class) diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/InversedChain.kt b/numass-main/src/main/kotlin/inr/numass/scripts/InversedChain.kt index dac1c2a5..08337019 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/InversedChain.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/InversedChain.kt @@ -17,7 +17,7 @@ package inr.numass.scripts import hep.dataforge.description.Descriptors -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.kodex.buildContext import hep.dataforge.kodex.buildMeta import hep.dataforge.plots.data.DataPlot @@ -32,7 +32,7 @@ import inr.numass.data.storage.NumassStorageFactory fun main(args: Array) { - val context = buildContext("NUMASS", NumassPlugin::class.java, PlotManager::class.java) { + val context = buildContext("NUMASS", NumassPlugin::class.java, FXPlotManager::class.java) { rootDir = "D:\\Work\\Numass\\sterile\\2017_11" dataDir = "D:\\Work\\Numass\\data\\2017_11" } @@ -63,7 +63,7 @@ fun main(args: Array) { val metaForChainInverted = metaForChain.builder.setValue("inverted", true) - val plots = context.getFeature(PlotManager::class.java) + val plots = context.get(FXPlotManager::class.java) for (hv in arrayOf(14000.0, 14500.0, 15000.0, 15500.0, 16050.0)) { diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/InversedChainProto.kt b/numass-main/src/main/kotlin/inr/numass/scripts/InversedChainProto.kt index 5d43386e..8420dd26 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/InversedChainProto.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/InversedChainProto.kt @@ -17,7 +17,7 @@ package inr.numass.scripts import hep.dataforge.description.Descriptors -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.kodex.buildContext import hep.dataforge.kodex.buildMeta import hep.dataforge.plots.data.DataPlot @@ -31,7 +31,7 @@ import java.nio.file.Paths fun main(args: Array) { - val context = buildContext("NUMASS", NumassPlugin::class.java, PlotManager::class.java) + val context = buildContext("NUMASS", NumassPlugin::class.java, FXPlotManager::class.java) val analyzer = SmartAnalyzer() @@ -45,7 +45,7 @@ fun main(args: Array) { val metaForChainInverted = metaForChain.builder.setValue("inverted", true) - val plots = context.getFeature(PlotManager::class.java) + val plots = context.get(FXPlotManager::class.java) val point = ProtoNumassPoint.readFile(Paths.get("D:\\Work\\Numass\\data\\2017_05_frames\\Fill_3_events\\set_33\\p36(30s)(HV1=17000).df")) diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/AnalyzePoint.kt b/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/AnalyzePoint.kt index 3c41ec67..c2b54b2d 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/AnalyzePoint.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/AnalyzePoint.kt @@ -1,7 +1,7 @@ package inr.numass.scripts.timeanalysis import hep.dataforge.data.DataSet -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.kodex.buildContext import hep.dataforge.kodex.buildMeta import inr.numass.NumassPlugin @@ -15,7 +15,7 @@ import java.util.stream.Collectors fun main(args: Array) { - val context = buildContext("NUMASS", NumassPlugin::class.java, PlotManager::class.java) { + val context = buildContext("NUMASS", NumassPlugin::class.java, FXPlotManager::class.java) { rootDir = "D:\\Work\\Numass\\sterile\\2017_11" dataDir = "D:\\Work\\Numass\\data\\2017_11" } diff --git a/numass-main/src/main/kotlin/inr/numass/tasks/NumassTasks.kt b/numass-main/src/main/kotlin/inr/numass/tasks/NumassTasks.kt index d032382a..658c1c82 100644 --- a/numass-main/src/main/kotlin/inr/numass/tasks/NumassTasks.kt +++ b/numass-main/src/main/kotlin/inr/numass/tasks/NumassTasks.kt @@ -5,7 +5,7 @@ import hep.dataforge.data.DataSet import hep.dataforge.data.DataTree import hep.dataforge.data.DataUtils import hep.dataforge.description.ValueDef -import hep.dataforge.fx.plots.PlotManager +import hep.dataforge.fx.plots.FXPlotManager import hep.dataforge.fx.plots.plus import hep.dataforge.kodex.buildMeta import hep.dataforge.kodex.configure @@ -70,7 +70,7 @@ val monitorTableTask = task("monitor") { ).build() if (meta.getBoolean("showPlot", true)) { - context.provide("plots", PlotManager::class.java).ifPresent { + context.provide("plots", FXPlotManager::class.java).ifPresent { it.display(stage = "monitor") { configure { "xAxis.title" to "time" diff --git a/numass-web/src/main/kotlin/inr/numass/server/Interceptors.kt b/numass-web/src/main/kotlin/inr/numass/server/Interceptors.kt index 91223309..ea40aba4 100644 --- a/numass-web/src/main/kotlin/inr/numass/server/Interceptors.kt +++ b/numass-web/src/main/kotlin/inr/numass/server/Interceptors.kt @@ -32,7 +32,7 @@ private suspend fun ApplicationCall.json(json: suspend JsonObjectBuilder.() -> U } val storageInterceptor = InterceptorFactory { context, meta -> - val storageManager = context.getFeature(StorageManager::class.java); + val storageManager = context.get(StorageManager::class.java); val storage = storageManager.buildStorage(meta); ServerInterceptor("storage") { get("listStorage") { @@ -86,7 +86,7 @@ val storageInterceptor = InterceptorFactory { context, meta -> } val deviceInterceptor = InterceptorFactory { context, meta -> - val deviceManager = context.getFeature(DeviceManager::class.java); + val deviceManager = context.get(DeviceManager::class.java); ServerInterceptor("devices") { get("listDevices") { call.json {