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

GUI dialog to edit synthesis parameters. More...

## Public Member Functions
def | __init__
| Constructor: Creates dialog window containing values of parameters.
def | updateDialogParams
| Updates paramEditDlg widgets with contents of local copy of P (self.P).
def | updatewFuncTableEntries
| Update predistorsion weights table Widget with list.
def | readwFuncTableEntries
| Read list from predistorsion weights table Widget entries.
def | readTZsTableEntries
| Read list from TZs table Widget entries.
def | updateTZsTable
| Updates a TZs tableWidget with contents of list, and makes the number of rows equal to the number of zeros.
def | frequencyUnits
| Returns frequency expressed in GHz, MHz, 'kHz' or Hz.
def | st2floatInf
| Convert string to float.
def | float2stInf
| Convert float to string.
def | readDialogParams
| Reads parameter values from dialog and store in self.P (dialog working copy of parameters).
Functions automatically excuted when the user interacts with the GUI
def | updatePredisZerosArrang
| Update the size of the predistortion zeros arrangement list after the user changes the filter order.
def | updatewFuncTableSize
| Make the size of the adaptive predistorsion weights table equal to the order of the filter.
def | updateTotaltransmissionZeros
| Count the number of Generalized Chebyshev transmission zeros set in the GUI widgets and update the lcdNumber widget.
def | updateDlgHeight
| Update dialog size to fit table.
def | dialogChanged
| Custom slot in Qt designer conected to widgets "changed" signal.
def | on_outDir_pushButton_clicked
| Opens getExistingDirectory Qt dialog in order to set P.outDir variable.
def | on_TZoptim_pushButton_clicked
| Run imaginary TZ and bandwidth optimization to comply specification mask.
def | on_compute_pushButton_clicked
| Run synthesis.
def | on_TZS_newZero_pushButton_clicked
| Add new zero (blank) to transmission zeros table.
def | on_LP_newZero_pushButton_clicked
| Add new zero (blank) to LP complex zeros table.
def | on_TZs_symm_pushButton_clicked
| Add new zero with symmetrical imaginary part (in normalized frequency) to transmission zeros table.
def | on_LP_symm_pushButton_clicked
| Add new zero with symmetrical imaginary part (in normalized frequency) to transmission zeros table.
def | closeEvent
| Save current dialog parameters to mainWindow.P and close dialog.
def | on_discard_pushButton_clicked
| Reject current dialog parameters and close dialog.
def | on_f0_comboBox_currentIndexChanged
| Update lineEdit value when the units ComboBox is changed.
def | on_BW_comboBox_currentIndexChanged
| Update lineEdit value when the units ComboBox is changed.
def | on_qeZero_comboBox_currentIndexChanged
| Update lineEdit value when the units ComboBox is changed.
def | on_transmissionZeros_comboBox_currentIndexChanged
| Update lineEdit value when the units ComboBox is changed.
def | on_minFreq_comboBox_currentIndexChanged
| Update lineEdit value when the units ComboBox is changed.
def | on_maxFreq_comboBox_currentIndexChanged
| Update lineEdit value when the units ComboBox is changed.

## Detailed Description

GUI dialog to edit synthesis parameters.

Definition at line 4155 of file mwfiltersgui.py.

## Constructor & Destructor Documentation

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

Constructor: Creates dialog window containing values of parameters.

            Modifies MainWindow.P , using a shallow copy for easier access.
            Saves a backup copy of the mainWindow Parameters and synthesis results, that will be restored if the user Discards the dialog.
            @param parent = Parent widget, in this case is mainWindow.

