Microwave filters GUI 2.0.3

- Main Page
- Related Pages
- Packages
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
mwfiltersgui.CouplingMatrixDlg Class Reference

GUI dialog to show coupling matrices. More...

## Public Member Functions
def | __init__
| Constructor: Creates dialog window with a table to display coupling matrices and buttons to save or store to disk, select matrix from list, plot [S] parameters or edit current matrix.
def | closeEvent
| Reimplementation of the window close function.
def | loadMatrixQ
| Load a N+2 coupling matrix into a QTableWidget.
def | okToContinue
| This function checks if matrix has been modified and not saved to list.
Functions automatically excuted when the user interacts with the GUI
def | CM_currentCellChanged
| Slot that is executed whenever current CM cell is changed.
def | Q_currentCellChanged
| Slot that is executed whenever current Q cell is changed.
def | matrixQChanged
| Slot that is executed whenever CM.MatQ is changed by a matrix edit action.
def | CM_itemChanged
| Update the contents of self.CM.MatQ after the user has edited the CM table widget.
def | Q_itemChanged
| Update the contents of self.CM.MatQ after the user has edited the Q table widget.
def | on_runSensitivity_pushButton_clicked
| Run sensitivity analysis This function is automatically executed by the GUI when the user pushes the 'Run' button in the sensitivity groupBox.
def | on_action_Edit_toggled
| Enable or disable matrix edit.
def | on_sensitivity_groupBox_toggled
| Enable or disable sensitivity analysis.
def | on_action_Read_triggered
| Load current matrix from disk.
def | on_action_SaveAll_triggered
| Save all matrices to disk, using default file names and extensions.
def | on_action_Save_triggered
| Save current matrix in disk.
def | on_action_ListAdd_triggered
| Store current matrix in self.CM_comboBox list.
def | on_action_ListRemove_triggered
| Remove current matrix from self.CM_comboBox and CM.listM lists.
def | on_action_PlotEnergy_triggered
| Plot stored energy and dissipated power computed from current coupling matrix.
def | on_action_PlotS_triggered
| Plot [S] parameters computed from current coupling matrix.
def | on_CM_comboBox_currentIndexChanged
| Load a new coupling matrix into the QTableWidget.
def | pushEditAction

## Detailed Description

GUI dialog to show coupling matrices.

Definition at line 3048 of file mwfiltersgui.py.

## Constructor & Destructor Documentation

def mwfiltersgui.CouplingMatrixDlg.__init__ | ( |  | self,
|  |  | CM,
|  |  | parent = `None`
| ) |  |

Constructor: Creates dialog window with a table to display coupling matrices and buttons to save or store to disk, select matrix from list, plot [S] parameters or edit current matrix.

            @param CM = CouplingMatrix class instance.
            @param parent = Parent widget, in this case is mainWindow.

Copy of the mainWindow class instance. It is necessary to store a copy since it must be accessed by some member functions. Matrix edit dialog. It will be a Modeless Live dialog, that is only hidden when closed. Sensitivity analysis dialog. It will be a Modeless Live dialog, that is only hidden when closed. Shallow copy of the mainWindow CM class instance, for easier access. Attribute that is set to True when CM.MatQ has been modified by user edit actions and not saved in list. Attribute that is set to True when changes to matrix must be recorded. It is disabled, for example, when the user does and incorrect matrix edit and the program automatically restores the old matrix value. Attribute that is set to True before automatic calls to on_action_CM_comboBox_currentIndexChanged() to avoid loading a matrix. SensitivityAnalisys class instance.

