StreamReader
- class pyrogue.utilities.fileio.StreamReader(**kwargs)[source]
Wrapper
pyrogue.Devicearoundrogue.utilities.fileio.StreamReader.See also
- StreamReader
StreamReader utility documentation.
- Rogue File Data Format
Canonical Rogue file record format consumed by StreamReader.
- Parameters:
**kwargs (
Any) – Additional keyword arguments forwarded topyrogue.Device.
- addCustomBlock(block)
Add a pre-defined memory block to the device.
- addInterface(*interfaces)
Add stream or memory interfaces to manage.
- addNode(nodeClass, **kwargs)
Construct and add a node of
nodeClass.
- addNodes(nodeClass, number, stride, **kwargs)
Add a series of nodes with indexed names.
- addProtocol(*protocols)
Add protocol entities (alias of
addInterface).
- addRemoteVariables(number, stride, pack=False, **kwargs)
Add a repeating block of remote variables.
- addToGroup(group)
Add this node to a group and propagate to children.
- callRecursive(func, nodeTypes=None, **kwargs)
Call a named method on this node and matching children.
- checkBlocks(*, recurse=True, variable=None, **kwargs)
Check block transactions and notify variable listeners.
- command(**kwargs)
Decorator to add inline methods as commands.
The decorated function is used as
LocalCommand(function=...). The command wrapper supplies keyword argumentsroot,dev,cmd, andarg; the function may accept any subset.
- property commands: OrderedDict[str, BaseCommand]
Return direct child commands.
- commandsByGroup(incGroups=None, excGroups=None)
Return commands filtered by group.
- Return type:
- Parameters:
- property devices: OrderedDict[str, Device]
Return direct child devices.
- devicesByGroup(incGroups=None, excGroups=None)
Return devices filtered by group.
- enableChanged(value)
Hook for reacting to enable state changes.
- filterByGroup(incGroups, excGroups)
Return True if the node passes include/exclude filters.
- 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.
- genDocuments(path, incGroups=None, excGroups=None)
Generate Sphinx documentation pages for this device.
- getNodes(typ, excTyp=None, incGroups=None, excGroups=None)
Get a filtered ordered dictionary of nodes. pass a class to typ to receive a certain type of node 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:
- Returns:
Ordered dictionary of nodes.
- Return type:
- getYaml(readFirst=False, modes=['RW', 'RO', 'WO'], incGroups=None, excGroups=None, recurse=True)
Return current values as YAML text.
- Parameters:
readFirst (
bool, default:False) – If True, perform a full hardware read before exporting.modes (
list[str], default:['RW', 'RO', 'WO']) – Variable modes to include. Allowed values are'RW','WO', and'RO'.incGroups (
str|list[str] |None, default:None) – Group name or group names to include.excGroups (
str|list[str] |None, default:None) – Group name or group names to exclude.recurse (
bool, default:True) – If True, recurse into child devices.
- Returns:
YAML-formatted representation of the node subtree.
- Return type:
Return True if the node is hidden.
- hideVariables(hidden, variables=None)
Hide a list of variables or variable names.
- inGroup(group)
Return True if the node is in the provided group or groups.
- isinstance(typ)
Return True if this node is an instance of
typ.
- linkVariableGet(**kwargs)
Decorator to add inline
linkedGetfunctions.The decorated function is used as
LinkVariable(linkedGet=...). The linked-get wrapper supplies keyword argumentsdev,var,read,index, andcheck; the function may accept any subset.
- makeRecursive(func, nodeTypes=None)
Create a recursive wrapper for a named method.
- manage(*interfaces)
Manage additional interfaces for start/stop.
- node(name)
Return a direct child node by name.
- nodeMatch(name)
Match a node name, including array-style accessors.
- property nodes: OrderedDict[str, Node]
Return an ordered dictionary of direct child nodes.
- printYaml(readFirst=False, modes=['RW', 'RO', 'WO'], incGroups=None, excGroups=None, recurse=False)
Print the YAML representation to stdout.
- Parameters:
readFirst (
bool, default:False) – If True, perform a full hardware read before exporting.modes (
list[str], default:['RW', 'RO', 'WO']) – Variable modes to include. Allowed values are'RW','WO', and'RO'.incGroups (
str|list[str] |None, default:None) – Group name or group names to include.excGroups (
str|list[str] |None, default:None) – Group name or group names to exclude.recurse (
bool, default:False) – If True, recurse into child devices.
- Return type:
- readAndCheckBlocks(recurse=True, variable=None, checkEach=False)
Read and check all blocks.
- readBlocks(*, recurse=True, variable=None, checkEach=False, index=-1, **kwargs)
Read blocks in the background.
- Parameters:
recurse (
bool, default:True) – If True, recurse into child devices.variable (
Any|None, default:None) – Optional variable to read.checkEach (
bool, default:False) – Perform per-variable verification checks.index (
int, default:-1) – Optional index for array variables.**kwargs (
Any) – Additional arguments passed through to the transaction.
- Return type:
- removeFromGroup(group)
Remove this node from a group.
- 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.
- property variableList: list[BaseVariable]
Return a recursive list of variables and commands.
- property variables: OrderedDict[str, BaseVariable]
Return direct child variables (excluding commands).
- variablesByGroup(incGroups=None, excGroups=None)
Return variables filtered by group.
- Return type:
- Parameters:
- verifyBlocks(*, recurse=True, variable=None, checkEach=False, **kwargs)
Verify blocks in the background.
- Parameters:
- Return type:
- writeAndVerifyBlocks(force=False, recurse=True, variable=None, checkEach=False)
Write, verify, and check all blocks.
- Parameters:
- Return type:
- writeBlocks(*, force=False, recurse=True, variable=None, checkEach=False, index=-1, **kwargs)
Write all blocks held by this device.
- Parameters:
force (
bool, default:False) – Force the write even if values are unchanged.recurse (
bool, default:True) – If True, recurse into child devices.variable (
Any|None, default:None) – Optional variable to write.checkEach (
bool, default:False) – Perform per-variable verification checks.index (
int, default:-1) – Optional index for array variables.**kwargs (
Any) – Additional arguments passed through to the transaction.
- Return type: