Class AlgorithmExecutionContext

java.lang.Object
org.yamcs.algorithms.AlgorithmExecutionContext

public class AlgorithmExecutionContext extends Object
A context is a collection of active algorithms. Each algorithm has only one instance active in a given context.

There is normally a global context in a processor and a few contexts related to the command verifiers.

The process(long, ProcessingData) method will trigger calling all the active algorithms from this context in order.

  • Constructor Details

    • AlgorithmExecutionContext

      public AlgorithmExecutionContext(String contextName, ProcessorData procData, int maxErrCount)
  • Method Details

    • process

      public void process(long acqTime, ProcessingData data)
      Update the input data and run the affected algorithms

      Add the result of the algorithms to the processing data

    • getName

      public String getName()
    • containsAlgorithm

      public boolean containsAlgorithm(String algoFqn)
    • addAlgorithm

      public void addAlgorithm(ActiveAlgorithm activeAlgorithm)
    • removeAlgorithm

      public ActiveAlgorithm removeAlgorithm(String algoFqn)
      remove the active algorithm with the given identifier.

      The algorithm will not be called in subsequent calls to process(long, ProcessingData)

      Parameters:
      algoFqn -
      Returns:
      the active algorithm removed or null if there was no active algorithm
    • removeAlgorithm

      public ActiveAlgorithm removeAlgorithm(Algorithm algorithm)
    • getActiveAlgorithms

      public List<ActiveAlgorithm> getActiveAlgorithms()
    • getProcessorData

      public ProcessorData getProcessorData()
    • getMdb

      public Mdb getMdb()
    • getEventProducer

      public EventProducer getEventProducer()
    • enableTracing

      public void enableTracing(Algorithm algo)
    • disableTracing

      public void disableTracing(Algorithm algo)
    • getTrace

      public AlgorithmTrace getTrace(String algoFqn)
    • logTrace

      public void logTrace(String algoFqn, String msg)
    • getAlgorithm

      public ActiveAlgorithm getAlgorithm(String algoFqn)
    • getAlgorithmStatus

      public AlgorithmStatus getAlgorithmStatus(String algoFqn)