magneticalc.Constraint_Editor.Constraint_Editor

# ``magneticalc`.`Constraint_Editor`.`Constraint_Editor``

class documentation

`class Constraint_Editor(QDialog2):`

Constructor: `Constraint_Editor(gui)`

View In Hierarchy

Constraint_Editor class.

Method | `__init__` | Prepares the constraint editor, but doesn't fully initialize it yet.
Method | `changed.setter` | Sets the "changed" state. This updates the window title.
Method | `get_constraints` | Gets the list of constraints.
Method | `on_table_cell_edited` | Gets called after a table cell has been edited.
Method | `on_table_row_added` | Gets called after a row has been added to the table.
Method | `on_table_row_deleted` | Gets called after a row has been deleted from the table.
Method | `reload` | Reloads the constraint editor.
Method | `showEvent` | Gets called when the dialog is opened.
Method | `update_table` | Populates the table.
Constant | `HTML` | Undocumented
Class Variable | `Constraint_Options` | Undocumented
Class Variable | `Constraint_Types` | Undocumented
Instance Variable | `changed` | Returns the "changed" state.
Instance Variable | `gui` | Undocumented
Instance Variable | `table` | Undocumented
Instance Variable | `text_browser` | Undocumented
Property | `rows` | Gets the list of rows (constraint groups).
Property | `rows_count` | Gets the number of rows (constraint groups).
Instance Variable | `_changed` | Undocumented
Instance Variable | `_constraint_collection` | Undocumented

Inherited from `QDialog2`:

Method | `show` | Shows this dialog.
Instance Variable | `user_accepted` | Undocumented

Inherited from `QLayouted` (via `QDialog2`):

Method | `addButtons` | Adds buttons.
Method | `addLayout` | Adds layout.
Method | `addSpacing` | Adds spacing.
Method | `addWidget` | Adds widget.
Method | `install_layout` | Installs this layout in the parent.
Instance Variable | `_layout` | Undocumented

def __init__(self, gui: `GUI`):
overrides `magneticalc.QtWidgets2.QDialog2.QDialog2.__init__`

Prepares the constraint editor, but doesn't fully initialize it yet.

Parameters
gui: `GUI` | GUI

@changed.setter
def changed(self, changed: `bool`):

Sets the "changed" state. This updates the window title.

def get_constraints(self) -> `list[Constraint]`:

Gets the list of constraints.

Returns
`list[Constraint]` | List of constraints

def on_table_cell_edited(self, value: `str`, row: `int`, column: `int`):

Gets called after a table cell has been edited.

Parameters
value: `str` | Cell value
row: `int` | Row index
column: `int` | Column index

def on_table_row_added(self):

Gets called after a row has been added to the table.

def on_table_row_deleted(self, row: `int`):

Gets called after a row has been deleted from the table.

Parameters
row: `int` | Row index

def reload(self):

Reloads the constraint editor.

def showEvent(self, event: `QShowEvent`):
overrides `magneticalc.QtWidgets2.QDialog2.QDialog2.showEvent`

Gets called when the dialog is opened.

Parameters
event: `QShowEvent` | QShowEvent

def update_table(self):

Populates the table.

HTML =

Undocumented

Value
    f"""\n        Lengths in <b>cm</b>. &nbsp; Angles in <b>degrees</b>.<br><br>\n\n↵
            <b style="color: {Theme.MainColor};">Experimental Feature</b><br><br>\n\↵
    n        By default, all sampling volume points have relative permeability µ<sub↵
    >r</sub> = 1.<br>\n        A constraint assigns some other µ<sub>r</sub> to some↵
     region of the sampling volume.<br>\n        Setting the permeability of some re↵
    gion to zero locally disables the field calculation.<br>\n        In case of amb↵
    iguous constraints, the ones with maximum permeability take precedence.<br><br>\↵
    ...

Constraint_Options =

Undocumented

Constraint_Types: `dict[str, str]` =

Undocumented

@property
changed: `bool` =

Returns the "changed" state.

gui =

Undocumented

table =

Undocumented

text_browser =

Undocumented

@property
rows: `list[dict]` =

Gets the list of rows (constraint groups).

@property
rows_count: `int` =

Gets the number of rows (constraint groups).

_changed =

Undocumented

_constraint_collection =

Undocumented