def __init__(self, iface, parent=None): QWidget.__init__(self, parent) self.setupUi(self) # store the iface and the events layer self.iface = iface self.vl = Utils.eventsVl() self.canvas = self.iface.mapCanvas() self._prevMapTool = None self._sharedData = { } # it will contain the classification map (data shared through the all cross sections) # create the maptool to define the area of interest self.areaDrawer = PolygonDrawer( self.iface.mapCanvas(), { 'color': QColor('#333333'), 'border': 2, 'enableSnap': False, 'keepAfterEnd': True }) self.areaDrawer.setAction(self.drawAreaBtn) self.connect(self.areaDrawer, SIGNAL("geometryEmitted"), self.areaCreated) # create the maptool to create classification buffers self.segmentDrawer = SegmentDrawer(self.iface.mapCanvas(), { 'color': QColor('cyan'), 'border': 3, 'enableSnap': False }) self.segmentDrawer.setAction(self.addBufferBtn) self.connect(self.segmentDrawer, SIGNAL("geometryEmitted"), self.midlineBufferCreated) # initialize the table that will contain classification buffers self.buffersTable.setModel(self.BuffersTableModel(self.buffersTable)) self.connect( self.buffersTable.selectionModel(), SIGNAL( "currentRowChanged(const QModelIndex &, const QModelIndex &)"), self.buffersSelectionChanged) self.connect(self.buffersTable.model(), SIGNAL("bufferWidthChanged"), self.updateBuffer) # connect actions to the widgets self.connect(self.drawAreaBtn, SIGNAL("clicked()"), self.drawArea) self.connect(self.clearAreaBtn, SIGNAL("clicked()"), self.clearArea) self.connect(self.addBufferBtn, SIGNAL("clicked()"), self.drawBuffer) self.connect(self.delBufferBtn, SIGNAL("clicked()"), self.deleteBuffer) self.connect(self.crossSectionBtn, SIGNAL("clicked()"), self.openCrossSection) self.connect(self.displayClassifiedDataBtn, SIGNAL("clicked()"), self.loadClassifiedData) # disable buttons self.delBufferBtn.setEnabled(False) self.crossSectionBtn.setEnabled(False)
def __init__(self, iface, parent=None): QWidget.__init__(self, parent) self.setupUi(self) # store the iface and the event layer self.iface = iface self.vl = Utils.eventsVl() self.canvas = self.iface.mapCanvas() self._prevMapTool = None # setup the magnitude, depth and range filters self.setupFilters() # create the maptool to draw polygons self.polygonDrawer = PolygonDrawer(self.canvas, { 'color': QColor("#666666"), 'enableSnap': False, 'keepAfterEnd': True }) self.polygonDrawer.setAction(self.drawPolygonBtn) self.connect(self.polygonDrawer, SIGNAL("geometryEmitted"), self.polygonCreated) # populate plot type combo self.plotTypeCombo.addItem("Histogram", self.PLOT_HIST) self.plotTypeCombo.addItem("Histogram (log10)", self.PLOT_HIST_LOG) self.plotTypeCombo.addItem("Scatter plot", self.PLOT_SCATTER) self.updateAxesCombos() # populate both axis combos with field names for index, fld in self.vl.dataProvider().fields().iteritems(): self.xAxisCombo.addItem(fld.name(), QVariant(index)) self.yAxisCombo.addItem(fld.name(), QVariant(index)) # connect actions to the widgets self.connect(self.drawPolygonBtn, SIGNAL("clicked()"), self.drawPolygon) self.connect(self.clearPolygonBtn, SIGNAL("clicked()"), self.clearPolygon) self.connect(self.plotBtn, SIGNAL("clicked()"), self.createPlot) self.connect(self.plotTypeCombo, SIGNAL("currentIndexChanged(int)"), self.updateAxesCombos)
def __init__(self, iface, parent=None): QWidget.__init__(self, parent) self.setupUi(self) # store the iface self.iface = iface self.canvas = self.iface.mapCanvas() self._prevMapTool = None self.algorithmStacked.setCurrentIndex(0) # create the maptool to draw polygons self.polygonDrawer = PolygonDrawer(self.canvas, { 'color': QColor("#666666"), 'enableSnap': False, 'keepAfterEnd': True }) self.polygonDrawer.setAction(self.drawPolygonBtn) self.connect(self.polygonDrawer, SIGNAL("geometryEmitted"), self.polygonCreated) # connect actions to the widgets self.connect(self.drawPolygonBtn, SIGNAL("clicked()"), self.drawPolygon) self.connect(self.clearPolygonBtn, SIGNAL("clicked()"), self.clearPolygon) QObject.connect(self.declusterWdg, SIGNAL("dataRequested"), self.fillData) QObject.connect(self.completenessWdg, SIGNAL("dataRequested"), self.fillData) QObject.connect(self.recurrenceWdg, SIGNAL("dataRequested"), self.fillData) QObject.connect(self.maxMagnitudeWdg, SIGNAL("dataRequested"), self.fillData)