Skip to content
Snippets Groups Projects
Commit 638729e2 authored by Emmanuel Heriberto Oceguera Conchas's avatar Emmanuel Heriberto Oceguera Conchas
Browse files

the info into the QTextBrowser has been added

parent d3cf8de4
Branches
No related tags found
No related merge requests found
...@@ -79,6 +79,7 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -79,6 +79,7 @@ class maskAndFuntionality (BASE, WIDGET):
self.btn_load.clicked.connect(self.loadNetCDF) self.btn_load.clicked.connect(self.loadNetCDF)
self.btn_remove_sel.clicked.connect(self.removeSelection) self.btn_remove_sel.clicked.connect(self.removeSelection)
self.btn_plot.clicked.connect(self.plotEbvCube) self.btn_plot.clicked.connect(self.plotEbvCube)
self.
"""Here is the place for set stzlesheet""" """Here is the place for set stzlesheet"""
#self.btn_plot.setStyleSheet("backgrou") #self.btn_plot.setStyleSheet("backgrou")
...@@ -166,24 +167,27 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -166,24 +167,27 @@ class maskAndFuntionality (BASE, WIDGET):
child3 = QTreeWidgetItem([ncFileVariablesName2[k], longNameVariables2]) child3 = QTreeWidgetItem([ncFileVariablesName2[k], longNameVariables2])
child2.addChild(child3) child2.addChild(child3)
#get the entyties of the variables of the groups of the groups an set the lon name of the entyties into the QComboBox if the variable is a cube and click on the variable #we get the attributes of the variables of the groups of the groups and show them in the QTextBrowser if the variable is clicked
if child3.isSelected():
ncFileVariablesName2Attributes = list(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].ncattrs())
for l in range(len(ncFileVariablesName2Attributes)):
ncFileVariablesName2AttributesValue = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].getncattr(ncFileVariablesName2Attributes[l])
self.text_info.append(ncFileVariablesName2Attributes[l] + ": " + str(ncFileVariablesName2AttributesValue))
#get the entyties of the variables of the groups of the groups an set the lon name of the entyties into the QComboBox if the variable is a cube and click on the variable
if child3.isSelected() and len(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].dimensions) == 3:
ncFileVariablesName2Entities = list(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].dimensions)
for m in range(len(ncFileVariablesName2Entities)):
ncFileVariablesName2EntitiesValue = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].getncattr(ncFileVariablesName2Entities[m])
self.combo_entity.addItem(ncFileVariablesName2Entities[m])
self.combo_entity.setItemText(m, ncFileVariablesName2EntitiesValue)
#we get the attributes of the variables of the groups of the groups and show them in the QTextBrowser if the variable is clicked
if child3.isSelected():
ncFileVariablesName2Attributes = list(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].ncattrs())
for l in range(len(ncFileVariablesName2Attributes)):
ncFileVariablesName2AttributesValue = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].getncattr(ncFileVariablesName2Attributes[l])
self.text_info.append(ncFileVariablesName2Attributes[l] + ": " + str(ncFileVariablesName2AttributesValue))
#we get the variables of the groups #we get the variables of the groups
ncFileGroupsVariablesName = list(ncFile.groups[ncFileGroupsName[i]].variables.keys()) ncFileGroupsVariablesName = list(ncFile.groups[ncFileGroupsName[i]].variables.keys())
#we show the variables of the groups in the QTreeWidgetite and set the long name of the variables #we show the variables of the groups in the QTreeWidgetite and set the long name of the variables if the group is clicked
for j in range(len(ncFileGroupsVariablesName)): for j in range(len(ncFileGroupsVariablesName)):
longNameVariables = ncFile.groups[ncFileGroupsName[i]].variables[ncFileGroupsVariablesName[j]].long_name longNameVariables = ncFile.groups[ncFileGroupsName[i]].variables[ncFileGroupsVariablesName[j]].long_name
child4 = QTreeWidgetItem([ncFileGroupsVariablesName[j],longNameVariables]) child4 = QTreeWidgetItem([ncFileGroupsVariablesName[j],longNameVariables])
...@@ -195,11 +199,22 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -195,11 +199,22 @@ class maskAndFuntionality (BASE, WIDGET):
""" here we are gonna show all information into the GUI""" """ here we are gonna show all information into the GUI"""
#we get the attributes of the file and show them in the QTextBrowser when the file is loaded #get the attributes and the name of the file and show them in the QTextBrowser
ncFileAttributes = list(ncFile.ncattrs()) ncFileAttributes = list(ncFile.ncattrs())
for i in range(len(ncFileAttributes)): for i in range(len(ncFileAttributes)):
ncFileAttributesValue = ncFile.getncattr(ncFileAttributes[i]) ncFileAttributesValue = ncFile.getncattr(ncFileAttributes[i])
self.text_info.append(ncFileAttributes[i] + ": " + str(ncFileAttributesValue)) self.text_info.append(ncFileName) #we show the name of the file
self.text_info.append(ncFileAttributes[i] + ": " + str(ncFileAttributesValue)) #we show the attributes of the file
#we close the netCDF file #we close the netCDF file
...@@ -207,8 +222,9 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -207,8 +222,9 @@ class maskAndFuntionality (BASE, WIDGET):
def loadMap(self): def loadCubeLayer(self):
"""This function loads the variables of groups of the groups into the panel layer of the QGIS if click on the variable"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment