示例#1
0
	def __init__(self, server):
		QToolBar.__init__(self)
		self.hpc_window = QWidget()
		#self.hpc_window.show()

		self.myserver=server
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"hpc_window")

		self.setIconSize(QSize(42, 42))

		self.cluster_button = QAction(QIcon(os.path.join(get_image_file_path(),"not_connected.png")), _("Connect to cluster"), self)
		self.cluster_button.triggered.connect(self.callback_cluster_connect)
		self.addAction(self.cluster_button)


		self.node_view=QWidget()
		self.node_view_vbox=QVBoxLayout()
		self.node_view.setLayout(self.node_view_vbox)
		self.bar=[]
		self.button=[]
		self.slider=[]
		self.label=[]

		self.init_job_window()
示例#2
0
	def __init__(self):
		QWidget.__init__(self)
		self.win_list=windows()
		self.setFixedSize(900, 600)
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"doping.png")))
		self.setWindowTitle(_("Doping profile editor (www.gpvdm.com)")) 

		self.win_list.set_window(self,"doping")
		self.main_vbox=QVBoxLayout()

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

		self.save = QAction(QIcon(os.path.join(get_image_file_path(),"save.png")), _("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(QIcon(os.path.join(get_image_file_path(),"help.png")), _("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
示例#3
0
	def __init__(self):
		QWidget.__init__(self)
		self.setFixedSize(600, 400)

		self.win_list=windows()
		self.win_list.set_window(self,"contacts")

		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"contact.png")))

		self.setWindowTitle(_("Edit contacts (www.gpvdm.com)")) 
		
		self.main_vbox = QVBoxLayout()

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

		add = QAction(QIcon(os.path.join(get_image_file_path(),"add.png")),  _("Add contact"), self)
		add.triggered.connect(self.on_add_clicked)
		toolbar.addAction(add)

		remove = QAction(QIcon(os.path.join(get_image_file_path(),"minus.png")),  _("Remove contacts"), self)
		remove.triggered.connect(self.on_remove_clicked)
		toolbar.addAction(remove)

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


		self.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)

		self.main_vbox.addWidget(toolbar)

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

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

		self.tab.clear()
		self.tab.setColumnCount(5)
		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)
示例#4
0
	def __init__(self):
		QWidget.__init__(self)
		self.setFixedSize(900, 600)
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"jv.png")))

		self.setWindowTitle(_("Steady state simulation (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.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)

		self.main_vbox.addWidget(toolbar)


		self.notebook = QTabWidget()

		self.notebook.setTabsClosable(True)
		self.notebook.setMovable(True)

		self.main_vbox.addWidget(self.notebook)


		files=["jv.inp","jv_simple.inp","sun_voc.inp"]
		description=["JV simulation","Diode equation","Suns v.s. Voc"]


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


		self.setLayout(self.main_vbox)
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"jv_window")
		
		self.notebook.currentChanged.connect(self.changed_click)
示例#5
0
	def __init__(self,file_name):
		QWidget.__init__(self)
		self.setFixedSize(900, 600)
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"jv.png")))

		self.setWindowTitle(_("Simulation information (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.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		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=[file_name]
		description=["Simulation Information"]


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


		self.setLayout(self.main_vbox)
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"sim_info_window")
示例#6
0
	def init(self):
		self.setFixedSize(900, 600)
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"cog.png")))

		self.setWindowTitle(_("Configure (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(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.undo.setStatusTip(_("Close"))
		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)

		files=["math.inp","dump.inp","thermal.inp","led.inp","config.inp"]
		description=["Math","Dump","Thermal","LED","GUI  config"]

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


		self.setLayout(self.main_vbox)
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"config_window")
示例#7
0
	def __init__(self):
		self.ret_path=None
		# Create a new window

		self.window = loadUi(os.path.join(get_ui_path(),"new.ui"))

		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self.window,"new_simulation")

		self.window.listwidget.setIconSize(QSize(64,64))
		self.window.listwidget.clear()

		itm = QListWidgetItem( "Organic solar cell (p3htpcbm.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"icon.png")))
		self.window.listwidget.addItem(itm)

		itm = QListWidgetItem( "Organic LED (oled.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"oled.png")))
		self.window.listwidget.addItem(itm)

		itm = QListWidgetItem( "Crystalline silicon solar cell new/beta (silicon.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"si.png")))
		self.window.listwidget.addItem(itm)

		itm = QListWidgetItem( "CIGS Solar cell new/beta (cigs.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"si.png")))
		self.window.listwidget.addItem(itm)

		itm = QListWidgetItem( "a-Si solar cell new/beta (a-silicon.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"asi.png")))
		self.window.listwidget.addItem(itm)

		itm = QListWidgetItem( "polycrystalline silicon (new/beta) (silicon.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"psi.png")))
		self.window.listwidget.addItem(itm)

		itm = QListWidgetItem( "OFET (new/beta) (ofet.gpvdm)" )
		itm.setIcon(QIcon(os.path.join(get_image_file_path(),"ofet.png")))
		self.window.listwidget.addItem(itm)

		self.window.listwidget.itemDoubleClicked.connect(self.callback_next)
		self.window.next.clicked.connect(self.callback_next)
		self.window.cancel.clicked.connect(self.callback_close)
示例#8
0
	def __init__(self):
		QWidget.__init__(self)
		self.win_list=windows()
		self.setFixedSize(400,700)
		self.main_vbox=QVBoxLayout()

		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"scan.png")))

		self.setWindowTitle(_("Select simulation parameter (www.gpvdm.com)")) 


		self.tab = QTreeWidget()
		#self.tab.setHeaderItem("Scan items")


		self.main_vbox.addWidget(self.tab)

		self.hwidget=QWidget()

		okButton = QPushButton("OK")
		cancelButton = QPushButton("Cancel")

		hbox = QHBoxLayout()
		hbox.addStretch(1)
		hbox.addWidget(okButton)
		hbox.addWidget(cancelButton)

		self.hwidget.setLayout(hbox)

		self.main_vbox.addWidget(self.hwidget)

		self.setLayout(self.main_vbox)

		okButton.clicked.connect(self.tree_apply_click) 
		cancelButton.clicked.connect(self.close)

		#self.tab.itemSelectionChanged.connect(self.tree_apply_click)
		self.tab.header().close() 
		self.update()

		return
示例#9
0
	def __init__(self):
		QWidget.__init__(self)
		self.setFixedSize(900, 600)
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"jv.png")))

		self.setWindowTitle(_("Cost and energy payback calculator (BETA - missing realistic data at the moment!!!)")) 
		

		self.main_vbox = QVBoxLayout()

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

		self.play = QAction(QIcon(os.path.join(get_image_file_path(),"play.png")), "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(QIcon(os.path.join(get_image_file_path(),"help.png")), "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.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"costs_window")

		self.update()
示例#10
0
	def init(self,liststore_combobox,dest_treeview):
		self.win_list=windows()
		self.liststore_combobox=liststore_combobox
		self.dest_treeview=dest_treeview
		self.set_title(_("Select simulation parameter"))
		self.set_size_request (300,700) 
		self.treestore = gtk.TreeStore(str)
		self.win_list.set_window(self,"scan_select")

		#for item in range(0, len(self.param_list)):
		#	self.combo_box_list.append(self.param_list[item].name)

		self.treeview = gtk.TreeView(self.treestore)

		self.tvcolumn = gtk.TreeViewColumn('Column 0')

		self.treeview.append_column(self.tvcolumn)

		self.cell = gtk.CellRendererText()

		self.tvcolumn.pack_start(self.cell, True)

		self.tvcolumn.add_attribute(self.cell, 'text', 0)

		self.treeview.set_search_column(0)

		self.tvcolumn.set_sort_column_id(0)

		self.treeview.set_reorderable(True)
		my_vbox=gtk.VBox()
		self.treeview.show()

		button_hbox=gtk.HBox()
		self.tree_apply = gtk.Button(stock=gtk.STOCK_APPLY)
		self.tree_apply.set_size_request (-1,40) 
		self.tree_apply.connect("clicked", self.tree_apply_click, None)
		self.tree_apply.show()
		button_hbox.add(self.tree_apply)

		self.tree_close = gtk.Button(stock=gtk.STOCK_CLOSE)
		self.tree_close.set_size_request (-1,40)
		self.tree_close.connect("clicked", self.tree_close_click, None) 
		self.tree_close.show()
		button_hbox.add(self.tree_close)

		button_hbox.show()

		scrolled_window = gtk.ScrolledWindow()
		scrolled_window.set_border_width(10)

		scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)

		my_vbox.pack_start(scrolled_window, gtk.TRUE, gtk.TRUE, 0)
		scrolled_window.show()


		# pack the table into the scrolled window

		scrolled_window.add_with_viewport(self.treeview)

		my_vbox.pack_start(button_hbox, gtk.FALSE, gtk.FALSE, 0)
		my_vbox.show_all()
		self.connect('delete-event', self.on_destroy)
		self.add(my_vbox)
		self.update()
