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.MainWindow Class Reference

GUI main window class. More...

## Public Member Functions
def | __init__
| Constructor to initialize main window.
def | okToContinue
| This function checks if there are unsaved changes and, if there are, aks the user to save them.
def | updateStatus
| Print message and update window title.
def | fileRead
| Reads parameters from a file.
def | closeSPlotMagPhaseWindow
| Close SPlotMagPhase plot window, if it exists.
def | closeResultsWindow
| Close SPlotCompare plot windows, if they exist.
def | closeCMWindows
| Close Coupling Matrix window and CM error plot window, if they exist.
def | cleanup
| Clean up previous results and any open plot or coupling matrix window.
def | plotSParameters
| Plot [S] parameters magnitude and phase graph, if they are available.
def | plotMasks
| Add masks to [S] plots.
def | updateWindows
| Update all plot windows and CM window if they exist.
Functions automatically excuted when the user interacts with the GUI
def | closeEvent
| Reimplementation of the window close function.
def | on_action_HelpAbout_triggered
| Show "HelpAbout"" dialog from help menu.
def | on_action_HelpHelp_triggered
| Show "HelpHelp"" dialog from help menu.
def | on_action_FileExit_triggered
| Close application.
def | on_action_Execute_triggered
| Execute synthesis computation.
def | on_action_CouplingMatrix_triggered
| Opens dialog to display and rotate coupling matrices.
def | on_action_Edit_triggered
| Opens dialog to edit parameters.
def | on_action_FileSave_triggered
| Save parameters to file.
def | on_action_FileSaveAs_triggered
| Ask for a file name and save parameters to file.
def | on_action_FileOpen_triggered
| Ask for a file name and load parameters from this file.
def | on_action_Mask_triggered
| If checked: Ask for a file name and load specification mask from this file.
def | on_action_Sopen_triggered
| Ask for a file name and load [S] from this file in Touchstone format.
def | on_action_FileNew_triggered
| Creates an empty instance of Parameters Class and opens dialog to edit parameters.
def | on_action_ListAdd_triggered
| Store current result in self.results_comboBox list and self.listResults.
def | on_action_ListRemove_triggered
| Remove result matrix from self.results_comboBox and self.listResults lists.
def | on_results_comboBox_currentIndexChanged
| Load a new result.
def | on_action_Compare_triggered
| Compare results in list.

## Detailed Description

GUI main window class.

Definition at line 998 of file mwfiltersgui.py.

## Constructor & Destructor Documentation

def mwfiltersgui.MainWindow.__init__ | ( |  | self,
|  |  | fileName,
|  |  | parent = `None`
| ) |  |

Constructor to initialize main window.

            @param fileName = Name of file to automatically open after creating the window. If equal to None, no file is open.
            @param parent = Parent widget, in this case is None.

Variable to store the modified or unmodifed status of parameters class instance P. Variable that will avoid cleanup if set to True. It is used when a method that calls self.clenaup() is called by the GUI and not by the user. The user may want to avoid cleanup in some situations. Name of the parameters file to process. When main Window is created, self.fileName is a copy of the file name given in the command line when calling the application. Later self.fileName can be modified when opening a parameter file with the GUI. Application name, to be accesible outside this module. Last open directory name Parameters class instance containing filter and synthesis parameters. Read from the parameters file and -maybe- modified with the Parameter Edit Dialog. Copy of the CharPolys class instance containing characteristic polynomials. Copy of the CouplingMatrices class instance containing coupling matrices. Copy of the SParameters class instance containing [S] parameters. Copy of the FrequencyTransform class instance containing the frequency transform. Specification Mask class instance. Flag that is True when a successful computation has been done. When the flag is False, no results are plotted. QMainWindow that contains the parameter edit window. QwtPlot that contains the Magnitude and Phase S-parameter plot. QwtPlot that compares S-parameters obtained from CP from those obtained from CM. QwtPlot that compares S-parameters for different results. QwtPlot that contains stored energy and dissipated power QwtPlot that contains S-parameters for sensitivity analysis QMainWindow that contains the coupling matrix table. List of results to compare Last index of results selection comboBox Flag that controls if frequency axis must be autoscaled. It will become true after changing the sweep min and max frequencies. Store the mainWindow class instance into global variable 'mainWindow' defined in the libcommonfunc.py and libfreefilters.py in order to let the console interface functions in libcommonfunc.py and libfreefilters.py access the GUI mainWindow. The GUI methods access the mainWindow class through ParamEditDlg.mainWindow and MainWindow self attributes.

