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 71824381..a1b31a6f 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 @@ -41,7 +41,7 @@ import inr.numass.control.StorageHelper; import java.time.Duration; import java.util.Collection; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -50,7 +50,7 @@ import java.util.Map; * @author Alexander Nozik */ @RoleDef(name = Roles.STORAGE_ROLE) -@RoleDef(name = Roles.VIEW_ROLE, objectType = PKT8View.class) +@RoleDef(name = Roles.VIEW_ROLE) @ValueDef(name = "port", def = "virtual", info = "The name of the port for this PKT8") public class PKT8Device extends PortSensor { public static final String PKT8_DEVICE_TYPE = "numass:pkt8"; @@ -62,7 +62,7 @@ public class PKT8Device extends PortSensor { /** * The key is the letter (a,b,c,d...) as in measurements */ - private final Map channels = new HashMap<>(); + private final Map channels = new LinkedHashMap<>(); private RegularPointCollector collector; private StorageHelper storageHelper; @@ -191,7 +191,7 @@ public class PKT8Device extends PortSensor { updateState(ABUF, Integer.parseInt(response.substring(14))); // getLogger().info("successfully set buffer size to {}", this.abuf); } else { - getLogger().error("Setting averaging buffer failsed with message: " + response); + getLogger().error("Setting averaging buffer failed with message: " + response); } } diff --git a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8View.java b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8View.java index 39082598..7c826888 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8View.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8View.java @@ -72,7 +72,6 @@ public class PKT8View extends DeviceViewConnection implements Initia sensorColumn.setCellValueFactory(new PropertyValueFactory<>("channel")); resColumn.setCellValueFactory(new PropertyValueFactory<>("rawString")); tempColumn.setCellValueFactory(new PropertyValueFactory<>("temperatureString")); - bindBooleanToState("storing", storeButton.selectedProperty()); } @Override @@ -86,6 +85,7 @@ public class PKT8View extends DeviceViewConnection implements Initia new FragmentWindow(logFragment).bindTo(consoleButton); new FragmentWindow(plotFragment).bindTo(plotButton); + bindBooleanToState("storing", storeButton.selectedProperty()); } @Override diff --git a/numass-control/cryotemp/src/main/resources/config/thermo-1.xml b/numass-control/cryotemp/src/main/resources/config/devices.xml similarity index 87% rename from numass-control/cryotemp/src/main/resources/config/thermo-1.xml rename to numass-control/cryotemp/src/main/resources/config/devices.xml index 200c435b..c725212c 100644 --- a/numass-control/cryotemp/src/main/resources/config/thermo-1.xml +++ b/numass-control/cryotemp/src/main/resources/config/devices.xml @@ -1,11 +1,10 @@ - - - 192.168.111.36:4001 - 1 - "PT60S" - + diff --git a/numass-control/msp/src/main/java/inr/numass/control/msp/MspDevice.java b/numass-control/msp/src/main/java/inr/numass/control/msp/MspDevice.java index 4bd1729e..d5dbccd2 100644 --- a/numass-control/msp/src/main/java/inr/numass/control/msp/MspDevice.java +++ b/numass-control/msp/src/main/java/inr/numass/control/msp/MspDevice.java @@ -92,7 +92,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po super.shutdown(); super.stopMeasurement(true); if(isConnected()) { - setFileamentOn(false); + setFilamentOn(false); setConnected(false); } getHandler().close(); @@ -145,7 +145,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po case PortSensor.CONNECTED_STATE: setConnected(value.booleanValue()); case "filamentOn": - setFileamentOn(value.booleanValue()); + setFilamentOn(value.booleanValue()); default: super.requestStateChange(stateName, value); } @@ -243,13 +243,13 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po * with command name) * * @param commandName - * @param paremeters + * @param parameters * @return * @throws PortException */ - private MspResponse sendAndWait(String commandName, Object... paremeters) throws PortException { + private MspResponse sendAndWait(String commandName, Object... parameters) throws PortException { - String request = buildCommand(commandName, paremeters); + String request = buildCommand(commandName, parameters); if (mspListener != null) { mspListener.acceptRequest(request); } @@ -289,7 +289,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po * @return * @throws hep.dataforge.exceptions.PortException */ - public boolean setFileamentOn(boolean filamentOn) throws PortException { + public boolean setFilamentOn(boolean filamentOn) throws PortException { if (filamentOn) { return sendAndWait("FilamentControl", "On").isOK(); } else { diff --git a/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java b/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java index b47ced1c..eba0bd67 100644 --- a/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java +++ b/numass-control/msp/src/main/java/inr/numass/control/msp/fx/MspViewController.java @@ -138,7 +138,7 @@ public class MspViewController extends DeviceViewConnection implement fillamentButton.selectedProperty().addListener((ObservableValue observable, Boolean oldValue, Boolean newValue) -> { try { fillamentSelector.setDisable(newValue); - getDevice().setFileamentOn(newValue); + getDevice().setFilamentOn(newValue); } catch (PortException ex) { getDevice().getLogger().error("Failed to toggle filaments"); } diff --git a/numass-control/src/main/java/inr/numass/control/DeviceViewConnection.java b/numass-control/src/main/java/inr/numass/control/DeviceViewConnection.java index 75cebafa..7d85d71a 100644 --- a/numass-control/src/main/java/inr/numass/control/DeviceViewConnection.java +++ b/numass-control/src/main/java/inr/numass/control/DeviceViewConnection.java @@ -28,7 +28,11 @@ public abstract class DeviceViewConnection extends DeviceConne new ObjectBinding() { @Override protected Value computeValue() { - return getDevice().getState(stateName); + if(isOpen()) { + return getDevice().getState(stateName); + } else { + return Value.NULL; + } } } ); 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 e6c220d2..a581bd27 100644 --- a/numass-control/src/main/java/inr/numass/control/NumassControlUtils.java +++ b/numass-control/src/main/java/inr/numass/control/NumassControlUtils.java @@ -29,7 +29,7 @@ import java.util.function.Predicate; * Created by darksnake on 08-May-17. */ public class NumassControlUtils { - public static final String DEFAULT_CONFIG_LOCATION = "numass-control.xml"; + public static final String DEFAULT_CONFIG_LOCATION = "./numass-control.xml"; /** * Create a single or multiple storage connections for a device diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/VacCollectorDevice.java b/numass-control/vac/src/main/java/inr/numass/readvac/VacCollectorDevice.java index 7cf11213..c638b947 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/VacCollectorDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/VacCollectorDevice.java @@ -105,6 +105,7 @@ public class VacCollectorDevice extends Sensor { @Override public void shutdown() throws ControlException { super.shutdown(); + helper.close(); for (Sensor sensor : getSensors()) { sensor.shutdown(); } @@ -116,7 +117,9 @@ public class VacCollectorDevice extends Sensor { format.setType(s.getName(), ValueType.NUMBER); }); - return LoaderFactory.buildPointLoder(connection.getStorage(), "vactms", "", "timestamp", format.build()); + String suffix = DateTimeUtils.fileSuffix(); + + return LoaderFactory.buildPointLoder(connection.getStorage(), "vactms_" + suffix, "", "timestamp", format.build()); } @Override @@ -183,7 +186,6 @@ public class VacCollectorDevice extends Sensor { currentTask.cancel(force); executor.shutdown(); currentTask = null; - helper.close(); afterStop(); } return isRunning; diff --git a/numass-control/vac/src/main/resources/config/devices.xml b/numass-control/vac/src/main/resources/config/devices.xml index 84ab5ebb..c5c1677b 100644 --- a/numass-control/vac/src/main/resources/config/devices.xml +++ b/numass-control/vac/src/main/resources/config/devices.xml @@ -1,6 +1,6 @@ - +