ControlSource

class ControlSource(**properties: Any)

Superclasses: Object, InitiallyUnowned, Object

The ControlSource is a base class for control value sources that could be used to get timestamp-value pairs. A control source essentially is a function over time.

A ControlSource is used by first getting an instance of a specific control-source, creating a binding for the control-source to the target property of the element and then adding the binding to the element. The binding will convert the data types and value range to fit to the bound property.

For implementing a new ControlSource one has to implement ControlSourceGetValue and ControlSourceGetValueArray functions. These are then used by control_source_get_value() and control_source_get_value_array() to get values for specific timestamps.

Methods

class ControlSource
control_source_get_value(timestamp: int) tuple[bool, float]

Gets the value for this ControlSource at a given timestamp.

Parameters:

timestamp – the time for which the value should be returned

control_source_get_value_array(timestamp: int, interval: int, values: Sequence[float]) bool

Gets an array of values for for this ControlSource. Values that are undefined contain NANs.

Parameters:
  • timestamp – the first timestamp

  • interval – the time steps

  • values – array to put control-values in

Fields

class ControlSource
get_value

Function for returning a value for a given timestamp

get_value_array

Function for returning a values array for a given timestamp

parent

The parent structure