示例#1
0
文件: spool.py 项目: miili/kite
 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)
示例#2
0
 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)
示例#3
0
文件: spool.py 项目: miili/kite
 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)
示例#4
0
 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)
示例#5
0
文件: talpa.py 项目: hvasbath/kite
 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)
示例#6
0
    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)
示例#7
0
 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)
示例#8
0
 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)
示例#9
0
 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)
示例#10
0
    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')
示例#11
0
 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()
示例#12
0
 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()
示例#13
0
    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")
示例#14
0
 def onSaveModel(self):
     filename, _ = QtWidgets.QFileDialog.getSaveFileName(
         filter='YAML *.yml (*.yml)', caption='Save SandboxScene')
     if not validateFilename(filename):
         return
     self.sandbox.model.save(filename)
示例#15
0
 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)
示例#16
0
 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)
示例#17
0
文件: spool.py 项目: hvasbath/kite
 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)
示例#18
0
文件: spool.py 项目: miili/kite
 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)