Exemplo n.º 1
0
    def _helpLineDraw(self):
        hline = QubPointDrawingMgr(self._view.canvas(), self._view.matrix())
        hline.setAutoDisconnectEvent(True)
        hline.setEventName("HelpLine")
        hline.setExceptExclusiveListName(["StickAlignement"])
        if self._vertPhiFlag:
            drawingobject = QubCanvasHLine(self._view.canvas())
        else:
            drawingobject = QubCanvasVLine(self._view.canvas())
        hline.addDrawingObject(drawingobject)
        hline.setEndDrawCallBack(self._centeringPlug.endHline)
        self._view.addDrawingMgr(hline)
        hline.setPen(qt.QPen(qt.Qt.red, 2, qt.Qt.DashLine))

        hline.startDrawing()
        self._centeringPlug.hLines.append(hline)
Exemplo n.º 2
0
    def _helpLineDraw(self):
        hline = QubPointDrawingMgr(self._view.canvas(), self._view.matrix())
        hline.setAutoDisconnectEvent(True)
        hline.setEventName("HelpLine")
        hline.setExceptExclusiveListName(["StickAlignement"])
        if self._vertPhiFlag:
            drawingobject = QubCanvasHLine(self._view.canvas())
        else:
            drawingobject = QubCanvasVLine(self._view.canvas())
        hline.addDrawingObject(drawingobject)
        hline.setEndDrawCallBack(self._centeringPlug.endHline)
        self._view.addDrawingMgr(hline)
        hline.setPen(qt.QPen(qt.Qt.red, 2, qt.Qt.DashLine))

        hline.startDrawing()
        self._centeringPlug.hLines.append(hline)
Exemplo n.º 3
0
class _alignementProcess:
    def __init__(self, centeringPlug, widgetTree, view, verticalPhi):
        self._centeringPlug = centeringPlug
        self._widgetTree = widgetTree
        self._view = view
        self._vertPhiFlag = verticalPhi
        self._lastDrawing = None
        centeringPlug.alignementProcessState = self

    def __del__(self):
        if self._lastDrawing is not None:
            self._lastDrawing.stopDrawing()

    def begin(self):
        pass

    def endDraw(self, aDrawingMgr):
        pass

    def cancel(self):
        _cancelAlignementProcess(
            self._centeringPlug, self._widgetTree, self._view, self._vertPhiFlag
        )

    def setView(self, view):
        self._view = view

    def setVerticalPhi(self, aFlag):
        self._vertPhiFlag = aFlag

    def verticalPhi(self):
        return self._vertPhiFlag

    def _clearTable(self):
        at = self._widgetTree.child("alignementTable")
        self._centeringPlug.nbPoint4Alignement = self._widgetTree.child(
            "__nbPoint"
        ).value()
        at.setNumRows(self._centeringPlug.nbPoint4Alignement)

        for rowid in range(at.numRows()):
            for colid in range(at.numCols()):
                at.setText(rowid, colid, "")

    def _insertPos(self, aDrawingMgr, rowid):
        phiPos = str(self._centeringPlug.getPhi())
        x, y = aDrawingMgr.point()

        aDrawingMgr.hide()

        at = self._widgetTree.child("alignementTable")
        at.setText(rowid, 0, phiPos)
        at.setText(rowid, 1, str(x))
        at.setText(rowid, 2, str(y))

    def _startDraw(self):
        self._lastDrawing = QubPointDrawingMgr(self._view.canvas(), self._view.matrix())
        drawingobject = QubCanvasTarget(self._view.canvas())

        self._lastDrawing.setAutoDisconnectEvent(True)
        self._lastDrawing.setEventName("StickAlignement")
        self._lastDrawing.setExceptExclusiveListName(["HelpLine"])
        self._lastDrawing.addDrawingObject(drawingobject)
        self._view.addDrawingMgr(self._lastDrawing)
        self._lastDrawing.startDrawing()
        self._lastDrawing.setEndDrawCallBack(self._centeringPlug.endAlignementDraw)

    def _helpLineDraw(self):
        hline = QubPointDrawingMgr(self._view.canvas(), self._view.matrix())
        hline.setAutoDisconnectEvent(True)
        hline.setEventName("HelpLine")
        hline.setExceptExclusiveListName(["StickAlignement"])
        if self._vertPhiFlag:
            drawingobject = QubCanvasHLine(self._view.canvas())
        else:
            drawingobject = QubCanvasVLine(self._view.canvas())
        hline.addDrawingObject(drawingobject)
        hline.setEndDrawCallBack(self._centeringPlug.endHline)
        self._view.addDrawingMgr(hline)
        hline.setPen(qt.QPen(qt.Qt.red, 2, qt.Qt.DashLine))

        hline.startDrawing()
        self._centeringPlug.hLines.append(hline)

    def _phiStep(self):
        phiStepLineEditor = self._widgetTree.child("__deltaPhiCalib")
        step, valid = phiStepLineEditor.text().toFloat()
        self._centeringPlug.mvPhi(step)

    def endHline(self, drawingMgr):
        pass
Exemplo n.º 4
0
class _alignementProcess:
    def __init__(self, centeringPlug, widgetTree, view, verticalPhi):
        self._centeringPlug = centeringPlug
        self._widgetTree = widgetTree
        self._view = view
        self._vertPhiFlag = verticalPhi
        self._lastDrawing = None
        centeringPlug.alignementProcessState = self

    def __del__(self):
        if self._lastDrawing is not None:
            self._lastDrawing.stopDrawing()

    def begin(self):
        pass

    def endDraw(self, aDrawingMgr):
        pass

    def cancel(self):
        _cancelAlignementProcess(self._centeringPlug, self._widgetTree,
                                 self._view, self._vertPhiFlag)

    def setView(self, view):
        self._view = view

    def setVerticalPhi(self, aFlag):
        self._vertPhiFlag = aFlag

    def verticalPhi(self):
        return self._vertPhiFlag

    def _clearTable(self):
        at = self._widgetTree.child("alignementTable")
        self._centeringPlug.nbPoint4Alignement = self._widgetTree.child(
            "__nbPoint").value()
        at.setNumRows(self._centeringPlug.nbPoint4Alignement)

        for rowid in range(at.numRows()):
            for colid in range(at.numCols()):
                at.setText(rowid, colid, "")

    def _insertPos(self, aDrawingMgr, rowid):
        phiPos = str(self._centeringPlug.getPhi())
        x, y = aDrawingMgr.point()

        aDrawingMgr.hide()

        at = self._widgetTree.child("alignementTable")
        at.setText(rowid, 0, phiPos)
        at.setText(rowid, 1, str(x))
        at.setText(rowid, 2, str(y))

    def _startDraw(self):
        self._lastDrawing = QubPointDrawingMgr(self._view.canvas(),
                                               self._view.matrix())
        drawingobject = QubCanvasTarget(self._view.canvas())

        self._lastDrawing.setAutoDisconnectEvent(True)
        self._lastDrawing.setEventName("StickAlignement")
        self._lastDrawing.setExceptExclusiveListName(["HelpLine"])
        self._lastDrawing.addDrawingObject(drawingobject)
        self._view.addDrawingMgr(self._lastDrawing)
        self._lastDrawing.startDrawing()
        self._lastDrawing.setEndDrawCallBack(
            self._centeringPlug.endAlignementDraw)

    def _helpLineDraw(self):
        hline = QubPointDrawingMgr(self._view.canvas(), self._view.matrix())
        hline.setAutoDisconnectEvent(True)
        hline.setEventName("HelpLine")
        hline.setExceptExclusiveListName(["StickAlignement"])
        if self._vertPhiFlag:
            drawingobject = QubCanvasHLine(self._view.canvas())
        else:
            drawingobject = QubCanvasVLine(self._view.canvas())
        hline.addDrawingObject(drawingobject)
        hline.setEndDrawCallBack(self._centeringPlug.endHline)
        self._view.addDrawingMgr(hline)
        hline.setPen(qt.QPen(qt.Qt.red, 2, qt.Qt.DashLine))

        hline.startDrawing()
        self._centeringPlug.hLines.append(hline)

    def _phiStep(self):
        phiStepLineEditor = self._widgetTree.child("__deltaPhiCalib")
        step, valid = phiStepLineEditor.text().toFloat()
        self._centeringPlug.mvPhi(step)

    def endHline(self, drawingMgr):
        pass