Application plugin in demo
This commit is contained in:
parent
8e261a5ff5
commit
1ae8679a8c
@ -21,7 +21,7 @@ suspend fun Device.flowValues(): Flow<Pair<String, MetaItem<*>>> = callbackFlow
|
||||
}
|
||||
}
|
||||
}
|
||||
registerListener(listener, listener)
|
||||
registerListener(listener)
|
||||
awaitClose {
|
||||
removeListener(listener)
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.3.72"
|
||||
id("org.openjfx.javafxplugin") version "0.0.8"
|
||||
`application`
|
||||
}
|
||||
|
||||
val plotlyVersion: String by rootProject.extra
|
||||
@ -31,3 +32,7 @@ javafx{
|
||||
version = "14"
|
||||
modules("javafx.controls")
|
||||
}
|
||||
|
||||
application{
|
||||
mainClassName = "hep.dataforge.control.demo.DemoControllerViewKt"
|
||||
}
|
@ -25,10 +25,6 @@ class DemoDevice(parentScope: CoroutineScope = GlobalScope) : DeviceBase() {
|
||||
val timeScale: IsolatedDeviceProperty by writingVirtual(5000.0.asValue())
|
||||
var timeScaleValue by timeScale.double()
|
||||
|
||||
val resetScale: Action by action {
|
||||
timeScaleValue = 5000.0
|
||||
}
|
||||
|
||||
val sinScale by writingVirtual(1.0.asValue())
|
||||
var sinScaleValue by sinScale.double()
|
||||
val sin by readingNumber {
|
||||
@ -50,6 +46,13 @@ class DemoDevice(parentScope: CoroutineScope = GlobalScope) : DeviceBase() {
|
||||
"y" put cos(time.toEpochMilli().toDouble() / timeScaleValue)*cosScaleValue
|
||||
}
|
||||
|
||||
|
||||
val resetScale: Action by action {
|
||||
timeScaleValue = 5000.0
|
||||
sinScaleValue = 1.0
|
||||
cosScaleValue = 1.0
|
||||
}
|
||||
|
||||
init {
|
||||
sin.readEvery(0.2.seconds)
|
||||
cos.readEvery(0.2.seconds)
|
||||
|
Loading…
Reference in New Issue
Block a user