示例#1
0
文件: main.py 项目: bclmary/eccw_gui
 def save_session(self):
     SaveDialog = QtWidgets.QFileDialog.getSaveFileName
     file_name, _ = SaveDialog(self, "Save file", self.current_dir,
                               self.mime_types)
     if file_name:
         eccwf = EccwFile(data=self.get_params())
         eccwf.save(file_name)
示例#2
0
def launch():
    out = options_parser()
    app = QtWidgets.QApplication(sys.argv)
    params = dict()
    if out:
        eccwf = EccwFile(filename=out)
        params = eccwf.values
    myapp = MainController(**params)
    sys.exit(app.exec_())
示例#3
0
文件: main.py 项目: bclmary/eccw_gui
 def load_session(self):
     OpenDialog = QtWidgets.QFileDialog.getOpenFileName
     out_opendialog = OpenDialog(self, "Open file", self.current_dir,
                                 self.mime_types)
     file_name = out_opendialog[0]
     if file_name == "":
         return
     self.current_dir = dirname(realpath(file_name))
     eccwf = EccwFile(filename=file_name)
     if eccwf.values is None:
         message = ("Wrong file type.\n"
                    "Chosen file must be a *.eccw mime type.")
         QtWidgets.QMessageBox.about(self, "Error", message)
         return
     self.set_params(**eccwf.values)
示例#4
0
                "focus": "scalar"
            },
            "sketch": True,
            "color": (0, 1, 0, 1),
            "size": 5,
            "style": "square",
            "label": "poulpe",
        }
        params = {
            "fluids": "False",
            "phiB": phiB,
            "label": "poulpe",
            "context": "Extension",
            "points": [point, point],
        }

        from eccw_gui.shared.file_management import EccwFile

        eccwf = EccwFile(filename="../../../tests/data/test.eccw")
        params = eccwf.values["plot"]["curves"][0]
        graph_print(params)

        myapp = CurveController(**params)

        sys.exit(app.exec_())
    finally:
        print("params =")
        graph_print(myapp.get_params(), indent=2)
        print("select =")
        graph_print(myapp.get_select(), indent=2)