예제 #1
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()
예제 #2
0
    def __init__(self):
        QDialog.__init__(self)
        self.main_vbox = QVBoxLayout()
        self.setMinimumSize(900, 580)
        self.setWindowTitle(_("New simulation") + " (https://www.gpvdm.com)")
        self.setWindowIcon(icon_get("si"))
        self.title = QLabel(
            "<big><b>" +
            _("Which type of device would you like to simulate?") +
            "</b></big>")

        self.viewer = gpvdm_viewer(get_device_lib_path())
        self.viewer.open_own_files = False
        self.viewer.set_back_arrow(True)
        self.viewer.set_enable_menu(False)
        self.viewer.setViewMode(QListView.IconMode)
        self.viewer.setSpacing(8)
        self.viewer.setWordWrap(True)
        gridsize = self.size()
        gridsize.setWidth(100)
        gridsize.setHeight(140)
        self.viewer.setGridSize(gridsize)

        self.viewer.setTextElideMode(Qt.ElideNone)
        #gridsize=self.size()
        #gridsize.setWidth(100)
        #gridsize.setHeight(90)
        #self.setGridSize(gridsize)
        self.main_vbox.addWidget(self.title)
        self.main_vbox.addWidget(self.viewer)

        self.hwidget = QWidget()

        self.nextButton = QPushButton(_("Next"))
        self.cancelButton = QPushButton(_("Cancel"))

        self.files = []

        hbox = QHBoxLayout()
        self.show_hidden = QCheckBox(_("Show hidden"))
        self.show_hidden.clicked.connect(self.callback_toggle_hidden)
        hbox.addWidget(self.show_hidden)
        hbox.addStretch(1)
        hbox.addWidget(self.cancelButton)
        hbox.addWidget(self.nextButton)
        self.hwidget.setLayout(hbox)

        self.main_vbox.addWidget(self.hwidget)

        self.setLayout(self.main_vbox)
        self.show()

        self.ret_path = None
        # Create a new window

        self.viewer.accept.connect(self.callback_next)
        self.nextButton.clicked.connect(self.callback_next)
        self.cancelButton.clicked.connect(self.callback_close)
예제 #3
0
	def __init__(self):
		QWidget.__init__(self)

		hbox=QHBoxLayout(self)
		mainLayout = QSplitter(Qt.Horizontal)
		self.viewer=gpvdm_viewer(get_sim_path())
		self.viewer.allow_navigation=True
		self.viewer.set_directory_view(True)
		self.viewer.set_back_arrow(True)
		self.viewer.set_multi_select()
		
		hbox.addWidget(self.viewer)
		
		self.setLayout(hbox)
		server_get().sim_finished.connect(self.refresh)
예제 #4
0
    def __init__(self):
        QDialog.__init__(self)
        self.main_vbox = QVBoxLayout()
        self.setFixedSize(450, 580)
        self.setWindowTitle(_("New simulation") + " (https://www.gpvdm.com)")
        self.setWindowIcon(icon_get("si"))
        self.title = QLabel(
            "<big><b>" +
            _("Which type of device would you like to simulate?") +
            "</b></big>")

        self.viewer = gpvdm_viewer(get_device_lib_path())
        self.viewer.open_own_files = False
        self.viewer.set_back_arrow(True)
        self.viewer.set_enable_menu(False)
        self.main_vbox.addWidget(self.title)
        self.main_vbox.addWidget(self.viewer)

        self.hwidget = QWidget()

        self.nextButton = QPushButton(_("Next"))
        self.cancelButton = QPushButton(_("Cancel"))

        self.files = []

        hbox = QHBoxLayout()
        self.show_hidden = QCheckBox(_("Show hidden"))
        self.show_hidden.clicked.connect(self.callback_toggle_hidden)
        hbox.addWidget(self.show_hidden)
        hbox.addStretch(1)
        hbox.addWidget(self.cancelButton)
        hbox.addWidget(self.nextButton)
        self.hwidget.setLayout(hbox)

        self.main_vbox.addWidget(self.hwidget)

        self.setLayout(self.main_vbox)
        self.show()

        self.ret_path = None
        # Create a new window

        self.viewer.accept.connect(self.callback_next)
        self.nextButton.clicked.connect(self.callback_next)
        self.cancelButton.clicked.connect(self.callback_close)
예제 #5
0
	def __init__(self,my_server):
		QWidgetSavePos.__init__(self,"scan_window")
		self.myserver=my_server
		self.setMinimumSize(1000,500)
		self.setWindowTitle(_("Parameter scan - gpvdm"))
		self.setWindowIcon(icon_get("scan"))

		self.rod=[]
		self.sim_dir=get_sim_path()

		self.main_vbox = QVBoxLayout()
		self.ribbon=scan_ribbon()
		self.main_vbox.addWidget(self.ribbon)

		self.ribbon.menu_plot_fits.triggered.connect(self.callback_plot_fits)

		self.ribbon.sim_no_gen.triggered.connect(self.callback_run_simulation_nogen)

		self.ribbon.single_fit.triggered.connect(self.callback_run_single_fit)

		self.ribbon.clean_unconverged.triggered.connect(self.callback_clean_unconverged_simulation)

		self.ribbon.clean_sim_output.triggered.connect(self.callback_clean_simulation_output)

		self.ribbon.push_unconverged_to_hpc.triggered.connect(self.callback_push_unconverged_to_hpc)

		
		self.ribbon.report.triggered.connect(self.callback_report)

		self.ribbon.tb_new.triggered.connect(self.callback_new_scan)

		self.ribbon.tb_delete.triggered.connect(self.callback_delete_page)

		self.ribbon.tb_clone.triggered.connect(self.callback_clone)

		self.ribbon.tb_rename.triggered.connect(self.callback_rename)
		
		#self.ribbon.tb_simulate.start_sim.connect(self.callback_run_simulation)

		#self.ribbon.tb_build.triggered.connect(self.callback_build_scan)

		#self.ribbon.tb_rerun.triggered.connect(self.callback_scan_run)

		#self.ribbon.tb_zip.triggered.connect(self.callback_scan_archive)

		self.ribbon.tb_run_all.triggered.connect(self.callback_run_all_simulations)

		#self.ribbon.tb_plot.triggered.connect(self.callback_plot)
	
		#self.ribbon.tb_plot_time.triggered.connect(self.callback_examine)

		self.ribbon.tb_ml_build_vectors.triggered.connect(self.callback_mb_build_vectors)

		#self.ribbon.tb_notes.triggered.connect(self.callback_notes)

		self.ribbon.tb_clean.triggered.connect(self.callback_clean_all)

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


		self.notebook = QTabWidget()
		self.notebook.setTabBar(QHTabBar())
		css_apply(self.notebook,"style_h.css")

		self.notebook.setTabPosition(QTabWidget.West)
		self.notebook.setMovable(True)


		#self.main_vbox.addWidget(self.notebook)

		self.viewer=gpvdm_viewer(self.sim_dir)
		self.viewer.allow_navigation=True
		self.viewer.set_directory_view(True)
		self.viewer.set_back_arrow(False)
		self.viewer.show_only=["scan_dir"]
		self.viewer.set_multi_select()
		self.viewer.selection_changed.connect(self.callback_selection_changed)
		self.callback_selection_changed()

		self.main_vbox.addWidget(self.viewer)

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

		
		print("!!!!!!!!!!!!>>>>>>>>>>>>>>>>>>>>>")
		get_scan_human_labels().populate_from_files()
		self.setLayout(self.main_vbox)
예제 #6
0
    def __init__(self, scan_file):
        QWidget.__init__(self)
        self.notebook = QTabWidget()
        self.setWindowTitle(_("Parameter scan editor - (www.gpvdm.com)"))
        self.setWindowIcon(icon_get("scan"))

        self.main_vbox = QVBoxLayout()

        self.scan_tab_vbox = QVBoxLayout()

        self.tokens = tokens()
        self.myserver = server_get()
        self.status_bar = QStatusBar()
        self.param_list = get_scan_human_labels().list
        #self.tab_label=tab_label

        self.scan_io = scan_io()
        self.scan_io.parent_window = self
        #self.scan_io.set_path(self.scan_io.scan_dir)
        self.scan_io.load(scan_file)
        self.scan_io.make_dir()

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

        self.tb_add = QAction(icon_get("list-add"), _("Add parameter to scan"),
                              self)
        self.tb_add.triggered.connect(self.callback_add_item)
        toolbar.addAction(self.tb_add)

        self.tb_minus = QAction(icon_get("list-remove"), _("Delete item"),
                                self)
        self.tb_minus.triggered.connect(self.callback_delete_item)
        toolbar.addAction(self.tb_minus)

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

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

        self.tb_command = QAction(icon_get("utilities-terminal"),
                                  _("Insert python command"), self)
        self.tb_command.triggered.connect(self.callback_insert_command)
        toolbar.addAction(self.tb_command)

        self.scan_tab_vbox.addWidget(toolbar)

        self.tab = gpvdm_tab()

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

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

        self.tab.setColumnCount(5)
        #if enable_betafeatures()==False:
        #	self.tab.setColumnHidden(0, True)
        #	self.tab.setColumnHidden(1, True)

        self.tab.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tab.setColumnWidth(2, 300)
        self.tab.setColumnWidth(3, 300)
        self.tab.setColumnWidth(4, 300)
        self.load()

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

        self.scan_tab_vbox.addWidget(self.tab)

        self.notebook.popMenu = QMenu(self)

        #self.mp_show_list=QAction(_("Select parameter to scan"), self)
        #self.mp_show_list.triggered.connect(self.callback_show_list)
        #self.popMenu.addAction(self.mp_show_list)

        self.notebook.popMenu.addSeparator()

        self.mp_delete = QAction(_("Delete item"), self)
        self.mp_delete.triggered.connect(self.callback_delete_item)
        self.notebook.popMenu.addAction(self.mp_delete)

        self.mp_copy = QAction(_("Copy"), self)
        self.mp_copy.triggered.connect(self.callback_copy_item)
        self.notebook.popMenu.addAction(self.mp_copy)

        self.mp_paste = QAction(_("Paste"), self)
        self.mp_paste.triggered.connect(self.callback_paste_item)
        self.notebook.popMenu.addAction(self.mp_paste)

        self.notebook.popMenu.addSeparator()

        self.mp_add = QAction(_("Add item"), self)
        self.mp_add.triggered.connect(self.callback_add_item)
        self.notebook.popMenu.addAction(self.mp_add)

        self.mp_down = QAction(_("Move down"), self)
        self.mp_down.triggered.connect(self.callback_move_down)
        self.notebook.popMenu.addAction(self.mp_down)

        self.mp_down = QAction(_("Move down"), self)
        self.mp_down.triggered.connect(self.callback_move_down)
        self.notebook.popMenu.addAction(self.mp_down)

        self.notebook.popMenu.addSeparator()
        self.notebook.setMinimumSize(700, 500)

        self.program_widget = QWidget()
        self.program_widget.setLayout(self.scan_tab_vbox)
        self.notebook.addTab(self.program_widget, "Commands")

        self.viewer = gpvdm_viewer(self.scan_io.scan_dir)
        self.viewer.show_back_arrow = True
        self.notebook.addTab(self.viewer, "Output")

        self.ribbon = scan_tab_ribbon()
        self.ribbon.tb_simulate.triggered.connect(self.callback_run_simulation)
        self.ribbon.tb_clean.triggered.connect(self.clean_scan_dir)
        self.ribbon.tb_plot.triggered.connect(self.callback_gen_plot_command)
        self.ribbon.tb_notes.triggered.connect(self.callback_notes)

        self.main_vbox.addWidget(self.ribbon)
        self.main_vbox.addWidget(self.notebook)

        self.main_vbox.addWidget(self.status_bar)
        self.setLayout(self.main_vbox)
        self.select_param_window = select_param(self.tab)