RunControl Device Class

  • pyrogue.RunControl is a sub-class of pyrogue.Device which serves as the base class for application specific run control.

    • Can be used as is for most software driven data acquisition

    • Can be sub-classed for more complex hardware and external run control

  • The RunControl object is created the following way:

Rc = pyrogue.RunControl(name, description,
                        hidden=True, rates, states, cmd)
  • Parameters:

    • Hidden is normally True since RunControl does not appear in the normal GUI tree, instead it is represented in a special window.

    • rates: A dictionary of rates and associated keys. The keys are application specific and represent the run rate in hz in the default class. The defaults rates are:

      • rates={1:’1 Hz’, 10:’10 Hz’}

    • states: A dictionary of states and associated keys. The keys are application specific. The default rates are:

      • states={0:’Stopped’, 1:’Running’}

    • cmd: Is the command to execute at each iteration when using the default software driven run() method. This can either be a pointer to a python function or pyrogue Command.

RunControl Class Documentation

class pyrogue.RunControl(*, hidden=True, rates=None, states=None, cmd=None, **kwargs)[source]

Special base class to control runs.

Variables:

attr1 – pr.Device

add(node)
Parameters:

node

addCustomBlock(block)
Parameters:

block

addInterface(*interfaces)

Add one or more rogue.interfaces.stream.Master or rogue.interfaces.memory.Master Also accepts iterables for adding multiple at once

Parameters:

*interfaces

addNode(nodeClass, **kwargs)
Parameters:
  • nodeClass

  • **kwargs

addNodes(nodeClass, number, stride, **kwargs)
Parameters:
  • nodeClass

  • number

  • stride

  • **kwargs

addProtocol(*protocols)

Add a protocol entity. Also accepts iterables for adding multiple at once

Parameters:

*protocols

addRemoteVariables(number, stride, pack=False, **kwargs)
Parameters:
  • number

  • stride

  • pack (bool) – (Default value = False)

  • **kwargs

addToGroup(group)

Add this node to the passed group, recursive to children

Parameters:

group – variable denoting a node that has not been passed

callRecursive(func, nodeTypes=None, **kwargs)
Parameters:
  • func

  • nodeTypes – (Default value = None)

  • **kwargs

checkBlocks(*, recurse=True, variable=None, **kwargs)

Check errors in all blocks and generate variable update notifications

Parameters:

*

recursebool

(Default value = True)

variablestr

(Default value = None)

**kwargs :

command(**kwargs)

A Decorator to add inline constructor functions as commands

Parameters:

**kwargs

commandsByGroup(incGroups=None, excGroups=None)
Parameters:
  • incGroups – (Default value = None)

  • excGroups – (Default value = None)

Returns:

Pass list of include and / or exclude groups

Return type:

type

property description

assigns and returns description attribute to class variable

property deviceList

Get a recursive list of devices

devicesByGroup(incGroups=None, excGroups=None)
Parameters:
  • incGroups – (Default value = None)

  • excGroups – (Default value = None)

Returns:

Pass list of include and / or exclude groups

Return type:

type

enableChanged(value)
Parameters:

value

filterByGroup(incGroups, excGroups)

Filter by the passed list of inclusion and exclusion groups

Parameters:
  • incGroups – list of passed inclusion groups

  • excGroups – list of passed exclusion groups

find(*, recurse=True, typ=None, **kwargs)

Find all child nodes that are a base class of ‘typ’ and whose properties match all of the kwargs. For string properties, accepts regexes.

Parameters:
  • *

  • recurse – (Default value = True)

  • typ – (Default value = None)

  • **kwargs

genDocuments(path, incGroups, excGroups)
Parameters:
  • path

  • incGroups

  • excGroups

getNodes(typ, excTyp=None, incGroups=None, excGroups=None)

Get a filtered ordered dictionary of nodes. pass a class type to receive a certain type of node class type may be a string when called over Pyro4 exc is a class type to exclude, incGroups is an optional group or list of groups that this node must be part of excGroups is an optional group or list of groups that this node must not be part of

