Block Diagram GUI

Module contents

B-ASIC GUI Module.

Graphical user interface for B-ASIC.

b_asic.GUI.start_editor(sfg: SFG | None = None) Dict[str, SFG]

Start the SFG editor.

Parameters:
sfgSFG, optional

The SFG to start the editor with.

Returns:
dict

All SFGs currently in the editor.

Submodules

GUI.main_window module

B-ASIC Signal Flow Graph Editor Module.

This file opens the main SFG editor window of the GUI for B-ASIC when run.

class b_asic.GUI.main_window.SFGMainWindow(*args, **kwargs)

Bases: QMainWindow

add_namespace(*args, **kwargs)
add_operation(*args, **kwargs)
add_operations_from_namespace(*args, **kwargs)
create_sfg_from_toolbar(*args, **kwargs)
display_about_page(*args, **kwargs)
display_faq_page(*args, **kwargs)
display_keybindings_page(*args, **kwargs)
exit_app(*args, **kwargs)
get_operations_from_namespace(*args, **kwargs)
keyPressEvent(self, a0: QKeyEvent | None)
load_work(*args, **kwargs)
paintEvent(self, a0: QPaintEvent | None)
resizeEvent(self, a0: QResizeEvent | None)
save_work(*args, **kwargs)
simulate_sfg(*args, **kwargs)
update_statusbar(*args, **kwargs)
view_operation_names(*args, **kwargs)
wheelEvent(self, a0: QWheelEvent | None)
b_asic.GUI.main_window.start_editor(sfg: SFG | None = None) Dict[str, SFG]

Start the SFG editor.

Parameters:
sfgSFG, optional

The SFG to start the editor with.

Returns:
dict

All SFGs currently in the editor.

GUI.arrow module

class b_asic.GUI.arrow.Arrow(source_port_button: PortButton, destination_port_button: PortButton, window: SFGMainWindow, signal: Signal | None = None, parent=None)

Bases: QGraphicsPathItem

Arrow/connection in signal flow graph GUI.

Parameters:
source_port_buttonPortButton

Source port button.

destination_port_buttonPortButton

Destination port button.

windowSFGMainWindow

Window containing signal flow graph.

signalSignal, optional

Let arrow represent signal.

parentoptional

Parent.

contextMenuEvent(event)

Open right-click menu.

Parameters:
eventQEvent

The event.

property destination_operation: Operation

The destination Operation.

property destination_operation_button: DragButton

The destination DragButton.

property destination_port: InputPort

The destination InputPort.

property destination_port_button: PortButton

The destination PortButton.

remove()

Remove line and connections to signals etc.

set_destination_operation(destination: Operation)

Set operation of the destination DragButton.

Parameters:
destinationOperation

The operation to use as destination.

set_source_operation(source: Operation)

Set operation of the source DragButton.

Parameters:
sourceOperation

The operation to use as source.

property source_operation: Operation

The source Operation.

property source_operation_button: DragButton

The source DragButton.

property source_port: OutputPort

The source OutputPort.

property source_port_button: PortButton

The source PortButton.

update_arrow()

Update coordinates for arrow.

Used as callback when moving operations.

GUI.drag_button module

B-ASIC Drag Button Module.

Contains a GUI class for drag buttons.

class b_asic.GUI.drag_button.DragButton(*args, **kwargs)

Bases: QPushButton

Drag button class.

This class creates a button which can be clicked, dragged and dropped.

Parameters:
operationOperation

The operation that the drag button corresponds to.

show_namebool

Whether to show the name.

windowSFGMainWindow

Parent MainWindow.

parentunknown, optional

Passed to QPushButton.

add_label(*args, **kwargs)
add_ports(*args, **kwargs)
connectionRequested(*args, **kwargs)
contextMenuEvent(self, a0: QContextMenuEvent | None)
is_flipped(*args, **kwargs)
mouseMoveEvent(self, e: QMouseEvent | None)
mousePressEvent(self, e: QMouseEvent | None)
mouseReleaseEvent(self, e: QMouseEvent | None)
moved(*args, **kwargs)
property port_list: List[PortButton]

Return a list of PortButtons.

remove(*args, **kwargs)
select_button(*args, **kwargs)
show_properties_window(*args, **kwargs)
type_name(*args, **kwargs)

GUI.gui_interface module

class b_asic.GUI.gui_interface.Ui_main_window

Bases: object

retranslateUi(main_window)
setupUi(main_window)

GUI.port_button module

