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 8c424b8f..10c55898 100644 --- a/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java +++ b/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java @@ -72,7 +72,7 @@ public class PlotFitResultAction extends OneToOneAction { XYPlotFrame frame = (XYPlotFrame) PlotsPlugin .buildFrom(getContext()).buildPlotFrame(getName(), input.getName(), - metaData.getNode("plot", null)); + metaData.getNode("plot", null)); //JFreeChartFrame.drawFrame(reader.getString("plotTitle", "Fit result plot for "+input.getName()), null); double[] x = new double[data.size()]; @@ -100,7 +100,7 @@ public class PlotFitResultAction extends OneToOneAction { frame.add(new PlottableFunction("fit", null, function, points, "x")); - frame.add(new PlottableData("data", null, points)); + frame.add(PlottableData.plot("data", adapter, points)); return input; } diff --git a/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java b/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java index e752ce26..9758ebc3 100644 --- a/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java +++ b/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java @@ -21,6 +21,7 @@ import hep.dataforge.context.Context; import hep.dataforge.data.DataSet; import hep.dataforge.data.ListDataSet; import hep.dataforge.data.MapDataPoint; +import hep.dataforge.data.XYDataAdapter; import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitTaskResult; import hep.dataforge.datafitter.Param; @@ -232,7 +233,7 @@ public class ShowLossSpectrumAction extends OneToOneAction { new MetaBuilder("plot").setValue("plotTitle", "Ion ratio Distribution for " + name) ); // XYPlotFrame frame = JFreeChartFrame.drawFrame("Ion ratio Distribution for " + name, null); - frame.add(new PlottableData(hist, "binCenter", "count")); + frame.add(PlottableData.plot(hist, new XYDataAdapter("binCenter", "count"))); return new DescriptiveStatistics(res).getStandardDeviation(); } 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 93bdd9a1..177fa2a0 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(GlobalContext.instance(), "d:\\sterile-new\\loss2014-11\\.dataforge\\merge\\empty_sum.out", "Uset", "CR", 15, 0.8, 19002d); - frame.add(new PlottableData("data", interpolator.getX(), interpolator.getY())); + frame.add(PlottableData.plot("data", interpolator.getX(), interpolator.getY())); frame.add(new PlottableFunction("interpolated", null, interpolator, interpolator.getXmin(), interpolator.getXmax(), 2000)); // PrintFunction.printFuntionSimple(new PrintWriter(System.out), interpolator, interpolator.getXmin(), interpolator.getXmax(), 500); diff --git a/numass-prop/src/test/java/hep/dataforge/numass/prop/TestFit.java b/numass-prop/src/test/java/inr/numass/prop/TestFit.java similarity index 100% rename from numass-prop/src/test/java/hep/dataforge/numass/prop/TestFit.java rename to numass-prop/src/test/java/inr/numass/prop/TestFit.java diff --git a/numass-prop/src/test/java/hep/dataforge/numass/prop/TestReader.java b/numass-prop/src/test/java/inr/numass/prop/TestReader.java similarity index 93% rename from numass-prop/src/test/java/hep/dataforge/numass/prop/TestReader.java rename to numass-prop/src/test/java/inr/numass/prop/TestReader.java index 0e7be321..6e6ceca2 100644 --- a/numass-prop/src/test/java/hep/dataforge/numass/prop/TestReader.java +++ b/numass-prop/src/test/java/inr/numass/prop/TestReader.java @@ -19,13 +19,13 @@ import hep.dataforge.meta.Meta; import hep.dataforge.meta.MetaBuilder; import hep.dataforge.context.GlobalContext; import hep.dataforge.data.FileData; +import hep.dataforge.data.XYDataAdapter; import hep.dataforge.plots.fx.FXPlotUtils; import inr.numass.prop.ar.JNAEpisode; import inr.numass.prop.ar.JNASpectrum; import inr.numass.prop.ar.ReadJNADataAction; import hep.dataforge.plots.PlotFrame; import hep.dataforge.plots.data.PlottableData; -import hep.dataforge.plots.jfreechart.JFreeChartFrame; import java.io.File; import java.io.FileNotFoundException; import java.util.Map; @@ -60,7 +60,7 @@ public class TestReader { PlotFrame frame = FXPlotUtils.displayJFreeChart("JNA test", null); - frame.add(new PlottableData(sp.asDataSet(), "chanel", "count")); + frame.add(PlottableData.plot(sp.asDataSet(), new XYDataAdapter("chanel", "count"))); Meta temps = sp.meta().getNode("temperature"); diff --git a/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java b/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java index c236fc73..51b7060f 100644 --- a/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java +++ b/numass-storage/src/main/java/inr/numass/storage/NumassDataLoader.java @@ -318,4 +318,9 @@ public class NumassDataLoader extends AbstractLoader implements BinaryLoader