Esempio n. 1
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
Esempio n. 2
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
Esempio n. 3
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)
Esempio n. 4
0
	def mesh_toolbar(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		#mesh
		self.show_mesh= QAction_lock("mesh_tri", wrap_text(_("Show\nMesh"),2), self,"ribbon_shape_mesh")
		self.show_mesh.setCheckable(True)
		self.show_mesh.setChecked(True)
		toolbar.addAction(self.show_mesh)

		#self.menu_mesh = QMenu(self)
		#self.show_mesh.setMenu(self.menu_mesh)

		#self.edit_mesh=QAction(_("Edit mesh"), self)
		#self.menu_mesh.addAction(self.edit_mesh)

		self.mesh_edit= QAction_lock("mesh_tri_edit", wrap_text(_("Edit\nMesh"),2), self,"ribbon_shape_mesh")
		toolbar.addAction(self.mesh_edit)

		self.mesh_build = play(self,"main_play_button",run_text=wrap_text(_("Build\nMesh"),2))

		#self.mesh_build= QAction_lock("media-playback-start", wrap_text(_("Build\nMesh"),2), self,"ribbon_shape_mesh")
		toolbar.addAction(self.mesh_build)

		return toolbar
Esempio n. 5
0
    def file_toolbar(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        self.import_image = QAction_lock("import_image",
                                         wrap_text(_("Load new image"),
                                                   7), self,
                                         "ribbon_shape_import_import_image")
        toolbar.addAction(self.import_image)

        self.save_data = QAction_lock("document-save-as",
                                      wrap_text(_("Import data"), 4), self,
                                      "ribbon_shape_import_save")
        toolbar.addAction(self.save_data)

        #self.xy_triangles= QAction_lock("shape", wrap_text(_("xy triangles"),2), self,"ribbon_shape_xy_tri")
        #toolbar.addAction(self.xy_triangles)

        self.tb_script = QAction_lock("script",
                                      wrap_text(_("Generate\nImage"), 2), self,
                                      "ribbon_shape_script")
        toolbar.addAction(self.tb_script)

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

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

        return toolbar
Esempio n. 6
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
Esempio n. 7
0
	def __init__(self,path,show_inp_files=True,act_as_browser=True,big_toolbar=False):
		QWidget.__init__(self)
		self.act_as_browser=act_as_browser
		self.menu_new_material_enabled=False
		self.menu_new_spectra_enabled=False
		self.show_inp_files=show_inp_files
		self.show_directories=True
		self.file_path=""
		self.vbox=QVBoxLayout()
		self.setLayout(self.vbox)

		self.toolbar=QToolBar()
		if big_toolbar==True:
			self.toolbar.setIconSize(QSize(42, 42))
			self.toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		#self.toolbar.setMaximumHeight(50)

		self.up = QAction(QIcon_load("go-up"), wrap_text(_("Back"),8), self)
		self.up.triggered.connect(self.on_up_clicked)
		self.toolbar.addAction(self.up)

		self.home = QAction(QIcon_load("user-home"), wrap_text(_("Home"),8), self)
		self.home.triggered.connect(self.on_home_clicked)
		self.toolbar.addAction(self.home)
	
		self.resize(800,500)
		self.path_widget=QLineEdit()
#		self.path_widget.setMinimumHeight(30)
#		self.path_widget.setStyleSheet("padding: 0; ")
		self.toolbar.addWidget(self.path_widget)



		self.setWindowTitle(_("Open file")+" https://www.gpvdm.com")
		self.setWindowIcon(QIcon_load("folder"))
#		self.listwidget=QListWidget()
#		self.listwidget.setSelectionMode(QAbstractItemView.ExtendedSelection)
#		self.listwidget.setStyleSheet("margin: 0; padding: 0; ")
		self.vbox.addWidget(self.toolbar)

		if self.act_as_browser==False:
			self.viewer=gpvdm_viewer(path,open_own_files=False)
		else:
			self.viewer=gpvdm_viewer(path)

		self.viewer.set_directory_view(True)
		self.vbox.addWidget(self.viewer)

		self.root_dir= path

		self.path_widget.setText(path)

		self.viewer.path_changed.connect(self.change_path)

		if self.act_as_browser==False:
			self.viewer.accept.connect(self.callback_accept)

		self.change_path()
		self.show()
Esempio n. 8
0
    def image_toolbar(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        #mesh
        self.show_mesh = QAction_lock("mesh_tri",
                                      wrap_text(_("Show\nMesh"),
                                                2), self, "ribbon_shape_mesh")
        self.show_mesh.setCheckable(True)
        self.show_mesh.setChecked(True)

        self.menu_mesh = QMenu(self)
        self.show_mesh.setMenu(self.menu_mesh)

        self.edit_mesh = QAction(_("Edit mesh"), self)
        self.menu_mesh.addAction(self.edit_mesh)

        toolbar.addAction(self.show_mesh)

        #blur
        self.tb_blur = QAction_lock("blur", wrap_text(_("Blur"), 2), self,
                                    "ribbon_shape_blur")
        self.tb_blur.setCheckable(True)
        #self.tb_blur.setChecked(True)

        self.menu_blur = QMenu(self)
        self.tb_blur.setMenu(self.menu_blur)

        self.edit_blur = QAction(_("Edit Gaussian"), self)
        self.menu_blur.addAction(self.edit_blur)

        toolbar.addAction(self.tb_blur)

        #norm y
        self.tb_norm_y = QAction_lock("plot_norm",
                                      wrap_text(_("Normalize\ny"), 2), self,
                                      "ribbon_shape_norm_y")
        self.tb_norm_y.setCheckable(True)
        #self.tb_norm_y.setChecked(True)

        self.menu_norm_y = QMenu(self)
        self.tb_norm_y.setMenu(self.menu_norm_y)

        self.edit_norm_y = QAction(_("Edit histogram"), self)
        self.menu_norm_y.addAction(self.edit_norm_y)

        toolbar.addAction(self.tb_norm_y)

        #norm z
        self.tb_norm_z = QAction_lock("plot_norm",
                                      wrap_text(_("Normalize\nz"), 2), self,
                                      "ribbon_shape_norm_z")
        self.tb_norm_z.setCheckable(True)
        #self.tb_norm_z.setChecked(True)
        toolbar.addAction(self.tb_norm_z)

        return toolbar
Esempio n. 9
0
    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(QIcon_load("lasers"))

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

        self.new = QAction(QIcon_load("document-new"),
                           wrap_text(_("New laser"), 2), self)
        self.new.triggered.connect(self.callback_add_page)
        toolbar.addAction(self.new)

        self.new = QAction(QIcon_load("edit-delete"),
                           wrap_text(_("Delete laser"), 3), self)
        self.new.triggered.connect(self.callback_delete_page)
        toolbar.addAction(self.new)

        self.clone = QAction(QIcon_load("clone.png"),
                             wrap_text(_("Clone laser"), 3), self)
        self.clone.triggered.connect(self.callback_copy_page)
        toolbar.addAction(self.clone)

        self.clone = QAction(QIcon_load("rename"),
                             wrap_text(_("Rename laser"), 3), self)
        self.clone.triggered.connect(self.callback_rename_page)
        toolbar.addAction(self.clone)

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

        self.help = QAction(QIcon_load("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.load_tabs()

        self.main_vbox.addWidget(self.notebook)

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

        self.setLayout(self.main_vbox)
Esempio n. 10
0
    def __init__(self):
        QToolBar.__init__(self)
        self.myserver = server_get()

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

        self.cluster_get_data = QAction(icon_get("server_get_data"),
                                        wrap_text(_("Cluster get data"), 8),
                                        self)
        self.cluster_get_data.triggered.connect(self.callback_cluster_get_data)
        self.addAction(self.cluster_get_data)
        self.cluster_get_data.setEnabled(False)

        self.cluster_copy_src = QAction(icon_get("server_copy_src"),
                                        wrap_text(_("Copy src to cluster"), 8),
                                        self)
        self.cluster_copy_src.triggered.connect(self.callback_cluster_copy_src)
        self.addAction(self.cluster_copy_src)
        self.cluster_copy_src.setEnabled(False)

        self.cluster_make = QAction(icon_get("server_make"),
                                    wrap_text(_("Make on cluster"), 6), self)
        self.cluster_make.triggered.connect(self.callback_cluster_make)
        self.addAction(self.cluster_make)
        self.cluster_make.setEnabled(False)

        self.cluster_clean = QAction(icon_get("server_clean"),
                                     wrap_text(_("Clean cluster"), 8), self)
        self.cluster_clean.triggered.connect(self.callback_cluster_clean)
        self.addAction(self.cluster_clean)
        self.cluster_clean.setEnabled(False)

        self.cluster_off = QAction(icon_get("off"),
                                   wrap_text(_("Kill all cluster code"), 8),
                                   self)
        self.cluster_off.triggered.connect(self.callback_cluster_off)
        self.addAction(self.cluster_off)
        self.cluster_off.setEnabled(False)

        self.cluster_sync = QAction(icon_get("sync"), _("Sync"), self)
        self.cluster_sync.triggered.connect(self.callback_cluster_sync)
        self.addAction(self.cluster_sync)
        self.cluster_sync.setEnabled(False)

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

        self.help = QAction(icon_get("internet-web-browser"), _("Help"), self)
        self.addAction(self.help)
Esempio n. 11
0
	def advanced(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		self.menu_plot_fits = QAction(icon_get("scan2"), wrap_text(_("Plot fits"),5), self)
		toolbar.addAction(self.menu_plot_fits)

		self.sim_no_gen = QAction(icon_get("forward"), wrap_text(_("Run simulation no generation"),5), self)
		toolbar.addAction(self.sim_no_gen)

		self.single_fit = QAction(icon_get("forward"), wrap_text(_("Run single fit"),5), self)
		toolbar.addAction(self.single_fit)

		self.clean_unconverged = QAction(icon_get("clean"), wrap_text(_("Clean unconverged simulation"),5), self)
		toolbar.addAction(self.clean_unconverged)

		self.clean_sim_output = QAction(icon_get("forward"), wrap_text(_("Clean simulation output"),5), self)
		toolbar.addAction(self.clean_sim_output)

		self.push_unconverged_to_hpc = QAction(icon_get("forward"), wrap_text(_("Push unconverged to hpc"),5), self)
		toolbar.addAction(self.push_unconverged_to_hpc)

		self.change_dir = QAction(icon_get("forward"), wrap_text(_("Change dir"),5), self)
		toolbar.addAction(self.change_dir)

		self.report = QAction(icon_get("office-calendar"), wrap_text(_("Report"),5), self)
		toolbar.addAction(self.report)

		return toolbar
Esempio n. 12
0
    def main_toolbar(self):
        self.main_toolbar = QToolBar()
        self.main_toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        self.main_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)
        self.main_toolbar.addAction(self.cost)

        self.folder_open = QAction(icon_get("folder"),
                                   _("Material\ndirectory"), self)
        #self.folder_open.triggered.connect(self.callback_dir_open)
        self.main_toolbar.addAction(self.folder_open)

        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.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
Esempio n. 13
0
	def optics(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))
		
		self.run = QAction(QIcon_load("media-playback-start"), wrap_text(_("Run optical simulation"),5), self)
		toolbar.addAction(self.run)
		
		self.tb_save = QAction(QIcon_load("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(QIcon_load("help"), _("Help"), self)
		toolbar.addAction(self.help)
		return toolbar
Esempio n. 14
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
Esempio n. 15
0
    def callback_home_backup(self):
        backup_path = get_backup_path()
        if os.path.isdir(backup_path) == False:
            os.makedirs(backup_path)

        lines = []
        lines.append("#gpvdm_file_type")
        lines.append("backup_main")
        lines.append("#end")

        write_lines_to_archive(os.path.join(backup_path, "sim.gpvdm"),
                               "mat.inp",
                               lines,
                               mode="l",
                               dest="file")

        self.dialog = gpvdm_open(backup_path, big_toolbar=True)
        self.new_backup = QAction_lock("add_backup",
                                       wrap_text(_("New backup"), 2), self,
                                       "add_backup")
        self.new_backup.clicked.connect(self.on_new_backup)
        self.dialog.toolbar.addAction(self.new_backup)

        self.dialog.viewer.show_inp_files = False
        ret = self.dialog.exec_()
Esempio n. 16
0
    def __init__(self):
        QWidget.__init__(self)
        self.dirs = []
        self.path = ""
        self.timer = None

        self.tb_play = QAction(icon_get("media-playback-start"),
                               wrap_text(_("Play"), 2), self)
        self.tb_play.triggered.connect(self.timer_toggle)

        self.setWindowTitle(_("Snapshot slider"))

        self.main_vbox = QVBoxLayout()

        self.slider_hbox0 = QHBoxLayout()
        self.slider_max = 30

        self.slider0 = QSlider(Qt.Horizontal)
        self.slider0.setMinimum(0)
        self.slider0.setMaximum(self.slider_max)

        self.slider0.setTickPosition(QSlider.TicksBelow)
        self.slider0.setTickInterval(5)
        self.slider0.valueChanged.connect(self.slider0_change)
        self.slider0.setMinimumSize(300, 80)

        self.slider_hbox0.addWidget(self.slider0)

        self.label0 = QLabel()
        self.label0.setText("")

        self.slider0.setValue(1)

        self.slider_hbox0.addWidget(self.label0)

        self.widget0 = QWidget()
        self.widget0.setLayout(self.slider_hbox0)

        self.main_vbox.addWidget(self.widget0)

        ################
        self.slider_hbox1 = QHBoxLayout()
        self.label1 = QLabel()
        self.label1.setText(_("File"))
        self.slider_hbox1.addWidget(self.label1)

        self.files_combo = QComboBox()
        self.slider_hbox1.addWidget(self.files_combo)

        self.files_combo.currentIndexChanged.connect(self.files_combo_changed)

        self.widget1 = QWidget()
        self.widget1.setLayout(self.slider_hbox1)

        self.main_vbox.addWidget(self.widget1)

        ###############

        self.setLayout(self.main_vbox)
Esempio n. 17
0
	def image_toolbar(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))


		#blur
		self.tb_blur= QAction_lock("blur", wrap_text(_("Blur"),2), self,"ribbon_shape_blur")
		self.tb_blur.setCheckable(True)
		#self.tb_blur.setChecked(True)

		self.menu_blur = QMenu(self)
		self.tb_blur.setMenu(self.menu_blur)

		self.edit_blur=QAction(_("Edit Gaussian"), self)
		self.menu_blur.addAction(self.edit_blur)

		toolbar.addAction(self.tb_blur)

		#norm y
		self.tb_norm_y= QAction_lock("plot_norm", wrap_text(_("Normalize\ny"),2), self,"ribbon_shape_norm_y")
		self.tb_norm_y.setCheckable(True)
		#self.tb_norm_y.setChecked(True)

		self.menu_norm_y = QMenu(self)
		self.tb_norm_y.setMenu(self.menu_norm_y)

		self.edit_norm_y=QAction(_("Edit histogram"), self)
		self.menu_norm_y.addAction(self.edit_norm_y)

		toolbar.addAction(self.tb_norm_y)

		#norm z
		self.tb_norm_z= QAction_lock("plot_norm", wrap_text(_("Normalize\nz"),2), self,"ribbon_shape_norm_z")
		self.tb_norm_z.setCheckable(True)
		#self.tb_norm_z.setChecked(True)
		toolbar.addAction(self.tb_norm_z)

		#rotate
		self.tb_rotate= QAction_lock("rotate_right", wrap_text(_("Rotate"),2), self,"ribbon_rotate_right")

		toolbar.addAction(self.tb_rotate)


		return toolbar
 def callback_view_optical(self):
     self.dialog = gpvdm_open(get_spectra_path(), big_toolbar=True)
     self.new_materials = QAction_lock("add_spectra",
                                       wrap_text(_("Add Spectra"), 8), self,
                                       "add_spectra")
     self.new_materials.clicked.connect(self.on_new_spectra_clicked)
     self.dialog.toolbar.addAction(self.new_materials)
     self.dialog.show_inp_files = False
     ret = self.dialog.exec_()
Esempio n. 19
0
	def callback_view_materials(self):
		self.dialog=gpvdm_open(get_materials_path(),big_toolbar=True)
		self.new_materials = QAction(icon_get("add_material"), wrap_text(_("Add Material"),8), self)
		self.new_materials.triggered.connect(self.on_new_materials_clicked)
		self.dialog.toolbar.addAction(self.new_materials)

		self.dialog.show_inp_files=False
		self.dialog.menu_new_material_enabled=True
		ret=self.dialog.exec_()
 def callback_configure_emission(self):
     self.dialog = gpvdm_open(get_emission_path(), big_toolbar=True)
     self.new_emission = QAction_lock("add_emission",
                                      wrap_text(_("Add Spectra"), 8), self,
                                      "add_emission")
     self.new_emission.clicked.connect(self.on_new_emission_clicked)
     self.dialog.toolbar.addAction(self.new_emission)
     self.dialog.show_inp_files = False
     ret = self.dialog.exec_()
 def callback_configure_shape(self):
     self.dialog = gpvdm_open(get_shape_path(), big_toolbar=True)
     self.new_shape = QAction_lock("add_shape",
                                   wrap_text(_("Add Shape"),
                                             8), self, "add_shape")
     self.new_shape.clicked.connect(self.on_new_shape_clicked)
     self.dialog.toolbar.addAction(self.new_shape)
     self.dialog.show_inp_files = False
     ret = self.dialog.exec_()
Esempio n. 22
0
	def nested(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		self.menu_run_nested = QAction(icon_get("nested"), wrap_text(_("Build nested simulation"),5), self)
		toolbar.addAction(self.menu_run_nested)

		return toolbar
Esempio n. 23
0
    def plot_toolbar(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

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

        return toolbar
Esempio n. 24
0
	def ml(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		self.tb_ml_build_vectors = QAction(icon_get("ml"), wrap_text(_("Build vectors"),4), self)
		toolbar.addAction(self.tb_ml_build_vectors)


		return toolbar
Esempio n. 25
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(_("Calculate"),5), self)
		toolbar.addAction(self.run)
		
		self.export = QAction(icon_get("document-export"), wrap_text(_("Export spectrum"),5), self)
		#self.export.triggered.connect(self.save_image)
		toolbar.addAction(self.export)

		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
	def laser(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))

		self.tb_laser_start_time = QAction(icon_get("laser"), wrap_text(_("Laser start time"),2), self)
		toolbar.addAction(self.tb_laser_start_time)

		self.tb_lasers=tb_lasers()
		toolbar.addWidget(self.tb_lasers)

		return toolbar
Esempio n. 27
0
 def render(self):
     text, tile1, tile2, bg = self.story[self.current]
     rl.clear()
     lines = util.wrap_text(text, game.WIDTH - 64)
     rl.draw_text(font, 32, (game.HEIGHT - len(lines) * 8) // 2,
                  '\n'.join(lines), rl.LIGHTGRAY)
     x = game.WIDTH // 2
     y = 8 + (game.HEIGHT + len(lines) * 8) // 2
     for i in range(4):
         rl.draw_tile(tileset, x - 12 + i * 8, y + 2, bg)
     rl.draw_tile(tileset, x - 8, y, tile1)
     rl.draw_tile(tileset, x + 8, y, tile2)
Esempio n. 28
0
	def __init__(self):
		QWidget.__init__(self)
		self.dirs=[]
		self.path=""
		self.timer=None

		self.tb_play = QAction(icon_get("media-playback-start"), wrap_text(_("Play"),2), self)
		self.tb_play.triggered.connect(self.timer_toggle)

		self.setWindowTitle(_("Snapshot slider")) 
		
		self.main_vbox = QVBoxLayout()

		self.slider_hbox0= QHBoxLayout()
		self.slider_max=30
		
		self.slider0 = QSlider(Qt.Horizontal)
		#self.slider0.setMinimum(0)
		#self.slider0.setMaximum(self.slider_max)

		self.slider0.setTickPosition(QSlider.TicksBelow)
		self.slider0.setTickInterval(5)
		self.slider0.valueChanged.connect(self.slider0_change)
		#self.slider0.setMinimumSize(300, 80)

		self.slider_hbox0.addWidget(self.slider0)

		self.label0 = QLabel()
		self.label0.setText("")

		self.slider0.setValue(1)

		self.slider_hbox0.addWidget(self.label0)

		self.widget0=QWidget()
		self.widget0.setLayout(self.slider_hbox0)

		self.main_vbox.addWidget(self.widget0)

		self.toolbar=QToolBar()
		self.main_vbox.addWidget(self.toolbar)

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

		self.main_vbox.addWidget(self.tab)
		self.tab.tb_add.triggered.connect(self.callback_insert_row)
		self.tab.tb_remove.triggered.connect(self.callback_remove_row)


		self.setLayout(self.main_vbox)
Esempio n. 29
0
    def main_toolbar(self):
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        toolbar.setIconSize(QSize(42, 42))

        self.open_data = QAction(icon_get("document-open"),
                                 wrap_text(_("Open data file"), 4), self)
        toolbar.addAction(self.open_data)

        self.import_data = QAction(icon_get("document-save-as"),
                                   wrap_text(_("Import data"), 4), self)
        self.import_data.setEnabled(False)
        toolbar.addAction(self.import_data)

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

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

        return toolbar
	def main_toolbar(self):
		toolbar = QToolBar()
		toolbar.setToolButtonStyle( Qt.ToolButtonTextUnderIcon)
		toolbar.setIconSize(QSize(42, 42))


		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