B-ASIC port button module.

class b_asic.GUI.port_button.PortButton(name: str, operation_button: DragButton, port: Port)

Bases: QPushButton

A button corresponding to a port.

Parameters:
namestr

The name of the button.

operation_buttonDragButton

The parent DragButton.

portPort

The SFG Port.

connectionRequested

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

contextMenuEvent(self, a0: QContextMenuEvent | None)
dragEnterEvent(self, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, a0: QDropEvent | None)
mouseMoveEvent(self, e: QMouseEvent | None)
mousePressEvent(self, e: QMouseEvent | None)
mouseReleaseEvent(self, e: QMouseEvent | None)
moved

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

property operation: Operation

Operation associated with PortButton.

select_port(modifiers=None)

Select the port taking modifiers into account.

Parameters:
modifiersoptional

Qt keyboard modifier.

GUI.precedence_graph_window module

B-ASIC window to show precedence graph.

class b_asic.GUI.precedence_graph_window.PrecedenceGraphWindow(window)

Bases: QDialog

Precedence graph window.

add_sfg_to_dialog()
pc

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

show_precedence_graph()

GUI.properties_window module

class b_asic.GUI.properties_window.PropertiesWindow(operation, main_window)

Bases: QDialog

save_properties()

GUI.select_sfg_window module

B-ASIC select SFG window.

class b_asic.GUI.select_sfg_window.SelectSFGWindow(window: SFGMainWindow)

Bases: QDialog

ok

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

save_properties()

GUI.signal_generator_input module

Inheritance diagram of b_asic.GUI.signal_generator_input
class b_asic.GUI.signal_generator_input.ConstantInput(*args, **kwargs)

Bases: SignalGeneratorInput

Class for graphically configuring and generating a Constant signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.DelayInput(*args, **kwargs)

Bases: SignalGeneratorInput

Abstract class for graphically configuring and generating signal generators that have a single delay parameter.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.FromFileInput(*args, **kwargs)

Bases: SignalGeneratorInput

Class for graphically configuring and generating a FromFile signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

get_input_file(i, file_browser)
class b_asic.GUI.signal_generator_input.GaussianInput(*args, **kwargs)

Bases: SignalGeneratorInput

Class for graphically configuring and generating a Gaussian signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.ImpulseInput(*args, **kwargs)

Bases: DelayInput

Class for graphically configuring and generating an Impulse signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.SignalGeneratorInput(logger, *args, **kwargs)

Bases: QGridLayout

Abstract class for graphically configuring and generating signal generators.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.SinusoidInput(*args, **kwargs)

Bases: SignalGeneratorInput

Class for graphically configuring and generating a Sinusoid signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.StepInput(*args, **kwargs)

Bases: DelayInput

Class for graphically configuring and generating a Step signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.UniformInput(*args, **kwargs)

Bases: SignalGeneratorInput

Class for graphically configuring and generating a Uniform signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

class b_asic.GUI.signal_generator_input.ZeroPadInput(*args, **kwargs)

Bases: SignalGeneratorInput

Class for graphically configuring and generating a ZeroPad signal generator.

get_generator() SignalGenerator

Return the SignalGenerator based on the graphical input.

GUI.simulate_sfg_window module

B-ASIC window to simulate an SFG.

class b_asic.GUI.simulate_sfg_window.SimulateSFGWindow(window)

Bases: QDialog

Simulation window.

add_sfg_to_dialog(sfg: SFG) None

Add a signal flow graph to the dialog.

Parameters:
sfgSFG

The signal flow graph to add.

change_input_format(i: int, text: str) None

Change the input format selector.

Parameters:
iint

Input number to change for.

textstr

Name of generator.

property properties: Dict

Return the simulation properties.

save_properties() None

Save the simulation properties and emit a signal to start the simulation.

simulate

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

GUI.simulation_worker module

class b_asic.GUI.simulation_worker.SimulationWorker(sfg: SFG, properties)

Bases: QObject

Simulation worker to enable running simulation in a separate thread.

Parameters:
sfgSFG

The signal flow graph to simulate.

propertiesdict

Dictionary containing information about the simulation.

finished

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

start_simulation()

Start simulation and emit signal when finished.

GUI.util_dialogs module

class b_asic.GUI.util_dialogs.FaqWindow(window)

Bases: QDialog

class b_asic.GUI.util_dialogs.KeybindingsWindow(window)

Bases: QDialog

add_information_to_layout()