-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Zmiana wyglądu UI * Aktualizacja loga EnviroSolutions --------- Co-authored-by: aglu <[email protected]> Co-authored-by: Wojciech Sołyga <[email protected]>
- Loading branch information
Showing
11 changed files
with
3,748 additions
and
1,050 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ | ||
------------------- | ||
begin : 2020-03-25 | ||
copyright : (C) 2020 by Michał Włoga - EnviroSolutions Sp. z o.o. | ||
copyright : (C) 2020 by EnviroSolutions Sp. z o.o. | ||
email : [email protected] | ||
git sha : $Format:%H$ | ||
***************************************************************************/ | ||
|
@@ -22,6 +22,7 @@ | |
***************************************************************************/ | ||
This script initializes the plugin, making it known to QGIS. | ||
""" | ||
|
||
from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication, Qt | ||
from qgis.PyQt.QtGui import QIcon | ||
from qgis.PyQt.QtWidgets import QAction, QToolBar, QApplication | ||
|
@@ -35,6 +36,7 @@ | |
from . import PLUGIN_VERSION as plugin_version | ||
|
||
"""Wersja wtyczki""" | ||
plugin_version = '1.0.6' | ||
plugin_name = 'Archiwalna Ortofotomapa' | ||
|
||
class ArchiwalnaOrtofotomapa: | ||
|
@@ -105,7 +107,7 @@ def tr(self, message): | |
""" | ||
# noinspection PyTypeChecker,PyArgumentList,PyCallByClass | ||
return QCoreApplication.translate('ArchiwalnaOrtofotomapa', message) | ||
|
||
|
||
def add_action( | ||
self, | ||
|
@@ -118,6 +120,7 @@ def add_action( | |
status_tip=None, | ||
whats_this=None, | ||
parent=None): | ||
|
||
"""Add a toolbar icon to the toolbar. | ||
:param icon_path: Path to the icon for this action. Can be a resource | ||
|
@@ -184,18 +187,17 @@ def add_action( | |
def initGui(self): | ||
"""Create the menu entries and toolbar icons inside the QGIS GUI.""" | ||
|
||
icon_path = ':/plugins/archiwalna_ortofotomapa/icon_pw2.png' | ||
icon_path = ':/plugins/archiwalna_ortofotomapa/icons/icon_pw2.png' | ||
self.add_action( | ||
icon_path, | ||
text=self.tr(u'Archiwalna Ortofotomapa'), | ||
callback=self.run, | ||
parent=self.iface.mainWindow()) | ||
|
||
|
||
def onClosePlugin(self): | ||
"""Cleanup necessary items here when plugin dockwidget is closed""" | ||
|
||
#print "** CLOSING ArchiwalnaOrtofotomapa" | ||
|
||
# disconnects | ||
self.dockwidget.closingPlugin.disconnect(self.onClosePlugin) | ||
|
||
|
@@ -211,8 +213,6 @@ def onClosePlugin(self): | |
def unload(self): | ||
"""Removes the plugin menu item and icon from QGIS GUI.""" | ||
|
||
#print "** UNLOAD ArchiwalnaOrtofotomapa" | ||
|
||
for action in self.actions: | ||
self.iface.removePluginMenu( | ||
self.tr(u'&EnviroSolutions'), | ||
|
@@ -224,6 +224,7 @@ def unload(self): | |
|
||
#-------------------------------------------------------------------------- | ||
|
||
|
||
def run(self): | ||
"""Run method that loads and starts the plugin""" | ||
|
||
|
@@ -256,6 +257,7 @@ def run(self): | |
self.dockwidget.closingPlugin.connect(self.onClosePlugin) | ||
|
||
# informacje o wersji | ||
self.dockwidget.setWindowTitle('%s %s' % (plugin_name, plugin_version)) | ||
self.dockwidget.lbl_pluginVersion.setText('%s %s' % (plugin_name, plugin_version)) | ||
|
||
# show the dockwidget | ||
|
@@ -272,39 +274,57 @@ def run(self): | |
#reopened | ||
pass | ||
|
||
|
||
def orto_removal(self): | ||
"""Funkcja wyłączająca okno z wtyczką przy usunięciu warstwy z ortofotomapą""" | ||
|
||
self.dockwidget.close() | ||
self.orto = None | ||
|
||
|
||
def slider_changed(self): | ||
"""Funkcja kontroluje rok jaki ma być wyświetlany przy przesuwaniu paska""" | ||
|
||
slider = self.dockwidget.sender() | ||
self.dockwidget.timeLabel.setText(str(slider.value())) | ||
if not self.isSliderPressed: | ||
self.changeOrtoLayer(slider) | ||
|
||
|
||
def slider_moved(self): | ||
"""Funkcja nic nie robi jeżeli pasek został przesuniętu""" | ||
|
||
pass | ||
|
||
|
||
def slider_pressed(self): | ||
"""Funkcja kontroluje parametr odpowiadający za akcje po wciśnięciu slidera""" | ||
|
||
slider = self.dockwidget.sender() | ||
self.isSliderPressed = True | ||
|
||
|
||
def slider_released(self): | ||
"""Funkcja kontroluje parametr odpowiadający za akcje po puszczeniu slidera""" | ||
|
||
slider = self.dockwidget.sender() | ||
self.isSliderPressed = False | ||
self.changeOrtoLayer(slider) | ||
|
||
|
||
def changeOrtoLayer(self, slider): | ||
# SET DATASOURCE AND RELOAD DATA | ||
"""Funkcja zmienia nazwę warstwy z orto po zmianie roku który ma wyświetlać""" | ||
|
||
uri = self.makeDataSourceUri(slider.value()) | ||
self.orto.dataProvider().setDataSourceUri(uri) | ||
self.orto.triggerRepaint() | ||
# self.orto.dataProvider().reloadData() #QGIS 3.12 and above | ||
self.orto.setName("Ortofotomapa Archiwalna %d" % slider.value()) | ||
|
||
|
||
def makeDataSourceUri(self, year): | ||
# serviceUrl = "http://mapy.geoportal.gov.pl/wss/service/img/guest/ORTO_TIME/MapServer/WMSServer" | ||
"""Funkcja edytuje warstwę z orto i zmienia rok, z którego jest ono opracowane""" | ||
|
||
serviceUrl = "https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMS/StandardResolutionTime" | ||
return "IgnoreGetFeatureInfoUrl=1&IgnoreGetMapUrl=1&contextualWMSLegend=0&crs=EPSG:2180&format=image/jpeg&layers=Raster&styles=&url=" \ | ||
+ serviceUrl + \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ | ||
------------------- | ||
begin : 2020-03-25 | ||
copyright : (C) 2020 by Michał Włoga - EnviroSolutions Sp. z o.o. | ||
copyright : (C) 2020 by EnviroSolutions Sp. z o.o. | ||
email : [email protected] | ||
git sha : $Format:%H$ | ||
***************************************************************************/ | ||
|
@@ -38,13 +38,16 @@ class ArchiwalnaOrtofotomapaDockWidget(QtWidgets.QDockWidget, FORM_CLASS): | |
|
||
def __init__(self, parent=None): | ||
"""Constructor.""" | ||
|
||
super(ArchiwalnaOrtofotomapaDockWidget, 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.img_main.setMargin(9) | ||
|
||
|
||
def closeEvent(self, event): | ||
self.closingPlugin.emit() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.