Package org.yamcs.algorithms
Class AbstractAlgorithmExecutor
java.lang.Object
org.yamcs.algorithms.AbstractAlgorithmExecutor
- All Implemented Interfaces:
AlgorithmExecutor
- Direct Known Subclasses:
AbstractJavaExprExecutor
,MathAlgorithmExecutor
,ScriptAlgorithmExecutor
Skeleton implementation for algorithms conforming to the XTCE
Algorithm
definition.
It collects all the inputs into an inputList and implements the triggering based on the mandatory parameters.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Algorithm
protected final AlgorithmExecutionContext
protected final List<RawEngValue>
protected static final org.slf4j.Logger
-
Constructor Summary
ConstructorDescriptionAbstractAlgorithmExecutor
(Algorithm algorithmDef, AlgorithmExecutionContext execCtx) -
Method Summary
Modifier and TypeMethodDescriptiongetInputArgument
(ProcessingData processingData, ArgumentInstanceRef ref) getInputParameter
(ProcessingData processingData, ParameterInstanceRef pref) protected Parameter
getOutputParameter
(int idx) Returns the output parameter with the given index.boolean
update
(ProcessingData processingData) update the parameters and return true if the algorithm should runprotected void
updateInput
(int idx, InputParameter inputParameter, ParameterValue newValue) Called when the given inputParameter receives a value. idx is the index of the inputParameter in the algorithm definition input list.protected void
updateInputArgument
(int idx, InputParameter inputParameter, ArgumentValue newValue) Called when the given inputParameter which contains a reference to an argument receives an argument value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.algorithms.AlgorithmExecutor
dispose, execute, getInputList, getOutputList
-
Field Details
-
execCtx
-
algorithmDef
-
log
protected static final org.slf4j.Logger log -
inputValues
-
-
Constructor Details
-
AbstractAlgorithmExecutor
-
-
Method Details
-
update
update the parameters and return true if the algorithm should run- Specified by:
update
in interfaceAlgorithmExecutor
- Parameters:
processingData
-- Returns:
- true if the algorithm should run
-
getInputParameter
-
getInputArgument
-
updateInput
Called when the given inputParameter receives a value. idx is the index of the inputParameter in the algorithm definition input list.newValue can be either a
ParameterValue
or aArgumentValue
Can be used by subclasses to perform specific actions;
Note that all values are also collected in the inputList
- Parameters:
inputParameter
-newValue
-
-
updateInputArgument
Called when the given inputParameter which contains a reference to an argument receives an argument value.idx is the index of the inputParameter in the algorithm.
- Parameters:
idx
-inputParameter
-newValue
-
-
getOutputParameter
Returns the output parameter with the given index.- Parameters:
idx
-- Returns:
-
getExecutionContext
- Specified by:
getExecutionContext
in interfaceAlgorithmExecutor
- Returns:
- the execution context in which the executor activates
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceAlgorithmExecutor
-