Package org.yamcs.algorithms
Class ScriptAlgorithmExecutor
- java.lang.Object
-
- org.yamcs.algorithms.AbstractAlgorithmExecutor
-
- org.yamcs.algorithms.ScriptAlgorithmExecutor
-
- All Implemented Interfaces:
AlgorithmExecutor
public class ScriptAlgorithmExecutor extends AbstractAlgorithmExecutor
Represents the execution context of one algorithm. An AlgorithmExecutor is reused upon each update of one or more of its InputParameters.This class will create and compile on-the-fly ValueBinding implementations for every unique combination of raw and eng types.
-
-
Field Summary
-
Fields inherited from class org.yamcs.algorithms.AbstractAlgorithmExecutor
algorithmDef, execCtx, execListeners, inputValues
-
-
Constructor Summary
Constructors Constructor Description ScriptAlgorithmExecutor(CustomAlgorithm algorithmDef, Invocable invocable, String functionName, String functionScript, AlgorithmExecutionContext execCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ParameterValue>runAlgorithm(long acqTime, long genTime)Runs the associated algorithm with the latest InputParametersStringtoString()protected voidupdateInput(int position, 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.-
Methods inherited from class org.yamcs.algorithms.AbstractAlgorithmExecutor
addExecListener, getAlgorithm, getExecutionContext, getOutputParameter, propagateToListeners, updateParameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.yamcs.algorithms.AlgorithmExecutor
getLookbackSize
-
-
-
-
Constructor Detail
-
ScriptAlgorithmExecutor
public ScriptAlgorithmExecutor(CustomAlgorithm algorithmDef, Invocable invocable, String functionName, String functionScript, AlgorithmExecutionContext execCtx)
-
-
Method Detail
-
updateInput
protected void updateInput(int position, InputParameter inputParameter, ParameterValue newValue)Description copied from class:AbstractAlgorithmExecutorCalled when the given inputParameter receives a value. idx is the index of the inputParameter in the algorithm definition input list.Can be used by subclasses to perform specific actions;
Note that all values are also collected in the inputList
- Overrides:
updateInputin classAbstractAlgorithmExecutor
-
runAlgorithm
public List<ParameterValue> runAlgorithm(long acqTime, long genTime)
Description copied from interface:AlgorithmExecutorRuns the associated algorithm with the latest InputParameters- Returns:
- the outputted parameters, if any
-
-