Definition at line 3056 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.CM, mwfiltersgui.CouplingMatrixDlg.CM, mwfiltersgui.CouplingMatrixDlg.CM_comboBox, mwfiltersgui.CouplingMatrixDlg.CM_currentCellChanged(), mwfiltersgui.CouplingMatrixDlg.CM_itemChanged(), mwfiltersgui.CouplingMatrixDlg.CM_name, mwfiltersgui.CouplingMatrixDlg.CM_nameLabel, mwfiltersgui.CouplingMatrixDlg.CM_prec, mwfiltersgui.CouplingMatrixDlg.CM_prec_label, mwfiltersgui.CouplingMatrixDlg.CM_tableWidget, mwfiltersgui.CouplingMatrixDlg.CM_tooltip, mwfiltersgui.CouplingMatrixDlg.CMbp_name, mwfiltersgui.CouplingMatrixDlg.CMbp_nameLabel, mwfiltersgui.CouplingMatrixDlg.CMbp_prec, mwfiltersgui.CouplingMatrixDlg.CMbp_prec_label, mwfiltersgui.CouplingMatrixDlg.CMbp_tableWidget, mwfiltersgui.CouplingMatrixDlg.CMbp_tooltip, mwfiltersgui.MainWindow.dirty, mwfiltersgui.CouplingMatrixDlg.dirty, mwfiltersgui.CouplingMatrixDlg.horizontalLayout_2, mwfiltersgui.CouplingMatrixDlg.horizontalLayout_3, mwfiltersgui.CouplingMatrixDlg.horizontalLayout_3bp, mwfiltersgui.CouplingMatrixDlg.horizontalLayout_4, mwfiltersgui.CouplingMatrixDlg.horizontalLayout_4bp, mwfiltersgui.CouplingMatrixDlg.loadMatrixQ(), dbplot.DbPlot.mainWindow, mwfiltersgui.SpecMask.mainWindow, dbplot.AxisScalingDlg.mainWindow, mwfiltersgui.HelpForm.mainWindow, dbplot.EditCurvesDlg.mainWindow, mwfiltersgui.SetCouplingDlg.mainWindow, mwfiltersgui.MatrixEditDlg.mainWindow, mwfiltersgui.PredisZeorsDlg.mainWindow, mwfiltersgui.SensitivityAnalysis.mainWindow, mwfiltersgui.CouplingMatrixDlg.mainWindow, mwfiltersgui.CouplingMatrixDlg.matrixEditDlg, mwfiltersgui.CouplingMatrixDlg.matrixQChanged(), mwfiltersgui.CouplingMatrixDlg.noLoadCM, mwfiltersgui.CouplingMatrixDlg.on_CM_comboBox_currentIndexChanged(), mwfiltersgui.CouplingMatrixDlg.Q_currentCellChanged(), mwfiltersgui.CouplingMatrixDlg.Q_itemChanged(), mwfiltersgui.CouplingMatrixDlg.Q_prec, mwfiltersgui.CouplingMatrixDlg.Q_prec_label, mwfiltersgui.CouplingMatrixDlg.Q_tableWidget, mwfiltersgui.CouplingMatrixDlg.Q_tooltip, mwfiltersgui.CouplingMatrixDlg.Qprec_Layout, mwfiltersgui.CouplingMatrixDlg.recordChanges, mwfiltersgui.CouplingMatrixDlg.SA, mwfiltersgui.CouplingMatrixDlg.sensitivityDlg, mwfiltersgui.CouplingMatrixDlg.verticalLayout_CM, and mwfiltersgui.CouplingMatrixDlg.verticalLayout_CMbp.

Here is the call graph for this function:

## Member Function Documentation

def mwfiltersgui.CouplingMatrixDlg.closeEvent | ( |  | self,
|  |  | event
| ) |  |

Reimplementation of the window close function.

Sets mainWindow.CMdialog to None.

Definition at line 3295 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.okToContinue(), and mwfiltersgui.CouplingMatrixDlg.okToContinue().

Here is the call graph for this function:

def mwfiltersgui.CouplingMatrixDlg.loadMatrixQ | ( |  | self,
|  |  | MatQ,
|  |  | loadMatrix = `True`,
|  |  | loadQ = `True`
| ) |  |

Load a N+2 coupling matrix into a QTableWidget.

All actions that modify the coupling matrix, end up executing this method, so the [S] error plot is updated if it exists.

