From 6497e2f04a08bf7e9ddd3e4b7e306f03adc2c7a2 Mon Sep 17 00:00:00 2001 From: darksnake Date: Mon, 19 Jun 2017 16:48:55 +0300 Subject: [PATCH] Fixed DataPoint reading --- .../src/main/kotlin/inr/numass/viewer/MainView.kt | 3 ++- .../main/kotlin/inr/numass/viewer/SlowControlView.kt | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt index 1460753a..d7501b12 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt @@ -105,7 +105,8 @@ class MainView : View("Numass data viewer") { loaderPane.center = numassLoaderView.root } is PointLoader -> { - slowControlView.load(value.content) + val loader: PointLoader = value.content; + slowControlView.load(loader); loaderPane.center = slowControlView.root } } diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/SlowControlView.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/SlowControlView.kt index 5a199a19..77385143 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/SlowControlView.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/SlowControlView.kt @@ -1,6 +1,7 @@ package inr.numass.viewer import hep.dataforge.kodex.buildMeta +import hep.dataforge.kodex.configure import hep.dataforge.meta.Meta import hep.dataforge.plots.Plottable import hep.dataforge.plots.data.PlottableData @@ -12,13 +13,16 @@ import hep.dataforge.tables.DataPoint import hep.dataforge.tables.ListTable import hep.dataforge.tables.Table import hep.dataforge.tables.XYAdapter -import tornadofx.* +import tornadofx.View +import tornadofx.borderpane /** * Created by darksnake on 18.06.2017. */ class SlowControlView : View("My View") { private val plotMeta = buildMeta("plot") { + "xAxis.type" to "time" + "yAxis.type" to "log" } val plot = JFreeChartFrame(plotMeta) @@ -33,7 +37,11 @@ class SlowControlView : View("My View") { ArrayList().apply { loader.format.columns.filter { it.name != "timestamp" }.forEach { val adapter = XYAdapter("timestamp", it.name); - this += PlottableData.plot("data", adapter, data); + this += PlottableData.plot(it.name, adapter, data).configure { + "showLine" to true + "showSymbol" to false + "showErrors" to false + } } } } ui {