diff --git a/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt index 117d5d82..79c72607 100644 --- a/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt @@ -38,7 +38,7 @@ class BoardController() : Controller(), AutoCloseable { fun load(app: Application) { runAsync { - NumassControlUtils.getConfig(app).ifPresent { + getConfig(app).ifPresent { val libDir = File(app.parameters.named.getOrDefault("libPath", "../lib")); val contextBuilder = Context .builder("NUMASS-SERVER"); diff --git a/numass-control/control-room/src/main/kotlin/inr/numass/control/ServerApp.kt b/numass-control/control-room/src/main/kotlin/inr/numass/control/ServerApp.kt index 7e07eb56..2d4f0555 100644 --- a/numass-control/control-room/src/main/kotlin/inr/numass/control/ServerApp.kt +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/ServerApp.kt @@ -13,7 +13,7 @@ class ServerApp : App(BoardView::class) { override fun start(stage: Stage) { controller.load(this) super.start(stage) - NumassControlUtils.setDFStageIcon(stage) + setDFStageIcon(stage) } override fun stop() { diff --git a/numass-control/cryotemp/src/main/java/inr/numass/control/cryotemp/PKT8Device.java b/numass-control/cryotemp/src/main/java/inr/numass/control/cryotemp/PKT8Device.java index e838765f..39f0489d 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/control/cryotemp/PKT8Device.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/control/cryotemp/PKT8Device.java @@ -47,6 +47,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.stream.Collectors; + /** * A device controller for Dubna PKT 8 cryogenic thermometry device * diff --git a/numass-control/src/main/kotlin/inr/numass/control/NumassControlUtils.kt b/numass-control/src/main/kotlin/inr/numass/control/NumassControlUtils.kt index 06b35874..8da6c718 100644 --- a/numass-control/src/main/kotlin/inr/numass/control/NumassControlUtils.kt +++ b/numass-control/src/main/kotlin/inr/numass/control/NumassControlUtils.kt @@ -26,6 +26,7 @@ import java.util.function.Predicate * Created by darksnake on 08-May-17. */ val DEFAULT_CONFIG_LOCATION = "./numass-control.xml" +val STORING_STATE = "storing" val dfIcon: Image = Image(Global::class.java.getResourceAsStream("/img/df.png")) /** @@ -114,4 +115,3 @@ fun setDFStageIcon(stage: Stage) { stage.icons.add(dfIcon) } - diff --git a/numass-control/vac/src/main/java/inr/numass/control/readvac/MKSVacDevice.java b/numass-control/vac/src/main/java/inr/numass/control/readvac/MKSVacDevice.java index db0eb5f3..82016141 100644 --- a/numass-control/vac/src/main/java/inr/numass/control/readvac/MKSVacDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/control/readvac/MKSVacDevice.java @@ -22,13 +22,15 @@ import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static hep.dataforge.values.ValueType.BOOLEAN; + /** * @author Alexander Nozik */ @ValueDef(name = "address", def = "253") @ValueDef(name = "channel", def = "5") -@ValueDef(name = "powerButton", type = "BOOLEAN", def = "true") -@StateDef(name = "power", writable = true, info = "Device powered up") +@ValueDef(name = "powerButton", type = {BOOLEAN}, def = "true") +@StateDef(value = @ValueDef(name = "power", info = "Device powered up"), writable = true) public class MKSVacDevice extends PortSensor { public MKSVacDevice() { diff --git a/numass-control/vac/src/main/java/inr/numass/control/readvac/MeradatVacDevice.java b/numass-control/vac/src/main/java/inr/numass/control/readvac/MeradatVacDevice.java index e0760046..bf08c85c 100644 --- a/numass-control/vac/src/main/java/inr/numass/control/readvac/MeradatVacDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/control/readvac/MeradatVacDevice.java @@ -21,10 +21,12 @@ import java.math.RoundingMode; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static hep.dataforge.values.ValueType.NUMBER; + /** * @author Alexander Nozik */ -@ValueDef(name = "address", type = "NUMBER", def = "1", info = "A modbus address") +@ValueDef(name = "address", type = {NUMBER}, def = "1", info = "A modbus address") public class MeradatVacDevice extends PortSensor { private static final String REQUEST = "0300000002"; diff --git a/numass-control/vac/src/main/java/inr/numass/control/readvac/VacCollectorDevice.java b/numass-control/vac/src/main/java/inr/numass/control/readvac/VacCollectorDevice.java index 3010760d..38eb5f8a 100644 --- a/numass-control/vac/src/main/java/inr/numass/control/readvac/VacCollectorDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/control/readvac/VacCollectorDevice.java @@ -16,6 +16,7 @@ import hep.dataforge.control.devices.Sensor; import hep.dataforge.control.devices.StateDef; import hep.dataforge.control.measurements.AbstractMeasurement; import hep.dataforge.control.measurements.Measurement; +import hep.dataforge.description.ValueDef; import hep.dataforge.exceptions.ControlException; import hep.dataforge.exceptions.MeasurementException; import hep.dataforge.meta.Meta; @@ -45,7 +46,10 @@ import static hep.dataforge.control.devices.PortSensor.CONNECTED_STATE; * @author Alexander Nozik */ @RoleDef(name = Roles.STORAGE_ROLE, objectType = StorageConnection.class, info = "Storage for acquired points") -@StateDef(name = "storing", writable = true, info = "Define if this device is currently writes to storage") +@StateDef( + value = @ValueDef(name = "storing", info = "Define if this device is currently writes to storage"), + writable = true +) public class VacCollectorDevice extends Sensor { private Map> sensorMap = new LinkedHashMap<>();