Project

General

Profile

Signals and slots

The Framework uses a signals and slots mechanism, similar to the one used by Qt, for communication between Bricks and Control Objects.

Each Brick or Control Object can have several signals, which can be emitted, and slots, corresponding to methods which are exposed to the framework.

The framework ensures that a Brick and a Control Object signals and slots match when creating a GUI.

Matching signals and slots between Bricks and Control Objects

Each Brick has one or more connection definitions

Example:

    connections = {"command_executor": Connection("Command Executor",
                                          [],
                                          [ Slot("get_vars"), Slot("do_it") ],
                                          "executor_connected")}

Here there are no Signals and 2 Slots

Each Control Object declares which signals and slots it has.

Example of Control Object corresponding to the Brick above:

    signals = []
...
    slots = [ Slot('get_vars'), Slot('do_it') ]

A more complicated matching

Extract from Brick:

  connections =  { "foils control": Connection("Foils Control",
                            [Signal("foilChanged", "foilChanged"),
                             Signal("foilStateChanged", "foilStateChanged")],
                            [Slot("get_positions"), Slot("set_foil")],
                            "isConnected") }

Extract from Control Object:
  signals = [Signal("foilChanged"), Signal("foilStateChanged")]
....
  slots = [Slot("get_positions"), Slot("get_current_foil"), Slot("set_foil")]

We note that the Brick need to fulfill all Slots/Signals of the Control Object, but the Control Object can have more, like get_current_foil