Package org.yamcs.parameter
Class SystemParametersService
java.lang.Object
com.google.common.util.concurrent.AbstractService
org.yamcs.AbstractYamcsService
org.yamcs.parameter.SystemParametersService
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Runnable,YamcsService
- Direct Known Subclasses:
SystemParametersCollector
Collects each second system processed parameters from whomever registers and sends them on the sys_var stream
Starting with Yamcs 5.5.0, all system parameters have types defined in the MDB. For the basic types (corresponding to scalar values), this class will provide some types (e.g. uint65, float32, etc)
For aggregate, the caller can use the createSystemParameter(String, AggregateParameterType, String) to make
the parameter and also add the corresponding type to the MDB.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
Fields inherited from class org.yamcs.AbstractYamcsService
config, log, serviceName, yamcsInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateEnumeratedParameterType(Class<? extends Enum<?>> enumClass) createEnumeratedSystemParameter(String relativeName, Class<? extends Enum<?>> enumClass, String description) Creates an enumerated system parameter by deducing the possible enumeration states from the java enum.createSystemParameter(String relativeName, Yamcs.Value.Type basicType, String description) createSystemParameter(String relativeName, Yamcs.Value.Type basicType, UnitType unit, String description) Create a system parameter for a basic value type.createSystemParameter(String relativeName, AggregateParameterType type, String description) Creates a system parameter for an aggregate type.static SystemParametercreateSystemParameter(Mdb mdb, String fqn, Value engValue) static SystemParametercreateSystemParameter(Mdb mdb, String fqn, Value engValue, UnitType unit) static SystemParametercreateSystemParameter(Mdb mdb, String fqn, Yamcs.Value.Type basicType, String description) static SystemParametercreateSystemParameter(Mdb mdb, String fqn, Yamcs.Value.Type basicType, UnitType unit, String description) static ParameterTypecreateSystemParameterType(Mdb mdb, String name, Value v, UnitType unit) voiddoStart()voiddoStop()getBasicType(Yamcs.Value.Type type) getBasicType(Yamcs.Value.Type type, UnitType unit) Create (if not already existing) a basic parameter type in the MDB and return it.static SystemParametersServicegetInstance(String instance) getMdb()this is the namespace all system parameters should be instatic ParameterValueDeprecated.static ParameterValuestatic ParameterValueDeprecated.static ParameterValueDeprecated.static ParameterValueDeprecated.static ParameterValueDeprecated.static ParameterValueDeprecated.static ParameterValueDeprecated.static ParameterValuestatic ParameterValuestatic ParameterValuestatic ParameterValuestatic ParameterValuestatic ParameterValuestatic <T extends Enum<T>>
ParameterValuegetSpec()Returns the valid configuration options for this service.static ParameterValuegetUnsignedIntPV(String fqn, long time, int v) Deprecated.static ParameterValuegetUnsignedIntPV(Parameter parameter, long time, int v) voidinit(String yamcsInstance, String serviceName, YConfiguration config) Initialize this service.voidRegister a parameter producer to be called each time the parameters are collectedvoidrun()Run from the timer, collect all parameters and send them on the streamvoidUnregister producer - from now on it will not be invoked.Methods inherited from class org.yamcs.AbstractYamcsService
findStream, getConfig, getYamcsInstanceMethods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Constructor Details
-
SystemParametersService
public SystemParametersService()
-
-
Method Details
-
getSpec
Description copied from interface:YamcsServiceReturns the valid configuration options for this service.- Specified by:
getSpecin interfaceYamcsService- Returns:
- the argument specification, or
nullif the args should not be validated.
-
init
public void init(String yamcsInstance, String serviceName, YConfiguration config) throws InitException Description copied from interface:YamcsServiceInitialize this service. This is called before the service is started. All operations should finish fast.- Specified by:
initin interfaceYamcsService- Overrides:
initin classAbstractYamcsService- Parameters:
yamcsInstance- The yamcs instance, ornullif this is a global service.serviceName- The service name.config- The configured arguments for this service. IfYamcsService.getSpec()is implemented then this contains the arguments after being validated (including any defaults).- Throws:
InitException- When something goes wrong during the execution of this method.
-
getInstance
-
doStart
public void doStart()- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
doStop
public void doStop()- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
run
public void run()Run from the timer, collect all parameters and send them on the stream -
registerProducer
Register a parameter producer to be called each time the parameters are collected -
unregisterProducer
Unregister producer - from now on it will not be invoked. Note that the collector collects parameters into a different thread taking all producer in turns, and there might be one collection already started when this method is called. -
getNamespace
this is the namespace all system parameters should be in- Returns:
- the namespace to be used by the system parameters
-
createSystemParameter
public SystemParameter createSystemParameter(String relativeName, AggregateParameterType type, String description) Creates a system parameter for an aggregate type.If the type has no qualified name, one is set and is added to the MDB. Otherwise it is assumed it already comes from he MDB and it is not added.
- Parameters:
relativeName-type-- Returns:
-
createSystemParameter
public SystemParameter createSystemParameter(String relativeName, Yamcs.Value.Type basicType, UnitType unit, String description) Create a system parameter for a basic value type. The created parameter will have a shared basic parameter type.If the type is aggregate, the method
createSystemParameter(String, AggregateParameterType, String)should be used after making an appropriateAggregateParameterType- Parameters:
relativeName- - the relative name of the parameter, can contain multiple subsystems but cannot start with "/"basicType- - any type except aggregate and array- Returns:
-
createSystemParameter
public SystemParameter createSystemParameter(String relativeName, Yamcs.Value.Type basicType, String description) -
createSystemParameter
-
createSystemParameter
public static SystemParameter createSystemParameter(Mdb mdb, String fqn, Value engValue, UnitType unit) -
createSystemParameter
public static SystemParameter createSystemParameter(Mdb mdb, String fqn, Yamcs.Value.Type basicType, UnitType unit, String description) -
createSystemParameter
public static SystemParameter createSystemParameter(Mdb mdb, String fqn, Yamcs.Value.Type basicType, String description) -
createEnumeratedParameterType
-
createEnumeratedSystemParameter
public SystemParameter createEnumeratedSystemParameter(String relativeName, Class<? extends Enum<?>> enumClass, String description) Creates an enumerated system parameter by deducing the possible enumeration states from the java enum. -
createSystemParameterType
-
getBasicType
-
getBasicType
Create (if not already existing) a basic parameter type in the MDB and return it.Basic type is everything except aggregate and arrays
- Parameters:
type-- Returns:
-
getNewPv
-
getPV
-
getPV
-
getPV
-
getPV
-
getPV
-
getUnsignedIntPV
-
getPV
-
getPV
-
getNewPv
Deprecated. -
getPV
Deprecated. -
getPV
Deprecated. -
getPV
Deprecated. -
getPV
Deprecated. -
getPV
Deprecated. -
getUnsignedIntPV
Deprecated. -
getPV
Deprecated. -
getMdb
-