util

class malcolm.modules.builtin.util.LayoutTable(name: Union[Anno(name='ANameArray', typ=<class 'str'>, description='Names of the layout parts'), Sequence[str]], mri: Union[Anno(name='AMriArray', typ=<class 'str'>, description='Malcolm full names of child blocks'), Sequence[str]], x: Union[Anno(name='AXArray', typ=<class 'float'>, description='X Coordinates of child blocks'), Sequence[float]], y: Union[Anno(name='AYArray', typ=<class 'float'>, description='Y Coordinates of child blocks'), Sequence[float]], visible: Union[Anno(name='AVisibleArray', typ=<class 'bool'>, description='Whether child blocks are visible'), Sequence[bool]])[source]
Parameters
  • name (str) – Names of the layout parts

  • mri (str) – Malcolm full names of child blocks

  • x (float) – X Coordinates of child blocks

  • y (float) – Y Coordinates of child blocks

  • visible (bool) – Whether child blocks are visible

class malcolm.modules.builtin.util.ExportTable(source: Union[Anno(name='ASourceNameArray', typ=<class 'str'>, description='Name of the block.field to export'), Sequence[str]], export: Union[Anno(name='AExportNameArray', typ=<class 'str'>, description='Name of the field to export as'), Sequence[str]])[source]
Parameters
  • source (str) – Name of the block.field to export

  • export (str) – Name of the field to export as

malcolm.modules.builtin.util.wait_for_stateful_block_init(context, mri, timeout=10.0)[source]

Wait until a Block backed by a StatefulController has initialized

Parameters
  • context (Context) – The context to use to make the child block

  • mri (str) – The mri of the child block

  • timeout (float) – The maximum time to wait

malcolm.modules.builtin.util.no_save(*attribute_names)[source]

Helper for defining ChildPart.no_save_attribute_names.

Parameters

attribute_names (str) – The Attributes of the child Block that shouldn’t be saved

class malcolm.modules.builtin.util.SVGIcon(svg_text: str)[source]

Helper object for working with SVG icons

class malcolm.modules.builtin.util.StatefulStates[source]

This state set covers controllers and parts that can be disabled and have faults, but otherwise have no state.

digraph { newrank=true; // Sensible ranking of clusters bgcolor=transparent compound=true rankdir=LR node [fontname=Arial fontsize=10 shape=rect style=filled fillcolor="#8BC4E9"] graph [fontname=Arial fontsize=11] edge [fontname=Arial fontsize=10 arrowhead=vee] Fault [fillcolor="#F03232"] Disabled [fillcolor="#AAAAAA"] subgraph cluster_normal { Ready [fillcolor="#BBE7BB"] Resetting -> Ready } Resetting -> Disabling [ltail=cluster_normal label="disable()"] Resetting -> Fault [ltail=cluster_normal label="on_error"] Fault -> Resetting [label="reset()"] Fault -> Disabling [label="disable()"] Disabling -> Fault [label="on_error"] Disabling -> Disabled Disabled -> Resetting [label="reset()"] label="Unlabelled transitions take place in response to internal actions\n Labelled transitions are triggered externally."; labelloc=bottom; }

class malcolm.modules.builtin.util.ManagerStates[source]

This state set covers controllers and parts that have loadable and savable child state.

digraph { newrank=true; // Sensible ranking of clusters bgcolor=transparent compound=true rankdir=LR node [fontname=Arial fontsize=10 shape=rect style=filled fillcolor="#8BC4E9"] graph [fontname=Arial fontsize=11] edge [fontname=Arial fontsize=10 arrowhead=vee] Fault [fillcolor="#F03232"] Disabled [fillcolor="#AAAAAA"] subgraph cluster_normal { Ready [fillcolor="#BBE7BB"] Ready -> Saving [label="save()"] Saving -> Ready [weight=0] Ready -> Loading [label="put\ndesign"] Loading -> Ready [weight=0] Resetting -> Ready } Resetting -> Disabling [ltail=cluster_normal label="disable()"] Resetting -> Fault [ltail=cluster_normal label="on_error"] Fault -> Resetting [label="reset()"] Fault -> Disabling [label="disable()"] Disabling -> Fault [label="on_error"] Disabling -> Disabled Disabled -> Resetting [label="reset()"] label="Unlabelled transitions take place in response to internal actions\n Labelled transitions are triggered externally."; labelloc=bottom; }