From 81dfdb8cf1c5a3ef8b30a3c0d83b70b50b7fb84b Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 12 Apr 2019 17:01:31 +0200 Subject: [PATCH] Progress --- StatusServer.iml | 2 +- pom.xml | 2 +- .../java/wpn/hdri/ss/tango/StatusServer2.java | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/StatusServer.iml b/StatusServer.iml index b54c1b5..05f1be6 100644 --- a/StatusServer.iml +++ b/StatusServer.iml @@ -33,7 +33,7 @@ - + diff --git a/pom.xml b/pom.xml index 976af94..ade2159 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ de.hzg.wpi.tango tango-server-bom - 15 + 17 pom import diff --git a/src/main/java/wpn/hdri/ss/tango/StatusServer2.java b/src/main/java/wpn/hdri/ss/tango/StatusServer2.java index cd86dc6..f51b78f 100644 --- a/src/main/java/wpn/hdri/ss/tango/StatusServer2.java +++ b/src/main/java/wpn/hdri/ss/tango/StatusServer2.java @@ -20,10 +20,7 @@ import org.tango.client.ez.data.type.TangoDataType; import org.tango.client.ez.data.type.TangoDataTypes; import org.tango.client.ez.data.type.UnknownTangoDataType; -import org.tango.server.InvocationContext; -import org.tango.server.ServerManager; -import org.tango.server.ServerManagerUtils; -import org.tango.server.StateMachineBehavior; +import org.tango.server.*; import org.tango.server.annotation.Attribute; import org.tango.server.annotation.*; import org.tango.server.attribute.AttributeConfiguration; @@ -78,20 +75,21 @@ public void setDynamicManager(DynamicManager manager) { this.dynamicManager = manager; } - @State + @State(isPolled = true) private DeviceState state; public DeviceState getState() { return state; } + @Status(isPolled = true) + private String status; + public void setState(DeviceState state) { this.state = state; + new ChangeEventPusher<>("State", state, deviceManager).run(); } - @Status - private String status; - public String getStatus() { return status; @@ -99,6 +97,7 @@ public String getStatus() { public void setStatus(String status) { this.status = status; + new ChangeEventPusher<>("Status", status, deviceManager).run(); } @@ -240,9 +239,10 @@ public PipeValue getPipe(){ long lastTimestamp = ctx.lastTimestamp; ctx.lastTimestamp = System.currentTimeMillis(); - return new PipeValue( + PipeValue value = new PipeValue( (PipeBlob) OutputType.PIPE.toType( engine.getStorage().getAllRecords().getRange(lastTimestamp), ctx)); + return value; } @Command