Sheets#

class mhi.enerplot.Sheet(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

An Enerplot Sheet

property name: Any#

The name of the sheet

property description: Any#

The description of the sheet

focus() None#

Switches the currently focused sheet to become this sheet.

property grid: bool#

Set to True to show a grid on the canvas, False otherwise.

property orientation: str#

Set to “Landscape” to orient the paper horizontally, “Portrait” to orient vertically.

property portrait: bool#

True if the sheet is oriented vertically, False otherwise.

property landscape: bool#

True if the sheet is oriented horizontally, False otherwise.

property pagesize: str#

The size of the canvas.

The size may be set by US name “A” or metric name “A4”, or by dimension in inches “8.5x11”. The following statements all set the same canvas size:

>>> sheet.pagesize = 'A/A4'
>>> sheet.pagesize = 'A4'
>>> sheet.pagesize = 'A'
>>> sheet.pagesize = '8.5x11'
>>> sheet.pagesize
'A/A4'
select_all() None#

Select all components on the sheet

remove(*components: Component) None#

Remove components from the sheet

sticky(x: int | None = None, y: int | None = None, w: int | None = None, h: int | None = None, text: str | None = None, **kwargs) TextArea#

Create a “Sticky Note” styled TextArea

Parameters:
  • x – x location for the Sticky Note

  • y – y-location for the Sticky Note

  • w – width of the Sticky Note

  • h – height of the Sticky Note

  • text – the contents of the sticky note

  • **kwargs – Additional key=value properties for the TextArea.

Returns:

the sticky note

Example:

note = sheet.sticky(1, 1, 8, 3, "Hello world", arrows="NE E SE",
                    fg_color='yellow', bg_color='black')
caption(x: int | None = None, y: int | None = None, w: int = 20, h: int = 2, text: str = 'Caption', **kwargs) TextArea#

Create a “Caption” styled TextArea

Parameters:
  • x – x location for the Caption

  • y – y-location for the Caption

  • w – width of the Caption

  • h – height of the Caption

  • text – the contents of the Caption

  • **kwargs – Additional key=value properties for the TextArea.

Returns:

the caption

Example:

caption = sheet.caption(1, 5, 8, 2, "Output", fg_color='red')
divider(x: int | None = None, y: int | None = None, w: int | None = None, h: int | None = None, **kwargs) Line#

Create a “Divider”

Parameters:
  • x – x location for the start of Divider

  • y – y-location for the start of Divider

  • w – width of the Divider (if horizontal)

  • h – height of the Divider (if vertical)

  • **kwargs – Additional key=value properties for the note.

Returns:

the divider

Example:

divider = sheet.divider(1, 10, 6, 0, state=0, style='Dash')
group_box(x: int | None = None, y: int | None = None, w: int = 11, h: int = 6, name: str = 'Groupbox', **kwargs) GroupBox#

Create a “Group Box”

Parameters:
  • x – x-location for the start of Group Box

  • y – y-location for the start of Group Box

  • w – width of the Group Box

  • h – height of the Group Box

  • name – the title of the Group Box

  • **kwargs – Additional key=value properties for the Group Box.

Returns:

the group box

attributes(**kwargs) Dict[str, Any]#

Set or get a component’s attributes

A component’s attributes are used to describe the component’s location and size relative to its parent.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current attributes.

See also

properties()

property book: Book#

The book the component belongs to (read-only)

property book_name: str#

The book the component belongs to (read-only)

property classid: str#

The classid of the component (read-only)

copy() None#

Copy the component to the clipboard

cut() None#

Remove the component to the clipboard

find([classid,] [key=value, ...])#

Find the (singular) component that matches the given criteria, or None if no matching component can be found. Raises an exception if more than one component matches the given criteria.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

find_all([classid,] [key=value, ...])#

Find all components that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the list of matching components

find_first([classid,] [key=value, ...])#

Find a component that matches the given criteria, or None if no matching component can be found.

Parameters:
  • classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

  • key=value – additional parameters which must be matched.

Returns:

the found component or None

graph_frame(x: int | None = None, y: int | None = None, w: int | None = None, h: int | None = None, *, polygraph: bool = False, **kwargs) GraphFrame#

Create a “Graph Frame”

Parameters:
  • x – x location for the start of Frame

  • y – y-location for the start of Frame

  • w – width of the Frame

  • h – height of the Frame

  • polygraph – First panel is overlay-graph or polygraph

  • **kwargs – Additional key=value properties for the frame.

Returns:

the graph frame

Changed in version 2.3: Added polygraph parameter

property id: str#

The id of the component (read-only)

list(classid: str | None = None) List[Component]#

List all the components contained inside this object, possibly restricted to a certain classid.

Parameters:

classid – one of “GraphFrame”, “PlotFrame”, “FFTFrame”, “Divider”, “Sticky” or “GroupBox”.

Returns:

the list of components

parent() Sheet#

Retrieve the owner of this component

paste() None#

Paste the component(s) from the clipboard to this canvas

properties(paramlist: str = '', **kwargs) Dict[str, Any]#

Set or get a component’s properties

A component’s properties are used to describe the component’s appearance or control the component’s behaviour.

Parameters:

**kwargs – key=value arguments

Returns:

The component’s current property values

See also

attributes()

plot_frame(x: int | None = None, y: int | None = None, w: int | None = None, h: int | None = None, **kwargs) PlotFrame#

Create a “Plot Frame” for X-Y plots

Parameters:
  • x – x location for the start of Frame

  • y – y-location for the start of Frame

  • w – width of the Frame

  • h – height of the Frame

  • **kwargs – Additional key=value properties for the frame.

Returns:

the x-y plot frame

fft_frame(x: int | None = None, y: int | None = None, w: int | None = None, h: int | None = None, **kwargs) FFTFrame#

Create a “FFT Frame” for FFT Graphs

Parameters:
  • x – x location for the start of Frame

  • y – y-location for the start of Frame

  • w – width of the Frame

  • h – height of the Frame

  • **kwargs – Additional key=value properties for the frame.

Returns:

the FFT graph frame

Relink channels to the referenced in one datafile to the other

Parameters:
  • from_datafile – the datafile to unlink channel data from.

  • to_datafile – the datafile to link channel data to.