Parameters

  MatQ | = MatrixQ class instance.
  loadMatrix | = Load contents of coupling matrix. Default True.
  loadQ | = Load contents of Q vector. Default True.

Definition at line 3328 of file mwfiltersgui.py.

References mwfiltersgui.CouplingMatrixDlg.CM_tableWidget, mwfiltersgui.CouplingMatrixDlg.CMbp_tableWidget, libcommonfunc.complexStr(), mwfiltersgui.CouplingMatrixDlg.matrixEditDlg, mwfiltersgui.CouplingMatrixDlg.on_action_PlotEnergy_triggered(), mwfiltersgui.CouplingMatrixDlg.on_action_PlotS_triggered(), mwfiltersgui.CouplingMatrixDlg.Q_tableWidget, libcommonfunc.MatrixQ.rowIndices, and mwfiltersgui.CouplingMatrixDlg.rowIndices.

Referenced by mwfiltersgui.CouplingMatrixDlg.__init__(), mwfiltersgui.CouplingMatrixDlg.matrixQChanged(), mwfiltersgui.CouplingMatrixDlg.on_action_Edit_toggled(), mwfiltersgui.CouplingMatrixDlg.on_action_Read_triggered(), and mwfiltersgui.CouplingMatrixDlg.on_CM_comboBox_currentIndexChanged().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.CouplingMatrixDlg.matrixQChanged | ( |  | self | ) |

Slot that is executed whenever CM.MatQ is changed by a matrix edit action.

The self.dirty attribute is set to True.

Definition at line 3511 of file mwfiltersgui.py.

References mwfiltersgui.CouplingMatrixDlg.CM_name, mwfiltersgui.MainWindow.dirty, mwfiltersgui.CouplingMatrixDlg.dirty, mwfiltersgui.CouplingMatrixDlg.loadMatrixQ(), mwfiltersgui.CouplingMatrixDlg.pushEditAction(), and mwfiltersgui.CouplingMatrixDlg.recordChanges.

Referenced by mwfiltersgui.CouplingMatrixDlg.__init__(), mwfiltersgui.CouplingMatrixDlg.CM_itemChanged(), and mwfiltersgui.CouplingMatrixDlg.Q_itemChanged().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.CouplingMatrixDlg.okToContinue | ( |  | self | ) |

This function checks if matrix has been modified and not saved to list.

If it has been modified, asks the user to save the matrix. The function is executed by the GUI when there is an action that will destroy CM.MatQ: Load matrix from list or read matrix from disk.

Returns
  ok (True / False) = If True the use has agreed to continue, if False the user cancels the operation.

Definition at line 3439 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.dirty, mwfiltersgui.CouplingMatrixDlg.dirty, mwfiltersgui.MainWindow.on_action_ListAdd_triggered(), and mwfiltersgui.CouplingMatrixDlg.on_action_ListAdd_triggered().

Referenced by mwfiltersgui.CouplingMatrixDlg.closeEvent(), mwfiltersgui.CouplingMatrixDlg.on_action_Read_triggered(), and mwfiltersgui.CouplingMatrixDlg.on_CM_comboBox_currentIndexChanged().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.CouplingMatrixDlg.on_action_Edit_toggled | ( |  | self,
|  |  | checked
| ) |  |

Enable or disable matrix edit.

This function is automatically executed by the GUI when the user toggles the 'Edit' button.

Definition at line 3687 of file mwfiltersgui.py.

References mwfiltersgui.CouplingMatrixDlg.CM_tooltip, mwfiltersgui.CouplingMatrixDlg.loadMatrixQ(), mwfiltersgui.CouplingMatrixDlg.Q_tooltip, and mwfiltersgui.CouplingMatrixDlg.recordChanges.

Here is the call graph for this function:

def mwfiltersgui.CouplingMatrixDlg.on_action_ListAdd_triggered | ( |  | self,
|  |  | checked,
|  |  | programmed = `False`
| ) |  |

Store current matrix in self.CM_comboBox list.

Parameters

  checked | = SIGNAL/SLOT parameter.
  programmed | = Flag that is true when this function is executed by the program, not the user, to avoid setting CM_comboBox CurrentIndex. Default False.

Definition at line 3815 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.dirty, mwfiltersgui.CouplingMatrixDlg.dirty, mwfiltersgui.CouplingMatrixDlg.matrixEditDlg, libcommonfunc.myPrint(), mwfiltersgui.CouplingMatrixDlg.pushEditAction(), and mwfiltersgui.CouplingMatrixDlg.recordChanges.

Referenced by mwfiltersgui.CouplingMatrixDlg.okToContinue().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.CouplingMatrixDlg.on_action_PlotS_triggered | ( |  | self,
|  |  | checked
| ) |  |

Plot [S] parameters computed from current coupling matrix.

S21 and S11 are plotted on top of [S] parameters computed from Characteristic Polynomials.

Definition at line 4018 of file mwfiltersgui.py.

References dbplot.DbPlot.mainWindow, mwfiltersgui.SpecMask.mainWindow, dbplot.AxisScalingDlg.mainWindow, mwfiltersgui.HelpForm.mainWindow, dbplot.EditCurvesDlg.mainWindow, mwfiltersgui.SetCouplingDlg.mainWindow, mwfiltersgui.MatrixEditDlg.mainWindow, mwfiltersgui.PredisZeorsDlg.mainWindow, mwfiltersgui.SensitivityAnalysis.mainWindow, mwfiltersgui.CouplingMatrixDlg.mainWindow, and libcommonfunc.myPrint().

Referenced by mwfiltersgui.CouplingMatrixDlg.loadMatrixQ().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.CouplingMatrixDlg.on_CM_comboBox_currentIndexChanged | ( |  | self,
|  |  | index
| ) |  |

Load a new coupling matrix into the QTableWidget.

This function is automatically executed by the GUI when the user changes the coupling matrix type comboBox.

Definition at line 4105 of file mwfiltersgui.py.

References libcommonfunc.copy(), mwfiltersgui.MainWindow.dirty, mwfiltersgui.CouplingMatrixDlg.dirty, mwfiltersgui.CouplingMatrixDlg.loadMatrixQ(), mwfiltersgui.CouplingMatrixDlg.matrixEditDlg, libcommonfunc.myPrint(), mwfiltersgui.CouplingMatrixDlg.noLoadCM, mwfiltersgui.MainWindow.okToContinue(), mwfiltersgui.CouplingMatrixDlg.okToContinue(), mwfiltersgui.CouplingMatrixDlg.pushEditAction(), and mwfiltersgui.CouplingMatrixDlg.recordChanges.

Referenced by mwfiltersgui.CouplingMatrixDlg.__init__(), and mwfiltersgui.CouplingMatrixDlg.on_action_ListRemove_triggered().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.CouplingMatrixDlg.on_sensitivity_groupBox_toggled | ( |  | self,
|  |  | checked
| ) |  |

Enable or disable sensitivity analysis.

This function is automatically executed by the GUI when the user toggles the 'Sensitivity analysis' groupBox.

Definition at line 3741 of file mwfiltersgui.py.

def mwfiltersgui.CouplingMatrixDlg.Q_itemChanged | ( |  | self,
|  |  | item
| ) |  |

Update the contents of self.CM.MatQ after the user has edited the Q table widget.

        For each node \form#47, the quality factor is

where the loss conductance of the unloaded resonator is:

        If we change the \form#43 of a resonator, the new value of \form#292 is:

Definition at line 3619 of file mwfiltersgui.py.

References libcommonfunc.complexStr(), mwfiltersgui.CouplingMatrixDlg.matrixQChanged(), and mwfiltersgui.CouplingMatrixDlg.recordChanges.

Referenced by mwfiltersgui.CouplingMatrixDlg.__init__().

Here is the call graph for this function:

Here is the caller graph for this function:

The documentation for this class was generated from the following file:

- mwfiltersgui.py