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 org.yamcs.xtce.Algorithmprotected final AlgorithmExecutionContextprotected final List<RawEngValue>protected static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAlgorithmExecutor(org.yamcs.xtce.Algorithm algorithmDef, AlgorithmExecutionContext execCtx) -
Method Summary
Modifier and TypeMethodDescriptionorg.yamcs.xtce.AlgorithmgetInputArgument(ProcessingData processingData, org.yamcs.xtce.ArgumentInstanceRef ref) getInputParameter(ProcessingData processingData, org.yamcs.xtce.ParameterInstanceRef pref) protected org.yamcs.xtce.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, org.yamcs.xtce.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, org.yamcs.xtce.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
dispose, execute, getInputList, getOutputList
-
Field Details
-
execCtx
-
algorithmDef
protected final org.yamcs.xtce.Algorithm algorithmDef -
log
protected static final org.slf4j.Logger log -
inputValues
-
-
Constructor Details
-
AbstractAlgorithmExecutor
public AbstractAlgorithmExecutor(org.yamcs.xtce.Algorithm algorithmDef, AlgorithmExecutionContext execCtx)
-
-
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
public ParameterValue getInputParameter(ProcessingData processingData, org.yamcs.xtce.ParameterInstanceRef pref) -
getInputArgument
public ArgumentValue getInputArgument(ProcessingData processingData, org.yamcs.xtce.ArgumentInstanceRef ref) -
updateInput
protected void updateInput(int idx, org.yamcs.xtce.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.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
protected void updateInputArgument(int idx, org.yamcs.xtce.InputParameter inputParameter, ArgumentValue newValue) 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
protected org.yamcs.xtce.Parameter getOutputParameter(int idx) 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
public org.yamcs.xtce.Algorithm getAlgorithm()- Specified by:
getAlgorithmin interfaceAlgorithmExecutor
-