Parameters:
  • typ

  • excTyp – (Default value = None)

  • incGroups – (Default value = None)

  • excGroups – (Default value = None)

Return type:

ordered dictionary of nodes

getYaml(readFirst=False, modes=['RW', 'RO', 'WO'], incGroups=None, excGroups=['Hidden'], recurse=True)

Get current values as yaml data. modes is a list of variable modes to include. If readFirst=True a full read from hardware is performed.

property groups

assigns and returns groups attribute to class variable

property hidden

assigns and returns hidden attribute to class variable

hideVariables(hidden, variables=None)

Hide a list of Variables (or Variable names)

Parameters:
  • hidden

  • variables (str) – (Default value = None)

inGroup(group)
Parameters:

group

isinstance(typ)
Parameters:

typ

linkVariableGet(**kwargs)

Decorator to add inline constructor functions as LinkVariable.linkedGet functions

Parameters:

**kwargs

makeRecursive(func, nodeTypes=None)
Parameters:
  • func

  • nodeTypes – (Default value = None)

manage(*interfaces)
Parameters:

*interfaces

property name

assigns and returns name attribute to class variable

node(name)
Parameters:

name

property nodeList

Get a recursive list of nodes.

nodeMatch(name)
Parameters:

name

Returns:

be a single value or a list accessor: value value[9] value[0:1] value[*] value[:] Variables will only match if their depth matches the passed lookup and wildcard: value[*] will match a variable named value[1] but not a variable named value[2][3] value[*][*] will match a variable named value[2][3]. The second return field will contain the array information if the base name matches an item in the non list array.

Return type:

type

property nodes

Get a ordered dictionary of all nodes.

readAndCheckBlocks(recurse=True, variable=None, checkEach=False)

Perform a read and check.

Parameters:
  • recurse (bool) – (Default value = True)

  • variable (str) – (Default value = None)

  • checkEach (bool) – (Default value = False)

readBlocks(*, recurse=True, variable=None, checkEach=False, index=-1, **kwargs)

Perform background reads

Parameters:

*

recursebool

(Default value = True)

variablestr

(Default value = None)

checkEachbool

(Default value = False)

indexint

(Default value = -1)

**kwargs :

removeFromGroup(group)

Remove this node from the passed group, not recursive

Parameters:

group – variable denoting a node that is in the passed group

Return type:

if in group, remove from group

property running

Check if Device._start() has been called

setName((Slave)arg1, (str)arg2) None :
C++ signature :

void setName(rogue::interfaces::memory::Slave {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

setPollInterval(interval, variables=None)

Set the poll interval for a group of variables. The variables param is an Iterable of strings If variables=None, set interval for all variables that currently have nonzero pollInterval

Parameters:
  • interval

  • variables (str) – (Default value = None)

property variableList

Get a recursive list of variables and commands.

variablesByGroup(incGroups=None, excGroups=None)
Parameters:
  • incGroups – (Default value = None)

  • excGroups – (Default value = None)

Returns:

Pass list of include and / or exclude groups

Return type:

type

verifyBlocks(*, recurse=True, variable=None, checkEach=False, **kwargs)

Perform background verify

Parameters:

*

recursebool

(Default value = True)

variablestr

(Default value = None)

checkEachbool

(Default value = False)

**kwargs :

writeAndVerifyBlocks(force=False, recurse=True, variable=None, checkEach=False)

Perform a write, verify and check. Useful for committing any stale variables

Parameters:
  • force (bool) – (Default value = False)

  • recurse (bool) – (Default value = True)

  • variable (str) – (Default value = None)

  • checkEach (bool) – (Default value = False)

writeBlocks(*, force=False, recurse=True, variable=None, checkEach=False, index=-1, **kwargs)

Write all of the blocks held by this Device to memory

Parameters:
  • *

  • force (bool) – (Default value = False)

  • recurse (bool) – (Default value = True)

  • variable (str) – (Default value = None)

  • checkEach (bool) – (Default value = False)

  • index (int) – (Default value = -1)

  • **kwargs