Skip to content
Snippets Groups Projects
Commit 6e14b012 authored by Emmanuel Oceguera Conchas's avatar Emmanuel Oceguera Conchas
Browse files

the icon has been added

parent fe50f026
No related branches found
No related tags found
No related merge requests found
...@@ -263,33 +263,36 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -263,33 +263,36 @@ class maskAndFuntionality (BASE, WIDGET):
#when we click on the top level item we show the name of the file, title and the global attributes #when we click on the top level item we show the name of the file, title and the global attributes
if self.tree_data.currentItem().parent() == None: if self.tree_data.currentItem().parent() == None:
self.text_info.clear() self.text_info.clear()
self.text_info.append("File name: " + ncFileName) self.text_info.append("<b><font size=4>" + "File name: " + ncFileName + "</font></b>")
self.text_info.append("Title: " + ncFileTitle) self.text_info.append("<b><font size=3>" + "Title: " + ncFileTitle + "</font></b>")
self.text_info.append("Global attributes:") self.text_info.append(" ")
for i in range(len(ncFileGlobalAttributes)): self.text_info.append("<b><font size=3>" +"Global attributes: " + "</font></b>")
self.text_info.append("-- " + ncFileGlobalAttributes[i] + ": " + str(ncFile.getncattr(ncFileGlobalAttributes[i]))) for i in range(len(ncFileGlobalAttributes)):
self.text_info.append("<b>" + ncFileGlobalAttributes[i] + ": " + "</b>" + str(ncFile.getncattr(ncFileGlobalAttributes[i])))
#when we click on a group we show the name of the group and the attributes of the group and if we click on a variable of the group we show the attributes of the variable #when we click on a group we show the name of the group and the attributes of the group and if we click on a variable of the group we show the attributes of the variable
elif self.tree_data.currentItem().parent().parent() == None: elif self.tree_data.currentItem().parent().parent() == None:
self.text_info.clear() self.text_info.clear()
self.text_info.append("File name: " + ncFileName) self.text_info.append("<b><font size=4>" + "File name: " + ncFileName + "</font></b>")
self.text_info.append("Title: " + ncFileTitle) self.text_info.append("<b><font size=3>" + "Title: " + ncFileTitle + "</font></b>")
self.text_info.append("Group name: " + self.tree_data.currentItem().text(0)) self.text_info.append("<b><font size=3>" + "Group name: " + self.tree_data.currentItem().text(0) + "</font></b>")
self.text_info.append("Long name: " + self.tree_data.currentItem().text(1)) self.text_info.append("<b><font size=3>" + "Long name: " + self.tree_data.currentItem().text(1) + "</font></b>")
self.text_info.append("Attributes:") self.text_info.append(" ")
self.text_info.append("<b><font size=3>" + "Attributes:" + "</font></b>")
for i in range(len(ncFile.groups[self.tree_data.currentItem().text(0)].ncattrs())): for i in range(len(ncFile.groups[self.tree_data.currentItem().text(0)].ncattrs())):
self.text_info.append("-- " + ncFile.groups[self.tree_data.currentItem().text(0)].ncattrs()[i] + ": " + str(ncFile.groups[self.tree_data.currentItem().text(0)].getncattr(ncFile.groups[self.tree_data.currentItem().text(0)].ncattrs()[i]))) self.text_info.append("<b>" + "-- " + ncFile.groups[self.tree_data.currentItem().text(0)].ncattrs()[i] + ": " + "</b>" + str(ncFile.groups[self.tree_data.currentItem().text(0)].getncattr(ncFile.groups[self.tree_data.currentItem().text(0)].ncattrs()[i])))
#when we click on a variable of the group and the attributes of the varibales #when we click on a variable of the group and the attributes of the varibales
else: else:
self.text_info.append("File name: " + ncFileName) self.text_info.append("<b><font size=4>" + "File name: " + ncFileName + "</font></b>")
self.text_info.append("Title: " + ncFileTitle) self.text_info.append("<b><font size=3>" + "Title: " + ncFileTitle + "</font></b>")
self.text_info.append("Variable name: " + self.tree_data.currentItem().text(0)) self.text_info.append("<b><font size=3>" + "Variable name: " + self.tree_data.currentItem().text(0) + "</font></b>")
self.text_info.append("Long name: " + self.tree_data.currentItem().text(1)) self.text_info.append("<b><font size=3>" + "Long name: " + self.tree_data.currentItem().text(1) + "</font></b>")
self.text_info.append("Attributes:") self.text_info.append(" ")
self.text_info.append("<b><font size=3>" + "Attributes:" + "</font></b>")
variableAttributes = list(ncFile.groups[self.tree_data.currentItem().parent().text(0)].variables[self.tree_data.currentItem().text(0)].ncattrs()) variableAttributes = list(ncFile.groups[self.tree_data.currentItem().parent().text(0)].variables[self.tree_data.currentItem().text(0)].ncattrs())
for i in range(len(variableAttributes)): for i in range(len(variableAttributes)):
self.text_info.append("-- " + variableAttributes[i] + ": " + str(ncFile.groups[self.tree_data.currentItem().parent().text(0)].variables[self.tree_data.currentItem().text(0)].getncattr(variableAttributes[i]))) self.text_info.append("<b>" + "-- " + variableAttributes[i] + ": " + "</b>" + str(ncFile.groups[self.tree_data.currentItem().parent().text(0)].variables[self.tree_data.currentItem().text(0)].getncattr(variableAttributes[i])))
#we close the netCDF file #we close the netCDF file
ncFile.close() ncFile.close()
...@@ -349,7 +352,12 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -349,7 +352,12 @@ class maskAndFuntionality (BASE, WIDGET):
#load the raster layer into the QGIS canvas #load the raster layer into the QGIS canvas
rasterLayer = QgsRasterLayer(uri, nameOfRasterLayer, "gdal") rasterLayer = QgsRasterLayer(uri, nameOfRasterLayer, "gdal")
print(rasterLayer.isValid())
if not rasterLayer.isValid():
self.iface.messageBar().pushMessage("Error", "The layer is not valid", level=Qgis.Critical, duration=5)
return
#calculate the band number #calculate the band number
......
# This file contains metadata for your plugin. Since
# version 2.0 of QGIS this is the proper way to supply
# information about a plugin. The old method of
# embedding metadata in __init__.py will
# is no longer supported since version 2.0.
# This file should be included when you package your plugin.# Mandatory items:
[general] [general]
name=EBVCubeVisualizer name=EBVCubeVisualizer
email=e.oceguera@gmx.de email=e.oceguera@gmx.de
...@@ -6,4 +15,21 @@ qgisMinimumVersion=3.0 ...@@ -6,4 +15,21 @@ qgisMinimumVersion=3.0
description=The user can visualizes netCDF formatted data. description=The user can visualizes netCDF formatted data.
about=The Plugin visualizes netCDF formatted data in a more efficient way, as well as creates plots of the data and can be exported. about=The Plugin visualizes netCDF formatted data in a more efficient way, as well as creates plots of the data and can be exported.
version=0.1 version=0.1
tags=python,netCDF,Visualizer
\ No newline at end of file
repository=https://github.com/EmmaOceg/EBVCubeVisualizerPlugin
#end of the mandatory metadata
#tags are comma separated with spaces allowed
tags=python,netCDF,Visualizer, EBVCube, EuropaBon
homepage=http://homepage
category=Plugins
icon=EBVIcon.png
#experimental flag
experimental=False
# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment