vacuum fix

This commit is contained in:
Alexander Nozik 2017-05-18 12:53:21 +03:00
parent 94cd39bbb6
commit 2c58a16fac
12 changed files with 71 additions and 101 deletions

View File

@ -37,7 +37,7 @@ task installAll(type: Copy) {
} }
} }
if (!configRoot.children().isEmpty()) { if (!configRoot.children().isEmpty()) {
File outFile = file("$buildDir/install/numass-control/config/devices.xml") File outFile = file("$buildDir/install/numass-control/bin/numass-control.xml")
outFile.getParentFile().mkdirs(); outFile.getParentFile().mkdirs();
outFile.createNewFile(); outFile.createNewFile();
new XmlNodePrinter(outFile.newPrintWriter()).print(configRoot) new XmlNodePrinter(outFile.newPrintWriter()).print(configRoot)

View File

@ -19,6 +19,7 @@ import hep.dataforge.context.Context;
import hep.dataforge.control.RoleDef; import hep.dataforge.control.RoleDef;
import hep.dataforge.control.connections.Roles; import hep.dataforge.control.connections.Roles;
import hep.dataforge.control.connections.StorageConnection; import hep.dataforge.control.connections.StorageConnection;
import hep.dataforge.control.devices.PortSensor;
import hep.dataforge.control.devices.SingleMeasurementDevice; import hep.dataforge.control.devices.SingleMeasurementDevice;
import hep.dataforge.control.devices.StateDef; import hep.dataforge.control.devices.StateDef;
import hep.dataforge.control.measurements.AbstractMeasurement; import hep.dataforge.control.measurements.AbstractMeasurement;
@ -51,7 +52,7 @@ import java.util.function.Consumer;
*/ */
@RoleDef(name = Roles.STORAGE_ROLE, objectType = StorageConnection.class) @RoleDef(name = Roles.STORAGE_ROLE, objectType = StorageConnection.class)
@RoleDef(name = Roles.VIEW_ROLE) @RoleDef(name = Roles.VIEW_ROLE)
@StateDef(name = "connected", writable = true, info = "Connection with the device itself") @StateDef(name = PortSensor.CONNECTED_STATE, writable = true, info = "Connection with the device itself")
@StateDef(name = "storing", writable = true, info = "Define if this device is currently writes to storage") @StateDef(name = "storing", writable = true, info = "Define if this device is currently writes to storage")
@StateDef(name = "filamentOn", writable = true, info = "Mass-spectrometer filament on") @StateDef(name = "filamentOn", writable = true, info = "Mass-spectrometer filament on")
@StateDef(name = "filamentStatus", info = "Filament status") @StateDef(name = "filamentStatus", info = "Filament status")
@ -134,7 +135,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po
case "storing": case "storing":
return false; return false;
default: default:
throw new ControlException("State not defined"); return super.computeState(stateName);
} }
} }
@ -146,7 +147,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po
@Override @Override
protected void requestStateChange(String stateName, Value value) throws ControlException { protected void requestStateChange(String stateName, Value value) throws ControlException {
switch (stateName) { switch (stateName) {
case "connected": case PortSensor.CONNECTED_STATE:
setConnected(value.booleanValue()); setConnected(value.booleanValue());
case "filamentOn": case "filamentOn":
setFileamentOn(value.booleanValue()); setFileamentOn(value.booleanValue());
@ -195,7 +196,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po
return false; return false;
} }
// connected = true; // connected = true;
updateState("connected", true); updateState(PortSensor.CONNECTED_STATE, true);
return true; return true;
} else { } else {
handler.unholdBy(this); handler.unholdBy(this);
@ -267,7 +268,7 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po
} }
public boolean isConnected() { public boolean isConnected() {
return getState("connected").booleanValue(); return getState(PortSensor.CONNECTED_STATE).booleanValue();
} }
public boolean isSelected() { public boolean isSelected() {

View File

@ -62,12 +62,12 @@ public abstract class NumassControlApplication<D extends Device> extends Applica
.orElseGet(() -> NumassControlUtils.readResourceMeta("/config/devices.xml")); .orElseGet(() -> NumassControlUtils.readResourceMeta("/config/devices.xml"));
Context ctx = NumassControlUtils.setupContext(config); Context ctx = NumassControlUtils.setupContext(config);
Meta mspConfig = NumassControlUtils.findDeviceMeta(config, this::acceptDevice) Meta deviceConfig = NumassControlUtils.findDeviceMeta(config, this::acceptDevice)
.orElseThrow(() -> new RuntimeException("Device configuration not found")); .orElseThrow(() -> new RuntimeException("Device configuration not found"));
try { try {
D d = getDeviceFactory().build(ctx, mspConfig); D d = getDeviceFactory().build(ctx, deviceConfig);
d.init(); d.init();
NumassControlUtils.connectStorage(d, config); NumassControlUtils.connectStorage(d, config);
Platform.runLater(() -> { Platform.runLater(() -> {

View File

@ -14,6 +14,8 @@ import hep.dataforge.storage.commons.StorageFactory;
import hep.dataforge.storage.commons.StorageManager; import hep.dataforge.storage.commons.StorageManager;
import inr.numass.client.ClientUtils; import inr.numass.client.ClientUtils;
import javafx.application.Application; import javafx.application.Application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -38,7 +40,7 @@ public class NumassControlUtils {
if (config.hasMeta("storage") && device.acceptsRole(Roles.STORAGE_ROLE)) { if (config.hasMeta("storage") && device.acceptsRole(Roles.STORAGE_ROLE)) {
String numassRun = ClientUtils.getRunName(config); String numassRun = ClientUtils.getRunName(config);
config.getMetaList("storage").forEach(node -> { config.getMetaList("storage").forEach(node -> {
device.getContext().getLogger().debug("Creating storage for device with meta: {}", node); device.getContext().getLogger().info("Creating storage for device with meta: {}", node);
//building storage in a separate thread //building storage in a separate thread
new Thread(() -> { new Thread(() -> {
Storage storage = StorageFactory.buildStorage(device.getContext(), node); Storage storage = StorageFactory.buildStorage(device.getContext(), node);
@ -65,7 +67,9 @@ public class NumassControlUtils {
public static Optional<Meta> getConfig(Application app) { public static Optional<Meta> getConfig(Application app) {
String configFileName = app.getParameters().getNamed().get("config"); String configFileName = app.getParameters().getNamed().get("config");
Logger logger = LoggerFactory.getLogger(app.getClass());
if (configFileName == null) { if (configFileName == null) {
logger.info("Configuration path not defined. Loading configuration from {}",DEFAULT_CONFIG_LOCATION);
configFileName = DEFAULT_CONFIG_LOCATION; configFileName = DEFAULT_CONFIG_LOCATION;
} }
File configFile = new File(configFileName); File configFile = new File(configFileName);
@ -78,6 +82,7 @@ public class NumassControlUtils {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} else { } else {
logger.warn("Configuration file not found");
return Optional.empty(); return Optional.empty();
} }
} }

View File

@ -54,29 +54,6 @@ public class CM32Device extends PortSensor<Double> {
return meta().getString("type", "Leibold CM32"); return meta().getString("type", "Leibold CM32");
} }
// @Override
// protected int timeout() {
// return meta().getInt("timeout", 1000);
// }
@Override
protected Object computeState(String stateName) throws ControlException {
if (getHandler() == null) {
notifyError("No port connection", null);
return null;
}
notifyError("State not found: " + stateName, null);
return null;
//TODO add connection check here
// switch (stateName) {
// case "connection":
// return !talk("T?").isEmpty();
// default:
// notifyError("State not found: " + stateName, null);
// return null;
// }
}
private class CMVacMeasurement extends SimpleMeasurement<Double> { private class CMVacMeasurement extends SimpleMeasurement<Double> {
private static final String CM32_QUERY = "MES R PM 1\r\n"; private static final String CM32_QUERY = "MES R PM 1\r\n";
@ -88,19 +65,19 @@ public class CM32Device extends PortSensor<Double> {
if (answer.isEmpty()) { if (answer.isEmpty()) {
this.progressUpdate("No signal"); this.progressUpdate("No signal");
updateState(CONNECTION_STATE, false); updateState(CONNECTED_STATE, false);
return null; return null;
} else if (answer.indexOf("PM1:mbar") < -1) { } else if (answer.indexOf("PM1:mbar") < -1) {
this.progressUpdate("Wrong answer: " + answer); this.progressUpdate("Wrong answer: " + answer);
updateState(CONNECTION_STATE, false); updateState(CONNECTED_STATE, false);
return null; return null;
} else if (answer.substring(14, 17).equals("OFF")) { } else if (answer.substring(14, 17).equals("OFF")) {
this.progressUpdate("Off"); this.progressUpdate("Off");
updateState(CONNECTION_STATE, true); updateState(CONNECTED_STATE, true);
return null; return null;
} else { } else {
this.progressUpdate("OK"); this.progressUpdate("OK");
updateState(CONNECTION_STATE, true); updateState(CONNECTED_STATE, true);
return Double.parseDouble(answer.substring(14, 17) + answer.substring(19, 23)); return Double.parseDouble(answer.substring(14, 17) + answer.substring(19, 23));
} }
} }

View File

@ -57,11 +57,11 @@ public class MKSBaratronDevice extends PortSensor<Double> {
String answer = getHandler().sendAndWait("AV" + getChannel() + "\r", timeout()); String answer = getHandler().sendAndWait("AV" + getChannel() + "\r", timeout());
if (answer == null || answer.isEmpty()) { if (answer == null || answer.isEmpty()) {
// invalidateState("connection"); // invalidateState("connection");
updateState(CONNECTION_STATE, false); updateState(CONNECTED_STATE, false);
this.progressUpdate("No connection"); this.progressUpdate("No connection");
return null; return null;
} else { } else {
updateState(CONNECTION_STATE, true); updateState(CONNECTED_STATE, true);
} }
double res = Double.parseDouble(answer); double res = Double.parseDouble(answer);
if (res <= 0) { if (res <= 0) {

View File

@ -68,18 +68,11 @@ public class MKSVacDevice extends PortSensor<Double> {
@Override @Override
protected Object computeState(String stateName) throws ControlException { protected Object computeState(String stateName) throws ControlException {
if (getHandler() == null) {
notifyError("No port connection", null);
return null;
}
switch (stateName) { switch (stateName) {
case CONNECTION_STATE:
return !talk("T?").isEmpty();
case "power": case "power":
return talk("FP?").equals("ON"); return talk("FP?").equals("ON");
default: default:
notifyError("State not found: " + stateName, null); return super.computeState(stateName);
return null;
} }
} }
@ -97,16 +90,18 @@ public class MKSVacDevice extends PortSensor<Double> {
@Override @Override
public void shutdown() throws ControlException { public void shutdown() throws ControlException {
if (isConnected()) {
setPowerOn(false); setPowerOn(false);
}
super.shutdown(); super.shutdown();
} }
public boolean isPowerOn() { private boolean isPowerOn() {
return getState("power").booleanValue(); return getState("power").booleanValue();
} }
public void setPowerOn(boolean powerOn) throws ControlException { private void setPowerOn(boolean powerOn) throws ControlException {
if (powerOn != isPowerOn()) { if (powerOn != isPowerOn()) {
if (powerOn) { if (powerOn) {
// String ans = talkMKS(p1Port, "@253ENC!OFF;FF"); // String ans = talkMKS(p1Port, "@253ENC!OFF;FF");
@ -155,7 +150,7 @@ public class MKSVacDevice extends PortSensor<Double> {
// if (getState("power").booleanValue()) { // if (getState("power").booleanValue()) {
String answer = talk("PR" + getChannel() + "?"); String answer = talk("PR" + getChannel() + "?");
if (answer == null || answer.isEmpty()) { if (answer == null || answer.isEmpty()) {
invalidateState(CONNECTION_STATE); updateState(CONNECTED_STATE, false);
this.progressUpdate("No connection"); this.progressUpdate("No connection");
return null; return null;
} }
@ -168,9 +163,6 @@ public class MKSVacDevice extends PortSensor<Double> {
this.progressUpdate("OK"); this.progressUpdate("OK");
return res; return res;
} }
// } else {
// return null;
// }
} }
} }

View File

@ -70,7 +70,7 @@ public class MeradatVacDevice extends PortSensor<Double> {
if (answer.isEmpty()) { if (answer.isEmpty()) {
this.progressUpdate("No signal"); this.progressUpdate("No signal");
updateState("connection", false); updateState(CONNECTED_STATE, false);
return null; return null;
} else { } else {
Matcher match = response.matcher(answer); Matcher match = response.matcher(answer);
@ -84,12 +84,12 @@ public class MeradatVacDevice extends PortSensor<Double> {
BigDecimal res = BigDecimal.valueOf(base * Math.pow(10, exp)); BigDecimal res = BigDecimal.valueOf(base * Math.pow(10, exp));
res = res.setScale(4, RoundingMode.CEILING); res = res.setScale(4, RoundingMode.CEILING);
this.progressUpdate("OK"); this.progressUpdate("OK");
updateState("connection", true); updateState(CONNECTED_STATE, true);
return res.doubleValue(); return res.doubleValue();
} }
else { else {
this.progressUpdate("Wrong answer: " + answer); this.progressUpdate("Wrong answer: " + answer);
updateState("connection", false); updateState(CONNECTED_STATE, false);
return null; return null;
} }
} }

View File

@ -39,15 +39,18 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static hep.dataforge.control.devices.PortSensor.CONNECTED_STATE;
/** /**
* @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a> * @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a>
*/ */
@RoleDef(name = Roles.STORAGE_ROLE, objectType = PointListener.class, info = "Storage for acquired points") @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(name = "storing", writable = true, info = "Define if this device is currently writes to storage")
public class VacCollectorDevice extends Sensor<DataPoint> { public class VacCollectorDevice extends Sensor<DataPoint> {
private Map<String, Sensor<Double>> sensorMap = new LinkedHashMap<>(); private Map<String, Sensor<Double>> sensorMap = new LinkedHashMap<>();
private int delay = 5000; private int delay = 5000;
private StorageHelper helper = new StorageHelper(VacCollectorDevice.this, this::buildLoader);
public VacCollectorDevice() { public VacCollectorDevice() {
} }
@ -78,11 +81,7 @@ public class VacCollectorDevice extends Sensor<DataPoint> {
} }
} }
@Override
protected Object computeState(String stateName) throws ControlException {
//TODO add dot path notation for states //TODO add dot path notation for states
return Value.NULL;
}
@Override @Override
protected Measurement<DataPoint> createMeasurement() { protected Measurement<DataPoint> createMeasurement() {
@ -96,7 +95,7 @@ public class VacCollectorDevice extends Sensor<DataPoint> {
} }
public void setDelay(int delay) throws MeasurementException { public void setDelay(int delay) throws MeasurementException {
this.delay = 5000; this.delay = delay;
if (isMeasuring()) { if (isMeasuring()) {
getMeasurement().stop(false); getMeasurement().stop(false);
getMeasurement().start(); getMeasurement().start();
@ -111,6 +110,21 @@ public class VacCollectorDevice extends Sensor<DataPoint> {
} }
} }
private PointLoader buildLoader(StorageConnection connection) {
TableFormatBuilder format = new TableFormatBuilder().setType("timestamp", ValueType.TIME);
getSensors().forEach((s) -> {
format.setType(s.getName(), ValueType.NUMBER);
});
return LoaderFactory.buildPointLoder(connection.getStorage(), "vactms", "", "timestamp", format.build());
}
@Override
public void onMeasurementResult(Measurement<DataPoint> measurement, DataPoint result, Instant time) {
super.onMeasurementResult(measurement, result, time);
helper.push(result);
}
public Collection<Sensor<Double>> getSensors() { public Collection<Sensor<Double>> getSensors() {
return sensorMap.values(); return sensorMap.values();
} }
@ -120,21 +134,19 @@ public class VacCollectorDevice extends Sensor<DataPoint> {
private final ValueCollector collector = new PointCollector(this::result, sensorMap.keySet()); private final ValueCollector collector = new PointCollector(this::result, sensorMap.keySet());
private ScheduledExecutorService executor; private ScheduledExecutorService executor;
private ScheduledFuture<?> currentTask; private ScheduledFuture<?> currentTask;
private StorageHelper helper;
@Override @Override
public void start() { public void start() {
helper = new StorageHelper(VacCollectorDevice.this, this::buildLoader);
executor = Executors executor = Executors
.newSingleThreadScheduledExecutor((Runnable r) -> new Thread(r, "VacuumMeasurement thread")); .newSingleThreadScheduledExecutor((Runnable r) -> new Thread(r, "VacuumMeasurement thread"));
currentTask = executor.scheduleWithFixedDelay(() -> { currentTask = executor.scheduleWithFixedDelay(() -> {
sensorMap.values().forEach((sensor) -> { sensorMap.values().forEach((sensor) -> {
try { try {
Object value; Object value;
if (sensor.optBooleanState("disabled").orElse(false)) { if (sensor.optBooleanState(CONNECTED_STATE).orElse(false)) {
value = null;
} else {
value = sensor.read(); value = sensor.read();
} else {
value = null;
} }
collector.put(sensor.getName(), value); collector.put(sensor.getName(), value);
} catch (Exception ex) { } catch (Exception ex) {
@ -144,6 +156,7 @@ public class VacCollectorDevice extends Sensor<DataPoint> {
}, 0, delay, TimeUnit.MILLISECONDS); }, 0, delay, TimeUnit.MILLISECONDS);
} }
@Override @Override
protected synchronized void result(DataPoint result, Instant time) { protected synchronized void result(DataPoint result, Instant time) {
super.result(result, time); super.result(result, time);
@ -152,15 +165,6 @@ public class VacCollectorDevice extends Sensor<DataPoint> {
}); });
} }
private PointLoader buildLoader(StorageConnection connection) {
TableFormatBuilder format = new TableFormatBuilder().setType("timestamp", ValueType.TIME);
getSensors().forEach((s) -> {
format.setType(s.getName(), ValueType.NUMBER);
});
return LoaderFactory.buildPointLoder(connection.getStorage(), "vactms", "", "timestamp", format.build());
}
private DataPoint terminator() { private DataPoint terminator() {
MapPoint.Builder p = new MapPoint.Builder(); MapPoint.Builder p = new MapPoint.Builder();
p.putValue("timestamp", DateTimeUtils.now()); p.putValue("timestamp", DateTimeUtils.now());

View File

@ -32,6 +32,8 @@ import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import static hep.dataforge.control.devices.PortSensor.CONNECTED_STATE;
/** /**
* @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a> * @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a>
*/ */
@ -40,14 +42,14 @@ public class VacuumeterView extends DeviceViewConnection<Sensor<Double>> impleme
private static final DecimalFormat FORMAT = new DecimalFormat("0.###E0"); private static final DecimalFormat FORMAT = new DecimalFormat("0.###E0");
private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ISO_LOCAL_TIME; private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ISO_LOCAL_TIME;
protected Node node; Node node;
@FXML @FXML
private BorderPane root; private BorderPane root;
@FXML @FXML
protected Label deviceNameLabel; Label deviceNameLabel;
@FXML @FXML
protected Label unitLabel; Label unitLabel;
@FXML @FXML
private Label valueLabel; private Label valueLabel;
@FXML @FXML
@ -59,7 +61,7 @@ public class VacuumeterView extends DeviceViewConnection<Sensor<Double>> impleme
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void accept(Device device, String measurementName, Measurement measurement) { public void accept(Device device, String measurementName, Measurement measurement) {
measurement.addListener(this); measurement.addListener(this);
getDevice().meta().optValue("color").ifPresent(colorValue ->valueLabel.setTextFill(Color.valueOf(colorValue.stringValue()))); getDevice().meta().optValue("color").ifPresent(colorValue -> valueLabel.setTextFill(Color.valueOf(colorValue.stringValue())));
} }
@ -86,9 +88,9 @@ public class VacuumeterView extends DeviceViewConnection<Sensor<Double>> impleme
Platform.runLater(() -> { Platform.runLater(() -> {
unitLabel.setText(getDevice().meta().getString("units", "mbar")); unitLabel.setText(getDevice().meta().getString("units", "mbar"));
deviceNameLabel.setText(getDevice().getName()); deviceNameLabel.setText(getDevice().getName());
disableButton.setSelected(!getDevice().optBooleanState("disabled").orElse(false)); disableButton.setSelected(getDevice().optBooleanState(CONNECTED_STATE).orElse(false));
disableButton.selectedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> { disableButton.selectedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
getDevice().setState("disabled",!newValue); getDevice().setState(CONNECTED_STATE, newValue);
if (!newValue) { if (!newValue) {
valueLabel.setText("---"); valueLabel.setText("---");
} }
@ -133,7 +135,7 @@ public class VacuumeterView extends DeviceViewConnection<Sensor<Double>> impleme
} }
public String getTitle() { String getTitle() {
return getDevice().meta().getString("title", getDevice().getName()); return getDevice().meta().getString("title", getDevice().getName());
} }

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<config> <config>
<storage path="D:/temp/test"/>
<device type="numass:vac"> <device type="numass:vac">
<sensor name="P1" color="red" port="com::/dev/ttyUSB0" sensorType="mks"/> <sensor name="P1" color="red" port="com::/dev/ttyUSB0" sensorType="mks"/>
<sensor name="P2" color="blue" port="tcp::192.168.111.32:4002" sensorType="CM32"/> <sensor name="P2" color="blue" port="tcp::192.168.111.32:4002" sensorType="CM32"/>
<sensor name="P3" color="green" port="tcp::192.168.111.32:4003" sensorType="CM32"/> <sensor name="P3" color="green" port="tcp::192.168.111.32:4003" sensorType="CM32"/>
<!--<sensor name="Px" color="black" port="com::/dev/ttyUSB1" sensorType="meradat"/> -->
<sensor name="Px" color="black" port="tcp::192.168.111.33:4003" sensorType="meradat" address="1"/> <sensor name="Px" color="black" port="tcp::192.168.111.33:4003" sensorType="meradat" address="1"/>
<sensor name="Baratron" color="cyan" port="tcp::192.168.111.33:4004" sensorType="baratron"/> <sensor name="Baratron" color="cyan" port="tcp::192.168.111.33:4004" sensorType="baratron"/>
<!--<sensor name="collector" color="magenta" port="tcp::192.168.111.33:4003" sensorType="meradat" address="5"/>--> <sensor name="collector" color="magenta" port="tcp::192.168.111.33:4003" sensorType="meradat" address="5"/>
</device> </device>
</config> </config>

View File

@ -1,22 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?> <?import javafx.geometry.Insets?>
<?import java.net.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import org.controlsfx.control.*?>
<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import org.controlsfx.control.ToggleSwitch?> <?import org.controlsfx.control.ToggleSwitch?>
<?import java.net.URL?>
<AnchorPane styleClass="vacBox" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1"> <AnchorPane styleClass="vacBox" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1">
<stylesheets> <stylesheets>
<URL value="@/styles/vacstyles.css" /> <URL value="@/styles/vacstyles.css" />
</stylesheets> </stylesheets>
@ -26,7 +15,7 @@
<AnchorPane styleClass="namePane"> <AnchorPane styleClass="namePane">
<children> <children>
<Label id="name" fx:id="deviceNameLabel" alignment="CENTER" prefHeight="40.0" text="device Name" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="50.0" AnchorPane.topAnchor="0.0" /> <Label id="name" fx:id="deviceNameLabel" alignment="CENTER" prefHeight="40.0" text="device Name" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="50.0" AnchorPane.topAnchor="0.0" />
<ToggleSwitch fx:id="disableButton" alignment="CENTER" layoutX="130.0" layoutY="10.0" prefWidth="40.0" selected="true" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="10.0" /> <ToggleSwitch fx:id="disableButton" alignment="CENTER" layoutX="130.0" layoutY="10.0" prefWidth="40.0" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="10.0" />
</children> </children>
</AnchorPane> </AnchorPane>
<Separator /> <Separator />