Index of the Center Frequency Units comboBox. It is used to check if the user has changed the Frequency Units in the GUI and to update the Frequency value accordingly. Index of the Bandwidth Units comboBox. It is used to check if the user has changed the Bandwidth Units in the GUI and to update the Bandwidth value accordingly. Index of the Quasieliptic zero frequency units comboBox. It is used to check if the user has changed the Frequency Units in the GUI and to update the Frequency value accordingly. Index of the Generalized Chebyshev zeros frequency units comboBox. It is used to check if the user has changed the Frequency Units in the GUI and to update the Frequency value accordingly. Index of the Minimum Frequency Units comboBox. It is used to check if the user has changed the Frequency Units in the GUI and to update the Frequency value accordingly. Index of the Maximum Frequency Units comboBox. It is used to check if the user has changed the Frequency Units in the GUI and to update the Frequency value accordingly. Variable that becomes true when the user clicks the 'Discard' button to reject the dialog. Its is necessary to use this variable, since now the dialog is a QMainWindow instead of a QDialog, and QMainWindow does not have a reject() slot. Variable that is False when it is necessary to recompute synthesis because Parameters have been modified. Variable to store a list of widgets with bad input. Only when this list is empty, he "Accept" and "Compute" buttons are enabled. Variable to store sweep value in order to check if it has been changed by the user, and then update frequency axis. Tuple (fmin, fmax) Copy of the mainWindow class instance. It is necessary to store a copy since it must be accessed by some member functions. Shallow copy just for easier access. Backup copy of the mainWindow Parameters and synthesis results, that will be restored if the user Discards the dialog. Initial dialog size as set in Qt designer Variable to store the modified/unmodifed status of the dialog working copy of parameters self.P. The dialogChanged() method is automatically called when the user modifies the edit widgets contents and sets this variable to True. This variable must be set to False at the end of the init dialog constructor, since dialogChanged() is called when the constructor sets the edit widgets contents.

Definition at line 4164 of file mwfiltersgui.py.

References mwfiltersgui.MatrixEditDlg.badInput, mwfiltersgui.ParamEditDlg.badInput, mwfiltersgui.ParamEditDlg.BWUnitsIndex, mwfiltersgui.MatrixEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.dlgInitSize, mwfiltersgui.ParamEditDlg.f0UnitsIndex, mwfiltersgui.ParamEditDlg.genChebyTZs_horizontalLayout, mwfiltersgui.ParamEditDlg.genChebyTZs_tableWidget, mwfiltersgui.ParamEditDlg.genChebyTZs_tooltip, mwfiltersgui.ParamEditDlg.LPcomplexZeros_horizontalLayout, mwfiltersgui.ParamEditDlg.LPcomplexZeros_tableWidget, mwfiltersgui.ParamEditDlg.LPcomplexZeros_tooltip, 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.ParamEditDlg.mainWindow, mwfiltersgui.ParamEditDlg.maxFreqUnitsIndex, mwfiltersgui.ParamEditDlg.minFreqUnitsIndex, mwfiltersgui.MainWindow.P, mwfiltersgui.ParamEditDlg.P, mwfiltersgui.ParamEditDlg.qeZeroUnitsIndex, mwfiltersgui.ParamEditDlg.recomputed, mwfiltersgui.ParamEditDlg.rejected, mwfiltersgui.ParamEditDlg.resultBkp, mwfiltersgui.ParamEditDlg.transmissionZerosUnitsIndex, mwfiltersgui.ParamEditDlg.updateDialogParams(), mwfiltersgui.ParamEditDlg.updatePredisZerosArrang(), mwfiltersgui.ParamEditDlg.updatewFuncTableSize(), mwfiltersgui.ParamEditDlg.wFunc_horizontalLayout, mwfiltersgui.ParamEditDlg.wFunc_tableWidget, and mwfiltersgui.ParamEditDlg.wFunc_tooltip.

Here is the call graph for this function:

## Member Function Documentation

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

Save current dialog parameters to mainWindow.P and close dialog.

This function is automatically executed by the GUI when the user clickes the 'Accept' button or closes the dialog. Closing the dialog by killing the window is equivalent to clicking the 'Accept' button.

Definition at line 5280 of file mwfiltersgui.py.

References mwfiltersgui.MatrixEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.on_compute_pushButton_clicked(), mwfiltersgui.ParamEditDlg.readDialogParams(), mwfiltersgui.ParamEditDlg.recomputed, and mwfiltersgui.ParamEditDlg.rejected.

Here is the call graph for this function:

def mwfiltersgui.ParamEditDlg.dialogChanged | ( |  | self | ) |

Custom slot in Qt designer conected to widgets "changed" signal.

