seq  4.0.0-pre3
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
lib.nodes.observing_block.ObservingBlock Class Reference

Represents a Sequence from an OB file (json). More...

Inheritance diagram for lib.nodes.observing_block.ObservingBlock:
lib.nodes.sequence.Sequence lib.nodes.interface._BaseNode

Public Member Functions

def __attrs_post_init__ (self)
 Assigns node's name and id. More...
 
def load (self)
 Loads json file. More...
 
def clone (self, *args, **kw)
 Fake ctor for OB nodes. More...
 
- Public Member Functions inherited from lib.nodes.sequence.Sequence
def __iter__ (self)
 
def start_step (self)
 Standard sequence's start step. More...
 
def end_step (self)
 Standard sequence's end step. More...
 
def append (self, s)
 Appends a node to the Sequence. More...
 
def make_sequence (self, parent_tpl=None)
 Builds this sequence execution graph. More...
 
def create_node_tasks (self, resume=False)
 Creates Task object associated to this node. More...
 
def reschedule_node (self, node_id)
 Reschedule a node for execution. More...
 
def start (self, make_sequence=True, resume=False)
 This is the entry point for Sequence execution. More...
 
def run (self)
 Runs the node – This executes the task. More...
 
def execute (self, resume=False, propagate=False)
 Executes this just creates the asyncio task. More...
 
def resume (self)
 Resume node execution. More...
 
def main_task (self)
 Returns the objective node of the sequence – the end node. More...
 
def __call__ (self, resume=False)
 
def abort (self)
 Aborts the sequence. More...
 
def nodes (self)
 Return nodes from Graph. More...
 
def get_node (self, node_id)
 Get node by id. More...
 
def get_task (self, node_id)
 Get task by node_id. More...
 
def par (self, k)
 Get a parameter value. More...
 
def set (self, p)
 Sets the value of a parameter. More...
 
- Public Member Functions inherited from lib.nodes.interface._BaseNode
def make_sequence (self)
 does nothing More...
 
def make_task (self, node, input_list, resume)
 Creates the task object that executes the node. More...
 
def pause (self)
 

Static Public Member Functions

def create (f, *args, **kw)
 Creates a :class:ObservingBlock node. More...
 
- Static Public Member Functions inherited from lib.nodes.sequence.Sequence
def get_context ()
 
def create (*args, **kw)
 Sequence node constructor. More...
 

Public Attributes

 name
 
 in_error
 
 state
 
 seq
 
 serial_number
 
- Public Attributes inherited from lib.nodes.sequence.Sequence
 name
 
 id
 
 in_error
 
 runtime_flags
 
 t_start
 
 skip
 
 exception
 
 t_end
 

Static Public Attributes

 fname = attr.ib(default=None)
 
 content = attr.ib(default=attr.Factory(dict), repr=False, init=False)
 
dictionary template_parameters = {}
 
 current_tpl_params = attr.ib(default=attr.Factory(dict), init=False)
 
 ctor = attr.ib(default=None, init=False)
 
 descr = attr.ib(default=attr.Factory(dict), init=False)
 
 from_otto = attr.ib(default=False, kw_only=True)
 
- Static Public Attributes inherited from lib.nodes.sequence.Sequence
 graph = attr.ib(init=False, default=attr.Factory(nx.DiGraph), repr=False)
 
 debug = attr.ib(init=False, default=False, repr=False)
 
 current_seq = cv.ContextVar("current_seq", default=None)
 
 root = cv.ContextVar("root", default=None)
 
- Static Public Attributes inherited from lib.nodes.interface._BaseNode
 id = attr.ib(default=None, kw_only=True)
 
 name = attr.ib(default=None, kw_only=True)
 
 runtime_flags = attr.ib(default=0, kw_only=True)
 
 deps = attr.ib(default=attr.Factory(list), repr=False, kw_only=True, init=False)
 
 description = attr.ib(default="", kw_only=True)
 
 exception = attr.ib(init=False, default=None, repr=False)
 
 can_skip = attr.ib(default=True, init=False)
 
 hide = attr.ib(default=False, init=False)
 
 t_start = attr.ib(init=False, default=None, repr=False)
 
 t_end = attr.ib(init=False, default=None, repr=False)
 
 running_checkpoint
 
 serial_number = attr.ib(init=False)
 

