Updating control

This commit is contained in:
Alexander Nozik 2018-04-08 18:29:44 +03:00
parent 515eb2faac
commit 94ed08f7bd
5 changed files with 11 additions and 10 deletions

View File

@ -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"
}

View File

@ -34,6 +34,7 @@ class PKT8App : NumassControlApplication<PKT8Device>() {
}
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")}
}
}

View File

@ -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<String, PKT8Channel>()
val storing = valueState("storing")
private var storageHelper: StorageHelper? = null
/**

View File

@ -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)

View File

@ -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<PKT8Device>(), 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 {