PyPO User Manual
GUI.MainWindow.MainWidget Class Reference

Contains all inner GUI widgets. More...

Inheritance diagram for GUI.MainWindow.MainWidget:

Public Member Functions

def __init__ (self, parent=None)
 Constructor. More...
 
def addToWindowGrid (self, widget, param, vStretch=0, hStretch=0)
 GUI setup functions. More...
 
def setForm (self, formData, readAction, okText=None)
 Generates a form widget. More...
 
def removeForm (self)
 Removes the form ParameterWid if exists.
 
def addPlot (self, figure, label)
 Functionalities: Plotting. More...
 
def plotElement (self, surface)
 Plots a single element from the System. More...
 
def plotGroup (self, group)
 Plots a group from the System. More...
 
def snapActionForm (self, element)
 Generate a snapshot form. More...
 
def snapGroupActionForm (self, group)
 Generate a snapshot form for a group. More...
 
def snapFrameActionForm (self, frame)
 Generate a snapshot form for ray-trace frame. More...
 
def snapAction (self)
 Take, revert or delete a snapshot.
 
def copyElementActionForm (self, element)
 Generate a copy form for a element. More...
 
def copyElementAction (self)
 Copy a element in system to a new version.
 
def copyGroupActionForm (self, group)
 Generate a copy form for a group. More...
 
def copyGroupAction (self)
 Copy a group in system to a new version.
 
def plotSystem (self)
 Plots all elements of the system in one plot.
 
def closePlotTab (self, i)
 Removes a plot from the tabWidget. More...
 
def getSysPlotNr (self)
 Functionalities: Naming. More...
 
def getRayPlotNr (self)
 Gets the frame plot number and increments it. More...
 
def plotSystemWithRaytraceForm (self)
 Generate from to plot a system with several ordered ray-trace frames.
 
def plotSystemWithRaytrace (self)
 Plots all elements of the system including ray traces in one plot.
 
def saveBeforeClosing (self)
 Functionalities: Systems.
 
def saveSystem (self)
 Opens a form that allows user to save the System.
 
def saveSystemAs (self)
 Saves the current system state under the name given in form.
 
def loadSystem (self)
 Loads system selected in from form.
 
def removeElement (self, element)
 Removes an element from the system. More...
 
def removeFrame (self, frame)
 Remove a ray-trace frame from the system. More...
 
def addGroupForm (self)
 Generate form to add group to system.
 
def addGroupAction (self)
 Add group to system.
 
def printGroup (self, name_group)
 Print group members to the gui console. More...
 
def refreshWorkspace (self)
 Refresh the workspace and update contents. More...
 
def addReflectorWidget (self, name)
 Functionalities: Adding widgets to workspace. More...
 
def addGroupWidget (self, name)
 Add group widget to workspace. More...
 
def addFrameWidget (self, name)
 Add frame widget to workspace. More...
 
def addFieldWidget (self, name)
 Add field widget to workspace. More...
 
def addCurrentWidget (self, name)
 Add current widget to workspace. More...
 
def addSFieldWidget (self, name)
 Add scalarfield widget to workspace. More...
 
def addPlaneForm (self)
 Functionalities: Adding Elements. More...
 
def addPlaneAction (self)
 Reads form and adds plane to System.
 
def addQuadricForm (self)
 Shows from to add a quadric surface.
 
def addQuadricAction (self)
 Reads quadric form, evaluates surface type and calls corresponding addAction.
 
def addParabolaAction (self)
 Reads form and adds parabola to System.
 
def addHyperbolaAction (self)
 Reads form and adds hyperbola to System.
 
def addEllipseAction (self)
 Reads form and adds ellipse to System.
 
def transformSingleForm (self, element)
 Functionalities: Transforming Elements. More...
 
def transformFrameForm (self, frame)
 Shows single element transformation form.
 
def transformAction (self, element)
 Applies single element transformation.
 
def transformGroupForm (self, group)
 Functionalities: Transforming Groups. More...
 
def transformGroupAction (self, element)
 Applies group transformation.
 
def transformFrameAction (self, frame)
 Applies single frame transformation.
 
def transformationMultipleForm (self)
 Shows multiple element transformation form.
 
def transformationMultipleAction (self)
 Applies multiple element transformation.
 
def initTubeFrameForm (self)
 Functionalities: RTFrames. More...
 
def initTubeFrameAction (self)
 Reads form and adds a tube frame to system.
 
def initGaussianFrameForm (self)
 Shows form to initialize gaussian frame.
 
def initGaussianFrameWorker (self, st.System s_copy, GRTDict, returnDict)
 
def initGaussianFrameAction (self)
 Reads form and adds a gaussian frame to system.
 
def setPropRaysForm (self)
 Shows form to propagate rays.
 
def addPropRaysAction (self)
 Reads form and propagates rays.
 
def plotFrameForm (self, frame)
 Shows form to plot preselected frame. More...
 
def addPlotFrameAction (self)
 Reads form and plots frame.
 
def initGaussBeamForm (self)
 Functionalities: PO. More...
 
def initGaussBeamAction (self)
 Reads form and adds a vectorial gaussian beam to system.
 
def initSGaussBeamForm (self)
 Shows form to initialize a scalar gaussian beam.
 
def initSGaussBeamAction (self)
 Reads form and adds a scalar gaussian beam to system.
 
def initPSBeamForm (self)
 Shows form to initialize a point source.
 
def initUSBeamForm (self)
 Shows form to initialize a physical optics uniform source. More...
 
def initPSBeamAction (self)
 Reads form and adds a vectorial point source beam to system.
 
def initUSBeamAction (self)
 Reads form and adds a vectorial uniform source beam to system.
 
def initSPSBeamForm (self)
 Shows form to initialize a scalar point source beam.
 
def initSUSBeamForm (self)
 Shows form to initialize a scalar uniform source beam.
 
def initSPSBeamAction (self)
 Reads form and adds a scalar point source beam to system.
 
def initSUPSBeamAction (self)
 Reads form and adds a scalar uniform source beam to system.
 
def plotFieldForm (self, field)
 Shows form to plot field. More...
 
def plotFieldAction (self)
 Reads form and plots field.
 
def plotSFieldForm (self, field)
 Show form to plot a scalarfield. More...
 
def plotSFieldAction (self)
 Reads form and plots scalar field.
 
def plotCurrentForm (self, current)
 Shows form to plot current. More...
 
def plotCurrentAction (self)
 Reads form and plots current.
 
def propPOForm (self)
 Shows form to propagate physical optics beam to surface.
 
def propPOFFForm (self)
 Shows form to propagate physical optics beam far field.
 
def propPOHybridForm (self)
 Shows form to propagate physical optics beam using hybrid approach.
 
def runPOWorker (self, s_copy, runPODict, returnDict)
 Start a worker process for running long calculations. More...
 
def runPOHybridWorker (self, s_copy, runHybridDict, returnDict)
 Start a worker process for running long calculations. More...
 
def propPOAction (self)
 Reads form propagates beam, runs calculation on another thread.
 
def propPOHybridAction (self)
 Reads form, propagates hybrid beam, runs calculation on another thread.
 
def setTaperEffsForm (self)
 Efficiencies and analysis.
 
def setSpillEffsForm (self)
 Shows form to calculate spillover efficiencies.
 
def setXpolEffsForm (self)
 Shows form to calculate x-pol efficiencies.
 
def setMBEffsForm (self)
 Shows form to calculate main beam efficiencies.
 
def setHPBWForm (self)
 Shows form to calculate half-power beamwidths.
 
def setBMergeSurfForm (self)
 Shows form to select surface for beam merging.
 
def setBMergeForm (self)
 Shows form to select surface for beam merging.
 
def BMergeActionFields (self)
 Merge fields on a common surface.
 
def BMergeActionCurrents (self)
 Merge currents on a common surface.
 
def calcTaperAction (self)
 Reads form and calculates taper efficiencies.
 
def calcSpillAction (self)
 Reads form and calculates spillover efficiencies.
 
def calcXpolAction (self)
 Reads form and calculates x-pol efficiencies.
 
def calcMBAction (self)
 Reads form and calculates main beam efficiencies.
 
def calcHPBWAction (self)
 Calculates half-power beamwidth along the E and H plane.
 