Properties

 parameters = property
 Returns a dictionary with template's parameters. More...
 
 module = property
 Returns OB filename. More...
 
 doc = property
 Returns OB name from the corresponding kw. More...
 
- Properties inherited from lib.nodes.sequence.Sequence
 context = property
 Get context dictionary, preferably from root node. More...
 
 seq = property
 Retrieves the sequence list. More...
 
 G = property
 returns the graph object More...
 
 start_node = property
 Returns the start node. More...
 
 end_node = property
 Returns the end node. More...
 
 parameters = property
 Return parameters. More...
 
 state = property
 node state More...
 
 full_state = property
 
- Properties inherited from lib.nodes.interface._BaseNode
 result = property
 Node's result. More...
 
 end_node = property
 
 start_node = property
 
 state = property
 Gets the node state. More...
 
 full_state = property
 Gets the node state. More...
 
 in_error = property
 
 skip = property
 

Detailed Description

Represents a Sequence from an OB file (json).

The JSON file contains a lot of data, however the Sequencer only cares about the templates section::

"templates": [
        {
            "templateName": "seq.samples.a",
            "type": "string"
        },
        {
            "templateName": "seq.samples.tpa",
            "type": "string",
            "parameters": [
                {
                    "name": "par_b",
                    "type": "integer",
                    "value": 0
                },
                {
                    "name": "par_c",
                    "type": "number",
                    "value": 77
                }
            ]
        }
    ],

Inside the templates section there is list of templateName objects. The templateName defines a Python module that can be directly imported (it is reachable from PYTHONPATH).

Each template might contain a list of parameters that can be accessed from corresponding python code that implements the template.

Member Function Documentation

◆ __attrs_post_init__()

def lib.nodes.observing_block.ObservingBlock.__attrs_post_init__ (   self)

Assigns node's name and id.

Reimplemented from lib.nodes.sequence.Sequence.

◆ clone()

def lib.nodes.observing_block.ObservingBlock.clone (   self,
args,
**  kw 
)

Fake ctor for OB nodes.

◆ create()

def lib.nodes.observing_block.ObservingBlock.create (   f,
args,
**  kw 
)
static

Creates a :class:ObservingBlock node.

Parameters
fJSON file with OB definition
idNode id
namenode name

◆ load()

def lib.nodes.observing_block.ObservingBlock.load (   self)

Loads json file.

Member Data Documentation

◆ content

lib.nodes.observing_block.ObservingBlock.content = attr.ib(default=attr.Factory(dict), repr=False, init=False)
static

◆ ctor

lib.nodes.observing_block.ObservingBlock.ctor = attr.ib(default=None, init=False)
static

◆ current_tpl_params

lib.nodes.observing_block.ObservingBlock.current_tpl_params = attr.ib(default=attr.Factory(dict), init=False)
static

◆ descr

lib.nodes.observing_block.ObservingBlock.descr = attr.ib(default=attr.Factory(dict), init=False)
static

◆ fname

lib.nodes.observing_block.ObservingBlock.fname = attr.ib(default=None)
static

◆ from_otto

lib.nodes.observing_block.ObservingBlock.from_otto = attr.ib(default=False, kw_only=True)
static

◆ in_error

lib.nodes.observing_block.ObservingBlock.in_error

◆ name

lib.nodes.observing_block.ObservingBlock.name

◆ seq

lib.nodes.observing_block.ObservingBlock.seq

◆ serial_number

lib.nodes.observing_block.ObservingBlock.serial_number

◆ state

lib.nodes.observing_block.ObservingBlock.state

◆ template_parameters

dictionary lib.nodes.observing_block.ObservingBlock.template_parameters = {}
static

Property Documentation

◆ doc

lib.nodes.observing_block.ObservingBlock.doc = property
static

Returns OB name from the corresponding kw.

◆ module

lib.nodes.observing_block.ObservingBlock.module = property
static

Returns OB filename.

◆ parameters

lib.nodes.observing_block.ObservingBlock.parameters = property
static

Returns a dictionary with template's parameters.

   The returned dictionary enumerates the OB's templates as keys and the values are
   Template's parameters

The documentation for this class was generated from the following file: