-
Notifications
You must be signed in to change notification settings - Fork 0
/
tiler_layer_dockwidget.py
103 lines (89 loc) · 3.68 KB
/
tiler_layer_dockwidget.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- coding: utf-8 -*-
"""
/***************************************************************************
TilerLayerDockWidget
A QGIS plugin
Ceres Tiler Layer Loader
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2022-05-12
git sha : $Format:%H$
copyright : (C) 2022 by Ceres Imaging
email : mmiranda@ceresimaging.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
import os
from qgis.PyQt import QtWidgets, uic
from qgis.PyQt.QtCore import pyqtSignal
FORM_CLASS, _ = uic.loadUiType(
os.path.join(os.path.dirname(__file__), "tiler_layer_dockwidget_base.ui")
)
class TilerLayerDockWidget(QtWidgets.QDockWidget, FORM_CLASS):
closingPlugin = pyqtSignal()
def __init__(self, parent=None):
"""Constructor."""
super(TilerLayerDockWidget, self).__init__(parent)
# Set up the user interface from Designer.
# After setupUI you can access any designer object by doing
# self.<objectname>, and you can use autoconnect slots - see
# http://doc.qt.io/qt-5/designer-using-a-ui-file.html
# #widgets-and-dialogs-with-auto-connect
self.setupUi(self)
self.hideAll()
self.layer.addItem("")
self.layer.addItem("Mosaic", "mosaic")
self.layer.addItem("FieldGeo", "fieldgeo")
self.layer.addItem("Imagery", "imagery")
self.layer.addItem("PLI", "pli")
self.layer.addItem("Grid", "grid")
self.layer.addItem("Sensor", "sensor")
self.layer.addItem("Asset", "asset")
self.layer.addItem("Marker", "marker")
self.layer.activated.connect(self.layerChanged)
def hideAll(self):
for i in range(self.formLayout.count()):
self.formLayout.itemAt(i).widget().hide()
def layerChanged(self, index):
self.hideAll()
layer = self.layer.currentData()
if layer == "mosaic":
self.flight.show()
self.flightLabel.show()
self.field.show()
self.fieldLabel.show()
self.mosaicType.show()
self.mosaicTypeLabel.show()
elif layer == "fieldgeo":
self.field.show()
self.fieldLabel.show()
elif layer == "imagery":
self.overlay.show()
self.overlayLabel.show()
elif layer == "pli":
self.overlay.show()
self.overlayLabel.show()
elif layer == "grid":
self.overlay.show()
self.overlayLabel.show()
self.grid.show()
self.gridLabel.show()
elif layer == "sensor":
self.customer.show()
self.customerLabel.show()
elif layer == "asset":
self.asset.show()
self.assetLabel.show()
elif layer == "marker":
self.visit.show()
self.visitLabel.show()
def closeEvent(self, event):
self.closingPlugin.emit()
event.accept()