Пример #1
0
    def __init__(self):
        QWidgetSavePos.__init__(self, "measure_window")
        resize_window_to_be_sane(self, 0.5, 0.7)

        self.setWindowIcon(QIcon_load("measure"))
        self.setWindowTitle(
            _("Measurment editor") + " (https://www.gpvdm.com)")

        self.vbox = QVBoxLayout()

        self.ribbon = measure_ribbon()
        self.ribbon.tb_new.triggered.connect(self.callback_add_page)
        self.ribbon.tb_rename.triggered.connect(self.callback_rename_page)
        self.ribbon.tb_clone.triggered.connect(self.callback_copy_page)
        self.ribbon.tb_delete.triggered.connect(self.callback_delete_page)

        self.vbox.addWidget(self.ribbon)

        self.notebook = QTabWidget()
        self.notebook.setTabBar(QHTabBar())
        self.notebook.setTabPosition(QTabWidget.West)
        self.notebook.setMovable(True)

        self.vbox.addWidget(self.notebook)

        self.load_tabs()

        self.setLayout(self.vbox)
Пример #2
0
	def __init__(self):
		QWidgetSavePos.__init__(self,"measure_window")
		resize_window_to_be_sane(self,0.5,0.7)

		self.setWindowIcon(icon_get("measure"))
		self.setWindowTitle(_("Measurment editor")+" (https://www.gpvdm.com)")

		self.vbox=QVBoxLayout()

		self.ribbon=measure_ribbon()
		self.ribbon.order_widget.added.connect(self.callback_add_page)


		self.vbox.addWidget(self.ribbon)

		self.notebook = QTabWidget()
		self.notebook.setTabBar(QHTabBar())
		self.notebook.setTabPosition(QTabWidget.West)
		self.notebook.setMovable(True)

		self.ribbon.order_widget.notebook_pointer=self.notebook
		self.ribbon.order_widget.load_tabs()

		self.vbox.addWidget(self.notebook)


		self.setLayout(self.vbox)
Пример #3
0
    def __init__(self, bib_file, token):
        """Pass this the file name of the file you want referenced."""
        QWidgetSavePos.__init__(self, "ref_window")
        resize_window_to_be_sane(self, 0.5, 0.5)
        self.bib_file = bib_file
        self.token = token
        self.setWindowIcon(icon_get("ref"))
        self.setWindowTitle(
            _("Reference manager") + " (https://www.gpvdm.com)")

        self.vbox = QVBoxLayout()

        self.toolbar = QToolBar()
        self.toolbar.setIconSize(QSize(48, 48))

        spacer = QWidget()
        spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.toolbar.addWidget(spacer)

        self.tb_help = QAction(icon_get("help"), _("Help"), self)
        self.tb_help.setStatusTip(_("Help"))
        self.tb_help.triggered.connect(self.callback_help)
        self.toolbar.addAction(self.tb_help)

        self.vbox.addWidget(self.toolbar)
        self.tab = inp_viewer()
        self.tab.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.vbox.addWidget(self.tab)

        self.button_widget = QWidget()
        self.button_hbox = QHBoxLayout()
        self.button_widget.setLayout(self.button_hbox)

        spacer = QWidget()
        spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.button_hbox.addWidget(spacer)

        self.button_close = QPushButton(_("Save"))
        self.button_close.clicked.connect(self.callback_save)
        self.button_hbox.addWidget(self.button_close)
        self.vbox.addWidget(self.button_widget)
        self.setLayout(self.vbox)
        self.b = bibtex()
        self.b.load(self.bib_file)
        self.item = self.b.get_ref(self.token)
        if self.item == False:
            self.item = self.b.new()
            self.item.token = token

        lines = []
        for var in self.item.vars:
            lines.append("#ref_" + var)
            lines.append(getattr(self.item, var))
        lines.append("#end")
        self.tab.populate(lines)
Пример #4
0
    def __init__(self, file_name):
        """Pass this the file name of the file you want referenced."""
        QWidgetSavePos.__init__(self, "ref_window")
        resize_window_to_be_sane(self, 0.5, 0.5)
        self.file_name = os.path.splitext(file_name)[0] + ".ref"
        self.gen_file()
        self.setWindowIcon(QIcon_load("ref"))
        self.setWindowTitle(
            _("Reference manager") + " (https://www.gpvdm.com)")

        self.vbox = QVBoxLayout()

        self.toolbar = QToolBar()
        self.toolbar.setIconSize(QSize(48, 48))

        spacer = QWidget()
        spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.toolbar.addWidget(spacer)

        self.tb_help = QAction(QIcon_load("help"), _("Help"), self)
        self.tb_help.setStatusTip(_("Help"))
        self.tb_help.triggered.connect(self.callback_help)
        self.toolbar.addAction(self.tb_help)

        self.vbox.addWidget(self.toolbar)
        tab = tab_class()
        tab.icon_file = "ref.png"
        tab.init(self.file_name, _("Reference"))
        self.vbox.addWidget(tab)

        self.button_widget = QWidget()
        self.button_hbox = QHBoxLayout()
        self.button_widget.setLayout(self.button_hbox)

        spacer = QWidget()
        spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.button_hbox.addWidget(spacer)

        self.button_close = QPushButton(_("Close"))
        self.button_close.clicked.connect(self.callback_close)
        self.button_hbox.addWidget(self.button_close)
        self.vbox.addWidget(self.button_widget)
        self.setLayout(self.vbox)
Пример #5
0
    def __init__(self):
        super(gpvdm_main_window, self).__init__()
        icon_init_db()
        #from scans_io import scans_io
        #from cal_path import get_sim_path
        #scans=scans_io(get_sim_path())
        #sims=scans.get_scan_dirs()
        #print(sims)
        #asdsa
        self.splash = splash_window()
        self.scan_human_labels = get_scan_human_labels()

        self.splash.inc_value()
        process_events()
        process_events()

        #from wiz import wiz
        #a=wiz()
        #a.exec_()

        #sys.exit()
        do_import()

        if os.path.isdir(os.path.dirname(sys.argv[0])) == False:
            error_dlg(self, _("I can't run from inside a zip file!"))
            sys.exit()

        self.splash.inc_value()
        self.splash.inc_value()

        server_init()
        self.splash.inc_value()

        self.check_sim_exists = check_sim_exists()
        self.splash.inc_value()

        self.check_sim_exists.start_thread()
        self.splash.inc_value()

        self.check_sim_exists.sim_gone.connect(self.sim_gone)
        self.splash.inc_value()

        self.my_server = server_get()
        self.my_server.init(get_sim_path())
        self.splash.inc_value()

        self.undo_list = undo_list_class()
        wpos_load()
        self.splash.inc_value()

        self.ribbon = ribbon()
        self.splash.inc_value()

        self.notebook_active_page = None
        self.setAcceptDrops(True)
        #self.setGeometry(200, 100, 1300, 600)
        self.setWindowTitle(
            "General-purpose Photovoltaic Device Model (https://www.gpvdm.com)"
        )

        self.l = lock_gui()

        #self.l.disable_all.connect(self.disable_interface)
        #self.l.enable_all.connect(self.enable_disable_buttons)

        #super(gpvdm_main_window, self).__init__(parent, QtCore.Qt.FramelessWindowHint)
        #gobject.GObject.__init__(self)

        #self.my_server.setup_gui(self.gui_sim_start)
        self.my_server.sim_started.connect(self.gui_sim_start)
        self.splash.inc_value()

        self.my_server.sim_finished.connect(self.gui_sim_stop)
        self.splash.inc_value()

        help_init()
        self.splash.inc_value()

        #help_window().help_set_help(["star.png",_("<big><b>Update available!</b></big><br>")])

        #self.show()

        if running_on_linux() == True:
            self.bus = dbus.SessionBus()
            self.bus.add_match_string_non_blocking(
                "type='signal',interface='org.my.gpvdm'")
            self.bus.add_message_filter(self.adbus)
        else:
            self.win_pipe = win_pipe()
            self.win_pipe.new_data.connect(self.win_dbus)
            self.win_pipe.start()

        self.notebook = gpvdm_notebook()
        vbox = QVBoxLayout()
        self.splash.inc_value()

        vbox.addWidget(self.ribbon)
        self.ribbon.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
        self.notebook.setSizePolicy(QSizePolicy.Expanding,
                                    QSizePolicy.Expanding)
        vbox.addWidget(self.notebook)
        wvbox = QWidget()
        self.splash.inc_value()

        wvbox.setLayout(vbox)
        self.setCentralWidget(wvbox)

        self.splash.inc_value()

        self.statusBar()

        temp_error = ver_error()
        #print(temp_error)
        if len(temp_error) > 0:
            error_dlg(self, temp_error)
            return

        self.setWindowIcon(
            QIcon(os.path.join(get_image_file_path(), "image.jpg")))
        self.splash.inc_value()

        self.show_tabs = True
        self.show_border = True

        self.ribbon.file.home_new.clicked.connect(self.callback_new)
        self.ribbon.file.home_open.clicked.connect(self.callback_open)
        self.ribbon.file.used_files_click.connect(self.load_sim)
        self.ribbon.home.undo.triggered.connect(self.callback_undo)
        self.ribbon.home.run.start_sim.connect(self.callback_simulate)
        self.splash.inc_value()

        #self.ribbon.home.stop.setEnabled(False)

        self.ribbon.home.scan.setEnabled(False)
        self.ribbon.thermal.setEnabled(False)

        self.ribbon.home.help.triggered.connect(self.callback_on_line_help)

        update_init()

        resize_window_to_be_sane(self, 0.7, 0.75)

        self.change_dir_and_refresh_interface(get_sim_path())
        self.splash.inc_value()

        #self.ribbon.home.sun.changed.connect(self.notebook.update)
        self.ribbon.setAutoFillBackground(True)
        self.splash.inc_value()
        self.show()

        help_window().show()

        self.enable_disable_buttons()

        val = inp_get_token_value(os.path.join(get_sim_path(), "config.inp"),
                                  "#use_gpvdm_local")
        if val != "false":
            if os.path.isdir(get_materials_path()) == False:
                clone_materials(get_materials_path(), get_base_material_path(),
                                "material")

            if os.path.isdir(get_emission_path()) == False:
                clone_materials(get_emission_path(), get_base_emission_path(),
                                "emission")

            if os.path.isdir(get_shape_path()) == False:
                clone_materials(get_shape_path(), get_base_shape_path(),
                                "shape")

            if os.path.isdir(get_scripts_path()) == False:
                shutil.copytree(get_base_scripts_path(),
                                get_scripts_path(),
                                symlinks=True)

            if os.path.isdir(get_spectra_path()) == False:
                clone_spectras(get_spectra_path())

        self.cache = cache(only_open_if_full=True)

        #from shape_editor import shape_editor
        #self.shape_window=shape_editor("/home/rod/gpvdm_local/shape/pedot")
        #self.shape_window.show()

        #from shape_import import shape_import
        #self.shape_import=shape_import("/home/rod/gpvdm_local/shape/pedot")
        #self.shape_import.show()
        check_lib_in_bash_rc()
