def __init__(self, plot, parent=None):
QtGui.QDialog.__init__(self, parent)
loadUi(get_resource('transect.ui'), baseinstance=self)
pxmap = self.style().standardPixmap
self.closeButton.setIcon(
pxmap(QtGui.QStyle.SP_DialogCloseButton))
self.createButton.setIcon(
pxmap(QtGui.QStyle.SP_ArrowUp))
self.removeButton.setIcon(
pxmap(QtGui.QStyle.SP_DialogDiscardButton))
self.plot = plot
self.poly_line = None
self.trans_plot = pg.PlotDataItem(
antialias=True,
fillLevel=0.,
fillBrush=pg.mkBrush(0, 127, 0, 150))
self.plt_wdgt = pg.PlotWidget()
self.plt_wdgt.setLabels(
bottom={'Distance', 'm'},
left='Displacement [m]')
self.plt_wdgt.showGrid(True, True, alpha=.5)
self.plt_wdgt.enableAutoRange()
self.plt_wdgt.addItem(self.trans_plot)
self.layoutPlot.addWidget(self.plt_wdgt)
self.plot.image.sigImageChanged.connect(self.updateTransPlot)
self.createButton.released.connect(self.addPolyLine)
self.removeButton.released.connect(self.removePolyLine)
parent.model.sigConfigChanged.connect(self.close)
评论列表
文章目录