From 94ed08f7bdf7c1a130a7912650b5f5c4e54fdfe5 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 8 Apr 2018 18:29:44 +0300 Subject: [PATCH] Updating control --- numass-control/cryotemp/build.gradle | 6 +++--- .../src/main/kotlin/inr/numass/control/cryotemp/PKT8App.kt | 3 ++- .../main/kotlin/inr/numass/control/cryotemp/PKT8Device.kt | 2 ++ .../kotlin/inr/numass/control/cryotemp/PKT8DeviceFactory.kt | 4 +--- .../main/kotlin/inr/numass/control/cryotemp/PKT8Display.kt | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/numass-control/cryotemp/build.gradle b/numass-control/cryotemp/build.gradle index e90e580d..2f3112ad 100644 --- a/numass-control/cryotemp/build.gradle +++ b/numass-control/cryotemp/build.gradle @@ -16,10 +16,10 @@ dependencies { task testDevice(dependsOn: classes, type: JavaExec) { main mainClass - args = ["--config.resource=/config-test/devices.xml"] + args = ["--config.resource=config-debug/devices.xml"] classpath = sourceSets.main.runtimeClasspath - description "Start application in debug mode with default virtual port" - group "test" + description = "Start application in debug mode with default virtual port" + group = "application" } diff --git a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8App.kt b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8App.kt index d3391cab..eadbbef3 100644 --- a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8App.kt +++ b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8App.kt @@ -34,6 +34,7 @@ class PKT8App : NumassControlApplication() { } override fun getDeviceMeta(config: Meta): Meta { - return MetaUtils.findNode(config,"device"){it.getString("name") == "numass.temp"}.orElseThrow{RuntimeException("Temperature measurement configuration not found")} + return MetaUtils.findNode(config,"device"){it.getString("type") == "PKT8"} + .orElseThrow{RuntimeException("Temperature measurement configuration not found")} } } diff --git a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Device.kt b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Device.kt index 383b118d..ed674f50 100644 --- a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Device.kt +++ b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8Device.kt @@ -60,6 +60,8 @@ class PKT8Device(context: Context, meta: Meta) : PortSensor(context, meta) { * The key is the letter (a,b,c,d...) as in measurements */ val channels = LinkedHashMap() + + val storing = valueState("storing") private var storageHelper: StorageHelper? = null /** diff --git a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8DeviceFactory.kt b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8DeviceFactory.kt index 1e83e140..fd75e909 100644 --- a/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8DeviceFactory.kt +++ b/numass-control/cryotemp/src/main/kotlin/inr/numass/control/cryotemp/PKT8DeviceFactory.kt @@ -8,9 +8,7 @@ import hep.dataforge.meta.Meta * Created by darksnake on 09-May-17. */ class PKT8DeviceFactory : DeviceFactory { - override fun getType(): String { - return PKT8Device.PKT8_DEVICE_TYPE - } + override val type: String = PKT8Device.PKT8_DEVICE_TYPE override fun build(context: Context, meta: Meta): PKT8Device { return PKT8Device(context, meta) 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 163ba345..55985354 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 @@ -1,7 +1,7 @@ package inr.numass.control.cryotemp -import hep.dataforge.control.devices.Sensor import hep.dataforge.description.Descriptors +import hep.dataforge.fx.asBooleanProperty import hep.dataforge.fx.bindWindow import hep.dataforge.fx.dfIconView import hep.dataforge.fx.fragments.LogFragment @@ -82,11 +82,11 @@ class PKT8Display : DeviceDisplayFX(), PKT8ValueListener { toolbar { togglebutton("Measure") { isSelected = false - bindBooleanToState(Sensor.MEASURING_STATE, selectedProperty()) + selectedProperty().bindBidirectional(device.measuring.asBooleanProperty()) } togglebutton("Store") { isSelected = false - bindBooleanToState("storing", selectedProperty()) + selectedProperty().bindBidirectional(device.storing.asBooleanProperty()) } separator(Orientation.VERTICAL) pane {