zasim.gui.reset - Create/load configs and reset simulators

Inheritance diagram of zasim.gui.reset

This module offers a way for the user to reset a Simulator with different kinds of generated or specified configurations.

The ResetDocklet gets embedded in the ZasimMainWindow automatically. The user then gets to choose from any of the available resetters, all derived from the BaseResetter class. Subclasses are automatically registered to be used in the gui.

Each Resetter implements the following methods:

  • setup_ui to create the user interface for changing settings for this resetter.
  • set_values to update the GUI whenever the internal state has changed.
  • take_over_settings to read in settings from an existing Configuration
  • match_configuration to check if the Configuration can be used for take_over_settings.
  • generate_example will create usable values if the current simulator has a non-matching Configuration class.
  • generate_generator, which returns a Generator to match the settings from the user interface.

See also

zasim.config

class zasim.gui.reset.BaseResetter(mainwin, **kwargs)[source]

Bases: PySide.QtGui.QWidget

friendly_name = ''

Set this for the GUI.

handles_classes = ()

This defines, what kinds of Configuration classes we can handle.

setup_ui()[source]

This method sets up the widgets that the user can manipulate to generate different kinds of configurations.

set_values()[source]

This method changes the widgets to represent the internal state of the Resetter.

match_configuration(configuration)[source]

If the configuration, that’s passed in, can be handled by us, I.E. is in handles_classes, we use take_over_settings to extract the settings and return True.

If the configuration doesn’t match, return False.

take_over_settings(configuration=None)[source]

Either take over the settings of another configurator or reset the settings to the last used configurator.

generate_example()[source]

Generate valid example values and take them over into the gui.

generate_generator()[source]

Generate a matching configuration generator from the settings.

staticMetaObject = <PySide.QtCore.QMetaObject object at 0x468e518>
class zasim.gui.reset.BaseRandomConfigurationResetter(mainwin, **kwargs)[source]

Bases: zasim.gui.reset.BaseResetter

perc_widgets = {}
friendly_name = 'Random Configuration'
handles_classes

alias of BaseRandomConfiguration

setting_values = False
take_over_settings(configuration=None)[source]
generate_example()[source]
setup_ui()[source]
set_values()[source]
perc_changed(new_value, index)[source]
generate_generator()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x55a3248>
class zasim.gui.reset.PatternResetter(mainwin, **kwargs)[source]

Bases: zasim.gui.reset.BaseResetter

This resetter allows the user to define patterns, that will be used to create a configuration.

friendly_name = 'Pattern Editor'
handles_classes

alias of PatternConfiguration

patterns = [(0,), (1,)]
layout = (1,)
class SubPatternEditor(base, position, pattern=None, palette=None, **kwargs)[source]

Bases: PySide.QtGui.QWidget

delete_me = <PySide.QtCore.Signal object at 0x57b0a40>
add_more = <PySide.QtCore.Signal object at 0x57b0f48>
pattern_changed = <PySide.QtCore.Signal object at 0x57d9030>
setup_ui()[source]
make_pattern_editors()[source]
create_edit_widget(value, idx)[source]
change_pattern(idx, new)[source]
set_is_only(is_only)[source]
add_left()[source]
add_right()[source]
set_position(position)[source]
on_add_more()[source]
on_delete_me()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x46922d8>
PatternResetter.take_over_settings(configuration=None)[source]
PatternResetter.generate_example()[source]
PatternResetter.setup_ui()[source]
PatternResetter.make_pattern_editor(position, pattern)[source]
PatternResetter.pattern_changed(position)[source]
PatternResetter.insert_new_pattern(position)[source]
PatternResetter.remove_pattern(position)[source]
PatternResetter.layout_changed(text)[source]
PatternResetter.generate_generator()[source]
PatternResetter.staticMetaObject = <PySide.QtCore.QMetaObject object at 0x46924d0>
class zasim.gui.reset.ImageResetter(*args, **kwargs)[source]

Bases: zasim.gui.reset.BaseResetter

friendly_name = 'From Image'
handles_classes

alias of ImageConfiguration

take_over_settings(configuration=None)[source]
setup_ui()[source]
generate_generator()[source]
browse()[source]
try_load(path)[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x3e2ca70>
class zasim.gui.reset.FallbackResetter(mainwin, **kwargs)[source]

Bases: zasim.gui.reset.BaseResetter

friendly_name = 'Reset using original'
handles_classes

alias of BaseConfiguration

take_over_settings(configuration=None)[source]
setup_ui()[source]
generate_generator()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x3e2c878>
class zasim.gui.reset.ResetWidget(mainwin, **kwargs)[source]

Bases: PySide.QtGui.QWidget

This widget lets the user choose from a wide variety of config generators using classes derived from BaseResetter and registered with the reg_resetter class decorator.

resetters = {}
current_resetter = None
setup_ui()[source]
switch_resetter(index)[source]
dismiss_changes()[source]
generate()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x5614560>
class zasim.gui.reset.ResetDocklet(mainwin, **kwargs)[source]

Bases: PySide.QtGui.QDockWidget

This dockwidget lets the user choose from a wide variety of config generators, by embedding a ResetWidget into a DockWidget.

The ZasimMainWindow embeds this by default.

staticMetaObject = <PySide.QtCore.QMetaObject object at 0x5554950>
setup_ui()[source]

Previous topic

zasim.gui.control - The control bar

Next topic

zasim.gui.displaywidgets - Widgets for displaying configurations

This Page