diff --git a/numass-control/cryotemp/build.gradle b/numass-control/cryotemp/build.gradle index dc19332c..2d77e7a3 100644 --- a/numass-control/cryotemp/build.gradle +++ b/numass-control/cryotemp/build.gradle @@ -20,7 +20,7 @@ dependencies { task debug(dependsOn: classes, type: JavaExec) { main mainClass - args "--debug=true" + args "--config.resource=/config-debug/devices.xml" classpath = sourceSets.main.runtimeClasspath description "Start application in debug mode with default virtual port" group "debug" diff --git a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Device.java b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Device.java index 19a51d86..6afa2e5f 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Device.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Device.java @@ -22,6 +22,7 @@ import hep.dataforge.control.connections.Roles; import hep.dataforge.control.connections.StorageConnection; import hep.dataforge.control.devices.Device; import hep.dataforge.control.devices.PortSensor; +import hep.dataforge.control.devices.StateDef; import hep.dataforge.control.measurements.AbstractMeasurement; import hep.dataforge.control.measurements.Measurement; import hep.dataforge.control.ports.PortHandler; @@ -54,6 +55,7 @@ import java.util.stream.Collectors; @RoleDef(name = Roles.STORAGE_ROLE) @RoleDef(name = Roles.VIEW_ROLE) @ValueDef(name = "port", def = "virtual", info = "The name of the port for this PKT8") +@StateDef(name = "storing") public class PKT8Device extends PortSensor { public static final String PKT8_DEVICE_TYPE = "numass:pkt8"; diff --git a/numass-control/cryotemp/src/main/resources/config-debug/devices.xml b/numass-control/cryotemp/src/main/resources/config-debug/devices.xml index 9d7c9e96..d3e2e250 100644 --- a/numass-control/cryotemp/src/main/resources/config-debug/devices.xml +++ b/numass-control/cryotemp/src/main/resources/config-debug/devices.xml @@ -2,9 +2,8 @@ - + - 120 diff --git a/numass-control/src/main/java/inr/numass/control/NumassControlUtils.java b/numass-control/src/main/java/inr/numass/control/NumassControlUtils.java index a581bd27..ef10c214 100644 --- a/numass-control/src/main/java/inr/numass/control/NumassControlUtils.java +++ b/numass-control/src/main/java/inr/numass/control/NumassControlUtils.java @@ -68,10 +68,15 @@ public class NumassControlUtils { } public static Optional getConfig(Application app) { + String debugConfig = app.getParameters().getNamed().get("config.resource"); + if (debugConfig != null) { + return Optional.ofNullable(readResourceMeta(debugConfig)); + } + String configFileName = app.getParameters().getNamed().get("config"); Logger logger = LoggerFactory.getLogger(app.getClass()); if (configFileName == null) { - logger.info("Configuration path not defined. Loading configuration from {}",DEFAULT_CONFIG_LOCATION); + logger.info("Configuration path not defined. Loading configuration from {}", DEFAULT_CONFIG_LOCATION); configFileName = DEFAULT_CONFIG_LOCATION; } File configFile = new File(configFileName); @@ -100,7 +105,7 @@ public class NumassControlUtils { return ctx; } - public static void setDFStageIcon(Stage stage){ + public static void setDFStageIcon(Stage stage) { stage.getIcons().add(new Image(NumassControlUtils.class.getResourceAsStream("/img/df.png"))); }