This function is automatically executed by the GUI every time the user changes dialog values, and sets the self.dialogModified variable to True and self.recomputed to False.

Definition at line 5056 of file mwfiltersgui.py.

References mwfiltersgui.MatrixEditDlg.badInput, mwfiltersgui.ParamEditDlg.badInput, mwfiltersgui.MatrixEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.dialogModified, and mwfiltersgui.ParamEditDlg.recomputed.

def mwfiltersgui.ParamEditDlg.float2stInf | ( |  | self,
|  |  | value
| ) |  |

Convert float to string.

numpy.inf is converted to 'Inf'.

Parameters

  value | = Float value to convert.

Returns
  st = String.

Definition at line 4757 of file mwfiltersgui.py.

Referenced by mwfiltersgui.ParamEditDlg.updateDialogParams().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.frequencyUnits | ( |  | self,
|  |  | freq
| ) |  |

Returns frequency expressed in GHz, MHz, 'kHz' or Hz.

Parameters

  freq | = Frequency in Hz. Can be a float or a list of floats.

Returns
  (newFreq, units).
  newFreq = Frequency expressed in units.
  units = 'GHz', 'MHz', 'kHz' or 'Hz'.

Definition at line 4714 of file mwfiltersgui.py.

Referenced by mwfiltersgui.ParamEditDlg.updateDialogParams().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.on_BW_comboBox_currentIndexChanged | ( |  | self,
|  |  | value
| ) |  |

Update lineEdit value when the units ComboBox is changed.

This function is automatically executed by the GUI when the user changes the filter bandwidht units ComboBox.

Definition at line 5356 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.BWUnitsIndex.

def mwfiltersgui.ParamEditDlg.on_compute_pushButton_clicked | ( |  | self,
|  |  | checked
| ) |  |

Run synthesis.

If parameters are valid, self.mainWindow.on_action_Execute_triggered() will set self.recomputed to True.

Definition at line 5176 of file mwfiltersgui.py.

Referenced by mwfiltersgui.ParamEditDlg.closeEvent().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.on_discard_pushButton_clicked | ( |  | self,
|  |  | checked
| ) |  |

Reject current dialog parameters and close dialog.

A backup copy of parameters and synthesis results is recovered. This function is automatically executed by the GUI when the user clickes the 'Discard' button.

Definition at line 5315 of file mwfiltersgui.py.

References mwfiltersgui.MatrixEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.dialogModified, mwfiltersgui.ParamEditDlg.recomputed, mwfiltersgui.ParamEditDlg.rejected, and mwfiltersgui.ParamEditDlg.resultBkp.

def mwfiltersgui.ParamEditDlg.on_f0_comboBox_currentIndexChanged | ( |  | self,
|  |  | value
| ) |  |

Update lineEdit value when the units ComboBox is changed.

This function is automatically executed by the GUI when the user changes the filter frequency units ComboBox.

Definition at line 5341 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.f0UnitsIndex.

def mwfiltersgui.ParamEditDlg.on_maxFreq_comboBox_currentIndexChanged | ( |  | self,
|  |  | value
| ) |  |

Update lineEdit value when the units ComboBox is changed.

This function is automatically executed by the GUI when the user changes the maximum sweep frequency units ComboBox.

Definition at line 5417 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.maxFreqUnitsIndex.

def mwfiltersgui.ParamEditDlg.on_minFreq_comboBox_currentIndexChanged | ( |  | self,
|  |  | value
| ) |  |

Update lineEdit value when the units ComboBox is changed.

This function is automatically executed by the GUI when the user changes the minimum sweep frequency units ComboBox.

Definition at line 5402 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.minFreqUnitsIndex.

def mwfiltersgui.ParamEditDlg.on_qeZero_comboBox_currentIndexChanged | ( |  | self,
|  |  | value
| ) |  |

Update lineEdit value when the units ComboBox is changed.

This function is automatically executed by the GUI when the user changes the Quasieliptic zeros frequency units ComboBox.

Definition at line 5371 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.qeZeroUnitsIndex.

def mwfiltersgui.ParamEditDlg.on_transmissionZeros_comboBox_currentIndexChanged | ( |  | self,
|  |  | value
| ) |  |

Update lineEdit value when the units ComboBox is changed.

This function is automatically executed by the GUI when the user changes the Generalized Chebyshev zeros frequency units ComboBox.

Definition at line 5386 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.genChebyTZs_tableWidget, mwfiltersgui.ParamEditDlg.LPcomplexZeros_tableWidget, mwfiltersgui.ParamEditDlg.transmissionZerosUnitsIndex, and mwfiltersgui.ParamEditDlg.updateTZsTable().

Here is the call graph for this function:

def mwfiltersgui.ParamEditDlg.readDialogParams | ( |  | self | ) |

Reads parameter values from dialog and store in self.P (dialog working copy of parameters).

        Error control only for invalid parameter values that would crash the parser or the GUI.
        Empty lineEdit boxes are allowed in parameters that will not be used in the computation.
        More error control in lossyfilters.Parameters.validate() .
            @return ok (True / False) = If True, parameters have been read correctly, if False, there has been an error.

key is used to store parameter name for error catching

Definition at line 4769 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.BWUnitsIndex, mwfiltersgui.ParamEditDlg.f0UnitsIndex, mwfiltersgui.ParamEditDlg.genChebyTZs_tableWidget, mwfiltersgui.ParamEditDlg.LPcomplexZeros_tableWidget, mwfiltersgui.ParamEditDlg.maxFreqUnitsIndex, mwfiltersgui.ParamEditDlg.minFreqUnitsIndex, mwfiltersgui.ParamEditDlg.oldSweep, mwfiltersgui.MainWindow.P, mwfiltersgui.ParamEditDlg.P, mwfiltersgui.ParamEditDlg.qeZeroUnitsIndex, mwfiltersgui.ParamEditDlg.readTZsTableEntries(), mwfiltersgui.ParamEditDlg.readwFuncTableEntries(), and mwfiltersgui.ParamEditDlg.st2floatInf().

Referenced by mwfiltersgui.ParamEditDlg.closeEvent(), and mwfiltersgui.ParamEditDlg.on_TZoptim_pushButton_clicked().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.readTZsTableEntries | ( |  | self,
|  |  | table
| ) |  |

Read list from TZs table Widget entries.

Parameters

  table | = tableWidget to read

Returns
  listImag = list containing purely imaginary zeros entries in tableWidget
  listComplex = list containing complex zeros entries in tableWidget
  listReal = list containing purely real zeros entries in tableWidget

Definition at line 4611 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.transmissionZerosUnitsIndex.

Referenced by mwfiltersgui.ParamEditDlg.readDialogParams(), and mwfiltersgui.ParamEditDlg.updateTotaltransmissionZeros().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.readwFuncTableEntries | ( |  | self | ) |

Read list from predistorsion weights table Widget entries.

If row or column count is equal to 1, the 2D list is collapsed to a 1D list.

Returns
  list = list containing entries in tableWidget

Definition at line 4585 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.wFunc_tableWidget.

Referenced by mwfiltersgui.ParamEditDlg.readDialogParams().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.st2floatInf | ( |  | self,
|  |  | st
| ) |  |

Convert string to float.

'INF', 'Inf', 'inf' are converted to numpy.inf.

Parameters

  st | = String to convert.

Returns
  value = Numerical value of string (float).

Definition at line 4747 of file mwfiltersgui.py.

Referenced by mwfiltersgui.ParamEditDlg.readDialogParams().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.updateDialogParams | ( |  | self,
|  |  | autoFreqUnits = `True`
| ) |  |

Updates paramEditDlg widgets with contents of local copy of P (self.P).

Parameters

  autoFreqUnits | = If True, automatically update frequency units in ComboBoxes. It is True by default.

