当前位置: 首页>>代码示例>>Python>>正文


Python BatchAlgorithmDialog.BatchAlgorithmDialog类代码示例

本文整理汇总了Python中processing.gui.BatchAlgorithmDialog.BatchAlgorithmDialog的典型用法代码示例。如果您正苦于以下问题:Python BatchAlgorithmDialog类的具体用法?Python BatchAlgorithmDialog怎么用?Python BatchAlgorithmDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BatchAlgorithmDialog类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: executeAlgorithmAsBatchProcess

 def executeAlgorithmAsBatchProcess(self):
     item = self.algorithmTree.currentItem()
     if isinstance(item, TreeAlgorithmItem):
         alg = QgsApplication.processingRegistry().algorithmById(item.alg.id())
         dlg = BatchAlgorithmDialog(alg)
         dlg.show()
         dlg.exec_()
开发者ID:ndavid,项目名称:QGIS,代码行数:7,代码来源:ProcessingToolbox.py

示例2: executeAlgorithmAsBatchProcess

 def executeAlgorithmAsBatchProcess(self):
     item = self.algorithmTree.currentItem()
     if isinstance(item, TreeAlgorithmItem):
         alg = Processing.getAlgorithm(item.alg.commandLineName())
         alg = alg.getCopy()
         dlg = BatchAlgorithmDialog(alg)
         dlg.exec_()
开发者ID:LingboTang,项目名称:QGIS,代码行数:7,代码来源:ProcessingToolbox.py

示例3: executeAlgorithmAsBatchProcess

 def executeAlgorithmAsBatchProcess(self):
     alg = self.algorithmTree.selectedAlgorithm().create() if self.algorithmTree.selectedAlgorithm() is not None else None
     if alg is not None:
         dlg = BatchAlgorithmDialog(alg, iface.mainWindow())
         dlg.setAttribute(Qt.WA_DeleteOnClose)
         dlg.show()
         dlg.exec_()
开发者ID:tomkralidis,项目名称:QGIS,代码行数:7,代码来源:ProcessingToolbox.py

示例4: executeAlgorithmAsBatchProcess

 def executeAlgorithmAsBatchProcess(self):
     item = self.algorithmTree.currentItem()
     if isinstance(item, TreeAlgorithmItem):
         alg = QgsApplication.processingRegistry().createAlgorithmById(item.alg.id())
         if alg:
             dlg = BatchAlgorithmDialog(alg)
             dlg.show()
             dlg.exec_()
             # have to manually delete the dialog - otherwise it's owned by the
             # iface mainWindow and never deleted
             dlg.deleteLater()
开发者ID:nirvn,项目名称:QGIS,代码行数:11,代码来源:ProcessingToolbox.py

示例5: runAsBatch

 def runAsBatch(self):
     self.close()
     dlg = BatchAlgorithmDialog(self.algorithm().create(), parent=iface.mainWindow())
     dlg.show()
     dlg.exec_()
开发者ID:mbernasocchi,项目名称:QGIS,代码行数:5,代码来源:AlgorithmDialog.py

示例6: runAsBatch

 def runAsBatch(self):
     self.close()
     dlg = BatchAlgorithmDialog(self.algorithm())
     dlg.show()
     dlg.exec_()
开发者ID:CS-SI,项目名称:QGIS,代码行数:5,代码来源:AlgorithmDialog.py

示例7: runAsBatch

 def runAsBatch(self):
     dlg = BatchAlgorithmDialog(self.alg)
     dlg.exec_()
开发者ID:dudds6699,项目名称:QGIS,代码行数:3,代码来源:AlgorithmDialog.py

示例8: executeAlgorithmAsBatchProcess

 def executeAlgorithmAsBatchProcess(self):
     alg = self.algorithmTree.selectedAlgorithm()
     if alg is not None:
         dlg = BatchAlgorithmDialog(alg)
         dlg.show()
         dlg.exec_()
开发者ID:raymondnijssen,项目名称:QGIS,代码行数:6,代码来源:ProcessingToolbox.py