Пример #6
0
	def __init__(self,out_file,config_file,multi_files=False):
		QDialog.__init__(self)
		self.disable_callbacks=False
		self.multi_files=multi_files
		self.out_file=out_file
		self.config_file_path=config_file
		self.path=os.path.dirname(self.out_file)
		self.file_names=None
		resize_window_to_be_sane(self,0.6,0.7)

		self.setWindowIcon(icon_get("import"))

		self.setWindowTitle(_("Import data")+" (https://www.gpvdm.com)") 

		self.main_vbox = QVBoxLayout()
	
		self.ribbon=ribbon_import()
		
		self.ribbon.open_data.triggered.connect(self.callback_open)

		self.ribbon.import_data.triggered.connect(self.callback_import)

		self.ribbon.plot.triggered.connect(self.callback_plot)
				
		self.ribbon.tb_help.triggered.connect(self.callback_help)

		self.main_vbox.addWidget(self.ribbon)
		
		self.input_output_hbox=QHBoxLayout()

		self.raw_data_widget=QWidget()
		self.raw_data_hbox=QVBoxLayout()
		self.raw_data_widget.setLayout(self.raw_data_hbox)
		self.raw_data = QTextEdit(self)
		self.raw_data.setReadOnly(True)
		self.raw_data.setLineWrapMode(QTextEdit.NoWrap)
		font = self.raw_data.font()
		font.setFamily("Courier")
		font.setPointSize(10)
		self.raw_data_label=QLabel(_("The file to import:"))
		self.raw_data_hbox.addWidget(self.raw_data_label)
		self.raw_data_hbox.addWidget(self.raw_data)
		self.raw_data_path=QLabel()
		self.raw_data_hbox.addWidget(self.raw_data_path)

		self.out_data_widget=QWidget()
		self.out_data_hbox=QVBoxLayout()
		self.out_data_widget.setLayout(self.out_data_hbox)
		self.out_data = QTextEdit(self)
		self.out_data.setReadOnly(True)
		self.out_data.setLineWrapMode(QTextEdit.NoWrap)
		font = self.out_data.font()
		font.setFamily("Courier")
		font.setPointSize(10)
		self.out_data_label=QLabel(_("The imported file, the numbers should now be in SI units"))
		self.out_data_hbox.addWidget(self.out_data_label)

		self.out_data_hbox.addWidget(self.out_data)

		self.out_data_path=QLabel()
		self.out_data_hbox.addWidget(self.out_data_path)
		
		self.input_output_hbox.addWidget(self.raw_data_widget)
		self.input_output_hbox.addWidget(self.out_data_widget)
		self.input_output_widget=QWidget()
		self.input_output_widget.setLayout(self.input_output_hbox)

		###################
		self.build_top_widget()
		###################

		self.main_vbox.addWidget(self.top_widget)
		self.main_vbox.addWidget(self.input_output_widget)		
		self.input_output_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
		self.setLayout(self.main_vbox)

		self.out_data_path.setText(self.out_file)
		if self.load_config()==False:
			self.open_file()
		self.load_file()
		self.update()