示例#11
0
	def __init__(self):
		self.undo_list=undo_list_class()
		super(gpvdm_main_window,self).__init__()
		self.setGeometry(200, 100, 1300, 600)
		self.setWindowTitle(_("General-purpose Photovoltaic Device Model (www.gpvdm.com)"))

		#super(gpvdm_main_window, self).__init__(parent, QtCore.Qt.FramelessWindowHint)
		#gobject.GObject.__init__(self)
		server_init()
		self.my_server=server_get()
		self.my_server.init(os.getcwd())
		self.my_server.setup_gui(self.gui_sim_start)
		self.my_server.sim_finished.connect(self.gui_sim_stop)

		help_init()
		#help_window().help_set_help(["star.png",_("<big><b>Update available!</b></big><br>")])
		self.win_list=windows()
		self.win_list.load()

		#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()
		self.setCentralWidget(self.notebook)
		self.show()

		self.statusBar()

		toolbar = self.addToolBar('Exit')
		toolbar.setIconSize(QSize(42, 42))

		self.splash=splash_window()
		self.splash.init()

		temp_error=ver_error()
		print(temp_error)
		if len(temp_error)>0:
			msgBox = QMessageBox(self)
			msgBox.setIcon(QMessageBox.Critical)
			msgBox.setText(self.tr("gpvdm"))
			msgBox.setInformativeText(temp_error)
			msgBox.setStandardButtons(QMessageBox.Ok )
			msgBox.setDefaultButton(QMessageBox.Ok)
			reply = msgBox.exec_()
			return



		self.experiment_window=None

		self.fxexperiment_window=None

		self.jvexperiment_window=None

		self.fit_window=None

		self.config_window=None

		self.qe_window=None

		self.lasers_window=None

		self.sim_info_window=None

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

		self.show_tabs = True
		self.show_border = True

		menubar = self.menuBar()


		file_menu = menubar.addMenu('&File')
		self.menu_new=file_menu.addAction(_("&New simulation"))
		self.menu_new.triggered.connect(self.callback_new)

		self.menu_new_optical_material=file_menu.addAction(_("New optical material"))

		self.menu_export_open=file_menu.addAction(_("&Open simulation"))
		self.menu_export_open.triggered.connect(self.callback_open)

		self.menu_export_data=file_menu.addAction(_("&Export data"))
		self.menu_export_data.triggered.connect(self.callback_export)

		self.menu_import_data=file_menu.addAction(_("&Import data"))
		self.menu_import_data.triggered.connect(self.callback_import)

		self.menu_import_lib=file_menu.addAction(_("Import from library"))
		self.menu_import_lib.triggered.connect(self.callback_import_from_lib)

		self.menu_quit=file_menu.addAction(_("&Quit"))
		self.menu_quit.triggered.connect(self.close_now)

		simulation_menu = menubar.addMenu('&Simulation')

		self.menu_run=simulation_menu.addAction(_("&Run"))
		self.menu_run.triggered.connect(self.callback_simulate)

		self.menu_stop=simulation_menu.addAction(_("&Stop"))
		self.menu_stop.triggered.connect(self.callback_simulate_stop)

		self.menu_scan=simulation_menu.addAction(_("&Parameter scan"))
		self.menu_scan.triggered.connect(self.callback_scan)

		self.menu_configure=simulation_menu.addAction(_("&Configure"))
		self.menu_configure.triggered.connect(self.callback_config_window)


		view_menu = menubar.addMenu('&View')
		view_menu.addAction(_("&None"))


		plot_menu = menubar.addMenu('&Plot')
		self.plot_menu_plot=plot_menu.addAction(_("&Plot simulation result"))
		self.plot_menu_plot.triggered.connect(self.callback_plot_select)


		help_menu = menubar.addMenu('Help')

		help_web=help_menu.addAction(_("&Help window"))
		help_web.triggered.connect(self.callback_help)

		help_web=help_menu.addAction(_("&Online help"))
		help_web.triggered.connect(self.callback_on_line_help)

		help_web=help_menu.addAction(_("&License"))
		help_web.triggered.connect(self.callback_license)

		about=help_menu.addAction(_("&About"))
		about.triggered.connect(self.callback_about_dialog)




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


		new_sim = QAction(QIcon(os.path.join(get_image_file_path(),"new.png")), _("Make a new simulation"), self)
		new_sim.triggered.connect(self.callback_new)
		toolbar.addAction(new_sim)

		open_sim = QAction(QIcon(os.path.join(get_image_file_path(),"open.png")), _("Open a simulation"), self)
		open_sim.triggered.connect(self.callback_open)
		toolbar.addAction(open_sim)


		toolbar.addSeparator()

		self.undo = QAction(QIcon(os.path.join(get_image_file_path(),"undo.png")), _("Undo"), self)
		self.undo.triggered.connect(self.callback_undo)
		toolbar.addAction(self.undo)
		#seperator


		self.run = QAction(QIcon(os.path.join(get_image_file_path(),"play.png")), _("Run the simulation"), self)
		self.run.triggered.connect(self.callback_simulate)
		toolbar.addAction(self.run)

		self.tb_run_scan = QAction(QIcon(os.path.join(get_image_file_path(),"forward.png")), _("Run parameter scan"), self)
		self.tb_run_scan.triggered.connect(self.callback_run_scan)
		self.tb_run_scan.setEnabled(False)
		toolbar.addAction(self.tb_run_scan)

		self.stop = QAction(QIcon(os.path.join(get_image_file_path(),"pause.png")), _("Stop the simulation"), self)
		self.stop.triggered.connect(self.callback_simulate_stop)
		toolbar.addAction(self.stop)
		self.stop.setEnabled(False)


		toolbar.addSeparator()

		self.param_scan = QAction(QIcon(os.path.join(get_image_file_path(),"scan.png")), _("Parameter scan"), self)
		self.param_scan.triggered.connect(self.callback_scan)
		toolbar.addAction(self.param_scan)
		self.param_scan.setEnabled(False)


		if enable_betafeatures()==True:
			self.tb_run_fit = QAction(QIcon(os.path.join(get_image_file_path(),"fit.png")), _("Run a fit command"), self)
			self.tb_run_fit.triggered.connect(self.callback_run_fit)
			toolbar.addAction(self.tb_run_fit)
			self.tb_run_fit.setEnabled(True)


		toolbar.addSeparator()


		self.plot_select = QAction(QIcon(os.path.join(get_image_file_path(),"plot.png")), _("Find a file to plot"), self)
		self.plot_select.triggered.connect(self.callback_plot_select)
		toolbar.addAction(self.plot_select)

		self.examine = QAction(QIcon(os.path.join(get_image_file_path(),"plot_time.png")), _("Examine results in time domain"), self)
		self.examine.triggered.connect(self.callback_examine)
		toolbar.addAction(self.examine)

		toolbar.addSeparator()

		self.tb_time_domain = QAction(QIcon(os.path.join(get_image_file_path(),"time.png")), _("Time domain simulation editor."), self)
		self.tb_time_domain.triggered.connect(self.callback_edit_experiment_window)
		toolbar.addAction(self.tb_time_domain)


		self.experiment_window_button = QAction(QIcon(os.path.join(get_image_file_path(),"spectrum.png")), _("Frequency domain simulation editor"), self)
		self.experiment_window_button.triggered.connect(self.callback_fxexperiment_window)
		toolbar.addAction(self.experiment_window_button)


		self.jv_button = QAction(QIcon(os.path.join(get_image_file_path(),"jv.png")), _("Steady state simulation editor"), self)
		self.jv_button.triggered.connect(self.callback_jv_window)
		toolbar.addAction(self.jv_button)

		self.laser_button = QAction(QIcon(os.path.join(get_image_file_path(),"lasers.png")), _("Lasers editor"), self)
		self.laser_button.triggered.connect(self.callback_configure_lasers)
		toolbar.addAction(self.laser_button)


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


		self.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), _("Help"), self)
		self.help.triggered.connect(self.callback_on_line_help)
		toolbar.addAction(self.help)



		self.addToolBarBreak()
		toolbar1=self.make_tool_box1()
		self.addToolBar(toolbar1)


		if enable_betafeatures()==True:
			self.hpc_toolbar=hpc_class(self.my_server)
			#self.addToolBarBreak()
			toolbar_hpc = self.addToolBar(self.hpc_toolbar)
	
		self.win_list.set_window(self,"main_window")