Definition at line 4347 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.BWUnitsIndex, mwfiltersgui.ParamEditDlg.f0UnitsIndex, mwfiltersgui.ParamEditDlg.float2stInf(), mwfiltersgui.ParamEditDlg.frequencyUnits(), mwfiltersgui.ParamEditDlg.genChebyTZs_tableWidget, mwfiltersgui.ParamEditDlg.LPcomplexZeros_tableWidget, mwfiltersgui.ParamEditDlg.maxFreqUnitsIndex, mwfiltersgui.ParamEditDlg.minFreqUnitsIndex, mwfiltersgui.ParamEditDlg.oldSweep, mwfiltersgui.MainWindow.P, mwfiltersgui.ParamEditDlg.P, mwfiltersgui.ParamEditDlg.qeZeroUnitsIndex, mwfiltersgui.ParamEditDlg.transmissionZerosUnitsIndex, mwfiltersgui.ParamEditDlg.updateTotaltransmissionZeros(), mwfiltersgui.ParamEditDlg.updateTZsTable(), and mwfiltersgui.ParamEditDlg.updatewFuncTableSize().

Referenced by mwfiltersgui.ParamEditDlg.__init__().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.updatePredisZerosArrang | ( |  | self,
|  |  | N
| ) |  |

Update the size of the predistortion zeros arrangement list after the user changes the filter order.

Parameters

  N | = Filter order as in self.N_spinBox.value()

Definition at line 4968 of file mwfiltersgui.py.

Referenced by mwfiltersgui.ParamEditDlg.__init__().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.updateTotaltransmissionZeros | ( |  | self | ) |

Count the number of Generalized Chebyshev transmission zeros set in the GUI widgets and update the lcdNumber widget.

The dialog window is automatically resized to fit the rows corresponding to TZs. This function is automatically executed by the GUI every time the user changes one of the zeros lists in the GUI.

Definition at line 5012 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.genChebyTZs_tableWidget, mwfiltersgui.ParamEditDlg.LPcomplexZeros_tableWidget, mwfiltersgui.ParamEditDlg.readTZsTableEntries(), and mwfiltersgui.ParamEditDlg.updateDlgHeight().

Referenced by mwfiltersgui.ParamEditDlg.on_LP_symm_pushButton_clicked(), mwfiltersgui.ParamEditDlg.on_TZs_symm_pushButton_clicked(), and mwfiltersgui.ParamEditDlg.updateDialogParams().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.updateTZsTable | ( |  | self,
|  |  | table,
|  |  | list
| ) |  |

Updates a TZs tableWidget with contents of list, and makes the number of rows equal to the number of zeros.

Adjusts widget size to table contents. This function is called by the self.updateDialogParams() function.

Parameters

  table | = tableWidget to update
  list | = list containing entries to set in tableWidget

Definition at line 4673 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.transmissionZerosUnitsIndex.

Referenced by mwfiltersgui.ParamEditDlg.on_transmissionZeros_comboBox_currentIndexChanged(), and mwfiltersgui.ParamEditDlg.updateDialogParams().

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.updatewFuncTableEntries | ( |  | self,
|  |  | list
| ) |  |

Update predistorsion weights table Widget with list.

Parameters

  list | = list containing entries to set in tableWidget

Definition at line 4570 of file mwfiltersgui.py.

References libcommonfunc.complexStr().

Referenced by mwfiltersgui.ParamEditDlg.updatewFuncTableSize().

Here is the call graph for this function:

Here is the caller graph for this function:

def mwfiltersgui.ParamEditDlg.updatewFuncTableSize | ( |  | self,
|  |  | list,
|  |  | dims,
|  |  | updateEntries
| ) |  |

Make the size of the adaptive predistorsion weights table equal to the order of the filter.

Calls self.updatewFuncTableEntries() function and adjusts widget size to table contents. This function is automatically executed by the GUI every time the user changes the filter order in the GUI or activates the adaptive predistiortion checkbox, but only if the synthesis method is 'Predistortion' and adaptive predistortion group box is checked. and is called by the self.updateDialogParams() function.

Parameters

  list | = list containing entries to set in tableWidget
  dims | = tuple (rows, cols) contaning number of rows and columns
  updateEntries | = If True, table entries are updated (calls self.updatewFuncTableEntries(list)). When this function is called by itemChanged signal, this flag must be False to avoid infinite recursion.

Definition at line 4988 of file mwfiltersgui.py.

References mwfiltersgui.ParamEditDlg.updatewFuncTableEntries().

Referenced by mwfiltersgui.ParamEditDlg.__init__(), and mwfiltersgui.ParamEditDlg.updateDialogParams().

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