Compare commits

..

3 Commits

Author SHA1 Message Date
2baf583473 Update versions 2023-11-08 16:15:36 +03:00
9a1e9dc996
Merge remote-tracking branch 'spc/master' 2023-11-08 11:46:53 +03:00
b2bc67ecc3
Set storing by default 2023-11-08 11:46:13 +03:00
21 changed files with 49 additions and 29 deletions

View File

@ -9,4 +9,4 @@ This project build using [DataForge](http://www.inr.ru/~nozik/dataforge/) framew
It is intended to fix this problem with public maven repository later. It is intended to fix this problem with public maven repository later.
# Requirements # # Requirements #
Project requires JDK 8 with JavaFX for desktop controls (https://www.azul.com/downloads/?version=java-8-lts&package=jdk-fx) Project requires JDK 16 in the system. GUI modules must be compiled on the target OS (linux on linux systems)

View File

@ -4,7 +4,7 @@ plugins {
javafx { javafx {
modules = listOf("javafx.controls", "javafx.web") modules = listOf("javafx.controls", "javafx.web")
version = "11" version = "16"
} }
description = "A tornadofx based kotlin library" description = "A tornadofx based kotlin library"

View File

@ -7,7 +7,7 @@ apply plugin: 'kotlin'
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
if (!hasProperty('mainClass')) { if (!hasProperty('mainClass')) {

View File

@ -4,7 +4,7 @@ plugins {
javafx { javafx {
modules = listOf("javafx.controls") modules = listOf("javafx.controls")
version = "11" version = "16"
} }
description = "dataforge-plots" description = "dataforge-plots"

View File

@ -4,7 +4,7 @@ plugins {
javafx { javafx {
modules = listOf("javafx.controls") modules = listOf("javafx.controls")
version = "11" version = "16"
} }
description = "jFreeChart plugin" description = "jFreeChart plugin"

View File

@ -6,7 +6,7 @@ plugins {
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
apply plugin: "kotlin" apply plugin: "kotlin"

View File

@ -7,7 +7,7 @@ plugins {
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }

View File

@ -5,7 +5,7 @@ plugins{
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
apply plugin: 'application' apply plugin: 'application'
@ -22,7 +22,7 @@ dependencies {
} }
application{ application{
mainClassName("inr.numass.control.cryotemp.PKT8App") mainClassName = "inr.numass.control.cryotemp.PKT8AppKt"
} }
task testDevice(dependsOn: classes, type: JavaExec) { task testDevice(dependsOn: classes, type: JavaExec) {

View File

@ -18,6 +18,7 @@ package inr.numass.control.cryotemp
import hep.dataforge.meta.Meta import hep.dataforge.meta.Meta
import hep.dataforge.meta.MetaUtils import hep.dataforge.meta.MetaUtils
import inr.numass.control.NumassControlApplication import inr.numass.control.NumassControlApplication
import javafx.application.Application
import javafx.stage.Stage import javafx.stage.Stage
/** /**
@ -38,3 +39,9 @@ class PKT8App : NumassControlApplication<PKT8Device>() {
.orElseThrow{RuntimeException("Temperature measurement configuration not found")} .orElseThrow{RuntimeException("Temperature measurement configuration not found")}
} }
} }
fun main() {
Application.launch(PKT8App::class.java)
}

View File

@ -251,10 +251,6 @@ class PKT8Device(context: Context, meta: Meta) : PortSensor(context, meta) {
// logger.warn("Trying to start measurement which is already started") // logger.warn("Trying to start measurement which is already started")
// } // }
if(!connected.booleanValue){
logger.info("Not connected, connecting...")
connected.setAndWait(true)
}
logger.info("Starting measurement") logger.info("Starting measurement")

View File

@ -6,7 +6,7 @@ plugins{
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }

View File

@ -6,7 +6,7 @@ plugins{
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
version = "0.3.0" version = "0.3.0"

View File

@ -5,15 +5,14 @@ plugins{
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
version = "0.4.0" version = "0.4.0"
if (!hasProperty('mainClass')) { application{
ext.mainClass = 'inr.numass.control.msp.MspApp' mainClassName = "inr.numass.control.msp.MspAppKt"
} }
mainClassName = mainClass
dependencies { dependencies {

View File

@ -18,6 +18,7 @@ package inr.numass.control.msp
import hep.dataforge.meta.Meta import hep.dataforge.meta.Meta
import hep.dataforge.meta.MetaUtils import hep.dataforge.meta.MetaUtils
import inr.numass.control.NumassControlApplication import inr.numass.control.NumassControlApplication
import javafx.application.Application
import javafx.stage.Stage import javafx.stage.Stage
/** /**
@ -39,3 +40,9 @@ class MspApp : NumassControlApplication<MspDevice>() {
} }
} }
fun main() {
Application.launch(MspApp::class.java)
}

View File

@ -78,13 +78,13 @@ abstract class DeviceDisplayFX<D : Device> : Component(), Connection {
protected abstract fun buildView(device: D): UIComponent?; protected abstract fun buildView(device: D): UIComponent?;
fun valueStateProperty(stateName: String): ObjectProperty<Value> { fun valueStateProperty(stateName: String): ObjectProperty<Value> {
val state: ValueState = device.states.filterIsInstance(ValueState::class.java).find { it.name == stateName } val state: ValueState = device.states.filterIsInstance<ValueState>().find { it.name == stateName }
?: throw NameNotFoundException("State with name $stateName not found") ?: throw NameNotFoundException("State with name $stateName not found")
return state.asProperty() return state.asProperty()
} }
fun booleanStateProperty(stateName: String): BooleanProperty { fun booleanStateProperty(stateName: String): BooleanProperty {
val state: ValueState = device.states.filterIsInstance(ValueState::class.java).find { it.name == stateName } val state: ValueState = device.states.filterIsInstance<ValueState>().find { it.name == stateName }
?: throw NameNotFoundException("State with name $stateName not found") ?: throw NameNotFoundException("State with name $stateName not found")
return state.asBooleanProperty() return state.asBooleanProperty()
} }

View File

@ -112,15 +112,17 @@ fun EventTarget.deviceStateIndicator(connection: DeviceDisplayFX<*>, state: Stri
fun Node.deviceStateToggle(connection: DeviceDisplayFX<*>, state: String, title: String = state) { fun Node.deviceStateToggle(connection: DeviceDisplayFX<*>, state: String, title: String = state) {
if (connection.device.stateNames.contains(state)) { if (connection.device.stateNames.contains(state)) {
togglebutton(title) { togglebutton(title) {
isSelected = false
selectedProperty().addListener { _, oldValue, newValue -> selectedProperty().addListener { _, oldValue, newValue ->
if (oldValue != newValue) { if (oldValue != newValue) {
connection.device.states[state] = newValue connection.device.states[state] = newValue
} }
} }
connection.valueStateProperty(state).onChange { connection.valueStateProperty(state).apply {
runLater { isSelected = value?.boolean ?: false
isSelected = it?.boolean ?: false onChange {
runLater {
isSelected = it?.boolean ?: false
}
} }
} }
} }

View File

@ -5,7 +5,7 @@ plugins{
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
version = "0.6.0" version = "0.6.0"
@ -15,7 +15,7 @@ dependencies {
} }
application{ application{
mainClassName("inr.numass.control.readvac.ReadVac") mainClassName = "inr.numass.control.readvac.ReadVacKt"
} }
task testDevice(dependsOn: classes, type: JavaExec) { task testDevice(dependsOn: classes, type: JavaExec) {

View File

@ -8,6 +8,7 @@ package inr.numass.control.readvac
import hep.dataforge.meta.Meta import hep.dataforge.meta.Meta
import hep.dataforge.meta.MetaUtils import hep.dataforge.meta.MetaUtils
import inr.numass.control.NumassControlApplication import inr.numass.control.NumassControlApplication
import javafx.application.Application
import javafx.stage.Stage import javafx.stage.Stage
/** /**
@ -30,5 +31,9 @@ class ReadVac : NumassControlApplication<VacCollectorDevice>() {
} }
} }
fun main() {
Application.launch(ReadVac::class.java)
}

View File

@ -47,6 +47,10 @@ class VacCollectorDevice(context: Context, meta: Meta, val sensors: Collection<S
private val helper = StorageHelper(this, this::buildLoader) private val helper = StorageHelper(this, this::buildLoader)
init {
states["storing"] = true
}
private val collector = object : DeviceListener { private val collector = object : DeviceListener {
val averagingDuration: Duration = Duration.parse(meta.getString("averagingDuration", "PT30S")) val averagingDuration: Duration = Duration.parse(meta.getString("averagingDuration", "PT30S"))

View File

@ -5,7 +5,7 @@ plugins {
javafx { javafx {
modules = ["javafx.controls", "javafx.web"] modules = ["javafx.controls", "javafx.web"]
version = "11" version = "16"
} }
apply plugin: 'kotlin' apply plugin: 'kotlin'

View File

@ -8,7 +8,7 @@ plugins {
javafx { javafx {
modules = listOf("javafx.graphics", "javafx.controls", "javafx.web") modules = listOf("javafx.graphics", "javafx.controls", "javafx.web")
version = "11" version = "16"
} }
repositories { repositories {