From 638729e234a5dda61c28ef60661a8c5bcfa2747b Mon Sep 17 00:00:00 2001
From: Emmanuel Heriberto Oceguera Conchas <e.oceguera@gmx.de>
Date: Wed, 26 Oct 2022 14:07:33 +0200
Subject: [PATCH] the info into the QTextBrowser has been added

---
 netCDF_visualizer_funtionality.py | 48 ++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/netCDF_visualizer_funtionality.py b/netCDF_visualizer_funtionality.py
index a3d36e8..aa6ac7a 100644
--- a/netCDF_visualizer_funtionality.py
+++ b/netCDF_visualizer_funtionality.py
@@ -79,6 +79,7 @@ class maskAndFuntionality (BASE, WIDGET):
         self.btn_load.clicked.connect(self.loadNetCDF)
         self.btn_remove_sel.clicked.connect(self.removeSelection)
         self.btn_plot.clicked.connect(self.plotEbvCube)
+        self.
         
         """Here is the place for set stzlesheet"""
         #self.btn_plot.setStyleSheet("backgrou")
@@ -166,24 +167,27 @@ class maskAndFuntionality (BASE, WIDGET):
                         child3 = QTreeWidgetItem([ncFileVariablesName2[k], longNameVariables2])
                         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
                 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)):
                     longNameVariables = ncFile.groups[ncFileGroupsName[i]].variables[ncFileGroupsVariablesName[j]].long_name
                     child4 = QTreeWidgetItem([ncFileGroupsVariablesName[j],longNameVariables])
@@ -195,11 +199,22 @@ class maskAndFuntionality (BASE, WIDGET):
             
 
             """ 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())
             for i in range(len(ncFileAttributes)):
                 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
@@ -207,8 +222,9 @@ class maskAndFuntionality (BASE, WIDGET):
                     
                 
             
-    def loadMap(self):
-        """This function loads the variables of groups of the groups into the panel layer of the QGIS if click on the variable"""
+    def loadCubeLayer(self):
+
+        
 
         
 
-- 
GitLab