Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBVCubeVisualizerPlugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
no67wuwu
EBVCubeVisualizerPlugin
Commits
ba8957e3
Commit
ba8957e3
authored
2 years ago
by
Emmanuel Heriberto Oceguera Conchas
Browse files
Options
Downloads
Patches
Plain Diff
have benn updated
parent
fda72943
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
__init__.py
+2
-3
2 additions, 3 deletions
__init__.py
netCDF_visualizer.py
+23
-18
23 additions, 18 deletions
netCDF_visualizer.py
netCDF_visualizer_funtionality.py
+12
-11
12 additions, 11 deletions
netCDF_visualizer_funtionality.py
with
37 additions
and
32 deletions
__init__.py
+
2
−
3
View file @
ba8957e3
#the __init__ gives the construction order for the plugin
from
.netCDF_visualization
import
netCDF_viewer
from
netCDFVisualizer.netCDF_visualizer
import
netCDFVisualizer
def
classFactory
(
iface
):
plugin
=
netCDF
_view
er
(
iface
)
plugin
=
netCDF
Visualiz
er
(
iface
)
return
plugin
...
...
This diff is collapsed.
Click to expand it.
netCDF_visualizer.py
+
23
−
18
View file @
ba8957e3
...
...
@@ -33,8 +33,8 @@ from netCDF_visualizer_funtionality import *
#we write a class, Plugins is a class
import
os
class
netCDF
_v
isualizer
:
"""
This is a class for the netCDF
_v
isualizer Plugin
"""
class
netCDF
V
isualizer
:
"""
This is a class for the netCDF
V
isualizer Plugin
"""
#we set that we need the iface to build something with the class
def
__init__
(
self
,
iface
):
#our class builds netCDF_visualization Plugins
...
...
@@ -44,21 +44,26 @@ class netCDF_visualizer:
#when we click the plugin in QGIS the plugin will be loaded
def
initGui
(
self
):
#we build the menu entry without placing it in the menu
self
.
pluginButton
=
QAction
(
'
Start
'
,
self
.
iface
.
mainWindow
())
#we add the menu entry
self
.
iface
.
addPluginToMenu
(
'
netCDF_visualizer
'
,
self
.
pluginButton
)
#everytime the self.pluginButton is clicked the maskeAufrufen should be executed
self
.
pluginButton
.
triggered
.
connect
(
self
.
callMask
)
#we build the menu item without placing it already in the menu
self
.
pluginButton
=
QAction
(
'
start
'
,
self
.
iface
.
mainWindow
())
#we connect the menu item
self
.
iface
.
addPlugintoMenu
(
'
netCDFVisualizer
'
,
self
.
pluginButton
)
#whenever self.pluginButton is clicked, the maskCall should be executed
self
.
iface
.
triggered
.
connect
(
self
.
callMask
)
#when we close the plugin in QGIS the plugin will be unloaded
def
unload
(
self
):
#we have to remove the self.pluginButton and the menu entry again!1
self
.
iface
.
removePluginMenu
(
'
netCDF_visualizer
'
,
self
.
pluginButton
)
def
callMask
(
self
):
#the GUI will be built!
self
.
unsereGui
=
maskAndFuntionality
(
self
.
iface
)
#we open the Gui
self
.
unsereGui
.
show
()
#we remove the menu item
self
.
iface
.
removePluginMenu
(
'
netCDFVisualizer
'
,
self
.
pluginButton
)
#we remove the menu item
self
.
iface
.
removeToolBarIcon
(
self
.
pluginButton
)
#we create a function to call the mask
def
callMask
(
self
):
#we create the mask or GUI
self
.
mask
=
maskAndFuntionality
(
self
.
iface
)
#we show the mask
self
.
mask
.
show
()
This diff is collapsed.
Click to expand it.
netCDF_visualizer_funtionality.py
+
12
−
11
View file @
ba8957e3
...
...
@@ -24,7 +24,6 @@
#we import the impotant libraries and modules
#always import the libraries and modules at the top of the code
from
tkinter
import
Widget
from
PyQt5.Qtcore
import
*
from
PyQt5.QtGui
import
*
from
PyQt5.QtWidgets
import
*
...
...
@@ -42,24 +41,26 @@ from netCDF4 import Dataset
#we create the path to the ui file
#Path to the Ordner where the ui file is
ncPath
=
os
.
path
.
dirname
(
__file__
)
#the comand dirname gives the path to the directory where the file is
nc
v
Path
=
os
.
path
.
dirname
(
__file__
)
#the comand dirname gives the path to the directory where the file is
#path to the ui file
uiPath
=
os
.
path
.
join
(
ncPath
,
'
netCDF_visualizer.ui
'
)
#dosn't matter where the ui file is located in the directory
uiPath
=
os
.
path
.
join
(
ncvPath
,
'
netCDF_visualizer.ui
'
)
#
two class
#
TWO CLASES#
# WIDEGT is a class for the GUI
# BASE is a PyQt5 class to insatalize the GUI
WIDGET
,
BASE
=
uic
.
loadUiType
(
uiPath
)
class
maskAndFuntionality
(
WIDGET
,
BASE
):
class
maskAndFuntionality
(
BASE
,
WIDGET
):
"""
Class for the mask and the funtionality of the netCDFVisualizer Plugin
"""
def
__init__
(
self
,
iface
):
#self
=
GUI
/
mask
#self
is
GUI
and
mask
QDialog
.
__init__
(
self
,
iface
.
mainWindow
())
self
.
setuoUi
(
self
)
#self is a GUI
self
.
setupUi
(
self
)
#self ist our GUI
#the GUI is built in the running of QGIS in the current session (using the iface)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment