Package org.yamcs.parameter
Class LocalParameterManager
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.AbstractProcessorService
-
- org.yamcs.parameter.LocalParameterManager
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,ParameterProvider
,SoftwareParameterManager
,ProcessorService
public class LocalParameterManager extends AbstractProcessorService implements SoftwareParameterManager, ParameterProvider
Implements software parameters - these are parameters that can be set from the clients. All the parameters are sent from the executor thread.
-
-
Field Summary
-
Fields inherited from class org.yamcs.AbstractProcessorService
config, log, processor
-
-
Constructor Summary
Constructors Constructor Description LocalParameterManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameterListener(ParameterListener parameterListener)
boolean
canProvide(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Returns whether or not a given parameter can be provided by this providerboolean
canProvide(Parameter param)
protected void
doStart()
protected void
doStop()
Parameter
getParameter(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Returns the parameterDefinition corresponding to the parameter idvoid
init(Processor proc, YConfiguration config, Object spec)
void
setParameterListener(ParameterListener parameterListener)
Send parameters to this listener.void
startProviding(Parameter paramDef)
Adds a new parameter to the list of parameters that have to providedvoid
startProvidingAll()
start providing all known parametersvoid
stopProviding(Parameter paramDef)
Removes a parameter from the list of parameters that have to be providedvoid
updateParameter(Parameter p, Value engValue)
Updates a parameter just with the engineering valuevoid
updateParameters(List<ParameterValue> pvList)
update the list of parameters. - resolves NamedObjectId -> Parameter - sends the result to PRM-
Methods inherited from class org.yamcs.AbstractProcessorService
getConfig, getYamcsInstance
-
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.yamcs.ProcessorService
getSpec
-
-
-
-
Method Detail
-
init
public void init(Processor proc, YConfiguration config, Object spec)
- Specified by:
init
in interfaceProcessorService
- Overrides:
init
in classAbstractProcessorService
config
- service configuration as specified in processor.yamlspec
- passed by the user when creating the processor (for instance via the REST API)
-
setParameterListener
public void setParameterListener(ParameterListener parameterListener)
Description copied from interface:ParameterProvider
Send parameters to this listener. Normally is the channel.parameterRequestManager but something different may be used for unit tests or special applications (PacketViewer)- Specified by:
setParameterListener
in interfaceParameterProvider
-
addParameterListener
public void addParameterListener(ParameterListener parameterListener)
-
updateParameters
public void updateParameters(List<ParameterValue> pvList)
update the list of parameters. - resolves NamedObjectId -> Parameter - sends the result to PRM- Specified by:
updateParameters
in interfaceSoftwareParameterManager
-
updateParameter
public void updateParameter(Parameter p, Value engValue)
Updates a parameter just with the engineering value- Specified by:
updateParameter
in interfaceSoftwareParameterManager
-
startProviding
public void startProviding(Parameter paramDef)
Description copied from interface:ParameterProvider
Adds a new parameter to the list of parameters that have to provided- Specified by:
startProviding
in interfaceParameterProvider
-
startProvidingAll
public void startProvidingAll()
Description copied from interface:ParameterProvider
start providing all known parameters- Specified by:
startProvidingAll
in interfaceParameterProvider
-
stopProviding
public void stopProviding(Parameter paramDef)
Description copied from interface:ParameterProvider
Removes a parameter from the list of parameters that have to be provided- Specified by:
stopProviding
in interfaceParameterProvider
-
canProvide
public boolean canProvide(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Description copied from interface:ParameterProvider
Returns whether or not a given parameter can be provided by this provider- Specified by:
canProvide
in interfaceParameterProvider
- Returns:
-
getParameter
public Parameter getParameter(org.yamcs.protobuf.Yamcs.NamedObjectId paraId) throws InvalidIdentification
Description copied from interface:ParameterProvider
Returns the parameterDefinition corresponding to the parameter id- Specified by:
getParameter
in interfaceParameterProvider
- Parameters:
paraId
- - id of the parameter that is returned- Returns:
- Throws:
InvalidIdentification
-
canProvide
public boolean canProvide(Parameter param)
- Specified by:
canProvide
in interfaceParameterProvider
-
doStart
protected void doStart()
- Specified by:
doStart
in classcom.google.common.util.concurrent.AbstractService
-
doStop
protected void doStop()
- Specified by:
doStop
in classcom.google.common.util.concurrent.AbstractService
-
-