Пример #7
0
    def __init__(self):
        super(gpvdm_main_window, self).__init__()

        self.splash = splash_window()
        self.splash.inc_value()
        process_events()
        process_events()

        #from wiz import wiz
        #a=wiz()
        #a.exec_()

        #sys.exit()
        do_import()

        if os.path.isdir(os.path.dirname(sys.argv[0])) == False:
            error_dlg(self, _("I can't run from inside a zip file!"))
            sys.exit()

        self.splash.inc_value()
        self.splash.inc_value()

        server_init()
        self.splash.inc_value()

        self.check_sim_exists = check_sim_exists()
        self.splash.inc_value()

        self.check_sim_exists.start_thread()
        self.splash.inc_value()

        self.check_sim_exists.sim_gone.connect(self.sim_gone)
        self.splash.inc_value()

        self.my_server = server_get()
        self.my_server.init(get_sim_path())
        self.splash.inc_value()

        self.undo_list = undo_list_class()
        wpos_load()
        self.splash.inc_value()

        self.ribbon = ribbon()
        self.splash.inc_value()

        self.notebook_active_page = None
        self.setAcceptDrops(True)
        #self.setGeometry(200, 100, 1300, 600)
        self.setWindowTitle(
            "General-purpose Photovoltaic Device Model (https://www.gpvdm.com)"
        )

        #super(gpvdm_main_window, self).__init__(parent, QtCore.Qt.FramelessWindowHint)
        #gobject.GObject.__init__(self)

        self.my_server.setup_gui(self.gui_sim_start)
        self.splash.inc_value()

        self.my_server.sim_finished.connect(self.gui_sim_stop)
        self.splash.inc_value()

        help_init()
        self.splash.inc_value()

        #help_window().help_set_help(["star.png",_("<big><b>Update available!</b></big><br>")])

        #self.show()

        if running_on_linux() == True:
            DBusQtMainLoop(set_as_default=True)
            self.bus = dbus.SessionBus()
            self.bus.add_match_string_non_blocking(
                "type='signal',interface='org.my.gpvdm'")
            self.bus.add_message_filter(self.adbus)
        else:
            self.win_pipe = win_pipe()
            self.win_pipe.new_data.connect(self.win_dbus)
            self.win_pipe.start()

        self.notebook = gpvdm_notebook()
        vbox = QVBoxLayout()
        self.splash.inc_value()

        vbox.addWidget(self.ribbon)
        vbox.addWidget(self.notebook)
        wvbox = QWidget()
        self.splash.inc_value()

        wvbox.setLayout(vbox)
        self.setCentralWidget(wvbox)

        self.splash.inc_value()

        self.statusBar()

        temp_error = ver_error()
        #print(temp_error)
        if len(temp_error) > 0:
            error_dlg(self, temp_error)
            return

        self.setWindowIcon(
            QIcon(os.path.join(get_image_file_path(), "image.jpg")))
        self.splash.inc_value()

        self.show_tabs = True
        self.show_border = True

        self.ribbon.home_export.triggered.connect(self.callback_export)

        #if enable_webupdates()==False:
        #	self.help_menu_update=help_menu.addAction("&"+_("Check for updates"))
        #	self.help_menu_update.triggered.connect(self.callback_update)

        self.ribbon.home_new.triggered.connect(self.callback_new)
        self.ribbon.home_open.triggered.connect(self.callback_open)
        self.ribbon.home.undo.triggered.connect(self.callback_undo)
        self.ribbon.home.run.triggered.connect(self.callback_simulate)
        self.splash.inc_value()

        self.ribbon.home.stop.setEnabled(False)

        self.ribbon.home.scan.setEnabled(False)

        self.ribbon.home.help.triggered.connect(self.callback_on_line_help)

        resize_window_to_be_sane(self, 0.7, 0.75)

        self.change_dir_and_refresh_interface(get_sim_path())
        self.splash.inc_value()

        self.ribbon.home.sun.changed.connect(self.notebook.update)
        self.ribbon.setAutoFillBackground(True)
        self.splash.inc_value()
        self.show()
        help_window().show()

        from update import update_window
        self.a = update_window()
        self.a.show()