示例9: __init__

 def __init__(self, alg, mainDialog, canEdit=True):
     
     self.alg = alg
     self.mainDialog = mainDialog
     self.goForward = False
     self.goBackward = False
     
     QtGui.QDialog.__init__(self)
     
     self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowSystemMenuHint |
                         QtCore.Qt.WindowMinMaxButtonsHint)
     
     # create a tab for this algorithm
     self.tabLayout = QtGui.QGridLayout()
         
     self.algInstructions = QtGui.QTextEdit()
     self.algInstructions.setMinimumWidth(250)
     self.algInstructions.setMaximumWidth(250)
     self.algInstructions.setFontPointSize(10)
     if not canEdit:
         self.algInstructions.setReadOnly(True)
     
     self.normalModeDialog = alg.getCustomParametersDialog()
     if not self.normalModeDialog:
         self.normalModeDialog = AlgorithmDialog(alg)
     self.batchModeDialog = BatchAlgorithmDialog(alg)
     self.batchModeDialog.setHidden(True)
     # forwardButton does the job of cancel/close button
     try:
         if self.alg.name == "Field calculator":
             self.normalModeDialog.mButtonBox.removeButton(self.normalModeDialog.mButtonBox.button(QtGui.QDialogButtonBox.Cancel)) 
         else:    
             self.normalModeDialog.buttonBox.removeButton(self.normalModeDialog.buttonBox.button(QtGui.QDialogButtonBox.Close))
         self.batchModeDialog.buttonBox.removeButton(self.batchModeDialog.buttonBox.button(QtGui.QDialogButtonBox.Close)) # forwardButton does this job
     except:
         # Not all dialogs might have buttonBox
         pass
     if canEdit:
         try:
             self.normalModeDialog.progressBar.hide()
             self.batchModeDialog.progressBar.hide()
             if self.alg.name == "Field calculator":
                 self.normalModeDialog.mButtonBox.hide()
             else:
                 self.normalModeDialog.buttonBox.hide()
             self.batchModeDialog.buttonBox.hide() 
         except:
             # Not all dialogs might have buttonBox
             pass
     self.normalModeDialog.connect(self.normalModeDialog, QtCore.SIGNAL("finished(int)"), self.forward)
     self.batchModeDialog.connect(self.batchModeDialog, QtCore.SIGNAL("finished(int)"), self.forward)    
         
     self.tabLayout.addWidget(self.algInstructions,0,0)
     self.tabLayout.addWidget(self.normalModeDialog, 0, 1)
     self.tabLayout.addWidget(self.batchModeDialog, 0, 1)
     
     self.algMode = QtGui.QComboBox()  
     self.algMode.addItems([NORMAL_MODE, BATCH_MODE])
     if canEdit:
         self.algMode.connect(self.algMode, QtCore.SIGNAL("currentIndexChanged(QString)"),  self.mainDialog.changeAlgMode)
         self.tabLayout.addWidget(self.algMode, 1, 1)
     else:
         self.buttonBox = QtGui.QDialogButtonBox()
         self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
         self.backwardButton = QtGui.QPushButton()
         self.backwardButton.setText("< Previous step")
         self.buttonBox.addButton(self.backwardButton, QtGui.QDialogButtonBox.ActionRole)
         QtCore.QObject.connect(self.backwardButton, QtCore.SIGNAL("clicked()"), self.backward)
         self.forwardButton = QtGui.QPushButton()
         self.forwardButton.setText("Skip step >")
         self.buttonBox.addButton(self.forwardButton, QtGui.QDialogButtonBox.ActionRole)
         QtCore.QObject.connect(self.forwardButton, QtCore.SIGNAL("clicked()"), self.forward)
         self.closeButton = QtGui.QPushButton()
         self.closeButton.setText("Finish Workflow")
         self.buttonBox.addButton(self.closeButton, QtGui.QDialogButtonBox.ActionRole)
         QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.close)
         self.tabLayout.addWidget(self.buttonBox, 1, 1)
         
     self.setLayout(self.tabLayout)
     
     self.executed = self.normalModeDialog.executed
开发者ID:DominikReisinger,项目名称:Processing-Workflow,代码行数:81,代码来源:StepDialog.py

示例10: StepDialog

