From 755a901d2e52cafd531ec10579eefb318565b765 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 18 Oct 2017 12:19:03 +0300 Subject: [PATCH] Plots and Numass update --- .../numass/scripts/times/AnalyzePoint.groovy | 6 ++--- .../numass/actions/MonitorCorrectAction.java | 24 +++++++++---------- .../inr/numass/viewer/NumassLoaderView.kt | 2 +- .../main/kotlin/inr/numass/viewer/Viewer.kt | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) 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 e0822606..bd322f82 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 @@ -30,13 +30,13 @@ new GrindShell(ctx).eval { NumassStorage storage = NumassStorageFactory.buildLocal(rootDir); - Meta meta = Grind.buildMeta(binNum: 200, plotHist: false) { + Meta meta = Grind.buildMeta(binNum: 200) { window(lo: 500, up: 1800) plot(showErrors: false) } - def sets = ((2..14) + (22..31)).collect { "set_$it" } - //def sets = (2..14).collect { "set_$it" } + //def sets = ((2..14) + (22..31)).collect { "set_$it" } + def sets = (2..14).collect { "set_$it" } //def sets = (16..31).collect { "set_$it" } //def sets = (20..28).collect { "set_$it" } diff --git a/numass-main/src/main/java/inr/numass/actions/MonitorCorrectAction.java b/numass-main/src/main/java/inr/numass/actions/MonitorCorrectAction.java index 739e4dea..005da8b1 100644 --- a/numass-main/src/main/java/inr/numass/actions/MonitorCorrectAction.java +++ b/numass-main/src/main/java/inr/numass/actions/MonitorCorrectAction.java @@ -55,7 +55,7 @@ public class MonitorCorrectAction extends OneToOneAction { //private static final String[] monitorNames = {"timestamp", NumassAnalyzer.COUNT_KEY, NumassAnalyzer.COUNT_RATE_KEY, NumassAnalyzer.COUNT_RATE_KEY}; - CopyOnWriteArrayList monitorPoints = new CopyOnWriteArrayList<>(); + private CopyOnWriteArrayList monitorPoints = new CopyOnWriteArrayList<>(); //FIXME remove from state @Override @@ -69,17 +69,17 @@ public class MonitorCorrectAction extends OneToOneAction { return sourceData; } double norm = 0; - double totalAv = 0; - StringBuilder head = new StringBuilder(); - head.append(String.format("%20s\t%10s\t%s%n", "timestamp", "Count", "CR in window")); - for (Values dp : index.values()) { - head.append(String.format("%20s\t%10d\t%g%n", getTime(dp).toString(), getTotal(dp), getCR(dp))); - norm += getCR(dp) / index.size(); - totalAv += getTotal(dp) / index.size(); - monitorPoints.add(dp); - } - - head.append(String.format("%20s\t%10g\t%g%n", "Average", totalAv, norm)); +// double totalAv = 0; +// StringBuilder head = new StringBuilder(); +// head.append(String.format("%20s\t%10s\t%s%n", "timestamp", "Count", "CR in window")); +// for (Values dp : index.values()) { +// head.append(String.format("%20s\t%10d\t%g%n", getTime(dp).toString(), getTotal(dp), getCR(dp))); +// norm += getCR(dp) / index.size(); +// totalAv += getTotal(dp) / index.size(); +// monitorPoints.add(dp); +// } +// +// head.append(String.format("%20s\t%10g\t%g%n", "Average", totalAv, norm)); List dataList = new ArrayList<>(); diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt index 1b10590e..83a8afc1 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt @@ -286,7 +286,7 @@ class NumassLoaderView : View() { data.points.map { point -> val count = NumassAnalyzer.countInWindow(getSpectrum(point), loChannel, upChannel); val seconds = point.length.toMillis() / 1000.0; - spectrumPlot.progress = -1.0; + runLater { spectrumPlot.progress = -1.0 } ValueMap.ofMap( mapOf( XYAdapter.X_AXIS to point.voltage, diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/Viewer.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/Viewer.kt index e21764ba..0b7dd1b8 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/Viewer.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/Viewer.kt @@ -3,8 +3,8 @@ package inr.numass.viewer import ch.qos.logback.classic.Level import ch.qos.logback.classic.Logger import hep.dataforge.context.Global +import hep.dataforge.kodex.fx.dfIcon import hep.dataforge.storage.commons.StorageManager -import javafx.scene.image.Image import javafx.stage.Stage import org.slf4j.LoggerFactory import tornadofx.* @@ -15,7 +15,7 @@ import tornadofx.* class Viewer : App(MainView::class) { override fun start(stage: Stage) { - stage.icons += Image(Global::class.java.getResourceAsStream("/resource/img/df.png")) + stage.icons += dfIcon (LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) as Logger).level = Level.INFO Global.setDefaultContext(Global.instance()) StorageManager().startGlobal()