def handleCDF(self, checkState): isCDF = checkState == Qt.Checked if isCDF and qgs.getVersion() < conf.MIN_RASTER_MULTIBAND: QMessageBox.information( self.iface.mainWindow(), 'Info', 'QGIS 2.10 and higher is recommended for this feature') if isCDF and not CDFRasterLayer.isSupportedRaster( self.getSelectedLayer()): self.dialog.isCDF.setCheckState(Qt.Unchecked) QMessageBox.information( self.iface.mainWindow(), 'Error', 'To use this feature the raster should be using the ' + 'QgsSingleBandPseudoColorRenderer (can choose from Properties)' ) return if isCDF and not self.haveNetCDF(): QMessageBox.information( self.iface.mainWindow(), 'Info', 'For full CDF support please pip install netCDF4') enable = not isCDF self.dialog.checkBoxEnd.setEnabled(enable) self.dialog.checkBoxStart.setEnabled(enable) self.dialog.spinBoxStart1.setEnabled(enable) self.dialog.spinBoxStart2.setEnabled(enable) self.dialog.spinBoxEnd1.setEnabled(enable) self.dialog.spinBoxEnd2.setEnabled(enable) self.dialog.textStart.setEnabled(enable) self.dialog.textEnd.setEnabled(enable)
def currentTimeChangedSlider(self, sliderVal): try: pct = (sliderVal - self.dock.horizontalTimeSlider.minimum()) * 1.0 / ( self.dock.horizontalTimeSlider.maximum() - self.dock.horizontalTimeSlider.minimum()) except: # slider is not properly initialized yet return if self.model.getActiveDelimitedText() and qgs.getVersion() < conf.MIN_DTEXT_FIXED: time.sleep(0.1) # hack to fix issue in qgis core with delimited text which was fixed in 2.9 self.signalSliderTimeChanged.emit(pct)
def currentTimeChangedSlider(self,sliderVal): try: pct = (sliderVal - self.dock.horizontalTimeSlider.minimum())*1.0/( self.dock.horizontalTimeSlider.maximum() - self.dock.horizontalTimeSlider.minimum()) except: # slider is not properly initialized yet return if self.model.getActiveDelimitedText() and qgs.getVersion()<conf.MIN_DTEXT_FIXED: time.sleep(0.1) # hack to fix issue in qgis core with delimited text which was fixed in 2.9 self.signalSliderTimeChanged.emit(pct)
def handleCDF(self, checkState): isCDF = checkState == Qt.Checked if isCDF and qgs.getVersion() < conf.MIN_RASTER_MULTIBAND: QMessageBox.information(self.iface.mainWindow(),'Info','QGIS 2.10 and higher is recommended for this feature') if isCDF and not CDFRasterLayer.isSupportedRaster(self.getSelectedLayer()) : self.dialog.isCDF.setCheckState(Qt.Unchecked) QMessageBox.information(self.iface.mainWindow(),'Error','To use this feature the raster should be using the '+\ 'QgsSingleBandPseudoColorRenderer (can choose from Properties)') return enable = not isCDF self.dialog.checkBoxEnd.setEnabled(enable) self.dialog.checkBoxStart.setEnabled(enable) self.dialog.spinBoxStart1.setEnabled(enable) self.dialog.spinBoxStart2.setEnabled(enable) self.dialog.spinBoxEnd1.setEnabled(enable) self.dialog.spinBoxEnd2.setEnabled(enable) self.dialog.textStart.setEnabled(enable) self.dialog.textEnd.setEnabled(enable)