def onSaveScene(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='YAML *.yml and NumPy container *.npz (*.yml *.npz)', caption='Save scene') if not validateFilename(filename): return self.model.scene.save(filename)
def onOpenScene(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName( filter='YAML *.yml and NumPy container *.npz (*.yml *.npz)', caption='Load kite scene') if not validateFilename(filename): return self.model.loadFile(filename)
def onExportWeightMatrix(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='Text File *.txt (*.txt)', caption='Export Covariance Weights',) if not validateFilename(filename): return self.sigExportWeightMatrix.emit(filename)
def loadModel(self, filename=None): if filename is None: filename, _ = QtWidgets.QFileDialog.getOpenFileName( filter='YAML *.yml (*.yml)', caption='Load SandboxScene') if not validateFilename(filename): return model = SandboxScene.load(filename) self.sandbox.setModel(model)
def onExportScene(self): filename, _ = QtGui.QFileDialog.getSaveFileName( filter='YAML *.yml and NumPy container *.npz (*.yml *.npz)', caption='Save scene') if not validateFilename(filename): return scene = self.sandbox.model.getKiteScene() scene.save(filename)
def onLoadReferenceScene(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName( filter='YAML *.yml (*.yml)', caption='Load kite.Scene') if not validateFilename(filename): return self.sandbox.model.loadReferenceScene(filename) self.createMisfitWindow() self.actionMisfitScene.setChecked(True)
def onSaveConfig(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='YAML file *.yml (*.yml)', caption='Save scene YAML config') if not validateFilename(filename): return self.model.scene.saveConfig(filename) QtWidgets.QMessageBox.information( self, 'Scene config saved', 'Scene config successfuly saved!' '<p style="font-family: monospace;">%s' '</p>' % filename)
def onSaveScene(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='YAML *.yml and NumPy container *.npz (*.yml *.npz)', caption='Save scene') if not validateFilename(filename): return self.model.scene.save(filename) QtWidgets.QMessageBox.information( self, 'Scene saved', 'Scene successfuly saved!' '<p style="font-family: monospace;">%s' '</p>' % filename)
def onImportScene(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName( self, filter='Supported Formats, *.grd, *.geo, *unw*, *.mat ' '(*.grd,*.geo,*unw*,*.mat);;' 'GMT5SAR Scene, *.grd (*.grd);;' 'ISCE Scene, *unw* (*unw*);;Gamma Scene *.geo (*.geo);;' 'Matlab Container, *.mat (*.mat);;Any File * (*)', caption='Import scene to spool') if not validateFilename(filename): return self.sigImportFile.emit(filename)
def onExportQuadtree(self): filename, flt = QtWidgets.QFileDialog.getSaveFileName( filter='GeoJSON (*.json *.geojson);;CSV File *.csv (*.csv)', caption='Export Quadtree') if not validateFilename(filename): return if flt == 'GeoJSON (*.json *.geojson)': self.model.quadtree.export_geojson(filename) elif flt == 'CSV File *.csv (*.csv)': self.model.quadtree.export_csv(filename) else: raise ValueError('unknown filter')
def onSaveScene(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( parent=self, directory=self.getSceneDirname(), filter="YAML *.yml and NumPy container *.npz (*.yml *.npz)", caption="Save scene", ) if not validateFilename(filename): return self.model.scene.save(filename) QtWidgets.QMessageBox.information( self, "Scene saved", "Scene successfuly saved!" '<p style="font-family: monospace;">%s' "</p>" % filename, ) self.state_hash = self.model.scene.get_state_hash()
def onSaveConfig(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( parent=self, directory=self.getSceneDirname(), filter="YAML file *.yml (*.yml)", caption="Save scene YAML config", ) if not validateFilename(filename): return self.model.scene.saveConfig(filename) QtWidgets.QMessageBox.information( self, "Scene config saved", "Scene config successfuly saved!" f'<p style="font-family: monospace;">{filename}' "</p>", ) self.state_hash = self.model.scene.get_state_hash()
def onExportQuadtree(self): filename, flt = QtWidgets.QFileDialog.getSaveFileName( parent=self, filter="GeoJSON (*.geojson *.json);;CSV File *.csv (*.csv)", caption="Export Quadtree", ) if not validateFilename(filename): return if flt == "GeoJSON (*.geojson *.json)": if not filename.endswith(".geojson") and not filename.endswith( ".json"): filename += ".geojson" self.model.quadtree.export_geojson(filename) elif flt == "CSV File *.csv (*.csv)": if not filename.endswith(".csv"): filename += ".geojson" self.model.quadtree.export_csv(filename) else: raise ValueError("unknown filter")
def onSaveModel(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='YAML *.yml (*.yml)', caption='Save SandboxScene') if not validateFilename(filename): return self.sandbox.model.save(filename)
def onLoadConfig(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName( filter="YAML file *.yml (*.yml)", caption="Load scene YAML config") if not validateFilename(filename): return self.sigLoadConfig.emit(filename)
def onExportQuadtree(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='CSV File *.csv (*.csv)', caption='Export Quadtree CSV') if not validateFilename(filename): return self.model.quadtree.export(filename)
def onLoadConfig(self): filename, _ = QtGui.QFileDialog.getOpenFileName( filter='YAML file *.yml (*.yml)', caption='Load scene YAML config') if not validateFilename(filename): return self.sigLoadConfig.emit(filename)
def onSaveConfig(self): filename, _ = QtWidgets.QFileDialog.getSaveFileName( filter='YAML file *.yml (*.yml)', caption='Save scene YAML config') if not validateFilename(filename): return self.model.scene.saveConfig(filename)