def calcRMSfromFrame (self, frame)
 Calculates root mean square of a frame.
 
def setFocusFindForm (self)
 Create form for finding focus of a frame.
 
def findFocusAction (self)
 Find focus of a frame of rays.
 

Public Attributes

 currentFileName
 
 unsavedChanges
 TODO: focus wordt niet gebruikt!!
 
 darkTheme
 
 currentFilePath
 
 grid
 
 GPWorkSpace
 
 GPParameterForm
 
 GPPlotScreen
 
 GPConsole
 
 clog_mgr
 
 clog
 
 stm
 
 subprocessManager
 
 console
 
 cursor
 
 WorkSpace
 
 PlotWidget
 
 ParameterWid
 
 formScroll
 
 sysPlotNr
 
 rayPlotNr
 

Detailed Description

Contains all inner GUI widgets.

Except the menu bar.

Responsible for the managing the GUI functionalities and communicating with System

Constructor & Destructor Documentation

◆ __init__()

def GUI.MainWindow.MainWidget.__init__ (   self,
  parent = None 
)

Constructor.

Configures the layout and initializes the underlying system.

See also
System

Member Function Documentation

◆ addCurrentWidget()

def GUI.MainWindow.MainWidget.addCurrentWidget (   self,
  name 
)

Add current widget to workspace.

Parameters
nameName of current to add.

◆ addFieldWidget()

def GUI.MainWindow.MainWidget.addFieldWidget (   self,
  name 
)

Add field widget to workspace.

Parameters
nameName of field to add.

◆ addFrameWidget()

def GUI.MainWindow.MainWidget.addFrameWidget (   self,
  name 
)

Add frame widget to workspace.

Parameters
nameName of frame to add.

◆ addGroupWidget()

def GUI.MainWindow.MainWidget.addGroupWidget (   self,
  name 
)

Add group widget to workspace.

Parameters
nameName of group to add.

◆ addPlaneForm()

def GUI.MainWindow.MainWidget.addPlaneForm (   self)

Functionalities: Adding Elements.

Shows form to add a plane.

◆ addPlot()

def GUI.MainWindow.MainWidget.addPlot (   self,
  figure,
  label 
)

Functionalities: Plotting.

Constructs a PlotScreen and adds it to the plotWidget along with a label for the tab.

◆ addReflectorWidget()

def GUI.MainWindow.MainWidget.addReflectorWidget (   self,
  name 
)

Functionalities: Adding widgets to workspace.

Add reflector widget to workspace.

Parameters
nameName of reflector to add.

◆ addSFieldWidget()

def GUI.MainWindow.MainWidget.addSFieldWidget (   self,
  name 
)

Add scalarfield widget to workspace.

Parameters
nameName of scalarfield to add.

◆ addToWindowGrid()

def GUI.MainWindow.MainWidget.addToWindowGrid (   self,
  widget,
  param,
  vStretch = 0,
  hStretch = 0 
)

GUI setup functions.

Adds a widget to the layout of PyPOMainWidget.

◆ closePlotTab()

def GUI.MainWindow.MainWidget.closePlotTab (   self,
  i 
)

Removes a plot from the tabWidget.

Parameters
iIndex of the plot to be removed.

◆ copyElementActionForm()

def GUI.MainWindow.MainWidget.copyElementActionForm (   self,
  element 
)

Generate a copy form for a element.

Parameters
elementName of element to be copied.

◆ copyGroupActionForm()

def GUI.MainWindow.MainWidget.copyGroupActionForm (   self,
  group 
)

Generate a copy form for a group.

Parameters
groupName of group to be copied.

◆ getRayPlotNr()

def GUI.MainWindow.MainWidget.getRayPlotNr (   self)

Gets the frame plot number and increments it.

Returns
The incremented frame plot number.

◆ getSysPlotNr()

def GUI.MainWindow.MainWidget.getSysPlotNr (   self)

Functionalities: Naming.

Gets the plot number and increments it.

Returns
The incremented plot number.

◆ initGaussBeamForm()

def GUI.MainWindow.MainWidget.initGaussBeamForm (   self)

Functionalities: PO.

Shows form to initialize gaussian beam.

◆ initTubeFrameForm()

def GUI.MainWindow.MainWidget.initTubeFrameForm (   self)

Functionalities: RTFrames.

Shows tube frame form.

◆ initUSBeamForm()

def GUI.MainWindow.MainWidget.initUSBeamForm (   self)

Shows form to initialize a physical optics uniform source.

Because uniform uses same inout as point source, can use same form.

◆ plotCurrentForm()

def GUI.MainWindow.MainWidget.plotCurrentForm (   self,
  current 
)

Shows form to plot current.

Parameters
currentCurrent to plot.

◆ plotElement()

def GUI.MainWindow.MainWidget.plotElement (   self,
  surface 
)

Plots a single element from the System.

Parameters
surfacestr Name of the surface in system.

◆ plotFieldForm()

def GUI.MainWindow.MainWidget.plotFieldForm (   self,
  field 
)

Shows form to plot field.

Parameters
fieldField to plot.

◆ plotFrameForm()

def GUI.MainWindow.MainWidget.plotFrameForm (   self,
  frame 
)

Shows form to plot preselected frame.

Parameters
frameFrame to plot.

◆ plotGroup()

def GUI.MainWindow.MainWidget.plotGroup (   self,
  group 
)

Plots a group from the System.

Parameters
groupstr Name of the group in system.

◆ plotSFieldForm()

def GUI.MainWindow.MainWidget.plotSFieldForm (   self,
  field 
)

Show form to plot a scalarfield.

Parameters
fieldField to plot.

◆ printGroup()

def GUI.MainWindow.MainWidget.printGroup (   self,
  name_group 
)

Print group members to the gui console.

Parameters
name_groupName of the group to be printed.

◆ refreshWorkspace()

def GUI.MainWindow.MainWidget.refreshWorkspace (   self)

Refresh the workspace and update contents.

Parameters
columnDictDictionary containing keys to be added.
sectionDenotes what section the key should be added to.

◆ removeElement()

def GUI.MainWindow.MainWidget.removeElement (   self,
  element 
)

Removes an element from the system.

Parameters
elementName of the element in the system.

◆ removeFrame()

def GUI.MainWindow.MainWidget.removeFrame (   self,
  frame 
)

Remove a ray-trace frame from the system.

Parameters
frameName of frame to be removed.

◆ runPOHybridWorker()

def GUI.MainWindow.MainWidget.runPOHybridWorker (   self,
  s_copy,
  runHybridDict,
  returnDict 
)

Start a worker process for running long calculations.

Parameters
s_copyCopy of System, containing necessary data for calculation.
runHybridDictDictionary containing instructions for hybrid PO propagation.
returnDictDictionary containing a System filled with the result.

◆ runPOWorker()

def GUI.MainWindow.MainWidget.runPOWorker (   self,
  s_copy,
  runPODict,
  returnDict 
)

Start a worker process for running long calculations.

Parameters
s_copyCopy of System, containing necessary data for calculation.
runPODictDictionary containing instructions for PO propagation.
returnDictDictionary containing a System filled with the result.

◆ setForm()

def GUI.MainWindow.MainWidget.setForm (   self,
  formData,
  readAction,
  okText = None 
)

Generates a form widget.

Parameters
formDataList of InputDescription objects.
readActionFunction to be called when forms ok-button is clicked.

◆ snapActionForm()

def GUI.MainWindow.MainWidget.snapActionForm (   self,
  element 
)

Generate a snapshot form.

Parameters
elementElement to snap.

◆ snapFrameActionForm()

def GUI.MainWindow.MainWidget.snapFrameActionForm (   self,
  frame 
)

Generate a snapshot form for ray-trace frame.

Parameters
frameFrame to snap.

◆ snapGroupActionForm()

def GUI.MainWindow.MainWidget.snapGroupActionForm (   self,
  group 
)

Generate a snapshot form for a group.

Parameters
groupGroup to snap.

◆ transformGroupForm()

def GUI.MainWindow.MainWidget.transformGroupForm (   self,
  group 
)

Functionalities: Transforming Groups.

Shows group transformation form.

◆ transformSingleForm()

def GUI.MainWindow.MainWidget.transformSingleForm (   self,
  element 
)

Functionalities: Transforming Elements.

Shows single element transformation form.


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