Commit 94eb496d authored by Thomas Vincent's avatar Thomas Vincent

remove use of variables when used only once

parent 3e006dc5
......@@ -104,11 +104,9 @@ class ShiftNode(Node):
thisPoint = np.array([refPoint['x'], refPoint['y']])
refEntry = refPoint['entry']
if refPoint['entry'] != self.getEntry():
shift = self.getShift()
refShift = self.subject.getShift(refEntry)
refShift = self.subject.getShift(refPoint['entry'])
thisPoint += [shift.dx - refShift.dx, shift.dy - refShift.dy]
return thisPoint
......@@ -172,34 +170,21 @@ class ShiftNode(Node):
# ============
# WARNING END
entry = self.branchName
shiftSubject = self.subject
roiData = self.getRoiData(shifted=True, centered=True)
if roiData is not None:
pos_0, pos_1, data = roiData.x, roiData.y, roiData.z
origin = shiftSubject.getReferenceControlPoint()
shift = shiftSubject.getShift(entry)
origin = self.subject.getReferenceControlPoint()
shift = self.subject.getShift(self.branchName)
plot.selectPoint(origin['x'] + shift.dx, origin['y'] + shift.dy)
shiftX = shift.dx
shiftY = shift.dy
centerX = origin['x'] + shiftX
centerY = origin['y'] + shiftY
plot.selectPoint(centerX, centerY)
plot.setPlotData(pos_0, pos_1, data)
plot.setPlotData(x=roiData.x, y=roiData.y, values=roiData.z)
plot.replot()
pixmap = plot.toPixmap()
self._setDataInternal(1, pixmap, Qt.Qt.DecorationRole, notify=True)
self._setDataInternal(
1, plot.toPixmap(), Qt.Qt.DecorationRole, notify=True)
return True and rc
return rc
class ShiftSelectorPanel(Qt.QWidget):
......@@ -767,8 +752,8 @@ class ShiftWidget(Qt.QMainWindow):
layout.addWidget(self.__yShiftPlot)
buttonsLayout = Qt.QHBoxLayout()
buttons = Qt.QDialogButtonBox.Save | Qt.QDialogButtonBox.Cancel
bottomBnGrp = Qt.QDialogButtonBox(buttons)
bottomBnGrp = Qt.QDialogButtonBox(
Qt.QDialogButtonBox.Save | Qt.QDialogButtonBox.Cancel)
self.__saveProgBar = Qt.QProgressBar()
buttonsLayout.addWidget(bottomBnGrp)
......@@ -843,7 +828,6 @@ class ShiftWidget(Qt.QMainWindow):
def __slotResetShiftClicked(self):
"""Slot called when the "reset enty shift" button is clicked"""
subject = self.__shiftSubject
setEntry = self.__setPanel.getCurrentEntry()
buttons = Qt.QMessageBox.Ok | Qt.QMessageBox.Cancel
......@@ -857,7 +841,7 @@ class ShiftWidget(Qt.QMainWindow):
if ans == Qt.QMessageBox.Cancel:
return
subject.setShift(setEntry, 0., 0.)
self.__shiftSubject.setShift(setEntry, 0., 0.)
def __slotLinearShiftClicked(self, wholeRange=False):
"""Slot called when the "Apply linear shift" button is clicked"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment