Skip to content

Commit

Permalink
changed the actions to class variables
Browse files Browse the repository at this point in the history
  • Loading branch information
astellhorn committed Sep 18, 2023
1 parent 321bf5d commit 70ba195
Showing 1 changed file with 16 additions and 38 deletions.
54 changes: 16 additions & 38 deletions src/sas/qtgui/Plotting/Plotter2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,22 @@ def createContextMenu(self):
self.defaultContextMenu()

plot_slicer_menu=self.contextMenu.addMenu('Slicers')
plot_slicer_menu.actionCircularAverage = plot_slicer_menu.addAction("&Perform Circular Average")
plot_slicer_menu.actionCircularAverage.triggered.connect(self.onCircularAverage)
plot_slicer_menu.actionSectorView = plot_slicer_menu.addAction("&Sector [Q View]")
plot_slicer_menu.actionSectorView.triggered.connect(self.onSectorView)
plot_slicer_menu.actionAnnulusView = plot_slicer_menu.addAction("&Annulus [Phi View]")
plot_slicer_menu.actionAnnulusView.triggered.connect(self.onAnnulusView)
plot_slicer_menu.actionBoxSum = plot_slicer_menu.addAction("&Box Sum")
plot_slicer_menu.actionBoxSum.triggered.connect(self.onBoxSum)
plot_slicer_menu.actionBoxAveragingX = plot_slicer_menu.addAction("&Box Averaging in Qx")
plot_slicer_menu.actionBoxAveragingX.triggered.connect(self.onBoxAveragingX)
plot_slicer_menu.actionBoxAveragingY = plot_slicer_menu.addAction("&Box Averaging in Qy")
plot_slicer_menu.actionBoxAveragingY.triggered.connect(self.onBoxAveragingY)
plot_slicer_menu.actionWedgeAveragingQ = plot_slicer_menu.addAction("&Wedge Averaging in Q")
plot_slicer_menu.actionWedgeAveragingQ.triggered.connect(self.onWedgeAveragingQ)
plot_slicer_menu.actionWedgeAveragingPhi = plot_slicer_menu.addAction("&Wedge Averaging in Phi")
plot_slicer_menu.actionWedgeAveragingPhi.triggered.connect(self.onWedgeAveragingPhi)
self.actionCircularAverage = plot_slicer_menu.addAction("&Perform Circular Average")
self.actionCircularAverage.triggered.connect(self.onCircularAverage)
self.actionSectorView = plot_slicer_menu.addAction("&Sector [Q View]")
self.actionSectorView.triggered.connect(self.onSectorView)
self.actionAnnulusView = plot_slicer_menu.addAction("&Annulus [Phi View]")
self.actionAnnulusView.triggered.connect(self.onAnnulusView)
self.actionBoxSum = plot_slicer_menu.addAction("&Box Sum")
self.actionBoxSum.triggered.connect(self.onBoxSum)
self.actionBoxAveragingX = plot_slicer_menu.addAction("&Box Averaging in Qx")
self.actionBoxAveragingX.triggered.connect(self.onBoxAveragingX)
self.actionBoxAveragingY = plot_slicer_menu.addAction("&Box Averaging in Qy")
self.actionBoxAveragingY.triggered.connect(self.onBoxAveragingY)
self.actionWedgeAveragingQ = plot_slicer_menu.addAction("&Wedge Averaging in Q")
self.actionWedgeAveragingQ.triggered.connect(self.onWedgeAveragingQ)
self.actionWedgeAveragingPhi = plot_slicer_menu.addAction("&Wedge Averaging in Phi")
self.actionWedgeAveragingPhi.triggered.connect(self.onWedgeAveragingPhi)

plot_slicer_menu.addSeparator()

Expand All @@ -205,29 +205,7 @@ def createContextMenu(self):
functools.partial(self.onSavePoints, self.data0))
self.contextMenu.addSeparator()

#self.actionCircularAverage = self.contextMenu.addAction("&Perform Circular Average")
#self.actionCircularAverage.triggered.connect(self.onCircularAverage)
#self.actionSectorView = self.contextMenu.addAction("&Sector [Q View]")
#self.actionSectorView.triggered.connect(self.onSectorView)
#self.actionAnnulusView = self.contextMenu.addAction("&Annulus [Phi View]")
#self.actionAnnulusView.triggered.connect(self.onAnnulusView)
#self.actionBoxSum = self.contextMenu.addAction("&Box Sum")
#self.actionBoxSum.triggered.connect(self.onBoxSum)
#self.actionBoxAveragingX = self.contextMenu.addAction("&Box Averaging in Qx")
#self.actionBoxAveragingX.triggered.connect(self.onBoxAveragingX)
#self.actionBoxAveragingY = self.contextMenu.addAction("&Box Averaging in Qy")
#self.actionBoxAveragingY.triggered.connect(self.onBoxAveragingY)
#self.actionWedgeAveragingQ = self.contextMenu.addAction("&Wedge Averaging in Q")
#self.actionWedgeAveragingQ.triggered.connect(self.onWedgeAveragingQ)
#self.actionWedgeAveragingPhi = self.contextMenu.addAction("&Wedge Averaging in Phi")
#self.actionWedgeAveragingPhi.triggered.connect(self.onWedgeAveragingPhi)

# Additional items for slicer interaction
#if self.slicer:
# self.actionClearSlicer = self.contextMenu.addAction("&Clear Slicer")
# self.actionClearSlicer.triggered.connect(self.onClearSlicer)
#self.actionEditSlicer = self.contextMenu.addAction("&Edit Slicer Parameters")
#self.actionEditSlicer.triggered.connect(self.onEditSlicer)
self.contextMenu.addSeparator()
self.actionColorMap = self.contextMenu.addAction("&2D Color Map")
self.actionColorMap.triggered.connect(self.onColorMap)
Expand Down

0 comments on commit 70ba195

Please sign in to comment.