From 7749dd31deab6a19f1bd1bce3b31cc9d975518e3 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sat, 13 May 2017 21:46:12 +0300 Subject: [PATCH] Server is now a context plugin --- numass-control/control-room/build.gradle | 34 +++++++++ .../inr/numass/control/BoardController.kt | 33 +++++++++ .../kotlin/inr/numass/control/BoardView.kt | 22 ++++++ .../inr/numass/control/DeviceInfoView.kt | 46 ++++++++++++ .../kotlin/inr/numass/control/Indicator.kt | 74 +++++++++++++++++++ .../inr/numass/cryotemp/PKT8Controller.java | 20 +---- .../java/inr/numass/cryotemp/PKT8Device.java | 3 +- .../numass/cryotemp/PKT8DeviceFactory.java | 12 --- .../inr/numass/control/msp/MspDevice.java | 11 ++- .../numass/control/msp/MspDeviceFactory.java | 4 +- .../control/msp/fx/MspViewController.java | 10 --- .../java/inr/numass/readvac/app/ReadVac.java | 68 ++++++++++++----- .../numass/readvac/devices/CM32Device.java | 12 ++- .../readvac/devices/MKSBaratronDevice.java | 11 ++- .../numass/readvac/devices/MKSVacDevice.java | 10 +++ .../numass/readvac/devices/VITVacDevice.java | 13 +++- .../main/java/inr/numass/NumassPlugin.java | 2 +- .../inr/numass/server/NumassRootHandler.java | 4 +- .../numass/server/NumassStorageHandler.java | 4 +- numass-viewer/build.gradle | 13 ++-- settings.gradle | 1 + 21 files changed, 329 insertions(+), 78 deletions(-) create mode 100644 numass-control/control-room/build.gradle create mode 100644 numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt create mode 100644 numass-control/control-room/src/main/kotlin/inr/numass/control/BoardView.kt create mode 100644 numass-control/control-room/src/main/kotlin/inr/numass/control/DeviceInfoView.kt create mode 100644 numass-control/control-room/src/main/kotlin/inr/numass/control/Indicator.kt diff --git a/numass-control/control-room/build.gradle b/numass-control/control-room/build.gradle new file mode 100644 index 00000000..5bacbae4 --- /dev/null +++ b/numass-control/control-room/build.gradle @@ -0,0 +1,34 @@ +plugins{ + id "org.jetbrains.kotlin.jvm" version '1.1.2-2' + id "application" +} + +repositories { + mavenCentral() +} + +if (!hasProperty('mainClass')) { + ext.mainClass = 'inr.numass.viewer.Viewer'//"inr.numass.viewer.test.TestApp" +} + +mainClassName = mainClass + +version = "0.1.0" + +description = "The control room application for numass slow control" + +compileKotlin.kotlinOptions.jvmTarget = "1.8" + +dependencies { + compile project(':numass-core') + compile project(':numass-control') + + compile 'org.controlsfx:controlsfx:8.40.12' + + compile "no.tornado:tornadofx:1.7.4" + compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-2" +} + +apply plugin: 'kotlin' + + 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 new file mode 100644 index 00000000..4f3143be --- /dev/null +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardController.kt @@ -0,0 +1,33 @@ +package inr.numass.control + +import hep.dataforge.context.Context +import hep.dataforge.context.Global +import hep.dataforge.control.devices.Device +import hep.dataforge.meta.Meta +import hep.dataforge.storage.api.Storage +import hep.dataforge.storage.commons.StorageFactory +import inr.numass.client.ClientUtils +import javafx.collections.FXCollections +import javafx.collections.ObservableList +import javafx.scene.Node +import tornadofx.* + +/** + * Created by darksnake on 12-May-17. + */ +class BoardController(val context: Context = Global.instance(), val meta: Meta) : Controller() { + val devices: ObservableList> = FXCollections.observableArrayList>(); + + val storage: Storage? by lazy { + if (meta.hasMeta("storage")) { + val numassRun = ClientUtils.getRunName(meta) + var storage = StorageFactory.buildStorage(context, meta.getMeta("storage")); + if(! numassRun.isEmpty()){ + storage = storage.buildShelf(numassRun, Meta.empty()); + } + return@lazy storage; + } else { + return@lazy null; + } + } +} \ No newline at end of file diff --git a/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardView.kt b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardView.kt new file mode 100644 index 00000000..2e70a4ac --- /dev/null +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/BoardView.kt @@ -0,0 +1,22 @@ +package inr.numass.control + +import javafx.scene.layout.VBox +import tornadofx.* + +/** + * Created by darksnake on 11-May-17. + */ +class BoardView : View("Numass control board") { + private var deviceList: VBox by singleAssign(); + private val controller: BoardController by inject(); + + override val root = borderpane { + center { + deviceList = vbox { + bindChildren(controller.devices) { DeviceInfoView(it).root } + } + + } + } + +} diff --git a/numass-control/control-room/src/main/kotlin/inr/numass/control/DeviceInfoView.kt b/numass-control/control-room/src/main/kotlin/inr/numass/control/DeviceInfoView.kt new file mode 100644 index 00000000..14e3665f --- /dev/null +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/DeviceInfoView.kt @@ -0,0 +1,46 @@ +package inr.numass.control + +import hep.dataforge.control.devices.Device +import hep.dataforge.fx.FXObject +import hep.dataforge.fx.fragments.FragmentWindow +import javafx.beans.property.SimpleObjectProperty +import javafx.scene.Node +import javafx.scene.control.ToggleButton +import tornadofx.* + +/** + * A simple device indicator board + * Created by darksnake on 11-May-17. + */ +class DeviceInfoView(val device: Device, node: Node? = null) : Fragment(device.name) { + + constructor(pair: Pair) : this(pair.first, pair.second); + + val deviceNode = SimpleObjectProperty(); + + var viewButton: ToggleButton by singleAssign(); + + override val root = hbox { + label(device.name) + add(Indicator.build(device, Device.INITIALIZED_STATE).fxNode) + viewButton = togglebutton("View") { + disableProperty().bind(deviceNode.isNull); + } + } + + init { + FragmentWindow(hep.dataforge.fx.fragments.Fragment.buildFromNode(device.name) { deviceNode.get() }) + + if (node != null) { + deviceNode.set(node); + } else if (device is FXObject) { + deviceNode.set(device.fxNode) + } + } + + fun setDeviceView(node: Node) { + deviceNode.set(node); + } +} + + diff --git a/numass-control/control-room/src/main/kotlin/inr/numass/control/Indicator.kt b/numass-control/control-room/src/main/kotlin/inr/numass/control/Indicator.kt new file mode 100644 index 00000000..9b68c75b --- /dev/null +++ b/numass-control/control-room/src/main/kotlin/inr/numass/control/Indicator.kt @@ -0,0 +1,74 @@ +package inr.numass.control + +import hep.dataforge.control.connections.DeviceConnection +import hep.dataforge.control.devices.Device +import hep.dataforge.control.devices.DeviceListener +import hep.dataforge.fx.FXObject +import hep.dataforge.values.Value +import javafx.beans.binding.ObjectBinding +import javafx.scene.Node +import javafx.scene.paint.Color +import javafx.scene.paint.Paint +import javafx.scene.shape.Circle + +/** + * Lamp-like indicator + * + * TODO move to general kotlin FX utils + * Created by darksnake on 12-May-17. + */ +open class Indicator(val state: String) : FXObject, DeviceConnection(), DeviceListener { + private val color = object : ObjectBinding() { + override fun computeValue(): Paint { + val value = device.getState(state); + return compute(value); + } + } + private val indicator = Circle(); + + init { + indicator.fillProperty().bind(color); + } + + protected open fun compute(value: Value): Paint { + if (value.booleanValue()) { + return Color.GREEN; + } else { + return Color.GRAY; + } + } + + override fun getFXNode(): Node { + return indicator; + } + + override fun notifyDeviceStateChanged(device: Device?, name: String?, value: Value?) { + if (name == state) { + color.invalidate(); + } + } + + companion object { + /** + * Build an indicator + */ + fun build(device: Device, state: String): Indicator { + val indicator = Indicator(state); + device.connect(indicator); + return indicator; + } + + /** + * Build an indicator with the custom color builder + */ + fun build(device: Device, state: String, func: (Value)-> Paint): Indicator { + val indicator = object:Indicator(state){ + override fun compute(value: Value): Paint { + return func(value); + } + }; + device.connect(indicator); + return indicator; + } + } +} diff --git a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Controller.java b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Controller.java index 910d8421..9f303e17 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Controller.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8Controller.java @@ -1,7 +1,6 @@ package inr.numass.cryotemp; import hep.dataforge.control.connections.DeviceConnection; -import hep.dataforge.control.devices.Device; import hep.dataforge.control.devices.DeviceListener; import hep.dataforge.control.measurements.Measurement; import hep.dataforge.control.measurements.MeasurementListener; @@ -9,7 +8,6 @@ import hep.dataforge.exceptions.ControlException; import hep.dataforge.exceptions.MeasurementException; import hep.dataforge.fx.fragments.FragmentWindow; import hep.dataforge.fx.fragments.LogFragment; -import hep.dataforge.values.Value; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -82,22 +80,12 @@ public class PKT8Controller extends DeviceConnection implements Init } - @Override - public void notifyDeviceStateChanged(Device device, String name, Value state) { - } - - @Override - public void evaluateDeviceException(Device device, String message, Throwable exception) { - - } - - - public void start() throws MeasurementException { + private void startMeasurement() throws MeasurementException { getDevice().startMeasurement().addListener(this); } - public void stop() throws MeasurementException { + private void stopMeasurement() throws MeasurementException { if (getDevice().isMeasuring()) { getDevice().getMeasurement().removeListener(this); getDevice().stopMeasurement(false); @@ -110,10 +98,10 @@ public class PKT8Controller extends DeviceConnection implements Init if (getDevice() != null) { try { if (startStopButton.isSelected()) { - start(); + startMeasurement(); } else { //in case device started - stop(); + stopMeasurement(); } } catch (ControlException ex) { evaluateDeviceException(getDevice(), "Failed to start or stop device", ex); 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 d17c6600..10017916 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 @@ -71,7 +71,8 @@ public class PKT8Device extends PortSensor { public PKT8Device(Context context, Meta meta) { - + setContext(context); + setMetaBase(meta); } @Override diff --git a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8DeviceFactory.java b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8DeviceFactory.java index b0bc25f2..6f3274f2 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8DeviceFactory.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8DeviceFactory.java @@ -1,13 +1,9 @@ package inr.numass.cryotemp; import hep.dataforge.context.Context; -import hep.dataforge.control.connections.Connection; -import hep.dataforge.control.connections.Roles; import hep.dataforge.control.devices.DeviceFactory; import hep.dataforge.meta.Meta; -import java.util.Objects; - /** * Created by darksnake on 09-May-17. */ @@ -22,12 +18,4 @@ public class PKT8DeviceFactory implements DeviceFactory { return new PKT8Device(context, meta); } - @Override - public Connection buildConnection(String role, Context context, Meta meta) { - if(Objects.equals(role, Roles.VIEW_ROLE)){ - return new PKT8Controller(); - } else { - return DeviceFactory.super.buildConnection(role, context, meta); - } - } } 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 8980c155..2087af02 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 @@ -15,6 +15,7 @@ */ package inr.numass.control.msp; +import hep.dataforge.context.Context; import hep.dataforge.control.connections.Roles; import hep.dataforge.control.connections.StorageConnection; import hep.dataforge.control.devices.SingleMeasurementDevice; @@ -61,7 +62,15 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po private Consumer responseDelegate; private Consumer errorDelegate; -// public MspDevice(String name, Context context, Meta config) { + public MspDevice() { + } + + public MspDevice(Context context, Meta meta) { + setContext(context); + setMetaBase(meta); + } + + // public MspDevice(String name, Context context, Meta config) { // super(name, context, config); // } @Override diff --git a/numass-control/msp/src/main/java/inr/numass/control/msp/MspDeviceFactory.java b/numass-control/msp/src/main/java/inr/numass/control/msp/MspDeviceFactory.java index b9aa98d6..fafc22cd 100644 --- a/numass-control/msp/src/main/java/inr/numass/control/msp/MspDeviceFactory.java +++ b/numass-control/msp/src/main/java/inr/numass/control/msp/MspDeviceFactory.java @@ -15,9 +15,7 @@ public class MspDeviceFactory implements DeviceFactory { @Override public MspDevice build(Context context, Meta config) { - MspDevice device = new MspDevice(); - device.setContext(context); - device.configure(config); + MspDevice device = new MspDevice(context,config); return device; } } 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 7d4be673..37c58325 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 @@ -348,16 +348,6 @@ public class MspViewController extends DeviceConnection implements De } } - @Override - public void notifyDeviceInitialized(Device device) { - - } - - @Override - public void notifyDeviceShutdown(Device device) { - - } - @Override public void notifyDeviceStateChanged(Device device, String name, Value state) { diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/app/ReadVac.java b/numass-control/vac/src/main/java/inr/numass/readvac/app/ReadVac.java index f7e152a9..c84a9a48 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/app/ReadVac.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/app/ReadVac.java @@ -5,6 +5,8 @@ */ package inr.numass.readvac.app; +import hep.dataforge.context.Context; +import hep.dataforge.context.Global; import hep.dataforge.control.measurements.Sensor; import hep.dataforge.exceptions.StorageException; import hep.dataforge.io.MetaFileReader; @@ -56,26 +58,52 @@ public class ReadVac extends Application { config = Meta.empty(); } - Sensor p1 = new MKSVacDevice(); - p1.configure(config.getMeta("p1", - () -> new MetaBuilder("p1").setValue("port", "com::/dev/ttyUSB0"))); - p1.setName(config.getString("p1.name", "P1")); - Sensor p2 = new CM32Device(); - p2.configure(config.getMeta("p2", - () -> new MetaBuilder("p2").setValue("port", "tcp::192.168.111.32:4002"))); - p2.setName(config.getString("p2.name", "P2")); - Sensor p3 = new CM32Device(); - p3.configure(config.getMeta("p3", - () -> new MetaBuilder("p3").setValue("port", "tcp::192.168.111.32:4003"))); - p3.setName(config.getString("p3.name", "P3")); - Sensor px = new VITVacDevice(); - px.configure(config.getMeta("px", - () -> new MetaBuilder("px").setValue("port", "tcp::192.168.111.32:4003"))); - px.setName(config.getString("px.name", "Px")); - Sensor baratron = new MKSBaratronDevice(); - baratron.configure(config.getMeta("baratron", - () -> new MetaBuilder("baratron").setValue("port", "tcp::192.168.111.33:4004"))); - baratron.setName(config.getString("baratron.name", "Baratron")); + Context context = Global.instance(); + + Meta p1Meta = config.getMeta("p1", + new MetaBuilder("p1") + .setValue("port", "com::/dev/ttyUSB0") + .setValue("name", "P1") + .build() + ); + + Sensor p1 = new MKSVacDevice(context, p1Meta); + + Meta p2Meta = config.getMeta("p2", + new MetaBuilder("p2") + .setValue("port", "tcp::192.168.111.32:4002") + .setValue("name", "P2") + .build() + ); + + Sensor p2 = new CM32Device(context,p2Meta); + + Meta p3Meta = config.getMeta("p3", + new MetaBuilder("p3") + .setValue("port", "tcp::192.168.111.32:4003") + .setValue("name", "P3") + .build() + ); + + Sensor p3 = new CM32Device(context, p3Meta); + + Meta pxMeta = config.getMeta("px", + new MetaBuilder("px") + .setValue("port", "tcp::192.168.111.32:4003") + .setValue("name", "Px") + .build() + ); + + Sensor px = new VITVacDevice(context,pxMeta); + + Meta baratronMeta = config.getMeta("baratron", + new MetaBuilder("baratron") + .setValue("port", "tcp::192.168.111.33:4004") + .setValue("name", "Baratron") + .build() + ); + + Sensor baratron = new MKSBaratronDevice(context,baratronMeta); VacCollectorDevice collector = new VacCollectorDevice(); collector.configure(config); diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/devices/CM32Device.java b/numass-control/vac/src/main/java/inr/numass/readvac/devices/CM32Device.java index 67d3c607..840fd6e3 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/devices/CM32Device.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/devices/CM32Device.java @@ -5,6 +5,7 @@ */ package inr.numass.readvac.devices; +import hep.dataforge.context.Context; import hep.dataforge.control.devices.PortSensor; import hep.dataforge.control.measurements.Measurement; import hep.dataforge.control.measurements.SimpleMeasurement; @@ -13,15 +14,22 @@ import hep.dataforge.control.ports.PortFactory; import hep.dataforge.control.ports.PortHandler; import hep.dataforge.description.ValueDef; import hep.dataforge.exceptions.ControlException; +import hep.dataforge.meta.Meta; /** - * * @author Alexander Nozik */ @ValueDef(name = "port") @ValueDef(name = "delay") @ValueDef(name = "timeout") public class CM32Device extends PortSensor { + public CM32Device() { + } + + public CM32Device(Context context, Meta meta) { + setContext(context); + setMetaBase(meta); + } @Override protected PortHandler buildHandler(String portName) throws ControlException { @@ -46,7 +54,7 @@ public class CM32Device extends PortSensor { return meta().getString("type", "Leibold CM32"); } -// @Override + // @Override // protected int timeout() { // return meta().getInt("timeout", 1000); // } diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSBaratronDevice.java b/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSBaratronDevice.java index aa878e9c..a7109e1c 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSBaratronDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/devices/MKSBaratronDevice.java @@ -5,20 +5,29 @@ */ package inr.numass.readvac.devices; +import hep.dataforge.context.Context; import hep.dataforge.control.devices.PortSensor; import hep.dataforge.control.measurements.Measurement; 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.meta.Meta; /** - * * @author Alexander Nozik */ @ValueDef(name = "channel") public class MKSBaratronDevice extends PortSensor { + public MKSBaratronDevice() { + } + + public MKSBaratronDevice(Context context, Meta meta) { + setContext(context); + setMetaBase(meta); + } + @Override protected Measurement createMeasurement() { 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 0c8a2800..0dc4d9f6 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 @@ -5,12 +5,14 @@ */ package inr.numass.readvac.devices; +import hep.dataforge.context.Context; import hep.dataforge.control.devices.PortSensor; import hep.dataforge.control.measurements.Measurement; 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.meta.Meta; import javafx.beans.property.BooleanProperty; import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder; @@ -26,6 +28,14 @@ import java.util.regex.Pattern; @ValueDef(name = "powerButton", type = "BOOLEAN", def = "true") public class MKSVacDevice extends PortSensor { + public MKSVacDevice() { + } + + public MKSVacDevice(Context context, Meta meta) { + setContext(context); + setMetaBase(meta); + } + private String talk(String requestContent) throws ControlException { String answer = getHandler().sendAndWait(String.format("@%s%s;FF", getDeviceAddress(), requestContent), timeout()); diff --git a/numass-control/vac/src/main/java/inr/numass/readvac/devices/VITVacDevice.java b/numass-control/vac/src/main/java/inr/numass/readvac/devices/VITVacDevice.java index b6ff7482..0150ed79 100644 --- a/numass-control/vac/src/main/java/inr/numass/readvac/devices/VITVacDevice.java +++ b/numass-control/vac/src/main/java/inr/numass/readvac/devices/VITVacDevice.java @@ -5,11 +5,13 @@ */ package inr.numass.readvac.devices; +import hep.dataforge.context.Context; import hep.dataforge.control.devices.PortSensor; import hep.dataforge.control.measurements.Measurement; import hep.dataforge.control.measurements.SimpleMeasurement; import hep.dataforge.control.ports.PortHandler; import hep.dataforge.exceptions.ControlException; +import hep.dataforge.meta.Meta; import java.math.BigDecimal; import java.math.RoundingMode; @@ -17,14 +19,21 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * * @author Alexander Nozik */ public class VITVacDevice extends PortSensor { + public VITVacDevice() { + } + + public VITVacDevice(Context context, Meta meta) { + setContext(context); + setMetaBase(meta); + } + @Override protected PortHandler buildHandler(String portName) throws ControlException { - PortHandler newHandler = super.buildHandler(portName); + PortHandler newHandler = super.buildHandler(portName); newHandler.setDelimeter("\r\n"); return newHandler; } diff --git a/numass-main/src/main/java/inr/numass/NumassPlugin.java b/numass-main/src/main/java/inr/numass/NumassPlugin.java index bd87e6bc..561ff11a 100644 --- a/numass-main/src/main/java/inr/numass/NumassPlugin.java +++ b/numass-main/src/main/java/inr/numass/NumassPlugin.java @@ -45,7 +45,7 @@ import org.apache.commons.math3.util.FastMath; */ @PluginDef(group = "inr.numass", name = "numass", dependsOn = {"hep.dataforge:math", "hep.dataforge:MINUIT"}, - description = "Numass data analysis tools") + info = "Numass data analysis tools") public class NumassPlugin extends BasicPlugin { /** diff --git a/numass-server/src/main/java/inr/numass/server/NumassRootHandler.java b/numass-server/src/main/java/inr/numass/server/NumassRootHandler.java index 59d1b315..c638f245 100644 --- a/numass-server/src/main/java/inr/numass/server/NumassRootHandler.java +++ b/numass-server/src/main/java/inr/numass/server/NumassRootHandler.java @@ -6,11 +6,11 @@ package inr.numass.server; import freemarker.template.Template; +import hep.dataforge.server.ServletUtils; import hep.dataforge.storage.api.Loader; import hep.dataforge.storage.api.StateLoader; import hep.dataforge.storage.api.Storage; import hep.dataforge.storage.commons.JSONMetaWriter; -import hep.dataforge.storage.servlet.ServletUtils; import org.slf4j.LoggerFactory; import ratpack.handling.Context; import ratpack.handling.Handler; @@ -19,7 +19,7 @@ import java.io.StringWriter; import java.util.HashMap; import java.util.Map; -import static hep.dataforge.storage.servlet.StorageRenderer.renderStorage; +import static hep.dataforge.server.StorageRenderer.renderStorage; import static inr.numass.server.HandlerUtils.renderStates; /** diff --git a/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java b/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java index b7b45f1f..5a3a4daa 100644 --- a/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java +++ b/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java @@ -7,11 +7,11 @@ package inr.numass.server; import freemarker.template.Template; import hep.dataforge.meta.MetaBuilder; +import hep.dataforge.server.ServletUtils; +import hep.dataforge.server.StorageRatpackHandler; import hep.dataforge.storage.api.ObjectLoader; import hep.dataforge.storage.api.PointLoader; import hep.dataforge.storage.api.Storage; -import hep.dataforge.storage.servlet.ServletUtils; -import hep.dataforge.storage.servlet.StorageRatpackHandler; import inr.numass.data.NumassData; import org.slf4j.LoggerFactory; import ratpack.handling.Context; diff --git a/numass-viewer/build.gradle b/numass-viewer/build.gradle index cd5d5ea4..bc1cdf69 100644 --- a/numass-viewer/build.gradle +++ b/numass-viewer/build.gradle @@ -3,9 +3,15 @@ plugins{ id "application" } +repositories { + mavenCentral() +} + + if (!hasProperty('mainClass')) { ext.mainClass = 'inr.numass.viewer.Viewer'//"inr.numass.viewer.test.TestApp" } + mainClassName = mainClass version = "0.4.0" @@ -22,10 +28,7 @@ dependencies { compile 'org.controlsfx:controlsfx:8.40.12' compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:'1.1.2-2" - compile "no.tornado:tornadofx:1.7.1" + compile "no.tornado:tornadofx:1.7.4" } -apply plugin: 'kotlin' -repositories { - mavenCentral() -} + diff --git a/settings.gradle b/settings.gradle index 707c6e8a..0e0c5581 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,6 +5,7 @@ include ":numass-control:cryotemp" include ":numass-control:magnet" include ":numass-control:msp" include ":numass-control:vac" +include ":numass-control:control-room" // include ":numass-main" //