From 598c3f0a757f30f3a6268e8f16ae6cfc3f30818a Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 7 May 2017 22:17:04 +0300 Subject: [PATCH] Multiple fixes in control --- .../inr/numass/control/msp/MspDevice.java | 23 +++++++++---------- .../control/msp/fx/MspViewController.java | 3 +-- .../numass/readvac/devices/MKSVacDevice.java | 19 ++++++++------- .../inr/numass/readvac/fx/VacuumeterView.java | 4 ++-- .../src/main/java/inr/numass/Numass.java | 3 +-- settings.gradle | 1 + 6 files changed, 25 insertions(+), 28 deletions(-) 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 d3781714..6957ea95 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 @@ -36,7 +36,6 @@ import hep.dataforge.tables.MapPoint; import hep.dataforge.tables.TableFormat; import hep.dataforge.tables.TableFormatBuilder; import hep.dataforge.utils.DateTimeUtils; -import hep.dataforge.values.Value; import java.time.Instant; import java.util.*; @@ -123,17 +122,17 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po return "MKS E-Vision"; } - @Override - public void command(String commandName, Value argument) throws ControlException { - switch (commandName) { - case "connect": - setConnected(argument.booleanValue()); - case "setFilamentOn": - setFileamentOn(argument.booleanValue()); - default: - super.command(commandName, argument); - } - } +// @Override +// public void command(String commandName, Value argument) throws ControlException { +// switch (commandName) { +// case "connect": +// setConnected(argument.booleanValue()); +// case "setFilamentOn": +// setFileamentOn(argument.booleanValue()); +// default: +// super.command(commandName, argument); +// } +// } /** * Startup MSP: get available sensors, select sensor and control. 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 fef81846..1c2c3956 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 @@ -194,12 +194,11 @@ public class MspViewController implements Initializable, MspListener { this.device = new MspDevice(); device.setName(mspName); device.setContext(context); - device.setMeta(mspConfig); + device.configure(mspConfig); try { getDevice().setListener(this); getDevice().init(); -// getDevice().startMeasurement("peakJump"); } catch (ControlException ex) { showError(String.format("Can't connect to %s:%d. The port is either busy or not the MKS mass-spectrometer port", device.meta().getString("connection.ip", "127.0.0.1"), diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSVacDevice.java b/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSVacDevice.java index c104d5f2..036952d1 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSVacDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSVacDevice.java @@ -11,7 +11,6 @@ import hep.dataforge.control.measurements.SimpleMeasurement; import hep.dataforge.control.ports.PortHandler; import hep.dataforge.description.ValueDef; import hep.dataforge.exceptions.ControlException; -import hep.dataforge.values.Value; import javafx.beans.property.BooleanProperty; import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder; @@ -77,15 +76,15 @@ public class MKSVacDevice extends PortSensor { } } - @Override - public void command(String commandName, Value argument) throws ControlException { - if (commandName.equals("setPower")) { - boolean powerOn = argument.booleanValue(); - setPowerOn(powerOn); - } else { - super.command(commandName, argument); - } - } +// @Override +// public void command(String commandName, Value argument) throws ControlException { +// if (commandName.equals("setPower")) { +// boolean powerOn = argument.booleanValue(); +// setPowerOn(powerOn); +// } else { +// super.command(commandName, argument); +// } +// } @Override public void shutdown() throws ControlException { diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacuumeterView.java b/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacuumeterView.java index 85bc5a99..a46528b8 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacuumeterView.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/fx/VacuumeterView.java @@ -9,8 +9,8 @@ import hep.dataforge.control.connections.DeviceViewController; import hep.dataforge.control.devices.Device; import hep.dataforge.control.measurements.Measurement; import hep.dataforge.control.measurements.MeasurementListener; -import hep.dataforge.meta.Annotated; import hep.dataforge.meta.Meta; +import hep.dataforge.meta.Metoid; import hep.dataforge.names.Named; import hep.dataforge.values.Value; import javafx.application.Platform; @@ -35,7 +35,7 @@ import java.util.ResourceBundle; /** * @author Alexander Nozik */ -public class VacuumeterView extends DeviceViewController implements MeasurementListener, Initializable, Named, Annotated { +public class VacuumeterView extends DeviceViewController implements MeasurementListener, Initializable, Named, Metoid { private static final DecimalFormat FORMAT = new DecimalFormat("0.###E0"); private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ISO_LOCAL_TIME; diff --git a/numass-main/src/main/java/inr/numass/Numass.java b/numass-main/src/main/java/inr/numass/Numass.java index 908cb419..63601bef 100644 --- a/numass-main/src/main/java/inr/numass/Numass.java +++ b/numass-main/src/main/java/inr/numass/Numass.java @@ -31,8 +31,7 @@ import hep.dataforge.meta.Meta; public class Numass { public static Context buildContext(Context parent, Meta meta) { - return Context.builder("NUMASS") - .parent(parent) + return Context.builder("NUMASS", parent) .properties(meta) .plugin(NumassPlugin.class) .build(); diff --git a/settings.gradle b/settings.gradle index ae56b379..707c6e8a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,6 +4,7 @@ include ":numass-control" include ":numass-control:cryotemp" include ":numass-control:magnet" include ":numass-control:msp" +include ":numass-control:vac" // include ":numass-main" //