Definition at line 1006 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.applicationName, mwfiltersgui.MainWindow.autoScaleFreq, mwfiltersgui.MainWindow.CM, mwfiltersgui.MainWindow.CMdialog, mwfiltersgui.MainWindow.computed, mwfiltersgui.MainWindow.CP, mwfiltersgui.MainWindow.dirty, mwfiltersgui.MainWindow.EnergyPlot, mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.fileRead(), libcommonfunc.Sparameters.FT, mwfiltersgui.MainWindow.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, mwfiltersgui.MainWindow.indexResults, mwfiltersgui.MainWindow.lastDir, mwfiltersgui.MainWindow.listResults, libcommonfunc.myPrint(), mwfiltersgui.MainWindow.noCleanup, mwfiltersgui.MainWindow.on_results_comboBox_currentIndexChanged(), mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.paramEdit, mwfiltersgui.MainWindow.results_comboBox, libcommonfunc.setGlobalVariablesLibCommonFunc(), libfreefilters.setGlobalVariablesLibFreeFilters(), mwfiltersgui.MainWindow.settings, mwfiltersgui.MainWindow.SM, mwfiltersgui.MainWindow.SP, libcommonfunc.CouplingMatrices.SP, mwfiltersgui.MainWindow.SPlotCompare, mwfiltersgui.MainWindow.SPlotError, mwfiltersgui.MainWindow.SPlotMagPhase, and mwfiltersgui.MainWindow.SPlotSensitivity.

Here is the call graph for this function:

## Member Function Documentation

def mwfiltersgui.MainWindow.cleanup | ( |  | self | ) |

Clean up previous results and any open plot or coupling matrix window.

Clean up is disabled if self.nocleanup is True, in that case this method does nothing. Sets self.dirty to False.

Definition at line 1275 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.closeCMWindows(), mwfiltersgui.MainWindow.closeSPlotMagPhaseWindow(), mwfiltersgui.MainWindow.CM, mwfiltersgui.MainWindow.CP, libcommonfunc.Sparameters.FT, mwfiltersgui.MainWindow.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, mwfiltersgui.MainWindow.noCleanup, mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.SP, and libcommonfunc.CouplingMatrices.SP.

Referenced by mwfiltersgui.MainWindow.on_action_FileNew_triggered(), and mwfiltersgui.MainWindow.on_action_FileOpen_triggered().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.fileRead | ( |  | self,
|  |  | fname
| ) |  |

Reads parameters from a file.

Parameters

  fname | = File name.

Definition at line 1194 of file mwfiltersgui.py.

References mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, libcommonfunc.Sparameters.FT, mwfiltersgui.MainWindow.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, mwfiltersgui.MainWindow.lastDir, mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.paramEdit, libcommonfunc.readParamFile(), and mwfiltersgui.MainWindow.updateStatus().

Referenced by mwfiltersgui.MainWindow.__init__(), and mwfiltersgui.MainWindow.on_action_FileOpen_triggered().

Here is the call graph for this function:

Here is the caller graph for this function:

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

This function checks if there are unsaved changes and, if there are, aks the user to save them.

The function is executed by the GUI when there is an action that will destroy the parameter class P: Close application, Open file, New file, etc.

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

Definition at line 1155 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.dirty, mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, and mwfiltersgui.MainWindow.on_action_FileSaveAs_triggered().

Referenced by mwfiltersgui.MainWindow.closeEvent(), mwfiltersgui.CouplingMatrixDlg.closeEvent(), mwfiltersgui.MainWindow.on_action_FileNew_triggered(), mwfiltersgui.MainWindow.on_action_FileOpen_triggered(), mwfiltersgui.CouplingMatrixDlg.on_action_Read_triggered(), mwfiltersgui.CouplingMatrixDlg.on_CM_comboBox_currentIndexChanged(), and mwfiltersgui.MainWindow.on_results_comboBox_currentIndexChanged().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.on_action_Compare_triggered | ( |  | self,
|  |  | checked
| ) |  |

Compare results in list.

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

Definition at line 1949 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.closeResultsWindow(), mwfiltersgui.MainWindow.listResults, libcommonfunc.myPrint(), and mwfiltersgui.MainWindow.SPlotCompare.

Referenced by mwfiltersgui.MainWindow.on_action_Sopen_triggered().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.on_action_CouplingMatrix_triggered | ( |  | self,
|  |  | checked
| ) |  |

Opens dialog to display and rotate coupling matrices.

This function is automatically executed by the GUI when the user triggers the 'Coupling Matrix' action.

Definition at line 1636 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.CM, and mwfiltersgui.MainWindow.CMdialog.

def mwfiltersgui.MainWindow.on_action_Edit_triggered | ( |  | self,
|  |  | checked
| ) |  |

Opens dialog to edit parameters.

This function is automatically executed by the GUI when the user triggers the Edit action.

Definition at line 1651 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.P, and mwfiltersgui.MainWindow.paramEdit.

Referenced by mwfiltersgui.MainWindow.on_action_FileNew_triggered().

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.on_action_Execute_triggered | ( |  | self,
|  |  | checked
| ) |  |

Execute synthesis computation.

This function is automatically executed by the GUI when the user triggers the Execute action.

Definition at line 1580 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.CM, mwfiltersgui.MainWindow.CMdialog, mwfiltersgui.MainWindow.computed, mwfiltersgui.MainWindow.CP, mwfiltersgui.MainWindow.EnergyPlot, libcommonfunc.Sparameters.FT, mwfiltersgui.MainWindow.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.paramEdit, mwfiltersgui.MainWindow.plotSParameters(), mwfiltersgui.runSynthesis(), mwfiltersgui.MainWindow.SP, libcommonfunc.CouplingMatrices.SP, mwfiltersgui.MainWindow.SPlotError, and mwfiltersgui.MainWindow.updateStatus().

Here is the call graph for this function:

def mwfiltersgui.MainWindow.on_action_FileExit_triggered | ( |  | self,
|  |  | checked
| ) |  |

Close application.

This function is automatically executed by the GUI when the user triggers the FileExit action.

Definition at line 1570 of file mwfiltersgui.py.

def mwfiltersgui.MainWindow.on_action_FileNew_triggered | ( |  | self,
|  |  | checked
| ) |  |

Creates an empty instance of Parameters Class and opens dialog to edit parameters.

This function is automatically executed by the GUI when the user triggers the FileNew action.

Definition at line 1821 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.cleanup(), mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.okToContinue(), mwfiltersgui.MainWindow.on_action_Edit_triggered(), mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.paramEdit, and mwfiltersgui.MainWindow.updateStatus().

Here is the call graph for this function:

def mwfiltersgui.MainWindow.on_action_FileOpen_triggered | ( |  | self,
|  |  | checked
| ) |  |

Ask for a file name and load parameters from this file.

This function is automatically executed by the GUI when the user triggers the FileOpen action.

Definition at line 1718 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.cleanup(), mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.fileRead(), mwfiltersgui.MainWindow.lastDir, mwfiltersgui.MainWindow.okToContinue(), and mwfiltersgui.MainWindow.paramEdit.

Here is the call graph for this function:

def mwfiltersgui.MainWindow.on_action_FileSave_triggered | ( |  | self,
|  |  | checked
| ) |  |

Save parameters to file.

This function is automatically executed by the GUI when the user triggers the FileSave action.

Definition at line 1671 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.dirty, mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.on_action_FileSaveAs_triggered(), mwfiltersgui.MainWindow.P, and mwfiltersgui.MainWindow.updateStatus().

Referenced by mwfiltersgui.MainWindow.on_action_FileSaveAs_triggered().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.on_action_FileSaveAs_triggered | ( |  | self,
|  |  | checked
| ) |  |

Ask for a file name and save parameters to file.

This function is automatically executed by the GUI when the user triggers the FileSaveAs action.

Definition at line 1692 of file mwfiltersgui.py.

References mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.on_action_FileSave_triggered(), and mwfiltersgui.MainWindow.P.

Referenced by mwfiltersgui.MainWindow.okToContinue(), and mwfiltersgui.MainWindow.on_action_FileSave_triggered().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.on_action_HelpAbout_triggered | ( |  | self,
|  |  | checked
| ) |  |

Show "HelpAbout"" dialog from help menu.

This function is automatically executed by the GUI when the user selects the menu Help/About. The information shown is read from the file docstring.

Definition at line 1536 of file mwfiltersgui.py.

def mwfiltersgui.MainWindow.on_action_HelpHelp_triggered | ( |  | self | ) |

Show "HelpHelp"" dialog from help menu.

This function is automatically executed by the GUI when the user selects the menu Help/Help. The information shown is read file Help/GUI_help.html.

Definition at line 1558 of file mwfiltersgui.py.

def mwfiltersgui.MainWindow.on_action_ListAdd_triggered | ( |  | self,
|  |  | checked
| ) |  |

Store current result in self.results_comboBox list and self.listResults.

Parameters

  checked | = SIGNAL/SLOT parameter.

Definition at line 1844 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.addResultToList(), mwfiltersgui.MainWindow.CM, mwfiltersgui.MainWindow.CP, libcommonfunc.Sparameters.FT, mwfiltersgui.MainWindow.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.paramEdit, mwfiltersgui.MainWindow.SP, and libcommonfunc.CouplingMatrices.SP.

Referenced by mwfiltersgui.CouplingMatrixDlg.okToContinue().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.on_action_Mask_triggered | ( |  | self,
|  |  | checked
| ) |  |

If checked: Ask for a file name and load specification mask from this file.

Plot the mask. If unchecked: Delete the mask data from memory and delete the mask curve from the plots. This function is automatically executed by the GUI when the user triggers the Mask action.

Definition at line 1747 of file mwfiltersgui.py.

References mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.lastDir, mwfiltersgui.MainWindow.plotMasks(), mwfiltersgui.MainWindow.SM, mwfiltersgui.MainWindow.SPlotError, mwfiltersgui.MainWindow.SPlotMagPhase, and mwfiltersgui.MainWindow.SPlotSensitivity.

Here is the call graph for this function:

def mwfiltersgui.MainWindow.on_action_Sopen_triggered | ( |  | self,
|  |  | checked
| ) |  |

Ask for a file name and load [S] from this file in Touchstone format.

Plot the [S] parameters in the results comparison window. This function is automatically executed by the GUI when the user triggers the Sopen action.

Definition at line 1799 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.addResultToList(), mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, mwfiltersgui.MainWindow.lastDir, and mwfiltersgui.MainWindow.on_action_Compare_triggered().

Here is the call graph for this function:

def mwfiltersgui.MainWindow.on_results_comboBox_currentIndexChanged | ( |  | self,
|  |  | index
| ) |  |

Load a new result.

This function is automatically executed by the GUI when the user changes the results list comboBox. It does nothing if self.noCleanup is True.

Definition at line 1902 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.CM, mwfiltersgui.MainWindow.CP, libcommonfunc.Sparameters.FT, mwfiltersgui.MainWindow.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, mwfiltersgui.MainWindow.indexResults, mwfiltersgui.MainWindow.listResults, libcommonfunc.myPrint(), mwfiltersgui.MainWindow.noCleanup, mwfiltersgui.MainWindow.okToContinue(), mwfiltersgui.MainWindow.P, mwfiltersgui.MainWindow.SP, libcommonfunc.CouplingMatrices.SP, and mwfiltersgui.MainWindow.updateWindows().

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

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.MainWindow.updateStatus | ( |  | self,
|  |  | message
| ) |  |

Print message and update window title.

Prints message in the log widget at the main window background and also at the status bar for 5 sec. Updates main window title with open file name and modified state.

Parameters

  message | = Message to print (string).

Definition at line 1176 of file mwfiltersgui.py.

References mwfiltersgui.MainWindow.dirty, mwfiltersgui.SpecMask.fileName, mwfiltersgui.MainWindow.fileName, and mwfiltersgui.MainWindow.P.

Referenced by mwfiltersgui.MainWindow.fileRead(), mwfiltersgui.MainWindow.on_action_Execute_triggered(), mwfiltersgui.MainWindow.on_action_FileNew_triggered(), and mwfiltersgui.MainWindow.on_action_FileSave_triggered().

Here is the caller graph for this function:

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

- mwfiltersgui.py