Fixed model manager

This commit is contained in:
Alexander Nozik 2018-08-31 12:14:32 +03:00
parent 0c44f45428
commit da77fbdeaf
2 changed files with 6 additions and 7 deletions

View File

@ -200,11 +200,11 @@ class TimeAnalyzer(processor: SignalProcessor? = null) : AbstractAnalyzer(proces
*/
fun getEventsWithDelay(block: NumassBlock, config: Meta): Sequence<Pair<NumassEvent, Long>> {
val inverted = config.getBoolean("inverted", true)
val events: Stream<NumassEvent> = super.getEvents(block, config).let {
val events: Stream<NumassEvent> = 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
}
}

View File

@ -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<String>) {
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<String>) {
"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<String>) {
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<DataPlot>()
this.plots.configureValue("showLine", true)
}