#		self.menubar.show()

#		self.make_window2(main_vbox)
		#help_window().show()
		self.change_dir_and_refresh_interface(os.getcwd())



#		self.window.show()

#		process_events()

		self.show()
		
		self.light_button.changed.connect(self.notebook.update)
示例#12
0
	def __init__(self):
		QWidget.__init__(self)
		self.setMinimumSize(1200, 700)

		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"fxexperiments_window")

		self.main_vbox = QVBoxLayout()

		menubar = QMenuBar()

		file_menu = menubar.addMenu('&File')
		self.menu_close=file_menu.addAction(_("Close"))
		self.menu_close.triggered.connect(self.callback_close)


		self.menu_experiment=menubar.addMenu(_("Experiments"))
		self.menu_experiment_new=self.menu_experiment.addAction(_("&New"))
		self.menu_experiment_new.triggered.connect(self.callback_add_page)

		self.menu_experiment_delete=self.menu_experiment.addAction(_("&Delete experiment"))
		self.menu_experiment_delete.triggered.connect(self.callback_delete_page)

		self.menu_experiment_rename=self.menu_experiment.addAction(_("&Rename experiment"))
		self.menu_experiment_rename.triggered.connect(self.callback_rename_page)

		self.menu_experiment_clone=self.menu_experiment.addAction(_("&Clone experiment"))
		self.menu_experiment_clone.triggered.connect(self.callback_copy_page)


		self.menu_help=menubar.addMenu(_("Help"))
		self.menu_help_help=self.menu_help.addAction(_("Help"))
		self.menu_help_help.triggered.connect(self.callback_help)


		self.main_vbox.addWidget(menubar)

		self.setWindowTitle(_("Frequency domain experiment editor - gpvdm")) 
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"spectrum.png")))

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

		self.new = QAction(QIcon(os.path.join(get_image_file_path(),"new.png")), _("New experiment"), self)
		self.new.triggered.connect(self.callback_add_page)
		toolbar.addAction(self.new)

		self.new = QAction(QIcon(os.path.join(get_image_file_path(),"delete.png")), _("Delete experiment"), self)
		self.new.triggered.connect(self.callback_delete_page)
		toolbar.addAction(self.new)

		self.clone = QAction(QIcon(os.path.join(get_image_file_path(),"clone.png")), _("Clone experiment"), self)
		self.clone.triggered.connect(self.callback_copy_page)
		toolbar.addAction(self.clone)

		self.clone = QAction(QIcon(os.path.join(get_image_file_path(),"rename.png")), _("Rename experiment"), 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(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)

		self.main_vbox.addWidget(toolbar)


		self.notebook = QTabWidget()
		self.notebook.setTabBar(QHTabBar())

		self.notebook.setTabPosition(QTabWidget.West)
		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)
示例#13
0
	def init(self,my_server):
		self.cluster_window=None
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"scan_window")
		print "constructur"

		self.rod=[]
		if os.path.isfile("scan_window.inp"):
			f = open("scan_window.inp")
			lines = f.readlines()
			f.close()

			path=lines[0].strip()
			if path.startswith(os.getcwd()):
				self.sim_dir=path
			else:
				self.sim_dir=os.getcwd()
		else:
			self.sim_dir=os.getcwd()

		self.tooltips = gtk.Tooltips()

		self.set_border_width(2)
		self.set_title(_("Parameter scan - opvdm"))

		n=0

		self.hpc_root_dir= os.path.abspath(os.getcwd()+'/../')

		self.number_of_tabs=0
		items=0

		self.status_bar = gtk.Statusbar()      

		self.status_bar.show()

		self.context_id = self.status_bar.get_context_id("Statusbar example")

		box=gtk.HBox()
		box.add(self.status_bar)
		box.set_child_packing(self.status_bar, True, True, 0, 0)
		box.show()


		self.menu_items = (
		    ( _("/_File"),         None,         None, 0, "<Branch>" ),
		    ( _("/File/Change dir"),     None, self.callback_change_dir, 0, None ),
		    ( _("/File/Close"),     None, self.callback_close, 0, None ),
		    ( _("/Simulations/_New"),     None, self.callback_add_page, 0, "<StockItem>", "gtk-new" ),
		    ( _("/Simulations/_Delete simulaton"),     None, self.callback_delete_page, 0, "<StockItem>", "gtk-delete" ),
		    ( _("/Simulations/_Rename simulation"),     None, self.callback_rename_page, 0, "<StockItem>", "gtk-edit" ),
		    ( _("/Simulations/_Clone simulation"),     None, self.callback_copy_page, 0, "<StockItem>", "gtk-copy" ),
			( _("/Simulations/sep1"),     None, None, 0, "<Separator>" ),
		    ( _("/Simulations/_Run simulation"),     None, self.callback_run_simulation, 0, "<StockItem>", "gtk-media-play" ),
		    ( _("/Advanced/_Build simulation"),     None, self.callback_build_simulation, 0, "<StockItem>", "gtk-cdrom" ),
			( _("/Advanced/_Run (no build)"),     None, self.callback_run_simulation_no_build, 0, "<StockItem>", "gtk-media-play" ),
			( _("/Advanced/_Run nested simulation"),     None, self.callback_nested_simulation, 0, "<StockItem>", "gtk-media-play" ),
			( _("/Advanced/_Clean simulation"),     None, self.callback_clean_simulation, 0, "<StockItem>", "gtk-clear" ),
			( _("/Advanced/_Clean unconverged simulation"),     None, self.callback_clean_unconverged_simulation, 0, "<StockItem>", "gtk-clear" ),
			( _("/Advanced/_Clean simulation output"),     None, self.callback_clean_simulation_output, 0, "<StockItem>", "gtk-clear" ),
			( _("/Advanced/sep2"),     None, None, 0, "<Separator>" ),
			( _("/Advanced/_Import from hpc"),     None, self.callback_import_from_hpc, 0, "<StockItem>", "gtk-open" ),
			( _("/Advanced/_Push to hpc"),     None, self.callback_push_to_hpc, 0, "<StockItem>", "gtk-save" ),
			( _("/Advanced/_Push unconverged to hpc"),     None, self.callback_push_unconverged_to_hpc, 0, "<StockItem>", "gtk-save" ),
			( _("/Advanced/_Set hpc dir"),     None, self.callback_set_hpc_dir, 0, "<StockItem>", "gtk-open" ),

		    ( _("/Advanced/_Cluster sleep"),     None, self.callback_cluster_sleep, 0, "<StockItem>", "gtk-copy" ),
		    ( _("/Advanced/_Cluster poweroff"),     None, self.callback_cluster_poweroff, 0, "<StockItem>", "gtk-copy" ),
		    ( _("/Advanced/_Cluster wake"),     None, self.callback_wol, 0, "<StockItem>", "gtk-copy" ),

		    ( _("/Advanced/_Remove all results"),     None, self.callback_remove_all_results, 0, "<StockItem>", "gtk-copy" ),
		    ( _("/_Help"),         None,         None, 0, "<LastBranch>" ),
		    ( _("/_Help/Help"),   None,         self.callback_help, 0, None ),
		    ( _("/_Help/About"),   None,         about_dialog_show, 0, "<StockItem>", "gtk-about" ),
		    )


		
		main_vbox = gtk.VBox(False, 3)

		menubar = self.get_main_menu(self)
		main_vbox.pack_start(menubar, False, False, 0)
		menubar.show()

		toolbar = gtk.Toolbar()
		toolbar.set_style(gtk.TOOLBAR_ICONS)
		toolbar.set_size_request(-1, 50)
		pos=0

		#image = gtk.Image()
		#image.set_from_file(os.path.join(get_image_file_path(),"new-tab.png"))
		tb_new_scan = gtk.MenuToolButton(gtk.STOCK_NEW)
		tb_new_scan.connect("clicked", self.callback_add_page)
		self.tooltips.set_tip(tb_new_scan, _("New simulation"))

		self.tab_menu=gtk.Menu()
		tb_new_scan.set_menu(self.tab_menu)

		toolbar.insert(tb_new_scan, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(True)
		sep.set_expand(False)
		toolbar.insert(sep, pos)
		pos=pos+1

		delete = gtk.ToolButton(gtk.STOCK_DELETE)
		delete.connect("clicked", self.callback_delete_page,None)
		self.tooltips.set_tip(delete, _("Delete simulation"))
		toolbar.insert(delete, pos)
		pos=pos+1

		copy = gtk.ToolButton(gtk.STOCK_COPY)
		copy.connect("clicked", self.callback_copy_page,None)
		self.tooltips.set_tip(copy, _("Clone simulation"))
		toolbar.insert(copy, pos)
		pos=pos+1


		rename = gtk.ToolButton(gtk.STOCK_EDIT)
		rename.connect("clicked", self.callback_rename_page,None)
		self.tooltips.set_tip(rename, _("Rename simulation"))
		toolbar.insert(rename, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(True)
		sep.set_expand(False)
		toolbar.insert(sep, pos)
		pos=pos+1

		image = gtk.Image()
		image.set_from_file(os.path.join(get_image_file_path(),"forward2.png"))
		tb_simulate = gtk.ToolButton(image)
		tb_simulate.connect("clicked", self.callback_run_all_simulations)
		self.tooltips.set_tip(tb_simulate, _("Run all simulation"))
		toolbar.insert(tb_simulate, pos)
		pos=pos+1

		if debug_mode()==True:
			sep = gtk.SeparatorToolItem()
			sep.set_draw(True)
			sep.set_expand(False)
			toolbar.insert(sep, pos)
			pos=pos+1

			image = gtk.Image()
	   		image.set_from_file(os.path.join(get_image_file_path(),"server.png"))
			cluster = gtk.ToolButton(image)
			cluster.connect("clicked", self.callback_cluster)
			self.tooltips.set_tip(cluster, _("Configure cluster"))
			toolbar.insert(cluster, pos)
			cluster.show()
			pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(False)
		sep.set_expand(True)
		toolbar.insert(sep, pos)
		pos=pos+1

		tb_help = gtk.ToolButton(gtk.STOCK_HELP)
		tb_help.connect("clicked", self.callback_help)
		self.tooltips.set_tip(tb_help, _("Help"))
		toolbar.insert(tb_help, pos)
		pos=pos+1


		toolbar.show_all()
		main_vbox.pack_start(toolbar, False, False, 0)
		#main_vbox.add(toolbar)

		main_vbox.set_border_width(1)
		self.add(main_vbox)
		main_vbox.show()
		self.myserver=my_server
		

		self.notebook = gtk.Notebook()
		self.notebook.show()
		self.notebook.set_tab_pos(gtk.POS_LEFT)

		self.load_tabs()
		main_vbox.pack_start(self.notebook, True, True, 0)
		main_vbox.pack_start(box, False, False, 0)

		self.connect("delete-event", self.callback_close)
		self.notebook.connect("switch-page",self.switch_page)
		self.set_icon_from_file(os.path.join(get_image_file_path(),"image.jpg"))

		self.hide()
示例#14
0
	def __init__(self):
		QWidget.__init__(self)
		self.setWindowTitle(_("Examine simulation results in time domain")) 

		self.snapshots_hbox = QHBoxLayout()
		self.snapshots_label= QLabel("Snapshots")
		self.snapshots_hbox.addWidget(self.snapshots_label)
		self.snapshots_combobox=QComboBox()
		self.snapshots_hbox.addWidget(self.snapshots_combobox)
		self.snapshots_widget=QWidget()
		self.snapshot_dirs=self.find_snapshots()
		for i in range(0,len(self.snapshot_dirs)):
			self.snapshots_combobox.addItem(self.snapshot_dirs[i])

		self.snapshots_combobox.currentIndexChanged.connect(self.callback_snapshots_combobox)

		self.snapshots_widget.setLayout(self.snapshots_hbox)
		
		self.main_vbox = QVBoxLayout()

		self.slider=snapshot_slider()
		self.slider.set_path(os.path.join(os.getcwd(),"snapshots"))
		self.slider.changed.connect(self.update)
		self.plot=plot_widget()
		self.plot.init()
		#Toolbar
		toolbar=QToolBar()
		toolbar.setIconSize(QSize(42, 42))

		self.tb_video = QAction(QIcon(os.path.join(get_image_file_path(),"video.png")), _("Save video"), self)
		self.tb_video.triggered.connect(self.callback_save)
		toolbar.addAction(self.tb_video)

		#self.tb_scale = QAction(QIcon(os.path.join(get_image_file_path(),"scale.png")), _("Scale"), self)
		#self.tb_scale.triggered.connect(self.callback_scale)
		#toolbar.addAction(self.tb_rotate)


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


		self.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)
##############################################
		self.main_vbox.addWidget(toolbar)

		self.main_vbox.addWidget(self.plot)

		self.main_vbox.addWidget(self.snapshots_widget)
		
		self.main_vbox.addWidget(self.slider)

		self.setLayout(self.main_vbox)

		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"cmp_class")

		if os.path.isfile(os.path.join(os.getcwd(),"snapshots","0","Ec.dat"))==False:
			help_window().help_append(["warning.png",_("No electrical slice data has been stored in the snapshots directory.  To turn this on set Simulation->Configure->Dump->Dump 1D Slices to on.  This will dump a lot of data and slow down your simulations.")])
示例#15
0
	def __init__(self,my_server):
		QWidget.__init__(self)
		self.myserver=my_server

		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"scan_window")
		self.setWindowTitle(_("Parameter scan - gpvdm"))
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"scan.png")))

		self.rod=[]
		if os.path.isfile("scan_window.inp"):
			f = open("scan_window.inp")
			lines = f.readlines()
			f.close()

			path=lines[0].strip()
			if path.startswith(os.getcwd()):
				self.sim_dir=path
			else:
				self.sim_dir=os.getcwd()
		else:
			self.sim_dir=os.getcwd()



		self.main_vbox = QVBoxLayout()

		menubar = QMenuBar()

		file_menu = menubar.addMenu('&File')
		self.menu_change_dir=file_menu.addAction(_("Change dir"))
		self.menu_change_dir.triggered.connect(self.callback_close)
		self.menu_close=file_menu.addAction(_("Close"))
		self.menu_close.triggered.connect(self.callback_close)



		self.menu_simulation=menubar.addMenu(_("Simulations"))
		self.menu_new=self.menu_simulation.addAction(_("&New"))
		self.menu_new.triggered.connect(self.callback_add_page)

		self.menu_delete=self.menu_simulation.addAction(_("&Delete simulation"))
		self.menu_delete.triggered.connect(self.callback_delete_page)

		self.menu_rename=self.menu_simulation.addAction(_("&Rename simulation"))
		self.menu_rename.triggered.connect(self.callback_rename_page)

		self.menu_copy=self.menu_simulation.addAction(_("&Clone simulation"))
		self.menu_copy.triggered.connect(self.callback_copy_page)

		self.menu_simulation.addSeparator()

		self.menu_run=self.menu_simulation.addAction(_("&Run simulation"))
		self.menu_run.triggered.connect(self.callback_run_simulation)

		self.menu_advanced=menubar.addMenu(_("Advanced"))

		self.menu_plot_fits=self.menu_advanced.addAction(_("&Plot fits"))
		self.menu_plot_fits.triggered.connect(self.callback_plot_fits)

		self.menu_run_nested=self.menu_advanced.addAction(_("&Run nested simulation"))
		self.menu_run_nested.triggered.connect(self.callback_nested_simulation)

		self.menu_run_nested=self.menu_advanced.addAction(_("&Run simulation no generation"))
		self.menu_run_nested.triggered.connect(self.callback_run_simulation_nogen)

		self.menu_run_nested=self.menu_advanced.addAction(_("&Run simulation no generation"))
		self.menu_run_nested.triggered.connect(self.callback_run_simulation_nogen)

		self.menu_run_single_fit=self.menu_advanced.addAction(_("&Run single fit"))
		self.menu_run_single_fit.triggered.connect(self.callback_run_single_fit)

		self.menu_clean_simulation=self.menu_advanced.addAction(_("&Clean simulation"))
		self.menu_clean_simulation.triggered.connect(self.callback_clean_simulation)

		self.menu_clean_unconverged_simulation=self.menu_advanced.addAction(_("&Clean unconverged simulation"))
		self.menu_clean_unconverged_simulation.triggered.connect(self.callback_clean_unconverged_simulation)

		self.menu_clean_simulation_output=self.menu_advanced.addAction(_("&Clean simulation output"))
		self.menu_clean_simulation_output.triggered.connect(self.callback_clean_simulation_output)

		self.menu_clean_simulation_output=self.menu_advanced.addAction(_("&Clean simulation output"))
		self.menu_clean_simulation_output.triggered.connect(self.callback_clean_simulation_output)

		self.menu_advanced.addSeparator()

		self.menu_push_to_hpc=self.menu_advanced.addAction(_("&Push unconverged to hpc"))
		self.menu_push_to_hpc.triggered.connect(self.callback_push_unconverged_to_hpc)



		self.menu_help=menubar.addMenu(_("Help"))
		self.menu_help_help=self.menu_help.addAction(_("Help"))
		self.menu_help_help.triggered.connect(self.callback_help)

		self.main_vbox.addWidget(menubar)		


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

		self.tb_new = QAction(QIcon(os.path.join(get_image_file_path(),"new.png")), _("New simulation"), self)
		self.tb_new.triggered.connect(self.callback_add_page)
		toolbar.addAction(self.tb_new)

		self.tb_delete = QAction(QIcon(os.path.join(get_image_file_path(),"delete.png")), _("Delete simulation"), self)
		self.tb_delete.triggered.connect(self.callback_delete_page)
		toolbar.addAction(self.tb_delete)

		self.tb_clone = QAction(QIcon(os.path.join(get_image_file_path(),"clone.png")), _("Clone simulation"), self)
		self.tb_clone.triggered.connect(self.callback_copy_page)
		toolbar.addAction(self.tb_clone)

		self.tb_rename = QAction(QIcon(os.path.join(get_image_file_path(),"rename.png")), _("Rename simulation"), self)
		self.tb_rename.triggered.connect(self.callback_rename_page)
		toolbar.addAction(self.tb_rename)

		self.tb_run_all = QAction(QIcon(os.path.join(get_image_file_path(),"32_forward2.png")), _("Run all simulations"), self)
		self.tb_run_all.triggered.connect(self.callback_run_all_simulations)
		toolbar.addAction(self.tb_run_all)

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


		self.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)

		self.main_vbox.addWidget(toolbar)

		self.notebook = QTabWidget()
		self.notebook.setTabBar(QHTabBar())

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


		self.main_vbox.addWidget(self.notebook)


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

		self.load_tabs()

		self.setLayout(self.main_vbox)
