Moving msp to kotlin
This commit is contained in:
commit
203c02bf53
@ -38,7 +38,7 @@ class BoardController() : Controller(), AutoCloseable {
|
||||
|
||||
fun load(app: Application) {
|
||||
runAsync {
|
||||
NumassControlUtils.getConfig(app).ifPresent {
|
||||
getConfig(app).ifPresent {
|
||||
val libDir = File(app.parameters.named.getOrDefault("libPath", "../lib"));
|
||||
val contextBuilder = Context
|
||||
.builder("NUMASS-SERVER");
|
||||
|
@ -13,7 +13,7 @@ class ServerApp : App(BoardView::class) {
|
||||
override fun start(stage: Stage) {
|
||||
controller.load(this)
|
||||
super.start(stage)
|
||||
NumassControlUtils.setDFStageIcon(stage)
|
||||
setDFStageIcon(stage)
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
|
@ -47,6 +47,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* A device controller for Dubna PKT 8 cryogenic thermometry device
|
||||
*
|
||||
|
@ -26,6 +26,7 @@ import java.util.function.Predicate
|
||||
* Created by darksnake on 08-May-17.
|
||||
*/
|
||||
val DEFAULT_CONFIG_LOCATION = "./numass-control.xml"
|
||||
val STORING_STATE = "storing"
|
||||
val dfIcon: Image = Image(Global::class.java.getResourceAsStream("/img/df.png"))
|
||||
|
||||
/**
|
||||
@ -114,4 +115,3 @@ fun setDFStageIcon(stage: Stage) {
|
||||
stage.icons.add(dfIcon)
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,13 +22,15 @@ import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static hep.dataforge.values.ValueType.BOOLEAN;
|
||||
|
||||
/**
|
||||
* @author Alexander Nozik
|
||||
*/
|
||||
@ValueDef(name = "address", def = "253")
|
||||
@ValueDef(name = "channel", def = "5")
|
||||
@ValueDef(name = "powerButton", type = "BOOLEAN", def = "true")
|
||||
@StateDef(name = "power", writable = true, info = "Device powered up")
|
||||
@ValueDef(name = "powerButton", type = {BOOLEAN}, def = "true")
|
||||
@StateDef(value = @ValueDef(name = "power", info = "Device powered up"), writable = true)
|
||||
public class MKSVacDevice extends PortSensor<Double> {
|
||||
|
||||
public MKSVacDevice() {
|
||||
|
@ -21,10 +21,12 @@ import java.math.RoundingMode;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static hep.dataforge.values.ValueType.NUMBER;
|
||||
|
||||
/**
|
||||
* @author Alexander Nozik
|
||||
*/
|
||||
@ValueDef(name = "address", type = "NUMBER", def = "1", info = "A modbus address")
|
||||
@ValueDef(name = "address", type = {NUMBER}, def = "1", info = "A modbus address")
|
||||
public class MeradatVacDevice extends PortSensor<Double> {
|
||||
private static final String REQUEST = "0300000002";
|
||||
|
||||
|
@ -16,6 +16,7 @@ import hep.dataforge.control.devices.Sensor;
|
||||
import hep.dataforge.control.devices.StateDef;
|
||||
import hep.dataforge.control.measurements.AbstractMeasurement;
|
||||
import hep.dataforge.control.measurements.Measurement;
|
||||
import hep.dataforge.description.ValueDef;
|
||||
import hep.dataforge.exceptions.ControlException;
|
||||
import hep.dataforge.exceptions.MeasurementException;
|
||||
import hep.dataforge.meta.Meta;
|
||||
@ -45,7 +46,10 @@ import static hep.dataforge.control.devices.PortSensor.CONNECTED_STATE;
|
||||
* @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a>
|
||||
*/
|
||||
@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(
|
||||
value = @ValueDef(name = "storing", info = "Define if this device is currently writes to storage"),
|
||||
writable = true
|
||||
)
|
||||
public class VacCollectorDevice extends Sensor<DataPoint> {
|
||||
|
||||
private Map<String, Sensor<Double>> sensorMap = new LinkedHashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user