Ejemplo n.º 1
0
 def executeAlgorithm(self):
     item = self.algorithmTree.currentItem()
     if isinstance(item, TreeAlgorithmItem):
         alg = Sextante.getAlgorithm(item.alg.commandLineName())
         message = alg.checkBeforeOpeningParametersDialog()
         if message:
             QMessageBox.warning(self, self.tr("Warning"), message)
             return
         alg = alg.getCopy()#copy.deepcopy(alg)
         dlg = alg.getCustomParametersDialog()
         if not dlg:
             dlg = ParametersDialog(alg)
         canvas = QGisLayers.iface.mapCanvas()
         prevMapTool = canvas.mapTool()
         dlg.show()
         dlg.exec_()
         if canvas.mapTool()!=prevMapTool:
             try:
                 canvas.mapTool().reset()
             except:
                 pass
             canvas.setMapTool(prevMapTool)
         if dlg.executed:
             showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
             if showRecent:
                 self.fillTree()
     if isinstance(item, TreeActionItem):
         action = item.action
         action.setData(self)
         action.execute()
Ejemplo n.º 2
0
 def runAlgorithm(self):
     alg = RAlgorithm(None, unicode(self.text.toPlainText()))
     alg.provider = Providers.providers['r']
     dlg = alg.getCustomParametersDialog()
     if not dlg:
         dlg = ParametersDialog(alg)
     canvas = QGisLayers.iface.mapCanvas()
     prevMapTool = canvas.mapTool()
     dlg.show()
     dlg.exec_()
     if canvas.mapTool()!=prevMapTool:
         try:
             canvas.mapTool().reset()
         except:
             pass
         canvas.setMapTool(prevMapTool)
Ejemplo n.º 3
0
 def executeAlgorithm(self):
     item = self.algorithmTree.currentItem()
     if isinstance(item, TreeAlgorithmItem):
         alg = Sextante.getAlgorithm(item.alg.commandLineName())
         message = alg.checkBeforeOpeningParametersDialog()
         if message:
             dlg = MissingDependencyDialog(message)
             dlg.exec_()
             #QMessageBox.warning(self, self.tr("Warning"), message)
             return
         alg = alg.getCopy()
         dlg = alg.getCustomParametersDialog()
         if not dlg:
             dlg = ParametersDialog(alg)
         canvas = QGisLayers.iface.mapCanvas()
         prevMapTool = canvas.mapTool()
         dlg.show()
         dlg.exec_()
         if canvas.mapTool() != prevMapTool:
             try:
                 canvas.mapTool().reset()
             except:
                 pass
             canvas.setMapTool(prevMapTool)
         if dlg.executed:
             showRecent = SextanteConfig.getSetting(
                 SextanteConfig.SHOW_RECENT_ALGORITHMS)
             if showRecent:
                 self.addRecentAlgorithms(True)
     if isinstance(item, TreeActionItem):
         action = item.action
         action.setData(self)
         action.execute()
Ejemplo n.º 4
0
 def runalg_parameters(self):
     dlg = self.alg.getCustomParametersDialog()
     if not dlg:
         dlg = ParametersDialog(self.alg)
     # hack to handle that hacky code...
     dlg.setParamValues = lambda: True
     dlg.show()
     dlg.accept()
     while (not dlg.executed):
         time.sleep(.5)
Ejemplo n.º 5
0
 def runalg_parameters(self):
     dlg = self.alg.getCustomParametersDialog()
     if not dlg:
         dlg = ParametersDialog(self.alg)
     # hack to handle that hacky code...
     dlg.setParamValues = lambda: True
     dlg.show()
     dlg.accept()
     while (not dlg.executed):
         time.sleep(.5)
 def runAlgorithm(self, alg):
     alg = alg.getCopy()
     message = alg.checkBeforeOpeningParametersDialog()
     if message:
         dlg = MissingDependencyDialog(message)
         dlg.exec_()
         return
     dlg = alg.getCustomParametersDialog()
     if not dlg:
         dlg = ParametersDialog(alg)
     canvas = QGisLayers.iface.mapCanvas()
     prevMapTool = canvas.mapTool()
     dlg.show()
     dlg.exec_()
     if canvas.mapTool()!=prevMapTool:
         try:
             canvas.mapTool().reset()
         except:
             pass
         canvas.setMapTool(prevMapTool)
Ejemplo n.º 7
0
 def runAlgorithm(self):
     alg = RAlgorithm(None, unicode(self.text.toPlainText()))
     alg.provider = Providers.providers['r']
     dlg = alg.getCustomParametersDialog()
     if not dlg:
         dlg = ParametersDialog(alg)
     canvas = QGisLayers.iface.mapCanvas()
     prevMapTool = canvas.mapTool()
     dlg.show()
     dlg.exec_()
     if canvas.mapTool()!=prevMapTool:
         try:
             canvas.mapTool().reset()
         except:
             pass
         canvas.setMapTool(prevMapTool)