示例#16
0
	def init(self):
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"experiment_window")
		global_object_register("experiment_graph_update",self.update)
		print "constructur"

		self.tooltips = gtk.Tooltips()

		self.set_border_width(2)
		self.set_title(_("Time domain experiment window - opvdm"))

		self.status_bar = gtk.Statusbar()      
		self.status_bar.show()
		self.context_id = self.status_bar.get_context_id("Statusbar example")

		box=gtk.HBox()
		box.add(self.status_bar)
		box.set_child_packing(self.status_bar, True, True, 0, 0)
		box.show()


		self.menu_items = (
		    ( _("/_File"),         None,         None, 0, "<Branch>" ),
		    ( _("/File/Close"),     None, self.callback_close, 0, None ),
		    ( _("/Experiments/_New"),     None, self.callback_add_page, 0, "<StockItem>", "gtk-new" ),
		    ( _("/Experiments/_Delete experiment"),     None, self.callback_delete_page, 0, "<StockItem>", "gtk-delete" ),
		    ( _("/Experiments/_Rename experiment"),     None, self.callback_rename_page, 0, "<StockItem>", "gtk-edit" ),
		    ( _("/Experiments/_Clone experiment"),     None, self.callback_copy_page, 0, "<StockItem>", "gtk-copy" ),
		    ( _("/_Help"),         None,         None, 0, "<LastBranch>" ),
		    ( _("/_Help/Help"),   None,         self.callback_help, 0, None ),
		    ( _("/_Help/About"),   None,         about_dialog_show, 0, "<StockItem>", "gtk-about" ),
		    )


		main_vbox = gtk.VBox(False, 3)

		menubar = self.get_main_menu(self)
		main_vbox.pack_start(menubar, False, False, 0)
		menubar.show()

		toolbar = gtk.Toolbar()
		toolbar.set_style(gtk.TOOLBAR_ICONS)
		toolbar.set_size_request(-1, 50)
		pos=0

		tb_new_scan = gtk.ToolButton(gtk.STOCK_NEW)
		tb_new_scan.connect("clicked", self.callback_add_page)
		self.tooltips.set_tip(tb_new_scan, _("New experiment"))

		toolbar.insert(tb_new_scan, pos)
		pos=pos+1

		delete = gtk.ToolButton(gtk.STOCK_DELETE)
		delete.connect("clicked", self.callback_delete_page,None)
		self.tooltips.set_tip(delete, _("Delete experiment"))
		toolbar.insert(delete, pos)
		pos=pos+1

		copy = gtk.ToolButton(gtk.STOCK_COPY)
		copy.connect("clicked", self.callback_copy_page,None)
		self.tooltips.set_tip(copy, _("Clone experiment"))
		toolbar.insert(copy, pos)
		pos=pos+1


		rename = gtk.ToolButton(gtk.STOCK_EDIT)
		rename.connect("clicked", self.callback_rename_page,None)
		self.tooltips.set_tip(rename, _("Rename experiment"))
		toolbar.insert(rename, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(True)
		sep.set_expand(False)
		toolbar.insert(sep, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(False)
		sep.set_expand(True)
		toolbar.insert(sep, pos)
		pos=pos+1

		tb_help = gtk.ToolButton(gtk.STOCK_HELP)
		tb_help.connect("clicked", self.callback_help)
		self.tooltips.set_tip(tb_help, "Help")
		toolbar.insert(tb_help, pos)
		pos=pos+1


		toolbar.show_all()
		main_vbox.pack_start(toolbar, False, False, 0)

		main_vbox.set_border_width(1)
		self.add(main_vbox)
		main_vbox.show()
	

		self.notebook = gtk.Notebook()
		self.notebook.show()
		self.notebook.set_tab_pos(gtk.POS_LEFT)

		self.load_tabs()
		main_vbox.pack_start(self.notebook, True, True, 0)
		main_vbox.pack_start(box, False, False, 0)

		self.connect("delete-event", self.callback_close)
		self.notebook.connect("switch-page",self.switch_page)
		self.set_icon_from_file(os.path.join(get_image_file_path(),"image.jpg"))

		self.hide()
示例#17
0
	def init(self):
		self.dumps=0
		self.plot_token=plot_state()
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"cmp_class")

		self.snapshot_list=self.update_snapshots_dir()
		vbox=gtk.VBox()

		self.multi_plot=False

		self.log_scale_y="auto"

		self.plot=plot_widget()
		self.plot.init(self)

		accel_group = gtk.AccelGroup()
		item_factory = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group)

		menu_items = (
		    ( "/_Options",         None,         None, 0, "<Branch>" ),
		    ( "/Options/_Subtract 0th frame",     None, self.callback_toggle_subtract, 0, "<ToggleItem>", "gtk-save" ),
		    ( "/_Axis/_Multiplot",     None, self.callback_multi_plot, 0, "<ToggleItem>", "gtk-save" ),
		    ( "/_Axis/_Set y axis to maximum",     None, self.callback_set_min_max, 0, "<ToggleItem>", "gtk-save" ),
		    )

		self.plot.item_factory.create_items(menu_items)



		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"video.png"))
		self.video = gtk.ToolButton(image)
		self.plot.toolbar.add(self.video)
		self.video.show()
		self.video.connect("clicked", self.callback_save)

		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"scale.png"))
		self.scale = gtk.ToolButton(image)
		self.plot.toolbar.add(self.scale)

		sep = gtk.SeparatorToolItem()
		sep.set_draw(False)
		sep.set_expand(True)
		self.plot.toolbar.add(sep)
		sep.show()


		help = gtk.ToolButton(gtk.STOCK_HELP)
		self.plot.toolbar.add(help)
		help.connect("clicked", self.callback_help)
		help.show()

		close = gtk.ToolButton(gtk.STOCK_QUIT)
		close.connect("clicked", self.callback_close)
		self.plot.toolbar.add(close)
		close.show()

		self.connect("delete-event", self.callback_close) 

		self.plot.toolbar.show_all()


		self.canvas=self.plot.canvas 
		self.plot.show()
		vbox.add(self.plot)

		#adjust
		self.adj1 = gtk.Adjustment(0.0, 0.0, 100, 1, 1.0, 1.0)
		self.adj1.connect("value_changed", self.callback_scale)
		vscale = gtk.HScale(self.adj1)
		vscale.set_update_policy(gtk.UPDATE_CONTINUOUS)
		vscale.set_digits(1)
		vscale.set_value_pos(gtk.POS_TOP)
		vscale.set_draw_value(True)
		vscale.set_size_request(200, 40)
		vscale.set_digits(0)
		vbox.pack_start(vscale, False, False, 10)


		sim_vbox=gtk.VBox()
		primary_hbox=gtk.HBox()

		text=gtk.Label("Primary dir")
		primary_hbox.add(text)

		self.entry0 = gtk.combo_box_entry_new_text()
		self.entry0.show()


		for i in range(0,len(self.snapshot_list)):
			self.entry0.append_text(self.snapshot_list[i])

		primary_hbox.add(self.entry0)
		sim_vbox.add(primary_hbox)

		secondary_hbox=gtk.HBox()

		text=gtk.Label("Secondary dir")
		secondary_hbox.add(text)

		self.entry1 = gtk.combo_box_entry_new_text()
		self.entry1.show()

		for i in range(0,len(self.snapshot_list)):
			self.entry1.append_text(self.snapshot_list[i])

		secondary_hbox.add(self.entry1)
		sim_vbox.add(secondary_hbox)

		sim_vbox.show()
		#hbox.set_size_request(-1, 30)
		vbox.pack_start(sim_vbox, False, False, 0)

		hbox2=gtk.HBox()
		text=gtk.Label("Files to plot")
		hbox2.add(text)
		self.entry2 = gtk.Entry()
		self.entry2.set_text("pt_map nt_map")
		self.entry2.show()
		hbox2.add(self.entry2)
		hbox2.set_size_request(-1, 30)
		vbox.pack_start(hbox2, False, False, 0)

		hbox3=gtk.HBox()
		text=gtk.Label("Exprimental data")
		hbox3.add(text)
		self.entry3 = gtk.Entry()
		self.entry3.set_text("")
		self.entry3.show()
		hbox3.add(self.entry3)
		hbox3.set_size_request(-1, 30)
		vbox.pack_start(hbox3, False, False, 0)

		self.update_button = gtk.Button()
		self.update_button.set_label("Update")
		self.update_button.show()
		self.update_button.connect("clicked", self.callback_scale)
		vbox.add(self.update_button)

		self.config_load()
		self.count_dumps()
		if self.dumps==0:
			md = gtk.MessageDialog(None, 0, gtk.MESSAGE_QUESTION,  gtk.BUTTONS_YES_NO, "No slice data has been written to disk.  You need to re-run the simulation with the dump_slices set to 1.  Would you like to do this now?  Note: This generates lots of files and will slow down the simulation.")

			response = md.run()

			if response == gtk.RESPONSE_YES:
				inp_update_token_value("dump.inp", "#dump_1d_slices", "1",1)
				ret= os.system(get_exe_command())

			md.destroy()

			self.count_dumps()

		self.entry0.connect("changed", self.callback_edit)
		self.entry1.connect("changed", self.callback_edit)
		self.entry2.connect("changed", self.callback_edit)
		self.entry3.connect("changed", self.callback_edit)



		vbox.show_all()
		self.add(vbox)
		
		self.update(0)
		if self.dumps!=0:
			self.plot.do_plot()
			print "CONVERT!!!!!!!!!!!",type(self.plot.plot_token.key_units)
		self.set_border_width(10)
		self.set_title("Compare")
		self.set_icon_from_file(os.path.join(get_image_file_path(),"image.jpg"))

		self.connect('key_press_event', self.on_key_press_event)

		self.show()
