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
FieldsModifier and TypeFieldDescriptionprotected final Algorithmprotected final AlgorithmExecutionContextprotected final List<RawEngValue>protected static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAlgorithmExecutor(Algorithm algorithmDef, AlgorithmExecutionContext execCtx) -
Method Summary
Modifier and TypeMethodDescriptiongetInputArgument(ProcessingData processingData, ArgumentInstanceRef ref) getInputParameter(ProcessingData processingData, ParameterInstanceRef pref) protected ParametergetOutputParameter(int idx) Returns the output parameter with the given index.booleanupdate(ProcessingData processingData) update the parameters and return true if the algorithm should runprotected voidupdateInput(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 voidupdateInputArgument(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, waitMethods inherited from interface org.yamcs.algorithms.AlgorithmExecutor
execute
-
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:
updatein 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
ParameterValueor aArgumentValueCan 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:
getExecutionContextin interfaceAlgorithmExecutor- Returns:
- the execution context in which the executor activates
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceAlgorithmExecutor
-