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

has been upgraded

parent c0d5ba41
Branches
No related tags found
No related merge requests found
#the __init__ gives the construction order for the plugin #the __init__ gives the construction order for the plugin
from netCDFVisualizer.netCDF_visualizer import netCDFVisualizer from .netCDF_visualizer import netCDFVisualizer
def classFactory(iface): def classFactory(iface):
plugin = netCDFVisualizer(iface) plugin = netCDFVisualizer(iface)
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>835</height>
</rect>
</property>
<property name="windowTitle">
<string>netCDFVisualizer</string>
</property>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Load data:</string>
</property>
</widget>
<widget class="QWidget" name="formLayoutWidget_3">
<property name="geometry">
<rect>
<x>630</x>
<y>750</y>
<width>131</width>
<height>31</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btn_closePlugin">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>751</width>
<height>51</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="btn_inputFile">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="text_set"/>
</item>
<item>
<widget class="QPushButton" name="btn_remove">
<property name="text">
<string>remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_load">
<property name="text">
<string>load</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>90</y>
<width>751</width>
<height>651</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Datasets</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
...@@ -28,7 +28,7 @@ from PyQt5.QtGui import * ...@@ -28,7 +28,7 @@ from PyQt5.QtGui import *
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
#import everthing from the netCDF_visualization_funtionality.py file #import everthing from the netCDF_visualization_funtionality.py file
from netCDF_visualizer_funtionality import * from .netCDF_visualizer_funtionality import *
#we write a class, Plugins is a class #we write a class, Plugins is a class
import os import os
...@@ -47,7 +47,7 @@ class netCDFVisualizer: ...@@ -47,7 +47,7 @@ class netCDFVisualizer:
#we build the menu item without placing it already in the menu #we build the menu item without placing it already in the menu
self.pluginButton = QAction('start', self.iface.mainWindow()) self.pluginButton = QAction('start', self.iface.mainWindow())
#we connect the menu item #we connect the menu item
self.iface.addPlugintoMenu('netCDFVisualizer', self.pluginButton) self.iface.addPluginToMenu('netCDFVisualizer', self.pluginButton)
#whenever self.pluginButton is clicked, the maskCall should be executed #whenever self.pluginButton is clicked, the maskCall should be executed
self.pluginButton.triggered.connect(self.callMask) self.pluginButton.triggered.connect(self.callMask)
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DockWidget</class>
<widget class="QDockWidget" name="DockWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>770</width>
<height>855</height>
</rect>
</property>
<property name="windowTitle">
<string>netCDF_visualizer</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Load data:</string>
</property>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>751</width>
<height>51</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="btn_inputFile">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="text_set"/>
</item>
<item>
<widget class="QPushButton" name="btn_remove">
<property name="text">
<string>remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_load">
<property name="text">
<string>load</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>90</y>
<width>751</width>
<height>651</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Datasets</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="formLayoutWidget_3">
<property name="geometry">
<rect>
<x>630</x>
<y>750</y>
<width>131</width>
<height>31</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btn_closePlugin">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>
...@@ -24,27 +24,23 @@ ...@@ -24,27 +24,23 @@
#we import the impotant libraries and modules #we import the impotant libraries and modules
#always import the libraries and modules at the top of the code #always import the libraries and modules at the top of the code
from PyQt5.Qtcore import * from PyQt5.QtCore import *
from PyQt5.QtGui import * from PyQt5.QtGui import *
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
from pyQt5 import uic from PyQt5 import uic
#we want to work with the os module #we want to work with the os module
import os import os
#to import general tools from QGIS we need the qgis.core module #to import general tools from QGIS we need the qgis.core module
from qgis.core import * from qgis.core import *
#we want to work with the numpy module #for loading the netCDF files we need the netCDF4 module
import numpy as np
#for loading the netCDF files we need the netCDF4 module
import netCDF4 as nc
from netCDF4 import Dataset
#we create the path to the ui file #we create the path to the ui file
#Path to the Ordner where the ui file is #Path to the Ordner where the ui file is
ncvPath = os.path.dirname(__file__) #the comand dirname gives the path to the directory where the file is ncvPath = os.path.dirname(__file__) #the comand dirname gives the path to the directory where the file is
#path to the ui file #path to the ui file
#dosn't matter where the ui file is located in the directory #dosn't matter where the ui file is located in the directory
uiPath = os.path.join(ncvPath, 'netCDF_visualizer.ui') uiPath = os.path.join(ncvPath, 'netCDFVisualizer.ui')
#TWO CLASES# #TWO CLASES#
# WIDEGT is a class for the GUI # WIDEGT is a class for the GUI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment