예제 #1
0
파일: ribbon.py 프로젝트: xj361685640/gpvdm
    def file(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        self.home_new = QAction(icon_get("document-new"),
                                _("New simulation").replace(" ", "\n"), self)
        #self.home_new.setText(_("New\nsimulation"))
        toolbar.addAction(self.home_new)

        self.home_open = QAction(icon_get("document-open"),
                                 _("Open\nsimulation"), self)
        toolbar.addAction(self.home_open)

        self.home_export = QAction(icon_get("document-export"),
                                   _("Export\ndata"), self)
        toolbar.addAction(self.home_export)

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

        self.home_help = QAction(icon_get("internet-web-browser"), _("Help"),
                                 self)
        toolbar.addAction(self.home_help)

        return toolbar
예제 #2
0
	def scan(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		self.tb_new = QAction(icon_get("document-new"), wrap_text(_("New scan"),2), self)
		toolbar.addAction(self.tb_new)

		self.tb_delete = QAction(icon_get("edit-delete"), wrap_text(_("Delete scan"),3), self)
		toolbar.addAction(self.tb_delete)

		self.tb_clone = QAction(icon_get("clone"), wrap_text(_("Clone scan"),3), self)
		toolbar.addAction(self.tb_clone)

		self.tb_rename = QAction(icon_get("rename"), wrap_text(_("Rename scan"),3), self)
		toolbar.addAction(self.tb_rename)

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

		self.home_help = QAction(icon_get("internet-web-browser"), _("Help"), self)
		toolbar.addAction(self.home_help)

		return toolbar
예제 #3
0
	def optics(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))
		
		self.run = QAction(icon_get("media-playback-start"), wrap_text(_("Run optical simulation"),5), self)
		toolbar.addAction(self.run)
		
		self.tb_save = QAction(icon_get("document-save-as"), _("Save graph"), self)
		#self.tb_save.triggered.connect(self.save_image)
		toolbar.addAction(self.tb_save)

		self.fx_box=fx_selector()
		self.fx_box.show_all=True
		self.fx_box.file_name_set_start("light_1d_") 
		self.fx_box.file_name_set_end("_photons_abs.dat")
		self.fx_box.update()
		toolbar.addWidget(self.fx_box)
		
		self.optial_model=tb_optical_model()
		toolbar.addWidget(self.optial_model)

		self.spectrum=tb_spectrum()
		toolbar.addWidget(self.spectrum)

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


		self.help = QAction(icon_get("help"), _("Help"), self)
		toolbar.addAction(self.help)
		return toolbar
예제 #4
0
    def __init__(self, path="", api_callback=None):
        if path == "":
            self.path = get_scripts_path()
        else:
            self.path = path

        QWidgetSavePos.__init__(self, "scripts")

        self.setWindowIcon(icon_get("script"))

        self.setMinimumSize(1000, 600)
        self.setWindowTitle(_("Script editor") + " (https://www.gpvdm.com)")

        self.ribbon = script_ribbon()

        self.setWindowIcon(icon_get("script"))

        self.main_vbox = QVBoxLayout()

        self.ribbon.run.start_sim.connect(self.callback_run)

        self.ribbon.help.triggered.connect(self.callback_help)

        self.ribbon.tb_save.clicked.connect(self.callback_save)
        self.ribbon.tb_new.clicked.connect(self.callback_add_page)
        #self.ribbon.tb_rename.clicked.connect(self.callback_rename_page)

        self.ribbon.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)

        self.main_vbox.addWidget(self.ribbon)
        self.api_callback = api_callback

        self.notebook = QTabWidget()
        css_apply(self.notebook, "tab_default.css")
        self.notebook.setMovable(True)

        added = 0
        for f in listdir(self.path):
            if f.endswith(".py"):
                file_name = os.path.join(self.path, f)
                a = script_editor()
                a.api_callback = self.api_callback
                a.load(file_name)
                a.status_changed.connect(self.callback_tab_changed)
                self.notebook.addTab(a, f)
                added = added + 1
        if added == 0:
            file_name = os.path.join(self.path, "example.py")
            self.new_script(file_name)
            a = script_editor()
            a.api_callback = self.api_callback
            a.load(file_name)
            a.status_changed.connect(self.callback_tab_changed)
            self.notebook.addTab(a, "example.py")

        self.notebook.setSizePolicy(QSizePolicy.Expanding,
                                    QSizePolicy.Expanding)
        self.main_vbox.addWidget(self.notebook)

        self.setLayout(self.main_vbox)
예제 #5
0
	def experiment(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		self.order_widget=order_widget()
		self.order_widget.new_text=_("New experiment")
		self.order_widget.delete_text=_("Delete experiment")
		self.order_widget.clone_text=_("Clone experiment")
		self.order_widget.rename_text=_("Rename experiment")
		self.order_widget.new_dlg_text=_("New experiment name:")
		self.order_widget.base_file_name=["is","is_fxdomain_data","fxmesh"]
		self.order_widget.new_tab_name=_("experiment ")
		self.order_widget.clone_dlg_text=_("Clone the current experiment to a new experiment called:")
		self.order_widget.rename_dlg_text=_("Rename the experiment to be called:")
		self.order_widget.delete_dlg_text=_("Should I remove the experiment file ")
		self.order_widget.postfix="@is"
		self.order_widget.name_token="#sim_menu_name"
		self.order_widget.init()

		toolbar.addWidget(self.order_widget)



		self.tb_save = QAction(icon_get(("document-save")), wrap_text(_("Save image"),3), self)
		toolbar.addAction(self.tb_save)

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

		self.home_help = QAction(icon_get("internet-web-browser"), _("Help"), self)
		toolbar.addAction(self.home_help)

		return toolbar
    def __init__(self):
        QWidgetSavePos.__init__(self, "electrical")
        self.setFixedSize(1000, 600)
        self.setWindowIcon(icon_get("preferences-system"))

        self.setWindowTitle(
            _("Electrical parameter editor") + " (https://www.gpvdm.com)")

        self.main_vbox = QVBoxLayout()

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

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

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

        self.main_vbox.addWidget(toolbar)

        self.notebook = QTabWidget()

        self.notebook.setMovable(True)

        self.main_vbox.addWidget(self.notebook)

        widget = tab_class("device.inp")
        self.notebook.addTab(widget, _("Device"))

        self.setLayout(self.main_vbox)
예제 #7
0
    def init(self):

        if isinstance(self.base_file_name, list) == False:
            self.base_file_name = [self.base_file_name]

        self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        self.setIconSize(QSize(self.icon_size, self.icon_size))

        self.tb_new = QAction(icon_get("document-new"),
                              wrap_text(self.new_text, 2), self)
        self.tb_new.triggered.connect(self.callback_add_page)
        self.addAction(self.tb_new)

        self.tb_delete = QAction(icon_get("edit-delete"),
                                 wrap_text(self.delete_text, 3), self)
        self.tb_delete.triggered.connect(self.callback_delete_page)
        self.addAction(self.tb_delete)

        self.tb_clone = QAction(icon_get("clone"),
                                wrap_text(self.clone_text, 3), self)
        self.tb_clone.triggered.connect(self.callback_clone_page)
        self.addAction(self.tb_clone)

        self.tb_rename = QAction(icon_get("rename"),
                                 wrap_text(self.rename_text, 3), self)
        self.tb_rename.triggered.connect(self.callback_rename_page)
        self.addAction(self.tb_rename)
예제 #8
0
def status_icon_stop(cluster):
	if gui_get()==True:
		global statusicon
		if cluster==False:
			statusicon.setIcon(icon_get("ball_green"))
		else:
			statusicon.setIcon(icon_get("ball_green4"))
예제 #9
0
    def __init__(self):
        QToolBar.__init__(self)

        self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        self.setIconSize(QSize(42, 42))

        self.home_new = QAction_lock("document-new",
                                     _("New simulation").replace(" ", "\n"),
                                     self, "main_new")
        #self.home_new.setText(_("New\nsimulation"))
        self.addAction(self.home_new)

        self.old = QAction(icon_get("document-new"),
                           _("New simulation").replace(" ", "\n"), self)

        self.home_open = QAction_lock("document-open", _("Open\nsimulation"),
                                      self, "main_open")

        self.used_files_menu = QMenu(self)
        self.populate_used_file_menu()
        self.home_open.setMenu(self.used_files_menu)

        self.addAction(self.home_open)

        self.home_backup = QAction_lock("backup", _("Backup\nSimulaion"), self,
                                        "ribbion_db_backup")
        self.home_backup.clicked.connect(self.callback_home_backup)
        self.addAction(self.home_backup)

        self.home_export_xls = QAction_lock("export_xls",
                                            _("Export\nto Excel"), self,
                                            "main_export_xls")
        #self.home_export_xls = QAction(icon_get("export_xls"), _("Export\nto Excel"), self)
        self.addAction(self.home_export_xls)

        self.home_export_xls.clicked.connect(self.callback_export_xls)

        self.tb_script_editor = QAction_lock("script", _("Script\nEditor"),
                                             self, "script_editor")
        self.tb_script_editor.clicked.connect(self.callback_script)
        self.addAction(self.tb_script_editor)

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

        self.cite_me = cite_me()
        self.addWidget(self.cite_me)

        if get_lock().is_trial() == True and get_lock().is_registered(
        ) == True:
            self.home_cart = QAction(icon_get("upgrade"),
                                     _("Upgrade to\ngpvdm professional."),
                                     self)
            self.home_cart.triggered.connect(self.callback_buy)
            self.addAction(self.home_cart)

        self.home_help = QAction(icon_get("internet-web-browser"), _("Help"),
                                 self)
        self.addAction(self.home_help)
예제 #10
0
    def main_toolbar(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        self.cost = QAction(icon_get("cost"), _("Cost"), self)
        self.cost.setStatusTip(_("Cost of material"))
        #self.cost.triggered.connect(self.callback_cost)
        toolbar.addAction(self.cost)

        self.folder_open = QAction(icon_get("folder"),
                                   _("Material\ndirectory"), self)
        toolbar.addAction(self.folder_open)

        self.tb_ref = QAction(icon_get("ref"),
                              wrap_text(_("Insert reference information"), 8),
                              self)
        toolbar.addAction(self.tb_ref)

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

        self.help = QAction(icon_get("internet-web-browser"), _("Help"), self)
        toolbar.addAction(self.help)

        return toolbar
예제 #11
0
	def __init__(self):
		QWidget.__init__(self)

		self.setMinimumSize(1000,500)
		self.html = QWebView()

		vbox=QVBoxLayout()

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

		back = QAction(icon_get("go-previous.png"),  _("back"), self)
		back.triggered.connect(self.html.back)
		toolbar.addAction(back)

		home = QAction(icon_get("user-home.png"),  _("home"), self)
		home.triggered.connect(self.home)
		toolbar.addAction(home)

		self.tb_url=QLineEdit()
		self.tb_url.returnPressed.connect(self.browse)
		toolbar.addWidget(self.tb_url)
		
		vbox.addWidget(toolbar)

		self.default_url = "http://www.gpvdm.com/welcome.html"
		self.tb_url.setText(self.default_url)
		self.browse()

		vbox.addWidget(self.html)

		self.setLayout(vbox)
		return
예제 #12
0
def status_icon_run(cluster):
	if gui_get()==True:
		global statusicon
		if cluster==False:
			statusicon.setIcon(icon_get("ball_red"))
		else:
			statusicon.setIcon(icon_get("ball_red4"))
예제 #13
0
파일: cost.py 프로젝트: mandulaj/gpvdm
    def __init__(self):
        QWidgetSavePos.__init__(self, "cost")
        self.setFixedSize(900, 600)
        self.setWindowIcon(icon_get("jv"))

        self.setWindowTitle(_("Cost and energy payback calculator"))

        self.main_vbox = QVBoxLayout()

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

        self.play = QAction(icon_get("media-playback-start"),
                            _("Re-calcualte"), self)
        self.play.triggered.connect(self.update)
        toolbar.addAction(self.play)

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

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

        self.main_vbox.addWidget(toolbar)

        self.tab = QTableWidget()

        self.main_vbox.addWidget(self.tab)

        self.setLayout(self.main_vbox)

        self.update()
예제 #14
0
    def main_toolbar(self):
        self.main_toolbar = QToolBar()
        self.main_toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        self.main_toolbar.setIconSize(QSize(42, 42))

        #self.tb_ref= QAction(icon_get("ref"), wrap_text(_("Insert reference information"),8), self)
        #self.main_toolbar.addAction(self.tb_ref)

        self.tb_save = QAction(icon_get("document-save-as"), _("Save image"),
                               self)
        self.main_toolbar.addAction(self.tb_save)

        self.tb_trap_depth = QAction(icon_get("electrical"),
                                     _("Max\ntrap depth"), self)
        self.main_toolbar.addAction(self.tb_trap_depth)

        #self.import_data= QAction(icon_get("import"), _("Import data"), self)
        #self.main_toolbar.addAction(self.import_data)

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

        self.help = QAction(icon_get("internet-web-browser"), _("Help"), self)
        self.main_toolbar.addAction(self.help)

        return self.main_toolbar
예제 #15
0
	def __init__(self):
		QWidgetSavePos.__init__(self,"dim_editor")

		self.setWindowTitle(_("xz dimension editor")+" https://www.gpvdm.com")
		self.setWindowIcon(icon_get("dimensions"))
		self.resize(400,200)

		self.cost_window=False

		self.main_vbox=QVBoxLayout()

		self.toolbar=QToolBar()
		self.toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		self.toolbar.setIconSize(QSize(42, 42))

		spacer = QWidget()


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

		self.help = QAction(icon_get("internet-web-browser"), _("Help"), self)
		self.toolbar.addAction(self.help)
		
		self.main_vbox.addWidget(self.toolbar)
	
		self.widget0 = QWidget()
		self.widget0_hbox=QHBoxLayout()
		self.widget0.setLayout(self.widget0_hbox)

		self.widget0_label=QLabel("x size")
		self.widget0_hbox.addWidget(self.widget0_label)

		self.widget0_edit=QLineEdit()
		self.widget0_edit.setText(str(mesh_get_xlen()))
		self.widget0_edit.textChanged.connect(self.apply)
		self.widget0_hbox.addWidget(self.widget0_edit)
		self.widget0_label=QLabel("m")
		self.widget0_hbox.addWidget(self.widget0_label)

		self.main_vbox.addWidget(self.widget0)

		self.widget1 = QWidget()
		self.widget1_hbox=QHBoxLayout()
		self.widget1.setLayout(self.widget1_hbox)
		self.widget1_label=QLabel("z size")
		self.widget1_hbox.addWidget(self.widget1_label)
		self.widget1_edit=QLineEdit()
		self.widget1_edit.setText(str(mesh_get_zlen()))
		self.widget1_edit.textChanged.connect(self.apply)
		self.widget1_hbox.addWidget(self.widget1_edit)
		self.widget1_label=QLabel("m")
		self.widget1_hbox.addWidget(self.widget1_label)
		self.main_vbox.addWidget(self.widget1)

		
		#self.tab.itemSelectionChanged.connect(self.callback_tab_selection_changed)


		self.setLayout(self.main_vbox)
예제 #16
0
    def run(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        toolbar.addSeparator()

        self.tb_configure = QAction(icon_get("preferences-system"),
                                    wrap_text(_("Configure"), 4), self)
        toolbar.addAction(self.tb_configure)

        toolbar.addSeparator()

        self.play_one = play(self,
                             "fit_ribbon_one",
                             run_text=wrap_text(_("One itteration"), 2))

        toolbar.addAction(self.play_one)

        self.play = play(self,
                         "fit_ribbon_run",
                         play_icon="forward",
                         run_text=wrap_text(_("Run fit"), 2))

        toolbar.addAction(self.play)

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

        self.help = QAction(icon_get("help"), _("Help"), self)

        toolbar.addAction(self.help)

        return toolbar
예제 #17
0
    def update_ui(self, update_help):
        self.blockSignals(True)
        f = inp()
        f.load(os.path.join(get_sim_path(), "thermal.inp"))
        v = f.get_token("#thermal")
        self.thermal = str2bool(v)
        #print(self.thermal)

        if self.thermal == True:
            self.setIcon(icon_get("thermal-on"))
            self.setText(_("Thermal model\nenabled"))
            if update_help == True:
                help_window().help_set_help([
                    "thermal-on.png",
                    _("<big><b>Thermal solver switched on</b></big><br>The heat equation will be solved across the device"
                      )
                ])

        if self.thermal == False:
            self.setIcon(icon_get("thermal-off"))
            self.setText(_("Iso-thermal\nmodel"))
            if update_help == True:
                help_window().help_set_help([
                    "thermal-off.png",
                    _("<big><b>Isothermal mode</b></big><br>A single temperature will be assumed across the entire device."
                      )
                ])
        self.blockSignals(False)
예제 #18
0
파일: contacts.py 프로젝트: Ly0n/gpvdm
    def __init__(self):
        QWidgetSavePos.__init__(self, "contacts")
        self.epi = get_epi()

        self.setMinimumSize(1000, 400)

        self.setWindowIcon(icon_get("contact"))

        self.setWindowTitle(_("Edit contacts") + " (www.gpvdm.com)")

        self.main_vbox = QVBoxLayout()

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

        #add = QAction(icon_get("list-add"),  _("Add contact"), self)

        #toolbar.addAction(add)

        #remove = QAction(icon_get("list-remove"),  _("Remove contacts"), self)

        #toolbar.addAction(remove)

        self.main_vbox.addWidget(self.toolbar)

        self.tab = gpvdm_tab(toolbar=self.toolbar)
        self.tab.resizeColumnsToContents()

        self.tab.tb_add.triggered.connect(self.on_add_clicked)
        self.tab.user_remove_rows.connect(self.on_remove_clicked)
        self.tab.tb_down.triggered.connect(self.on_move_down)
        self.tab.tb_up.triggered.connect(self.on_move_up)

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

        #self.charge_density = QAction(icon_get("preferences-system"), _("Charge density"), self)
        #self.charge_density.triggered.connect(self.callback_contacts_boundary)
        #toolbar.addAction(self.charge_density)

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

        self.tab.verticalHeader().setVisible(False)

        self.tab.clear()
        self.tab.setColumnCount(13)
        self.tab.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.load()

        self.tab.cellChanged.connect(self.tab_changed)

        self.main_vbox.addWidget(self.tab)

        self.setLayout(self.main_vbox)
예제 #19
0
    def simulations(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        self.tb_simulate = QAction(icon_get("build_play2"),
                                   wrap_text(_("Run scan"), 2), self)
        toolbar.addAction(self.tb_simulate)

        self.tb_stop = QAction(icon_get("media-playback-pause"),
                               wrap_text(_("Stop"), 3), self)
        toolbar.addAction(self.tb_stop)

        toolbar.addSeparator()

        self.tb_plot = QAction(icon_get("plot"), wrap_text(_("Plot"), 4), self)
        toolbar.addAction(self.tb_plot)

        self.tb_plot_time = QAction(icon_get("plot_time"),
                                    wrap_text(_("Time domain plot"), 6), self)
        toolbar.addAction(self.tb_plot_time)

        self.box_widget = QWidget()
        self.box = QVBoxLayout()
        self.box_widget.setLayout(self.box)
        self.box_tb0 = QToolBar()
        self.box_tb0.setIconSize(QSize(32, 32))
        self.box.addWidget(self.box_tb0)
        self.box_tb1 = QToolBar()
        self.box_tb1.setIconSize(QSize(32, 32))
        self.box.addWidget(self.box_tb1)

        self.tb_build = QAction(icon_get("cog"), wrap_text(_("Build scan"), 2),
                                self)
        self.box_tb0.addAction(self.tb_build)

        self.tb_rerun = QAction(icon_get("play-green"),
                                wrap_text(_("Rerun"), 2), self)
        self.box_tb0.addAction(self.tb_rerun)

        self.tb_zip = QAction(icon_get("package-x-generic"),
                              wrap_text(_("Archive simulations"), 2), self)
        self.box_tb0.addAction(self.tb_zip)

        self.tb_clean = QAction(icon_get("clean"),
                                wrap_text(_("Clean simulation"), 4), self)
        self.box_tb1.addAction(self.tb_clean)

        self.tb_run_all = QAction(icon_get("forward2"),
                                  wrap_text(_("Run all scans"), 3), self)
        self.box_tb1.addAction(self.tb_run_all)

        self.tb_notes = QAction(icon_get("text-x-generic"),
                                wrap_text(_("Notes"), 3), self)
        toolbar.addAction(self.tb_notes)

        toolbar.addWidget(self.box_widget)

        return toolbar
예제 #20
0
파일: lasers.py 프로젝트: xj361685640/gpvdm
    def __init__(self):
        QWidgetSavePos.__init__(self, "lasers")

        self.main_vbox = QVBoxLayout()

        self.setFixedSize(900, 500)
        self.setWindowTitle(
            _("Laser configuration window") + " https://www.gpvdm.com")
        self.setWindowIcon(icon_get("lasers"))

        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(48, 48))

        self.order_widget = order_widget()
        self.order_widget.new_text = _("New laser")
        self.order_widget.delete_text = _("Delete laser")
        self.order_widget.clone_text = _("Clone laser")
        self.order_widget.rename_text = _("Rename laser")
        self.order_widget.new_dlg_text = _("New laser name:")
        self.order_widget.base_file_name = "laser"
        self.order_widget.new_tab_name = _("laser ")
        self.order_widget.clone_dlg_text = _(
            "Clone the current laser to a new laser called:")
        self.order_widget.rename_dlg_text = _("Rename the laser to be called:")
        self.order_widget.delete_dlg_text = _(
            "Should I remove the laser file ")
        self.order_widget.name_token = "#laser_name"
        self.order_widget.init()
        toolbar.addWidget(self.order_widget)

        self.order_widget.added.connect(self.callback_add_page)

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

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

        self.main_vbox.addWidget(toolbar)

        self.notebook = QTabWidget()
        css_apply(self.notebook, "tab_default.css")
        self.notebook.setMovable(True)

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

        self.main_vbox.addWidget(self.notebook)

        self.status_bar = QStatusBar()
        self.main_vbox.addWidget(self.status_bar)

        self.setLayout(self.main_vbox)
예제 #21
0
    def __init__(self):
        QWidgetSavePos.__init__(self, "doping")
        self.setFixedSize(900, 600)
        self.setWindowIcon(icon_get("doping"))
        self.setWindowTitle(
            _("Doping profile editor") + " (https://www.gpvdm.com)")

        self.main_vbox = QVBoxLayout()

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

        self.save = QAction(icon_get("document-save-as"), _("Save"), self)
        self.save.triggered.connect(self.callback_save)
        toolbar.addAction(self.save)

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

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

        self.main_vbox.addWidget(toolbar)

        self.fig = Figure(figsize=(5, 4), dpi=100)
        self.ax1 = None
        self.show_key = True
        canvas = FigureCanvas(self.fig)
        #canvas.set_background('white')
        #canvas.set_facecolor('white')
        canvas.figure.patch.set_facecolor('white')
        canvas.show()

        self.main_vbox.addWidget(canvas)

        self.tab = QTableWidget()
        self.tab.resizeColumnsToContents()

        self.tab.verticalHeader().setVisible(False)

        self.tab.clear()
        self.tab.setColumnCount(4)
        self.tab.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.load()
        self.build_mesh()

        self.tab.cellChanged.connect(self.tab_changed)

        self.main_vbox.addWidget(self.tab)

        self.draw_graph()

        self.setLayout(self.main_vbox)
        return
예제 #22
0
 def timer_toggle(self):
     if self.timer == None:
         self.timer = QTimer()
         self.timer.timeout.connect(self.slider_auto_incroment)
         self.timer.start(1)
         self.tb_play.setIcon(icon_get("media-playback-pause"))
     else:
         self.timer.stop()
         self.timer = None
         self.tb_play.setIcon(icon_get("media-playback-start"))
예제 #23
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)
예제 #24
0
	def setState(self,state):

		self.enabled=state
		if self.enabled==True:
			self.setIcon(icon_get("tick"))
			self.setText(self.enable_text)
			self.enabled=True
		else:
			self.setIcon(icon_get("cross"))
			self.setText(self.disable_text)
			self.enabled=False
예제 #25
0
    def __init__(self):
        QWidget.__init__(self)
        self.setWindowTitle(
            _("Fit variables duplicate window") + " - https://www.gpvdm.com")
        self.setWindowIcon(icon_get("duplicate"))

        self.vbox = QVBoxLayout()

        toolbar = QToolBar()
        toolbar.setIconSize(QSize(32, 32))

        self.tb_save = QAction(icon_get("list-add"), _("Add"), self)
        self.tb_save.triggered.connect(self.callback_add_item)
        toolbar.addAction(self.tb_save)

        self.tb_save = QAction(icon_get("list-remove"), _("Minus"), self)
        self.tb_save.triggered.connect(self.callback_delete_item)
        toolbar.addAction(self.tb_save)

        self.tb_down = QAction(icon_get("go-down"), _("Move down"), self)
        self.tb_down.triggered.connect(self.on_move_down)
        toolbar.addAction(self.tb_down)

        self.tb_up = QAction(icon_get("go-up"), _("Move up"), self)
        self.tb_up.triggered.connect(self.on_move_up)
        toolbar.addAction(self.tb_up)

        self.vbox.addWidget(toolbar)

        self.tab = QTableWidget()
        self.tab.resizeColumnsToContents()

        self.tab.verticalHeader().setVisible(False)
        self.create_model()

        self.tab.cellChanged.connect(self.tab_changed)

        self.select_param_window_src = select_param(self.tab)
        self.select_param_window_src.set_save_function(self.save_combo)
        self.select_param_window_src.file_name_tab_pos = 1
        self.select_param_window_src.token_tab_pos = 2
        self.select_param_window_src.path_tab_pos = 3

        self.select_param_window_dest = select_param(self.tab)
        self.select_param_window_dest.set_save_function(self.save_combo)
        self.select_param_window_dest.file_name_tab_pos = 4
        self.select_param_window_dest.token_tab_pos = 5
        self.select_param_window_dest.path_tab_pos = 6

        self.vbox.addWidget(self.tab)

        self.setLayout(self.vbox)
예제 #26
0
    def file(self):
        self.file_toolbar = QToolBar()
        self.file_toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        self.file_toolbar.setIconSize(QSize(42, 42))

        self.tb_save = QAction(icon_get("document-save-as"), _("Save"), self)
        self.file_toolbar.addAction(self.tb_save)

        self.tb_save_as = QAction(icon_get("document-save-as"), _("Save as"),
                                  self)
        self.file_toolbar.addAction(self.tb_save_as)

        return self.file_toolbar
예제 #27
0
	def update_ui(self,update_help):
		if self.dump==dump_slow:
			self.setIcon(icon_get("hdd_high"))
			if update_help==True:
				help_window().help_set_help(["hdd_high.png",_("<big><b>Write all data to disk (slow)</b></big><br>"+self.help_text)])

		if self.dump==dump_fast:
			self.setIcon(icon_get("hdd_low"))
			if update_help==True:
				help_window().help_set_help(["hdd_low.png",_("<big><b>Write minimal data to disk (fast)</b></big><br>"+self.help_text)])

		if self.dump==dump_custom:
			self.setIcon(icon_get("hdd_custom"))
예제 #28
0
    def color(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        self.tb_color_black = QAction(icon_get("black"), _("Black"), self)
        toolbar.addAction(self.tb_color_black)

        self.tb_color_rainbow = QAction(icon_get("rainbow"), _("Rainbow"),
                                        self)
        toolbar.addAction(self.tb_color_rainbow)

        return toolbar
예제 #29
0
    def __init__(self):
        QWidgetSavePos.__init__(self, "electrical")
        self.setFixedSize(1000, 600)
        self.setWindowIcon(icon_get("preferences-system"))

        self.setWindowTitle(
            _("Electrical parameter editor") + " (https://www.gpvdm.com)")

        self.main_vbox = QVBoxLayout()

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

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

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

        self.main_vbox.addWidget(toolbar)

        self.notebook = QTabWidget()

        self.notebook.setMovable(True)

        self.main_vbox.addWidget(self.notebook)

        widget = tab_class()
        widget.init("device.inp", _("Device"))
        self.notebook.addTab(widget, _("Device"))

        widget = dos_main()
        widget.update()
        self.notebook.addTab(widget, _("Electrical parameters"))

        if enable_betafeatures() == True:
            widget = tab_bands()
            widget.update()
            self.notebook.addTab(widget, _("Complex DoS"))

        widget = pl_main()
        widget.update()
        self.notebook.addTab(widget, _("Luminescence"))

        self.setLayout(self.main_vbox)

        #self.connect("delete-event", self.callback_close_window)
        self.notebook.currentChanged.connect(self.changed_click)
예제 #30
0
    def __init__(self, path):
        QWidgetSavePos.__init__(self, "spectra_main")
        self.path = path
        self.setFixedSize(900, 600)
        self.setWindowIcon(icon_get("spectra_file"))

        self.setWindowTitle(
            _("Optical spectrum editor") + " (https://www.gpvdm.com)" + " " +
            os.path.basename(self.path))

        self.main_vbox = QVBoxLayout()

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

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

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

        self.main_vbox.addWidget(toolbar)

        self.notebook = QTabWidget()

        self.notebook.setMovable(True)

        self.main_vbox.addWidget(self.notebook)

        files = ["mat.inp"]
        description = [_("Parameters")]

        eq = equation(self.path, "spectra_eq.inp", "spectra_gen.inp",
                      "spectra.inp", "#spectra_equation_or_data")
        eq.show_solar_spectra = True
        eq.set_default_value("3")
        eq.set_ylabel(_("Intensity") + " (au)")
        eq.init()
        self.notebook.addTab(eq, _("Intensity"))

        for i in range(0, len(files)):
            tab = tab_class()
            tab.init(os.path.join(self.path, files[i]), description[i])
            self.notebook.addTab(tab, description[i])

        self.setLayout(self.main_vbox)

        self.notebook.currentChanged.connect(self.changed_click)