zasim.display.console - Painting ascii art

Inheritance diagram of zasim.display.console

class zasim.display.console.BaseConsolePainter(simulator, extra=None, connect=True, auto_output=True, **kwargs)[source]

Bases: PySide.QtCore.QObject

This is a base class for implementing renderers that output the configuration of a simulator as an ascii-art string.

Initialise the painter.

Parameters:
  • simulator – The simulator to use.
  • connect – Connect the signals of the simulator immediately?
  • auto_output – Automatically output after every step?
connect_simulator()[source]
after_step(update_step=True)[source]
conf_changed()[source]
conf_replaced()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x4376368>
class zasim.display.console.OneDimConsolePainter(simulator, lines, **kwargs)[source]

Bases: zasim.display.console.BaseConsolePainter

This painter draws the configs as they happen, newer configs pushing older configs out through the top.

draw_conf(update_step=True)[source]
export(filename)[source]
conf_replaced()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x49e7290>
class zasim.display.console.TwoDimConsolePainter(simulator, **kwargs)[source]

Bases: zasim.display.console.BaseConsolePainter

This painter always draws the most current config.

draw_conf(update_step=True)[source]
export(filename)[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x49e72d8>
class zasim.display.console.MultilineOneDimConsolePainter(simulator, compact_boxes=None, **kwargs)[source]

Bases: zasim.display.console.BaseConsolePainter

A painter for multiline palettes (as described in convert_palette).

Parameters:
  • simulator – The simulator to get configs from.
  • compact_boxes – If this parameter is True, boxart palettes will share borders for a more compact display.
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x49e7368>
draw_conf(update_step=True)[source]
static convert_palette(palette, values=None)[source]

Convert a palette from the more easy to write format, where all first, second, third, ... lines share the same entry in an outer list, into the internal format, where each value is mapped to a list of lines.

static box_art_palette(palette, separate_lines=True, min_boxwidth=2)[source]

Create boxes around each entry in the palette. If separate_lines is set, divide boxes vertically into separate parts. If min_boxwidth is set, boxes have a minimum width.

Previous topic

zasim.display.qt - QImage based display renderers

Next topic

zasim.cagen - Programmatically generating CAs

This Page