class StepDialog(QtGui.QDialog):
    
    def __init__(self, alg, mainDialog, canEdit=True):
        
        self.alg = alg
        self.mainDialog = mainDialog
        self.goForward = False
        self.goBackward = False
        
        QtGui.QDialog.__init__(self)
        
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowSystemMenuHint |
                            QtCore.Qt.WindowMinMaxButtonsHint)
        
        # create a tab for this algorithm
        self.tabLayout = QtGui.QGridLayout()
            
        self.algInstructions = QtGui.QTextEdit()
        self.algInstructions.setMinimumWidth(250)
        self.algInstructions.setMaximumWidth(250)
        self.algInstructions.setFontPointSize(10)
        if not canEdit:
            self.algInstructions.setReadOnly(True)
        
        self.normalModeDialog = alg.getCustomParametersDialog()
        if not self.normalModeDialog:
            self.normalModeDialog = AlgorithmDialog(alg)
        self.batchModeDialog = BatchAlgorithmDialog(alg)
        self.batchModeDialog.setHidden(True)
        # forwardButton does the job of cancel/close button
        try:
            if self.alg.name == "Field calculator":
                self.normalModeDialog.mButtonBox.removeButton(self.normalModeDialog.mButtonBox.button(QtGui.QDialogButtonBox.Cancel)) 
            else:    
                self.normalModeDialog.buttonBox.removeButton(self.normalModeDialog.buttonBox.button(QtGui.QDialogButtonBox.Close))
            self.batchModeDialog.buttonBox.removeButton(self.batchModeDialog.buttonBox.button(QtGui.QDialogButtonBox.Close)) # forwardButton does this job
        except:
            # Not all dialogs might have buttonBox
            pass
        if canEdit:
            try:
                self.normalModeDialog.progressBar.hide()
                self.batchModeDialog.progressBar.hide()
                if self.alg.name == "Field calculator":
                    self.normalModeDialog.mButtonBox.hide()
                else:
                    self.normalModeDialog.buttonBox.hide()
                self.batchModeDialog.buttonBox.hide() 
            except:
                # Not all dialogs might have buttonBox
                pass
        self.normalModeDialog.connect(self.normalModeDialog, QtCore.SIGNAL("finished(int)"), self.forward)
        self.batchModeDialog.connect(self.batchModeDialog, QtCore.SIGNAL("finished(int)"), self.forward)    
            
        self.tabLayout.addWidget(self.algInstructions,0,0)
        self.tabLayout.addWidget(self.normalModeDialog, 0, 1)
        self.tabLayout.addWidget(self.batchModeDialog, 0, 1)
        
        self.algMode = QtGui.QComboBox()  
        self.algMode.addItems([NORMAL_MODE, BATCH_MODE])
        if canEdit:
            self.algMode.connect(self.algMode, QtCore.SIGNAL("currentIndexChanged(QString)"),  self.mainDialog.changeAlgMode)
            self.tabLayout.addWidget(self.algMode, 1, 1)
        else:
            self.buttonBox = QtGui.QDialogButtonBox()
            self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
            self.backwardButton = QtGui.QPushButton()
            self.backwardButton.setText("< Previous step")
            self.buttonBox.addButton(self.backwardButton, QtGui.QDialogButtonBox.ActionRole)
            QtCore.QObject.connect(self.backwardButton, QtCore.SIGNAL("clicked()"), self.backward)
            self.forwardButton = QtGui.QPushButton()
            self.forwardButton.setText("Skip step >")
            self.buttonBox.addButton(self.forwardButton, QtGui.QDialogButtonBox.ActionRole)
            QtCore.QObject.connect(self.forwardButton, QtCore.SIGNAL("clicked()"), self.forward)
            self.closeButton = QtGui.QPushButton()
            self.closeButton.setText("Finish Workflow")
            self.buttonBox.addButton(self.closeButton, QtGui.QDialogButtonBox.ActionRole)
            QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.close)
            self.tabLayout.addWidget(self.buttonBox, 1, 1)
            
        self.setLayout(self.tabLayout)
        
        self.executed = self.normalModeDialog.executed
    
    def forward(self):
        self.goForward = True
        self.close()
        
    def backward(self):
        self.goBackward = True
        self.close()
        
    def getMode(self):
        return self.algMode.currentText()
    
    def setMode(self, mode):
        if mode == NORMAL_MODE and not self.normalModeDialog.isVisible(): 
            self.batchModeDialog.setHidden(True)
            self.normalModeDialog.setVisible(True)
        elif mode == BATCH_MODE and not self.batchModeDialog.isVisible():
#.........这里部分代码省略.........
开发者ID:DominikReisinger,项目名称:Processing-Workflow,代码行数:101,代码来源:StepDialog.py


注:本文中的processing.gui.BatchAlgorithmDialog.BatchAlgorithmDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。