コード例 #1
0
ファイル: source_widget.py プロジェクト: lhow-atr/ArkSpatial
 def loadProject(self, plugin):
     self.siteCodeCombo.clear()
     for siteCode in sorted(set(Settings.siteCodes())):
         self.siteCodeCombo.addItem(siteCode, siteCode)
     if Settings.siteCode():
         self._setSiteCode(Settings.siteCode())
     else:
         projectCode = Settings.projectCode()
         self.siteCodeCombo.addItem(projectCode, projectCode)
         self._setSiteCode(projectCode)
コード例 #2
0
    def __init__(self, parent=None):
        super(SettingsDialog, self).__init__(parent)
        self.setupUi(self)

        # Settings tab settings
        self.siteCodeEdit.setText(Settings.siteCode())
        self.styleFolderCheck.setChecked(Settings.useCustomStyles())
        if Settings.useCustomStyles():
            self.styleFolderEdit.setEnabled(True)
            self.styleFolderButton.setEnabled(True)
        self.styleFolderButton.clicked.connect(self._selectStyleFolder)
        self.arkUrlEdit.setText(Settings.arkUrl())
        if Settings.isSettingsConfigured():
            self.useArkCheck.setEnabled(False)
        self.logUpdatesCheck.setChecked(Settings.logUpdates())

        # Drawings tab settings
        self.drawingTransparencySpin.setValue(Settings.drawingTransparency())
        self.georefFolderCheck.setChecked(Settings.useGeorefFolder())
        self.contextDrawingFolderCheck.setChecked(Settings.useCustomDrawingPath('context'))
        if Settings.useCustomDrawingPath('context'):
            self.contextDrawingFolderEdit.setEnabled(True)
            self.contextDrawingFolderButton.setEnabled(True)
        self.contextDrawingFolderEdit.setText(Settings.drawingPath('context'))
        self.contextDrawingFolderButton.clicked.connect(self._selectContextDrawingFolder)
        if Settings.useCustomDrawingPath('plan'):
            self.planDrawingFolderEdit.setEnabled(True)
            self.planDrawingFolderButton.setEnabled(True)
        self.planDrawingFolderEdit.setText(Settings.drawingPath('plan'))
        self.planDrawingFolderButton.clicked.connect(self._selectPlanDrawingFolder)
        if Settings.useCustomDrawingPath('section'):
            self.sectionDrawingFolderEdit.setEnabled(True)
            self.sectionDrawingFolderButton.setEnabled(True)
        self.sectionDrawingFolderEdit.setText(Settings.drawingPath('section'))
        self.sectionDrawingFolderButton.clicked.connect(self._selectSectionDrawingFolder)
コード例 #3
0
 def _loadGeoPlan(self):
     dialog = SelectDrawingDialog('context', Settings.siteCode(), True)
     if (dialog.exec_()):
         for filePath in dialog.selectedFiles():
             geoFile = QFileInfo(filePath)
             self._setDrawing(Drawing(geoFile))
             self._plugin.project().loadGeoLayer(geoFile)
コード例 #4
0
 def loadProject(self, plugin):
     if Settings.siteServerUrl():
         self.loadArkTool.setEnabled(True)
     self._enableArkNav(False)
     self.siteCodeCombo.clear()
     for siteCode in sorted(set(Settings.siteCodes())):
         self.siteCodeCombo.addItem(siteCode, siteCode)
     idx = self.siteCodeCombo.findData(Settings.siteCode())
     if idx >= 0:
         self.siteCodeCombo.setCurrentIndex(idx)
     self.resetContext()
コード例 #5
0
 def load(self):
     if Settings.useProjectServer():
         self._ark = Ark(Settings.serverUrl(), Settings.serverUser(), Settings.serverPassword())
         projects = self._ark.getProjectList()
         self.projectCodeCombo.setMaxCount(len(projects))
         for key in utils.natsorted(projects.keys()):
             self.projectCodeCombo.addItem(projects[key], key)
     self.setProjectCode(Settings.projectCode())
     self.setProjectName(Settings.projectName())
     self.setSiteCode(Settings.siteCode())
     self.setLocation(Settings.locationEasting(), Settings.locationNorthing)
コード例 #6
0
 def load(self):
     if Settings.useProjectServer():
         self._ark = Ark(Settings.serverUrl(), Settings.serverUser(),
                         Settings.serverPassword())
         projects = self._ark.getProjectList()
         self.projectCodeCombo.setMaxCount(len(projects))
         for key in utils.natsorted(projects.keys()):
             self.projectCodeCombo.addItem(projects[key], key)
     self.setProjectCode(Settings.projectCode())
     self.setProjectName(Settings.projectName())
     self.setSiteCode(Settings.siteCode())
     self.setLocation(Settings.locationEasting(), Settings.locationNorthing)
コード例 #7
0
ファイル: filter_module.py プロジェクト: lhow-atr/ArkSpatial
    def loadProject(self):
        # Load the Site Codes
        self._dock.initSiteCodes([Settings.siteCode()])

        # Load the Class Codes
        self._loadClassCodes()

        # Load the saved Filter Sets
        self._loadFilterSets()

        # Respond to ARK data load
        self._enableArkData()
        self._plugin.data().dataLoaded.connect(self._activateArkData)

        # Init the schematic filter set
        self._schematicFilterSet = FilterSet.fromSchematic(self._plugin)

        self._initialised = True
        self.setFilterSet('Default')
        return self._initialised
コード例 #8
0
    def __init__(self, iface, plugin, parent=None):
        super(GridWizard, self).__init__(parent)
        self._iface = iface  # QgisInterface()
        self._mapTool = None  # MapToolEmitPoint

        self.setupUi(self)
        collection = plugin.project().collection('grid')
        self.gridFolderEdit.setText(collection.settings.collectionPath)
        self.gridGroupNameEdit.setText(collection.settings.collectionGroupName)
        self.gridPointsNameEdit.setText(collection.layer('points').id())
        self.gridLinesNameEdit.setText(collection.layer('lines').id())
        self.gridPolygonsNameEdit.setText(collection.layer('polygons').id())
        self.siteCodeEdit.setText(Settings.siteCode())
        self.mapPoint1FromMapButton.clicked.connect(self.getPoint1FromMap)
        self.mapPoint2FromMapButton.clicked.connect(self.getPoint2FromMap)
        self.methodCombo.currentIndexChanged.connect(self.setMethodType)

        self._mapTool = MapToolEmitPoint(self._iface.mapCanvas())
        self._mapTool.setSnappingEnabled(True)
        self._mapTool.canvasClicked.connect(self.pointSelected)
        self._mapTool.deactivated.connect(self.cancelGetPoint)
コード例 #9
0
ファイル: grid_wizard.py プロジェクト: lparchaeology/ArkPlan
    def __init__(self, iface, plugin, parent=None):
        super(GridWizard, self).__init__(parent)
        self._iface = iface  # QgisInterface()
        self._mapTool = None  # MapToolEmitPoint

        self.setupUi(self)
        collection = plugin.project().collection('grid')
        self.gridFolderEdit.setText(collection.settings.collectionPath)
        self.gridGroupNameEdit.setText(collection.settings.collectionGroupName)
        self.gridPointsNameEdit.setText(collection.layer('points').id())
        self.gridLinesNameEdit.setText(collection.layer('lines').id())
        self.gridPolygonsNameEdit.setText(collection.layer('polygons').id())
        self.siteCodeEdit.setText(Settings.siteCode())
        self.mapPoint1FromMapButton.clicked.connect(self.getPoint1FromMap)
        self.mapPoint2FromMapButton.clicked.connect(self.getPoint2FromMap)
        self.methodCombo.currentIndexChanged.connect(self.setMethodType)

        self._mapTool = MapToolEmitPoint(self._iface.mapCanvas())
        self._mapTool.setSnappingEnabled(True)
        self._mapTool.canvasClicked.connect(self.pointSelected)
        self._mapTool.deactivated.connect(self.cancelGetPoint)
コード例 #10
0
 def loadProject(self, plugin):
     self.siteCodeCombo.clear()
     for siteCode in sorted(set(Settings.siteCodes())):
         self.siteCodeCombo.addItem(siteCode, siteCode)
     self.setSiteCode(Settings.siteCode())
コード例 #11
0
 def loadProject(self, plugin):
     self.projectCodeEdit.setText(Settings.projectCode())
     self.siteCodeEdit.setText(Settings.siteCode())
     self.projectNameEdit.setText(Settings.projectName())
コード例 #12
0
 def loadProject(self):
     # Load the Site Codes
     self._dock.initSiteCodes([Settings.siteCode()])
     return True
コード例 #13
0
 def _loadRawPlan(self):
     dialog = SelectDrawingDialog('context', Settings.siteCode())
     if (dialog.exec_()):
         for filePath in dialog.selectedFiles():
             self.georeferencePlan(QFileInfo(filePath))
コード例 #14
0
ファイル: project_module.py プロジェクト: lhow-atr/ArkSpatial
 def _showItem(self):
     classCodes = sorted(set(self.collection('plan').uniqueValues('class')))
     dialog = SelectItemDialog(Settings.siteCodes(), Settings.siteCode(),
                               classCodes, self._plugin.iface.mainWindow())
     if dialog.exec_():
         self.drawingModule.showItem(dialog.item(), dialog.loadDrawings(), dialog.zoomToItem())
コード例 #15
0
 def loadProject(self, plugin):
     self.projectCodeEdit.setText(Settings.projectCode())
     self.siteCodeEdit.setText(Settings.siteCode())
     self.projectNameEdit.setText(Settings.projectName())