From da77fbdeaf42291d22d70641ad5f8adcce93b7f2 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 31 Aug 2018 12:14:32 +0300 Subject: [PATCH] Fixed model manager --- .../main/kotlin/inr/numass/data/analyzers/TimeAnalyzer.kt | 6 +++--- .../src/main/kotlin/inr/numass/scripts/InversedChain.kt | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/numass-core/src/main/kotlin/inr/numass/data/analyzers/TimeAnalyzer.kt b/numass-core/src/main/kotlin/inr/numass/data/analyzers/TimeAnalyzer.kt index 70df4e3b..1e0fbb0e 100644 --- a/numass-core/src/main/kotlin/inr/numass/data/analyzers/TimeAnalyzer.kt +++ b/numass-core/src/main/kotlin/inr/numass/data/analyzers/TimeAnalyzer.kt @@ -200,11 +200,11 @@ class TimeAnalyzer(processor: SignalProcessor? = null) : AbstractAnalyzer(proces */ fun getEventsWithDelay(block: NumassBlock, config: Meta): Sequence> { val inverted = config.getBoolean("inverted", true) - val events: Stream = super.getEvents(block, config).let { + val events: Stream = super.getEvents(block, config).let { stream -> if (block is ParentBlock && !block.isSequential) { - it.sorted(compareBy { it.timeOffset }) + stream.sorted(compareBy { it.timeOffset }) } else { - it + stream } } 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 7e40caf1..3b0428ba 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,6 @@ package inr.numass.scripts import hep.dataforge.buildContext -import hep.dataforge.description.Descriptors import hep.dataforge.meta.buildMeta import hep.dataforge.plots.data.DataPlot import inr.numass.NumassPlugin @@ -43,7 +42,7 @@ fun main(args: Array) { val sets = (10..24).map { "set_$it" } val loaders = sets.mapNotNull { set -> - storage.provide("loader::$set", NumassSet::class.java).orElse(null) + storage.provide(set, NumassSet::class.java).orElse(null) } val set = NumassDataUtils.join("sum", loaders) @@ -58,7 +57,7 @@ fun main(args: Array) { "window.up" to 1600 } - val metaForChain = meta.builder.setValue("t0", 15e3) + val metaForChain = meta.builder.setValue("t0", 15e3).setValue("inverted", false) val metaForChainInverted = metaForChain.builder.setValue("inverted", true) @@ -66,7 +65,7 @@ fun main(args: Array) { for (hv in arrayOf(14000.0, 14500.0, 15000.0, 15500.0, 16050.0)) { val frame = displayChart("integral[$hv]").apply { - this.plots.descriptor = Descriptors.forType("plot", DataPlot::class) + this.plots.setType() this.plots.configureValue("showLine", true) }