示例#18
0
	def __init__(self):

		gobject.GObject.__init__(self)

		self.my_server=server()
		self.my_server.init(os.getcwd())
		self.my_server.statusicon.connect('popup-menu', self.on_status_icon_right_click)
		self.my_server.setup_gui(self.gui_sim_start,self.gui_sim_stop)

		if running_on_linux()==True:
			DBusGMainLoop(set_as_default=True)
			self.bus = dbus.SessionBus()
			self.bus.add_match_string_non_blocking("type='signal',interface='org.my.opvdm'")
			self.bus.add_message_filter(self.adbus)

		else:
			self.win_pipe=win_pipe()
			self.win_pipe.connect('new-data', self.win_dbus)
			self.win_pipe.start()

		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
		#self.window.set_size_request(-1,1000)
		self.window.set_border_width(10)
		self.window.set_title(_("Organic Photovoltaic Device Model (www.opvdm.com)"))

		splash=splash_window()
		splash.init()

		temp_error=ver_error()
		print temp_error
		if len(temp_error)>0:
				md = gtk.MessageDialog(self.window,gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, temp_error)
				md.run()
				md.destroy()

		self.undo_list=undo_list_class()
		self.undo_list.init()


		self.experiment_window=None

		self.fxexperiment_window=None

		self.qe_window=None

		self.win_list=windows()
		self.win_list.load()

		self.config=config()
		#table = gtk.Table(3,6,False)

		self.window.set_icon_from_file(os.path.join(get_image_file_path(),"image.jpg"))

		

		self.show_tabs = True
		self.show_border = True

		self.menu_items = (
		    ( _("/_File"),         None,         None, 0, "<Branch>" ),
			(_("/File/_New simulation"), "<control>N", self.callback_new, 0, "<StockItem>", "gtk-new" ),
			(_("/File/_Open simulation"), "<control>O", self.callback_open, 0, "<StockItem>", "gtk-open" ),
		    ( _("/File/_Export data"),     None, self.callback_export, 0, "<StockItem>", "gtk-save" ),
		    ( _("/File/Import data"),     None, self.callback_import, 0 , "<StockItem>", "gtk-harddisk"),
		    ( _("/File/Import from library"),     None, self.callback_import_from_lib, 0 , "<StockItem>", "gtk-harddisk"),
		    ( _("/File/Quit"),     "<control>Q", gtk.main_quit, 0, "<StockItem>", "gtk-quit" ),
		    ( _("/_Simulate"),      None,         None, 0, "<Branch>" ),
		    ( _("/Simulate/Run"),  None,         self.callback_simulate, 0, "<StockItem>", "gtk-media-play" ),
		    ( _("/Simulate/Parameter scan"),  None,         self.callback_scan , 0, None ),
		    ( _("/Simulate/Start cluster server"),  None,         self.callback_start_cluster_server , 0, None ),
		    ( _("/_View"),      None,         None, 0, "<Branch>" ),
		    ( _("/_Plots"),      None,         None, 0, "<Branch>" ),
		    ( _("/Plots/Plot simulation result"),  None,         self.callback_plot_select, 0, "<StockItem>", "gtk-open"),
		    ( _("/_Plots/"),     None, None, 0, "<Separator>" ),
		    ( _("/_Help"),         None,         None, 0, "<LastBranch>" ),
			( _("/_Help/Help Index"),   None,         self.callback_help, 0, "<StockItem>", "gtk-help"  ),
			

		    ( _("/_Help/About"),   None, self.callback_about_dialog, 0, "<StockItem>", "gtk-about" ),
		    )
		pos=0

		self.menubar = self.get_main_menu(self.window)

		#a = (( "/Plots/Plot after simulation",  None, self.callback_plot_after_run_toggle, 0, "<ToggleItem>" ),   )
		#self.item_factory.create_items( a, )


		#a = (( "/Plots/One plot window",  None, self.callback_set_plot_auto_close, 0, "<ToggleItem>" ),   )
		#self.item_factory.create_items( a, )


		#table.show()
		self.window.connect("destroy", gtk.main_quit)

		self.tooltips = gtk.Tooltips()

		self.window.set_size_request(-1, 780)
		main_vbox = gtk.VBox(False, 5)
		main_vbox.set_border_width(1)
		self.window.add(main_vbox)
		#window.add(table)
		main_vbox.show()


		toolbar = gtk.Toolbar()
		toolbar.set_style(gtk.TOOLBAR_ICONS)
		toolbar.set_size_request(-1, 50)

		open_sim = gtk.ToolButton(gtk.STOCK_OPEN)
		self.tooltips.set_tip(open_sim, _("Open a simulation"))
		toolbar.insert(open_sim, pos)
		pos=pos+1

		#self.save_sim = gtk.ToolButton(gtk.STOCK_SAVE)
		#self.tooltips.set_tip(self.save_sim, "Save a simulation")
		#toolbar.insert(self.save_sim, pos)
		#pos=pos+1

		new_sim = gtk.ToolButton(gtk.STOCK_NEW)
		self.tooltips.set_tip(new_sim, _("Make a new simulation"))
		toolbar.insert(new_sim, pos)
		pos=pos+1

		sep_lhs = gtk.SeparatorToolItem()
		sep_lhs.set_draw(True)
		sep_lhs.set_expand(False)
		toolbar.insert(sep_lhs, pos)
		pos=pos+1

		self.undo = gtk.ToolButton(gtk.STOCK_UNDO)
		self.tooltips.set_tip(self.undo, "Undo")
		toolbar.insert(self.undo, pos)
		self.undo.connect("clicked", self.callback_undo)
		pos=pos+1

		sep_lhs = gtk.SeparatorToolItem()
		sep_lhs.set_draw(True)
		sep_lhs.set_expand(False)
		toolbar.insert(sep_lhs, pos)
		pos=pos+1

	        image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"play.png"))
		self.play = gtk.ToolButton(image)
		self.tooltips.set_tip(self.play, _("Run the simulation"))
		toolbar.insert(self.play, pos)
		self.play.connect("clicked", self.callback_simulate)
		pos=pos+1

		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"forward.png"))
		self.tb_run_scan = gtk.ToolButton(image)
		self.tb_run_scan.connect("clicked", self.callback_run_scan)
		self.tooltips.set_tip(self.tb_run_scan, _("Run parameter scan"))
		toolbar.insert(self.tb_run_scan, pos)
		self.tb_run_scan.set_sensitive(False)
		pos=pos+1

		if debug_mode()==True:
			image = gtk.Image()
	   		image.set_from_file(os.path.join(get_image_file_path(),"fit.png"))
			self.tb_run_fit = gtk.ToolButton(image)
			self.tb_run_fit.connect("clicked", self.callback_run_fit)
			self.tooltips.set_tip(self.tb_run_fit, _("Run a fit command"))
			toolbar.insert(self.tb_run_fit, pos)
			self.tb_run_fit.set_sensitive(True)
			pos=pos+1

	        image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"pause.png"))
		self.stop = gtk.ToolButton(image )
		self.tooltips.set_tip(self.stop, _("Stop the simulation"))
		self.stop.connect("clicked", self.callback_simulate_stop)
		toolbar.insert(self.stop, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(True)
		sep.set_expand(False)
		toolbar.insert(sep, pos)
		pos=pos+1

		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"scan.png"))
		self.param_scan = gtk.ToolButton(image)
		self.param_scan.connect("clicked", self.callback_scan)
		self.tooltips.set_tip(self.param_scan, _("Parameter scan"))
		toolbar.insert(self.param_scan, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(True)
		sep.set_expand(False)
		toolbar.insert(sep, pos)
		pos=pos+1

	        image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"plot.png"))
		self.plot_select = gtk.MenuToolButton(image,"hello")
		self.tooltips.set_tip(self.plot_select, _("Find a file to plot"))
		self.plotted_graphs = used_files_menu()
		self.plot_select.set_menu(self.plotted_graphs.menu)
		toolbar.insert(self.plot_select, pos)
		self.plot_select.connect("clicked", self.callback_plot_select)
		self.plot_select.set_sensitive(False)
		pos=pos+1

		#image = gtk.Image()
   		#image.set_from_file(os.path.join(get_image_file_path(),"refresh.png"))
		#self.plot_open = gtk.ToolButton(image)
		#self.tooltips.set_tip(self.plot_open, "Replot the graph")
		#toolbar.insert(self.plot_open, pos)
		#self.plot_open.set_sensitive(False)
		#os=pos+1

		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"plot_time.png"))
		self.examine = gtk.ToolButton(image)
		self.tooltips.set_tip(self.examine, _("Examine results in time domain"))
		self.examine.connect("clicked", self.callback_examine)
		toolbar.insert(self.examine, pos)
		pos=pos+1

		sep = gtk.SeparatorToolItem()
		sep.set_draw(True)
		sep.set_expand(False)
		toolbar.insert(sep, pos)
		pos=pos+1



		image = gtk.Image()
	   	image.set_from_file(os.path.join(get_image_file_path(),"time.png"))
		self.experiment_window_button = gtk.ToolButton(image)
		self.tooltips.set_tip(self.experiment_window_button, _("Edit the time mesh"))
		self.experiment_window_button.connect("clicked", self.callback_edit_experiment_window)
		toolbar.insert(self.experiment_window_button, pos)
		pos=pos+1

		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"spectrum.png"))
		self.examine = gtk.ToolButton(image)
		self.tooltips.set_tip(self.examine, _("Frequency domain mesh editor"))
		self.examine.connect("clicked", self.callback_fxexperiment_window)
		toolbar.insert(self.examine, pos)
		pos=pos+1

		sep2 = gtk.SeparatorToolItem()
		sep2.set_draw(False)
		sep2.set_expand(True)
		toolbar.insert(sep2, pos)
		pos=pos+1


		help = gtk.ToolButton(gtk.STOCK_HELP)
		self.tooltips.set_tip(help, "Help")
		help.connect("clicked", self.callback_help)
		toolbar.insert(help, pos)
		pos=pos+1


		#quittb = gtk.ToolButton(gtk.STOCK_QUIT)
		#self.tooltips.set_tip(quittb, "Quit")
		#toolbar.insert(quittb, pos)
		#quittb.connect("clicked", gtk.main_quit)
		#pos=pos+1

		new_sim.connect("clicked", self.callback_new)
		open_sim.connect("clicked", self.callback_open)
		#self.save_sim.connect("clicked", self.callback_export)

		#self.plot_open.connect("clicked", self.callback_plot_open)

		toolbar1=self.make_tool_box1()


		toolbar.show_all()



		main_vbox.pack_start(self.menubar, False, True, 0)
		handlebox = gtk.HandleBox()
		handlebox.set_snap_edge(gtk.POS_LEFT)
		handlebox.show()

		toolbar.set_size_request(1000, -1)

		tb_vbox=gtk.VBox()
		tb_vbox.add(toolbar)
		tb_vbox.add(toolbar1)
		tb_vbox.show()



		handlebox.add(tb_vbox)

		main_vbox.pack_start(handlebox, False, False, 0)

		self.window.connect("delete-event", self.callback_close_window) 

		self.win_list.set_window(self.window,"main_window")



		self.menubar.show()

		self.make_window2(main_vbox)

		self.window.show()


		process_events()
示例#19
0
	def init(self, root_dir,terminal):
		print "ROOT=",root_dir
		self.win_list=windows()
		self.terminal=terminal
		main_box=gtk.HBox()
		self.hpc_root_dir=root_dir
		vbox_l=gtk.VBox(False, 2)
		vbox_l.show()
		main_box.pack_start(vbox_l, False, False, 0)
		vbox_r=gtk.VBox(False, 2)
		vbox_r.show()
		main_box.pack_start(vbox_r, False, False, 0)

		self.prog_hbox=gtk.VBox(False, 2)
		self.prog_hbox.show()
		main_box.pack_start(self.prog_hbox, True, True, 0)
		main_box.show_all()
		self.add(main_box)
		#check load
		button = gtk.Button("Check load")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_ZOOM_FIT, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_check_load)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)
		#vbox_l.add(button)
		

		button = gtk.Button("Get data")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_FLOPPY, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_get_data)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)

		button = gtk.Button("Fit log")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_fitlog_plot)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)

		button = gtk.Button("Fit speed")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_fit_speed_log_plot)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)

		button = gtk.Button("Run local sims")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_MEDIA_FORWARD, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_run_once)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)



		button = gtk.Button("Make images")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_CONVERT, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_make_images)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)

		button = gtk.Button("View images")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_COLOR_PICKER, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_view_images)
		button.set_size_request(-1, 50)
		button.show()
		vbox_l.pack_start(button, False, False, 0)



########

		button = gtk.Button("Build local job")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_EXECUTE, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_build_job_local)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)

		button = gtk.Button("Send to hpc")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_JUMP_TO, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_send_to_hpc)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)

		button = gtk.Button("Build jobs on HPC")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_EXECUTE, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_build_jobs)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)

		button = gtk.Button("Copy to nodes")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_NETWORK, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_copy_to_nodes)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)

		button = gtk.Button("Run jobs")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_MEDIA_FORWARD, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_run_jobs)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)

		button = gtk.Button("Clean nodes")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_clean_nodes)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)

		button = gtk.Button("Kill jobs")
		image = gtk.Image()
		image.set_from_stock(gtk.STOCK_MEDIA_STOP, gtk.ICON_SIZE_BUTTON)
		button.set_image(image)
		button.connect("clicked", self.callback_hpc_kill_jobs)
		button.set_size_request(-1, 50)
		button.show()
		vbox_r.pack_start(button, False, False, 0)
		self.win_list.set_window(self,"hpc_window")
		self.set_icon_from_file(os.path.join(get_image_file_path(),"server.png"))
		self.set_size_request(700,-1)
		self.set_title("Organic Photovoltaic Device Model (www.opvdm.com)")
		self.connect("delete-event", self.callback_close_window) 
		self.bar=[]
		self.button=[]
示例#20
0
	def __init__(self):
		QWidget.__init__(self)

		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"laser_window")

		self.main_vbox = QVBoxLayout()

		menubar = QMenuBar()

		file_menu = menubar.addMenu('&File')
		self.menu_close=file_menu.addAction(_("Close"))
		self.menu_close.triggered.connect(self.callback_close)


		self.menu_lasers=menubar.addMenu(_("Lasers"))
		self.menu_lasers_new=self.menu_lasers.addAction(_("&New"))
		self.menu_lasers_new.triggered.connect(self.callback_add_page)

		self.menu_lasers_delete=self.menu_lasers.addAction(_("&Delete laser"))
		self.menu_lasers_delete.triggered.connect(self.callback_delete_page)

		self.menu_lasers_rename=self.menu_lasers.addAction(_("&Rename laser"))
		self.menu_lasers_rename.triggered.connect(self.callback_rename_page)

		self.menu_lasers_rename=self.menu_lasers.addAction(_("&Rename laser"))
		self.menu_lasers_rename.triggered.connect(self.callback_rename_page)

		self.menu_lasers_clone=self.menu_lasers.addAction(_("&Clone laser"))
		self.menu_lasers_clone.triggered.connect(self.callback_copy_page)


		self.menu_help=menubar.addMenu(_("Help"))
		self.menu_help_help=self.menu_help.addAction(_("Help"))
		self.menu_help_help.triggered.connect(self.callback_help)


		self.main_vbox.addWidget(menubar)

		self.setFixedSize(900, 500)
		self.setWindowTitle(_("Laser configuration window - gpvdm"))   
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"lasers.png")))

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

		self.new = QAction(QIcon(os.path.join(get_image_file_path(),"new.png")), _("New laser"), self)
		self.new.triggered.connect(self.callback_add_page)
		toolbar.addAction(self.new)

		self.new = QAction(QIcon(os.path.join(get_image_file_path(),"delete.png")), _("Delete laser"), self)
		self.new.triggered.connect(self.callback_delete_page)
		toolbar.addAction(self.new)

		self.clone = QAction(QIcon(os.path.join(get_image_file_path(),"clone.png")), _("Clone laser"), self)
		self.clone.triggered.connect(self.callback_copy_page)
		toolbar.addAction(self.clone)

		self.clone = QAction(QIcon(os.path.join(get_image_file_path(),"rename.png")), _("Rename laser"), 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(os.path.join(get_image_file_path(),"help.png")), 'Hide', self)
		self.help.setStatusTip(_("Close"))
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)

		self.main_vbox.addWidget(toolbar)


		self.notebook = QTabWidget()
		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)
示例#21
0
	def init(self):
		QWidget.__init__(self)

		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"fit_window")

		self.main_vbox = QVBoxLayout()

		menubar = QMenuBar()

		file_menu = menubar.addMenu('&File')
		self.menu_close=file_menu.addAction(_("Close"))
		self.menu_close.triggered.connect(self.callback_close)


		self.menu_fit=menubar.addMenu(_("Fits"))
		self.menu_fit_new=self.menu_fit.addAction(_("&New"))
		self.menu_fit_new.triggered.connect(self.callback_add_page)

		self.menu_fit_delete=self.menu_fit.addAction(_("&Delete fit"))
		self.menu_fit_delete.triggered.connect(self.callback_delete_page)

		self.menu_fit_rename=self.menu_fit.addAction(_("&Rename fit"))
		self.menu_fit_rename.triggered.connect(self.callback_rename_page)

		self.menu_fit_import=self.menu_fit.addAction(_("&Import data"))
		self.menu_fit_import.triggered.connect(self.callback_import)

		self.menu_fit_clone=self.menu_fit.addAction(_("&Clone fit"))
		self.menu_fit_clone.triggered.connect(self.callback_copy_page)


		self.menu_help=menubar.addMenu(_("Help"))
		self.menu_help_help=self.menu_help.addAction(_("Help"))
		self.menu_help_help.triggered.connect(self.callback_help)


		self.main_vbox.addWidget(menubar)


		#self.setFixedSize(900, 700)
		self.setWindowTitle(_("Fit window - gpvdm"))   
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"fit.png")))

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

		self.new = QAction(QIcon(os.path.join(get_image_file_path(),"new.png")), _("New laser"), self)
		self.new.triggered.connect(self.callback_add_page)
		toolbar.addAction(self.new)

		self.new = QAction(QIcon(os.path.join(get_image_file_path(),"delete.png")), _("Delete laser"), self)
		self.new.triggered.connect(self.callback_delete_page)
		toolbar.addAction(self.new)

		self.clone = QAction(QIcon(os.path.join(get_image_file_path(),"clone.png")), _("Clone laser"), self)
		self.clone.triggered.connect(self.callback_copy_page)
		toolbar.addAction(self.clone)

		self.clone = QAction(QIcon(os.path.join(get_image_file_path(),"rename.png")), _("Rename laser"), self)
		self.clone.triggered.connect(self.callback_rename_page)
		toolbar.addAction(self.clone)

		self.import_data= QAction(QIcon(os.path.join(get_image_file_path(),"import.png")), _("Import data"), self)
		self.import_data.triggered.connect(self.callback_import)
		toolbar.addAction(self.import_data)

		self.play= QAction(QIcon(os.path.join(get_image_file_path(),"play.png")), _("Run a single fit"), self)
		self.play.triggered.connect(self.callback_import)
		toolbar.addAction(self.play)
		
		self.play= QAction(QIcon(os.path.join(get_image_file_path(),"forward.png")), _("Start the fitting process"), self)
		self.play.triggered.connect(self.callback_do_fit)
		toolbar.addAction(self.play)
		
		spacer = QWidget()
		spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
		toolbar.addWidget(spacer)


		self.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), 'Help', self)
		self.help.triggered.connect(self.callback_help)
		toolbar.addAction(self.help)

		self.main_vbox.addWidget(toolbar)

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

		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)

		return
示例#22
0
	def __init__(self,path):
		QWidget.__init__(self)
		self.path=path
		self.setFixedSize(900, 600)
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"organic_material.png")))

		self.setWindowTitle(_("Material editor (www.gpvdm.com)")) 
		

		self.main_vbox = QVBoxLayout()

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

		self.cost = QAction(QIcon(os.path.join(get_image_file_path(),"cost.png")), 'Hide', self)
		self.cost.setStatusTip(_("Cost of material"))
		self.cost.triggered.connect(self.callback_cost)
		toolbar.addAction(self.cost)
		
		spacer = QWidget()
		spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
		toolbar.addWidget(spacer)


		self.help = QAction(QIcon(os.path.join(get_image_file_path(),"help.png")), '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=["dos.inp","pl.inp"]
		description=[_("Electrical parameters"),_("Luminescence")]


		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])

		alpha=equation(self.path,"alpha_eq.inp","alpha_gen.omat","alpha.omat")
		alpha.set_default_value("1e7")
		alpha.set_ylabel("Absorption (m^{-1})")
		alpha.init()
		self.notebook.addTab(alpha,"Absorption")

		n=equation(self.path,"n_eq.inp","n_gen.omat","n.omat")
		n.set_default_value("3")
		n.set_ylabel("Refractive index (au)")
		n.init()
		self.notebook.addTab(n,"Refractive index")


		self.setLayout(self.main_vbox)
		self.win_list=windows()
		self.win_list.load()
		self.win_list.set_window(self,"materials_window")
		
		self.notebook.currentChanged.connect(self.changed_click)