Package org.yamcs.mdb

Class ProcessingData

Direct Known Subclasses:
ContainerProcessingResult, TcProcessingContext

public class ProcessingData extends Object
This class holds live information used during a (XTCE) processing.

It is created when data is incoming and is used in a processing pipeline. For example when a packet is received, the following pipeline is executed:

  • a new processing data object is instantiated containing an empty parameter list and a reference to the latest parameter value cache
  • parameters are added to it as extracted from the packet
  • calibration (raw to engineering conversion) is performed on the newly added parameters
  • algorithms are run creating new parameters also added to the processing data object
  • monitoring and generation of alarms is done for the new parameters
  • command verifiers are run (possibly creating new parameters TBD)
  • the parameter archive is populated

A processing can also start when receiving command history information (used as part of command verification), when receiving processed parameters via the pp stream or periodically by algorithms.

There will be different threads running in parallel, each with its own ProcessingData object but one object cannot be shared with another thread.

The following data is part of this object:

  • tmParamsCache - stores the latest values of the "released" TM parameters from a processor (processor's lastValueCache). Data can be updated from outside of this processing thread. The cache will buffer older values for some parameters if required (for example algorithms or match criteria can require old instances of parameter values).
  • tmParams - stores the "current" delivery - parameters that are being produced during the current pipeline execution. This list will only modify from within the pipeline (and is not visible outside) and all the data here is considered "more recent" than the data from the tmParamsCache. At the end of the execution of the pipeline, the data is moved from here to the tmParamsCache (i.e the processor lastValueCache)
  • cmdArgs - if the processing is part of a command, this stores the arguments of the command. Otherwise it is null. The command arguments are not modified during the pipeline execution.
  • cmdParamsCache - this is similar with the tmParams but stores parameters that are contextualized to the command. This includes command properties and command history parameters. The list can modify from outside the pipeline.
  • cmdParams - stores the "current" delivery command parameters. It is initialised when command history information is received. New elements can be added by algorithms producing command parameter values. A command parameter is one whose datasource is DataSource.COMMAND.
  • Field Details

  • Constructor Details

  • Method Details

    • createForTmProcessing

      public static ProcessingData createForTmProcessing(LastValueCache tmValueCache)
      Used in a TM processing pipeline - for example when a TM packet is received
    • createForCmdProcessing

      public static ProcessingData createForCmdProcessing(LastValueCache tmValueCache, Map<Argument,ArgumentValue> arguments, LastValueCache cmdLastValueCache)
      Used in TC processing when command history events are received, they will be added to the cmdParams.
    • createInitial

      public static ProcessingData createInitial(LastValueCache tmParamsCache, Map<Argument,ArgumentValue> arguments, LastValueCache cmdParamsCache)
      Processing data which contains values to be used in algorithm initialisation.

      The tmParams and cmdParams will be null.

    • cloneForCommanding

      public static ProcessingData cloneForCommanding(ProcessingData data, Map<Argument,ArgumentValue> arguments, LastValueCache cmdParams)
      Create a new processing data object with the tmParamsCache and tmParams shared with the data object, but with new cmdParams. To be used in command verifiers - each command has its own context with different cmdParams.

      It is used when starting a command processing chain.

    • cloneForTm

      public static ProcessingData cloneForTm(ProcessingData data)
      keeps the tmParamsCache and tmParams from the given data
    • createForTestTm

      public static ProcessingData createForTestTm(ParameterValue... pvlist)
      creates an object with an empty cache and with the given values as current tm delivery. Used in unit tests
    • createForTestCmd

      public static ProcessingData createForTestCmd(ParameterValue... pvlist)
      same as above but creates command parameters
    • getTmParams

      public ParameterValueList getTmParams()
    • addTmParam

      public void addTmParam(ParameterValue pv)
    • addTmParams

      public void addTmParams(List<ParameterValue> params)
    • addCmdParam

      public void addCmdParam(ParameterValue pv)
    • getParameterInstance

      public ParameterValue getParameterInstance(ParameterInstanceRef pref, boolean allowOld)
      Returns a parameter value associated to the parameter reference or null if none is found.

      The instance is according to XTCE rules: if tmParams/cmdParams contains multiple values for the parameter, then the oldest one (first inserted in the list) is instance 0, the next one is instance 1, etc.

      The negative instances are retrieved from the cache: -1 is the latest value in tmParamsCache (the one which was added last), -2 is the previous one and so on.

      If allowOld = true and the tmParams/cmdParams does not contain a value for the parameter, then the instances in the cache are counted down from 0 instead of -1.

      If allowOld = false, the return will always be null if the tmParams/cmdParams does not contain a value for the parameter.

    • getCmdArgument

      public ArgumentValue getCmdArgument(Argument arg)
    • getCmdArgs

      public Map<Argument,ArgumentValue> getCmdArgs()
    • containsUpdate

      public boolean containsUpdate(Parameter param)
      Returns true if the tmParams or cmdParams contains a value for param
    • getCmdParams

      public ParameterValueList getCmdParams()
    • resolveDynamicIntegerValue

      public long resolveDynamicIntegerValue(DynamicIntegerValue div, boolean allowOld) throws XtceProcessingException
    • toString

      public String toString()
      toString in class Object