Package org.km3net.clb.remote
Class CmdLogicBoard
- java.lang.Object
-
- org.km3net.clb.remote.Control.CommandGroup
-
- org.km3net.clb.remote.CmdLogicBoard
-
public class CmdLogicBoard extends Control.CommandGroup
-
-
Field Summary
Fields Modifier and Type Field Description EventDispenser<ClbState>
stateChange
EventDispenser<java.util.Map<java.lang.Integer,Var>>
varUpdate
Event dispenser for the variable update task.-
Fields inherited from class org.km3net.clb.remote.Control.CommandGroup
ctl, msg
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmdLogicBoard(Control ctl, MessageProcessor msg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response<java.lang.Void>
event(ClbEvent event)
Initiates a subsystem change to the specified state.Response<ClbError>
getCurrentError()
Response<ClbState>
getState()
Returns the current CLB state.Response<Var>
getVar(int varId)
Response<java.util.Map<java.lang.Integer,Var>>
getVars(int... varIds)
Queries the CLB for a number of variables.void
mcEvent(ClbEvent event)
void
mcSchEvent(ClbEvent event, long ts)
Response<java.lang.Void>
schEvent(ClbEvent event, long ts)
Response<java.lang.Void>
setVar(int varId, java.lang.Object obj)
Response<java.lang.Void>
setVars(java.util.Map<java.lang.Integer,java.lang.Object> toModify)
Sets the value to a number of variables.Response<java.lang.Void>
subscribeVars(int... varIds)
Subscribes to a number of variables.Response<java.lang.Void>
subscribeVars(int iv, int... varIds)
Subscribes to a number of variables with a single rate, or interval.Response<java.lang.Void>
unsubscribeVars(int[] varIds)
Unsubscribes to a number of variables.
-
-
-
Field Detail
-
stateChange
public final EventDispenser<ClbState> stateChange
-
varUpdate
public final EventDispenser<java.util.Map<java.lang.Integer,Var>> varUpdate
Event dispenser for the variable update task. Can be used like this: sys.update.add(new MessageEventHandler() { void handleEvent(MessageContext context, Map<Integer, Object> values) { System.out.println("Variable update"); } });
-
-
Constructor Detail
-
CmdLogicBoard
protected CmdLogicBoard(Control ctl, MessageProcessor msg)
-
-
Method Detail
-
event
public Response<java.lang.Void> event(ClbEvent event)
Initiates a subsystem change to the specified state.- Parameters:
event
- Te even tto issue- Returns:
- A void response.
-
mcEvent
public void mcEvent(ClbEvent event)
-
mcSchEvent
public void mcSchEvent(ClbEvent event, long ts)
-
getState
public Response<ClbState> getState()
Returns the current CLB state.- Returns:
- Current state.
-
subscribeVars
public Response<java.lang.Void> subscribeVars(int... varIds)
Subscribes to a number of variables. In this case these variables are send each second.- Parameters:
varIds
- A list of variable IDs.- Returns:
- A void response
-
subscribeVars
public Response<java.lang.Void> subscribeVars(int iv, int... varIds)
Subscribes to a number of variables with a single rate, or interval. Multiple calls for different variables may be invoked.- Parameters:
iv
- interval in seconds (1 to 127)varIds
- A list of variable IDs.- Returns:
- A void response
-
unsubscribeVars
public Response<java.lang.Void> unsubscribeVars(int[] varIds)
Unsubscribes to a number of variables. In this case these variables are send each second.- Parameters:
varIds
- A list of variable IDs.- Returns:
- A void response
-
getVars
public Response<java.util.Map<java.lang.Integer,Var>> getVars(int... varIds)
Queries the CLB for a number of variables.- Parameters:
varIds
- A list of variable IDs.- Returns:
- A map of variableID / value objects.
-
setVars
public Response<java.lang.Void> setVars(java.util.Map<java.lang.Integer,java.lang.Object> toModify)
Sets the value to a number of variables.- Parameters:
toModify
- A map of varID / value association.- Returns:
- A void response
-
setVar
public Response<java.lang.Void> setVar(int varId, java.lang.Object obj)
-
-