Esempio n. 1
0
    def __init__(self, iface):
        # Save reference to the QGIS interface
        self.iface = iface
        # a reference to our map canvas
        self.canvas = self.iface.mapCanvas()
        
        self.shaDEM = shaDEM(iface,  True)

        # Create the dialog (after translation) and keep reference
        self.dlg = SolarAccessDialog()
        
        #interactive GUI connections:
        self.dlg.comboBox.currentIndexChanged['QString'].connect(self.getParameters)
        self.dlg.spinBox_bands.valueChanged.connect(self.getParameters)
        self.dlg.runButton.clicked.connect(self.initLayer)
        self.dlg.spinBox_maxHt.valueChanged.connect(self.checkInput) 
        self.dlg.start_time.timeChanged.connect(self.checkInput)
        self.dlg.end_time.timeChanged.connect(self.checkInput)
Esempio n. 2
0
    def __init__(self, iface):

        # Save reference to the QGIS interface
        self.iface = iface
        # a reference to our map canvas
        self.canvas = self.iface.mapCanvas()
        # a reference to shaDEM with the svfContext set to True
        self.shaDEM = shaDEM(iface, True)

        # Create the dialog (after translation) and keep reference
        self.dlg = SVFdialog()

        # interactive GUI connections:
        self.dlg.comboBox.layerChanged.connect(
            self.getParameters
        )  # is it possible to call shaDEM class functions here?
        self.dlg.spinBox_bands.valueChanged.connect(self.getParameters)
        self.dlg.runButton.clicked.connect(self.initLayer)
        # debug - activate cProdile
        # self.dlg.runButton.clicked.connect(self.tmpProfile)
        self.dlg.spinBox_maxHt.valueChanged.connect(self.checkInput)
Esempio n. 3
0
    def __init__(self, iface):
        # Save reference to the QGIS interface
        self.iface = iface
        # save reference to tool interfaces
        self.shaDEM = shaDEM(iface)
        self.svf = svf(iface)
        self.SolarAccess = SolarAccess(iface)
        
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value("locale/userLocale")[0:2]
        localePath = os.path.join(self.plugin_dir, 'i18n', 'demtools_{}.qm'.format(locale))

        if os.path.exists(localePath):
            self.translator = QTranslator()
            self.translator.load(localePath)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)
        
        
        
       #check necessary libraries
        try:
            import numpy
            import numexpr
            
        except ImportError:
            QMessageBox.critical( self.iface.mainWindow(),"ImportError", "Plugin requires Numpy & Numexpr libraries.\n\See http://www.numpy.org & https://code.google.com/p/numexpr/" )
            
        
        try:
            import Pysolar as solar
        except ImportError:
            try:
                import solar
            except ImportError:
                QMessageBox.critical( self.iface.mainWindow(),"ImportError", "Plugin requires Pysolar libraries.\n\See http://pysolar.org/" )