diff --git a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Display.kt b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Display.kt index 0ce45362..33262528 100644 --- a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Display.kt +++ b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Display.kt @@ -148,7 +148,7 @@ class PKT8Display : DeviceDisplay(), PKT8ValueListener { private val plotFrame: PlotFrame by lazy { JFreeChartFrame(plotFrameMeta).apply { plots.descriptor = Descriptors.buildDescriptor(TimePlot::class.java) - PlotUtils.setXAxis(this, "timestamp", null, "time") + PlotUtils.setXAxis(this, "timestamp", "", "time") } } @@ -190,7 +190,9 @@ class PKT8Display : DeviceDisplay(), PKT8ValueListener { if (rawDataButton.isSelected) { TimePlot.put(this, rawValue) } else { - TimePlot.put(this, temperature) + if(temperature != null) { + TimePlot.put(this, temperature) + } } } } diff --git a/numass-control/msp/src/main/kotlin/inr/numass/control/msp/MspDisplay.kt b/numass-control/msp/src/main/kotlin/inr/numass/control/msp/MspDisplay.kt index a5e78760..a11c930d 100644 --- a/numass-control/msp/src/main/kotlin/inr/numass/control/msp/MspDisplay.kt +++ b/numass-control/msp/src/main/kotlin/inr/numass/control/msp/MspDisplay.kt @@ -25,9 +25,9 @@ import hep.dataforge.fx.plots.PlotContainer import hep.dataforge.meta.Meta import hep.dataforge.meta.MetaBuilder import hep.dataforge.plots.PlotFrame +import hep.dataforge.plots.PlotGroup import hep.dataforge.plots.PlotUtils import hep.dataforge.plots.data.TimePlot -import hep.dataforge.plots.data.TimePlottableGroup import hep.dataforge.plots.jfreechart.JFreeChartFrame import hep.dataforge.values.Value import inr.numass.control.DeviceDisplay @@ -88,7 +88,7 @@ class MspDisplay() : DeviceDisplay(), DeviceListener, NamedValueListe configure(plotFrameMeta) } } - val plottables: TimePlottableGroup = TimePlottableGroup().apply { + val plottables = PlotGroup().apply { if (plotFrameMeta.hasMeta("peakJump.peak")) { for (peakMeta in plotFrameMeta.getMetaList("peakJump.peak")) { val mass = peakMeta.getString("mass") diff --git a/numass-control/vac/src/main/kotlin/inr/numass/control/readvac/VacCollectorDisplay.kt b/numass-control/vac/src/main/kotlin/inr/numass/control/readvac/VacCollectorDisplay.kt index 335d5c64..11d42b59 100644 --- a/numass-control/vac/src/main/kotlin/inr/numass/control/readvac/VacCollectorDisplay.kt +++ b/numass-control/vac/src/main/kotlin/inr/numass/control/readvac/VacCollectorDisplay.kt @@ -13,7 +13,6 @@ import hep.dataforge.control.measurements.MeasurementListener import hep.dataforge.fx.bindWindow import hep.dataforge.fx.fragments.LogFragment import hep.dataforge.plots.data.TimePlot -import hep.dataforge.plots.data.TimePlottableGroup import hep.dataforge.values.Value import inr.numass.control.DeviceDisplay import inr.numass.control.deviceStateToggle diff --git a/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java b/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java index 55c8d42e..437f9f1e 100644 --- a/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java +++ b/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2015 Alexander Nozik. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -63,10 +63,10 @@ public class PlotFitResultAction extends OneToOneAction { } - PlotFrame frame = PlotUtils.getPlotManager(context) + PlotFrame frame = PlotUtils.INSTANCE.getPlotManager(context) .getPlotFrame(getName(), name, metaData.getMeta("frame", Meta.empty())); - XYFunctionPlot fit = new XYFunctionPlot("fit",(x) -> model.getSpectrum().value(x, input.getParameters())); + XYFunctionPlot fit = new XYFunctionPlot("fit", Meta.empty(), (Double x) -> model.getSpectrum().value(x, input.getParameters())); fit.setDensity(100); fit.setSmoothing(true); // ensuring all data points are calculated explicitly @@ -75,7 +75,7 @@ public class PlotFitResultAction extends OneToOneAction { frame.add(fit); - frame.add(DataPlot.plot("data", adapter, data)); + frame.add(DataPlot.Companion.plot("data", adapter, data)); return input; } diff --git a/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt b/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt index 3a07443e..189281d0 100644 --- a/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt +++ b/numass-main/src/main/kotlin/inr/numass/NumassUtils.kt @@ -280,7 +280,7 @@ fun FitResult.display(context: Context, stage: String = "fit") { val func = { x: Double -> model.spectrum.value(x, parameters) } - val fit = XYFunctionPlot("fit", func) + val fit = XYFunctionPlot("fit", function = func) fit.density = 100 // ensuring all data points are calculated explicitly data.rows.map { dp -> Adapters.getXValue(adapter, dp).doubleValue() }.sorted().forEach { fit.calculateIn(it) } 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 724f5e2e..ac1d75f9 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt @@ -75,14 +75,13 @@ class TimeAnalyzerAction : OneToOneAction() { } } - val histogramPlot = DataPlot(name) + val histogramPlot = DataPlot(name, adapter = Adapters.buildXYAdapter("x", "count")) .configure { "showLine" to true "showSymbol" to false "showErrors" to false "connectionType" to "step" }.apply { - adapter = Adapters.buildXYAdapter("x", "count") configure(inputMeta.getMetaOrEmpty("histogram")) }.fillData(histogram) 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 28b7fc64..05083bde 100644 --- a/numass-main/src/main/kotlin/inr/numass/tasks/NumassTasks.kt +++ b/numass-main/src/main/kotlin/inr/numass/tasks/NumassTasks.kt @@ -251,7 +251,7 @@ val plotFitTask = task("plotFit") { val frame = PlotUtils.getPlotManager(context) .getPlotFrame("numass.plotFit", name, meta.getMeta("frame", Meta.empty())) - val fit = XYFunctionPlot("fit", function).apply { + val fit = XYFunctionPlot("fit", function = function).apply { density = 100 } diff --git a/numass-main/src/test/java/inr/numass/models/TransmissionInterpolatorTest.java b/numass-main/src/test/java/inr/numass/models/TransmissionInterpolatorTest.java index 77d34ac0..5fe0ef3c 100644 --- a/numass-main/src/test/java/inr/numass/models/TransmissionInterpolatorTest.java +++ b/numass-main/src/test/java/inr/numass/models/TransmissionInterpolatorTest.java @@ -32,7 +32,7 @@ public class TransmissionInterpolatorTest { //JFreeChartFrame.drawFrame("TransmissionInterpolatorTest", null); TransmissionInterpolator interpolator = TransmissionInterpolator.fromFile(Global.INSTANCE, "d:\\sterile-new\\loss2014-11\\.dataforge\\merge\\empty_sum.onComplete", "Uset", "CR", 15, 0.8, 19002d); - frame.add(DataPlot.plot("data", interpolator.getX(), interpolator.getY())); + frame.add(DataPlot.Companion.plot("data", interpolator.getX(), interpolator.getY())); frame.add(XYFunctionPlot.Companion.plot("interpolated", interpolator.getXmin(), interpolator.getXmax(), 2000, interpolator::value)); // PrintFunction.printFuntionSimple(new PrintWriter(System.onComplete), interpolator, interpolator.getXmin(), interpolator.getXmax(), 500);