def __init__(self):
		QWidget.__init__(self)

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

		vbox=QVBoxLayout()

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

		back = QAction(QIcon(os.path.join(get_image_file_path(),"left.png")),  _("back"), self)
		back.triggered.connect(self.html.back)
		toolbar.addAction(back)

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

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

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

		vbox.addWidget(self.html)

		self.setLayout(vbox)
		return
Example #2
0
	def __init__(self,index):
		QWidget.__init__(self)

		vbox=QVBoxLayout()


		self.index=index

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


		self.load_type=tb_pulse_load_type(self.index)
		#self.load_type.connect("changed", self.draw_callback)

		toolbar.addWidget(self.load_type)
		vbox.addWidget(toolbar)

		self.diode = QPixmap(os.path.join(get_image_file_path(),"diode.png"))
		self.ideal_diode = QPixmap(os.path.join(get_image_file_path(),"ideal_diode.png"))
		self.load = QPixmap(os.path.join(get_image_file_path(),"load.png"))
		self.ideal_load = QPixmap(os.path.join(get_image_file_path(),"ideal_load.png"))
		self.voc = QPixmap(os.path.join(get_image_file_path(),"voc.png"))

		self.darea = QWidget()

		vbox.addWidget(self.darea)

		self.setLayout(vbox)
		self.load_type.changed.connect(self.repaint)
		return
Example #3
0
    def __init__(self, index):
        QWidget.__init__(self)

        vbox = QVBoxLayout()

        self.index = index

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

        self.load_type = tb_pulse_load_type(self.index)
        #self.load_type.connect("changed", self.draw_callback)

        toolbar.addWidget(self.load_type)
        vbox.addWidget(toolbar)

        self.diode = QPixmap(os.path.join(get_image_file_path(), "diode.png"))
        self.ideal_diode = QPixmap(
            os.path.join(get_image_file_path(), "ideal_diode.png"))
        self.load = QPixmap(os.path.join(get_image_file_path(), "load.png"))
        self.ideal_load = QPixmap(
            os.path.join(get_image_file_path(), "ideal_load.png"))
        self.voc = QPixmap(os.path.join(get_image_file_path(), "voc.png"))

        self.darea = QWidget()

        vbox.addWidget(self.darea)

        self.setLayout(vbox)
        self.load_type.changed.connect(self.repaint)
        return
Example #4
0
	def __init__(self,index):
		QWidget.__init__(self)

		self.index=index
		
		self.vbox=QVBoxLayout()

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

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

		self.tb_save = QAction(QIcon(os.path.join(get_image_file_path(),"minus.png")), _("Minus"), self)
		self.tb_save.triggered.connect(self.callback_delete_item)
		toolbar.addAction(self.tb_save)

		self.vbox.addWidget(toolbar)

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

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

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

		self.vbox.addWidget(self.tab)


		self.setLayout(self.vbox)
Example #5
0
	def cluster_gui_update(self):
		if self.myserver.cluster==True:
			self.cluster_button.setIcon(QIcon(os.path.join(get_image_file_path(),"connected.png")))
			self.cluster_clean.setEnabled(True)
			self.cluster_make.setEnabled(True)
			self.cluster_copy_src.setEnabled(True)
			self.cluster_get_info.setEnabled(True)
			self.cluster_get_data.setEnabled(True)
			self.cluster_off.setEnabled(True)
			self.cluster_sync.setEnabled(True)
			self.cluster_jobs.setEnabled(True)
			self.cluster_stop.setEnabled(True)
			self.cluster_view_button.setEnabled(True)

		else:
			self.cluster_button.setIcon(QIcon(os.path.join(get_image_file_path(),"not_connected.png")))
			self.cluster_clean.setEnabled(False)
			self.cluster_make.setEnabled(False)
			self.cluster_copy_src.setEnabled(False)
			self.cluster_get_info.setEnabled(False)
			self.cluster_get_data.setEnabled(False)
			self.cluster_off.setEnabled(False)
			self.cluster_sync.setEnabled(False)
			self.cluster_jobs.setEnabled(False)
			self.cluster_stop.setEnabled(False)
			self.cluster_view_button.setEnabled(False)
Example #6
0
    def init(self, index):
        self.index = index
        self.toolbar = gtk.Toolbar()
        self.toolbar.set_style(gtk.TOOLBAR_ICONS)
        self.toolbar.set_size_request(900, 50)
        self.toolbar.show()

        pos = 0
        self.load_type = tb_pulse_load_type()
        self.load_type.init(self.index)
        self.load_type.connect("changed", self.draw_callback)

        self.toolbar.insert(self.load_type, pos)
        pos = pos + 1

        self.pack_start(self.toolbar, False, False, 0)

        self.darea = gtk.DrawingArea()
        self.darea.connect("expose-event", self.expose)

        self.pack_start(self.darea, True, True, 0)

        self.diode = gtk.gdk.pixbuf_new_from_file(os.path.join(get_image_file_path(), "diode.png"))
        self.load = gtk.gdk.pixbuf_new_from_file(os.path.join(get_image_file_path(), "load.png"))
        self.voc = gtk.gdk.pixbuf_new_from_file(os.path.join(get_image_file_path(), "voc.png"))

        self.show_all()
Example #7
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
Example #8
0
    def init(self):
        self.fig = Figure(figsize=(5, 4), dpi=100)
        self.canvas = FigureCanvas(self.fig)
        self.canvas.figure.patch.set_facecolor("white")

        self.main_vbox = QVBoxLayout()

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

        self.tb_save = QAction(QIcon(os.path.join(get_image_file_path(), "32_save.png")), _("Save image"), self)
        self.tb_save.triggered.connect(self.callback_save)
        toolbar.addAction(self.tb_save)

        self.tb_ref = QAction(
            QIcon(os.path.join(get_image_file_path(), "32_ref.png")), _("Insert reference information"), self
        )
        self.tb_ref.triggered.connect(self.callback_ref)
        toolbar.addAction(self.tb_ref)

        self.main_vbox.addWidget(toolbar)

        self.main_vbox.addWidget(self.canvas)

        # toolbar 2

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

        self.tb_add = QAction(QIcon(os.path.join(get_image_file_path(), "add.png")), _("Add section"), self)
        self.tb_add.triggered.connect(self.callback_add_section)
        toolbar2.addAction(self.tb_add)

        self.tb_remove = QAction(QIcon(os.path.join(get_image_file_path(), "minus.png")), _("Delete section"), self)
        self.tb_remove.triggered.connect(self.callback_remove_item)
        toolbar2.addAction(self.tb_remove)

        self.tb_move = QAction(QIcon(os.path.join(get_image_file_path(), "down.png")), _("Move down"), self)
        self.tb_move.triggered.connect(self.callback_move_down)
        toolbar2.addAction(self.tb_move)

        self.main_vbox.addWidget(toolbar2)

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

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

        self.main_vbox.addWidget(self.tab)

        self.setLayout(self.main_vbox)

        self.load_data()

        self.build_mesh()

        self.draw_graph()

        self.tab.cellChanged.connect(self.on_cell_edited)
Example #9
0
	def __init__(self):
		QWidget.__init__(self)
		self.complex_display=False

		self.hbox=QVBoxLayout()
		self.gl_cmp=gl_cmp(os.path.join(os.getcwd(),"snapshots"))
		
		toolbar=QToolBar()
		toolbar.setIconSize(QSize(42, 42))

		self.tb_rotate = QAction(QIcon(os.path.join(get_image_file_path(),"rotate.png")), _("Rotate"), self)
		self.tb_rotate.triggered.connect(self.tb_rotate_click)
		toolbar.addAction(self.tb_rotate)
		self.tb_rotate.setEnabled(True)
		
		self.tb_contact = QAction(QIcon(os.path.join(get_image_file_path(),"contact.png")), _("Contacts"), self)
		self.tb_contact.triggered.connect(self.callback_contacts)
		toolbar.addAction(self.tb_contact)

		self.tb_mesh = QAction(QIcon(os.path.join(get_image_file_path(),"mesh.png")), _("Edit the electrical mesh"), self)
		self.tb_mesh.triggered.connect(self.callback_edit_mesh)
		toolbar.addAction(self.tb_mesh)


		self.tb_config = QAction(QIcon(os.path.join(get_image_file_path(),"cog.png")), _("Configuration"), self)
		self.tb_config.triggered.connect(self.callback_configure)
		toolbar.addAction(self.tb_config)
		
		self.hbox.addWidget(toolbar)
		
		enable_3d=inp_get_token_value(os.path.join(os.getcwd(),"config.inp") , "#gui_config_3d_enabled")
		if enable_3d==None:
			enable_3d="True"
		enable_3d=str2bool(enable_3d)
		
		if enable_3d==True:
			self.display=glWidget(self)
			self.hbox.addWidget(self.display)
			self.display.setMinimumSize(800, 600)

			self.timer=QTimer()
			self.timer.setSingleShot(True)
			self.timer.timeout.connect(self.timer_update)
			self.timer.start(2000)
		else:
			self.add_fallback()
			
		self.setLayout(self.hbox)

		self.electrical_mesh=tab_electrical_mesh()
		self.electrical_mesh.changed.connect(self.recalculate)

		self.contacts_window=contacts_window()
		self.contacts_window.changed.connect(self.recalculate)

		self.gl_cmp.slider.changed.connect(self.recalculate)
Example #10
0
	def __init__(self,file_name,token):
		self.file_name=os.path.splitext(file_name)[0]+".ref"
		self.token=token
		self.ui = loadUi(os.path.join(get_ui_path(),"ref.ui"))
		self.ui.label.setText(_("Reference information"))
		pixmap = QPixmap(os.path.join(get_image_file_path(),"ref.png"))
		self.ui.image.setPixmap(pixmap)
		self.ui.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"ref.jpg")))		

		self.load()
Example #11
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)
Example #12
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)
Example #13
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")
Example #14
0
	def make_window2(self,main_vbox):

		box=gtk.HBox()
		self.status_bar = gtk.Statusbar()      
		self.context_id = self.status_bar.get_context_id("Statusbar example")
		self.status_bar.push(self.context_id, os.getcwd())

		box.add(self.status_bar)

		self.window2_box=gtk.VBox()
		self.window2_box.add(self.notebook)
		self.window2_box.add(box)
		self.window2_box.set_child_packing(box, False, False, 0, 0)
		self.window2_box.set_size_request(-1, 550)
		self.window2 = gtk.Window(gtk.WINDOW_TOPLEVEL)
		self.window2.set_border_width(10)

		self.window2.set_title(_("Organic Photovoltaic Device Model (www.opvdm.com)"))
		self.window2.connect("delete-event", self.callback_close_window2)

		self.window2.set_icon_from_file(os.path.join(get_image_file_path(),"image.jpg"))
		if main_vbox==None:
			self.window2.add(self.window2_box)
		else:
			main_vbox.add(self.window2_box)			

		box.show()
		self.status_bar.show()
		self.window2_box.show()

		self.change_dir_and_refresh_interface(os.getcwd())
		if main_vbox==None:
			self.window2.show()
		my_help_class.show()
Example #15
0
	def init(self):

		self.main_vbox = QVBoxLayout()

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

		self.tb_save = QAction(QIcon(os.path.join(get_image_file_path(),"save.svg")), "Save image", self)
		self.tb_save.setStatusTip(_("Close"))
		self.tb_save.triggered.connect(self.callback_save_image)
		toolbar.addAction(self.tb_save)

		self.main_vbox.addWidget(toolbar)

		self.my_figure=Figure(figsize=(5,4), dpi=100)
		self.canvas = FigureCanvas(self.my_figure)
		self.canvas.mpl_connect('key_press_event', self.press)
		self.canvas.setFocusPolicy( Qt.ClickFocus )
		self.canvas.setFocus()
		self.canvas.figure.patch.set_facecolor('white')
		#self.canvas.set_size_request(600, 400)
		self.canvas.show()

		self.main_vbox.addWidget(self.canvas)

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


		self.setLayout(self.main_vbox)
Example #16
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()
Example #17
0
	def init(self):
		self.window = gtk.Window()
		self.window.connect("show", self.show_cb)

		self.window.set_decorated(False)
		self.window.set_border_width(0)
		self.window.set_keep_above(True)
		fixed = gtk.Fixed()
		image = gtk.Image()
		image_file=os.path.join(get_image_file_path(),"splash.png")
		label = gtk.Label()
		label.set_use_markup(gtk.TRUE)
		label.set_markup('<span color="black" size="88000"><b>opvdm</b></span>')
		label.show()
		image.set_from_file(image_file)
		image.show()
		fixed.put(image, 0, 0)
		fixed.put(label,40,40)

		label = gtk.Label()
		label.set_use_markup(gtk.TRUE)
		label.set_markup(notice()+"\n"+ver())
		label.show()

		fixed.put(label,40,200)

		self.window.add(fixed)
		self.window.set_position(gtk.WIN_POS_CENTER)
		self.window.show_all()
		self.window.connect("destroy", self.callback_destroy)
Example #18
0
	def add_welcome_page(self):
		self.welcome=welcome_class()
		self.welcome.init(os.path.join(get_image_file_path(),"image.jpg"))
		self.welcome.web.connect("got-data", self.welcome.update)
		self.welcome.get_data()
		self.welcome.show()
		self.append_page(self.welcome, gtk.Label(_("Information")))
Example #19
0
	def update(self):
		items=int(len(self.last[self.pos])/2)
		for i in range(0,5):
			self.box[i].hide()

		for i in range(0,items):
			pixmap = QPixmap(os.path.join(get_image_file_path(),self.last[self.pos][i*2]))
			self.image[i].setPixmap(pixmap)
			text=self.last[self.pos][i*2+1]+"<br>"
			self.label[i].setText(text)
			height=(len(text)/80)*30
			self.label[i].setFixedSize(380,height)
			self.box[i].show()
			#self.image[i].show()

		self.resize(300, items*self.item_height)

		self.forward.setEnabled(True)
		self.back.setEnabled(True)

		if self.pos==0:
			self.back.setEnabled(False)

		if self.pos==len(self.last)-1:
			self.forward.setEnabled(False)

		self.status_bar.showMessage(str(self.pos)+"/"+str(len(self.last)-1))
Example #20
0
 def __init__(self):
     # QDialog.__init__(self)
     self.ui = loadUi(os.path.join(get_ui_path(), "about.ui"))
     self.ui.ver.setText(ver() + "\n" + notice())
     self.ui.li.setText("Written by Roderick MacKenzie 2014, published under GPL v2.0")
     self.ui.show()
     pixmap = QPixmap(os.path.join(get_image_file_path(), "image.jpg"))
     self.ui.image.setPixmap(pixmap)
Example #21
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")
Example #22
0
	def __init__(self,path):
		self.file_path=""
		self.window = loadUi(os.path.join(get_ui_path(),"open.ui"))
		#self.window.center()

		icon = QPixmap(os.path.join(get_image_file_path(),"up.png"))
		self.window.up.setIcon(QIcon(icon))
		self.window.up.clicked.connect(self.on_up_clicked)


		icon = QPixmap(os.path.join(get_image_file_path(),"home.png"))
		self.window.home.setIcon(QIcon(icon))
		self.window.home.clicked.connect(self.on_home_clicked)


		self.dir = path
		self.root_dir= path

		self.window.path.setText(path)

		self.dir_icon = self.get_icon("dir")
		self.dat_icon = self.get_icon("dat")
		self.inp_icon = self.get_icon("inp")
		self.xls_icon = self.get_icon("xls")
		self.info_icon = self.get_icon("info")
		self.spectra_icon = self.get_icon("spectra")
		self.mat_icon = QIcon(QPixmap(os.path.join(get_image_file_path(),"organic_material.png")))

		self.window.listwidget.setIconSize(QSize(48,48))
		self.window.listwidget.setViewMode(QListView.IconMode)
		self.window.listwidget.setSpacing(8)
		self.window.listwidget.setWordWrap(True)
		gridsize=self.window.listwidget.size()
		gridsize.setWidth(80)
		gridsize.setHeight(80)

		self.window.listwidget.setGridSize(gridsize)

		self.fill_store()

		self.window.listwidget.itemDoubleClicked.connect(self.on_item_activated)
		self.window.listwidget.itemClicked.connect(self.on_selection_changed)
Example #23
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()
Example #24
0
def about_dialog_show():
    about = gtk.AboutDialog()
    about.set_program_name("opvdm")
    about.set_version("")
    about.set_copyright("Written by Roderick MacKenzie 2014, published under GPL v2.0")
    about.set_comments(ver() + "\n" + notice())
    about.set_website("http://www.opvdm.com")

    image = os.path.join(get_image_file_path(), "image.jpg")
    about.set_logo(gtk.gdk.pixbuf_new_from_file(image))
    about.run()
    about.destroy()
Example #25
0
	def __init__(self,text,default,image):
		#QDialog.__init__(self)
		self.ui = loadUi(os.path.join(get_ui_path(),"question.ui"))
		self.ui.label.setText(text)
		self.ui.text.setText(default)
		pixmap = QPixmap(os.path.join(get_image_file_path(),image))
		self.ui.image.setPixmap(pixmap)
		ret=self.ui.exec_()
		if ret==True:
			self.ret=self.ui.text.text()
		else:
			self.ret=None
Example #26
0
    def __init__(self, index, base_file_name="pulse", token="#pulse_sim_mode"):
        QWidget.__init__(self)

        vbox = QVBoxLayout()

        self.index = index

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

        self.load_type = tb_pulse_load_type(self.index,
                                            base_file_name=base_file_name,
                                            token=token)
        #self.load_type.connect("changed", self.draw_callback)

        toolbar.addWidget(self.load_type)
        vbox.addWidget(toolbar)

        self.diode = QPixmap(os.path.join(get_image_file_path(), "diode.png"))
        self.ideal_diode = QPixmap(
            os.path.join(get_image_file_path(), "ideal_diode.png"))
        self.load = QPixmap(os.path.join(get_image_file_path(), "load.png"))
        self.ideal_load = QPixmap(
            os.path.join(get_image_file_path(), "ideal_load.png"))
        self.voc = QPixmap(os.path.join(get_image_file_path(), "voc.png"))

        self.darea = QWidget()

        self.diagram = ersatzschaltbild()
        self.diagram.dx = 200
        self.diagram.dy = 200
        self.diagram.editable = False

        vbox.addWidget(self.diagram)
        #vbox.addWidget(self.darea)

        self.setLayout(vbox)
        #self.load_type.changed.connect(self.repaint)
        self.load_type.changed.connect(self.update)
        self.update()
Example #27
0
	def __init__(self,long_error,error):

		self.error=error
		self.file_path=""
		QWidget.__init__(self)
		self.setWindowTitle(_("Error"))

		self.main_vbox=QVBoxLayout()
		self.setFixedSize(800,400)
		h_widget=QWidget()
		h_box=QHBoxLayout()
		h_widget.setLayout(h_box)
		image=QLabel()
		pixmap = QPixmap(os.path.join(get_image_file_path(),"warning.png"))
		image.setPixmap(pixmap)
		h_box.addWidget(image)

		h_box.setAlignment(image,Qt.AlignTop)
		
		self.message = QTextEdit()
		help_text="<big><b>An error has occurred please report this error by clicking ok:<b></big><br><br>"
		help_text2="<br><br><big><b>It would also help if you e-mailed the error message to [email protected] and described what you were doing with the model to make it crash.  Very often there is not enough information in bug reports alone to fix the problem.<br><br>All error reports are gratefully received.<br><br>Rod 5/9/16<b></big>"
		self.message.setText(help_text+long_error+help_text2)
		h_box.addWidget(self.message)
		
		self.main_vbox.addWidget(h_widget)

		button_widget=QWidget()
		self.main_vbox.addWidget(button_widget)
		
		self.label_reporting=QLabel(_("Reporting error...."))
		self.label_reporting.hide()

		self.spin=spinner()
		self.spin.hide()
		
		okButton = QPushButton("OK")
		cancelButton = QPushButton("Cancel")

		button_layout = QHBoxLayout()
		button_layout.addWidget(self.label_reporting)
		button_layout.addWidget(self.spin)

		button_layout.addStretch(1)
		button_layout.addWidget(okButton)
		button_layout.addWidget(cancelButton)
		button_widget.setLayout(button_layout)

		self.setLayout(self.main_vbox)
	
		okButton.clicked.connect(self.on_ok_clicked) 
		cancelButton.clicked.connect(self.close_clicked)
Example #28
0
	def __init__(self):
		QWidget.__init__(self)
		self.rebuild_mat_list()
		self.doping_window=False
		self.cost_window=False
		self.optics_window=False

		self.main_vbox=QVBoxLayout()

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

		self.tb_add = QAction(QIcon(os.path.join(get_image_file_path(),"add.png")), _("Add device layer"), self)
		self.tb_add.triggered.connect(self.on_add_item_clicked)
		self.toolbar.addAction(self.tb_add)

		self.tb_remove = QAction(QIcon(os.path.join(get_image_file_path(),"minus.png")), _("Delete device layer"), self)
		self.tb_remove.triggered.connect(self.on_remove_item_clicked)
		self.toolbar.addAction(self.tb_remove)


		self.tb_remove= QAction(QIcon(os.path.join(get_image_file_path(),"down.png")), _("Move device layer"), self)
		self.tb_remove.triggered.connect(self.on_move_down)
		self.toolbar.addAction(self.tb_remove)

		self.tb_doping = QAction(QIcon(os.path.join(get_image_file_path(),"doping.png")), _("Doping"), self)
		self.tb_doping.triggered.connect(self.callback_doping)
		self.toolbar.addAction(self.tb_doping)

		self.optics_button = QAction(QIcon(os.path.join(get_image_file_path(),"optics.png")), _("Optical simulation"), self)
		self.optics_button.triggered.connect(self.callback_optics_sim)
		self.toolbar.addAction(self.optics_button)

		self.tb_open = QAction(QIcon(os.path.join(get_image_file_path(),"organic_material.png")), _("Look at the materials database"), self)
		self.tb_open.triggered.connect(self.callback_view_materials)
		self.toolbar.addAction(self.tb_open)

		self.cost = QAction(QIcon(os.path.join(get_image_file_path(),"cost.png")), _("Calculate the cost of the solar cell"), self)
		self.cost.triggered.connect(self.callback_cost)
		self.toolbar.addAction(self.cost)
		
		self.main_vbox.addWidget(self.toolbar)
	
		self.tab = QTableWidget()
		self.tab.resizeColumnsToContents()

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

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

		self.setLayout(self.main_vbox)
Example #29
0
	def __init__(self):
		QWidget.__init__(self)
		self.setWindowTitle("Quantum Efficiency calculator - (www.gpvdm.com)")
		self.setWindowIcon(QIcon(os.path.join(get_image_file_path(),"qe.jpg")))

		self.fig = Figure(figsize=(5,4), dpi=100)
		self.ax1=None
		self.show_key=True

		self.draw_graph()
		canvas = FigureCanvas(self.fig)
		#canvas.set_background('white')
		#canvas.set_facecolor('white')
		canvas.figure.patch.set_facecolor('white')
		#canvas.set_size_request(500, 150)
		#canvas.show()

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

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

		self.tb_refresh = QAction(QIcon(os.path.join(get_image_file_path(),"play.png")), _("Run"), self)
		self.tb_refresh .triggered.connect(self.callback_refresh)
		toolbar.addAction(self.tb_refresh )

		nav_bar=NavigationToolbar(canvas,self)
		toolbar.addWidget(nav_bar)

		
		window_main_vbox=QVBoxLayout()
		window_main_vbox.addWidget(toolbar)
		window_main_vbox.addWidget(canvas)

		self.setLayout(window_main_vbox)
Example #30
0
	def __init__(self,file_name,name):
		QGroupBox.__init__(self)
		self.file_name=file_name
		self.name=name
		self.setTitle(name)
		self.setStyleSheet("QGroupBox {  border: 1px solid gray;}")
		vbox=QVBoxLayout()
		self.setLayout(vbox)

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

		add = QAction(QIcon(os.path.join(get_image_file_path(),"16_add.png")),  _("Add "+self.name+" mesh layer"), self)
		add.triggered.connect(self.add_item_clicked)
		toolbar.addAction(add)

		remove = QAction(QIcon(os.path.join(get_image_file_path(),"16_minus.png")),  _("Remove "+self.name+" mesh layer"), self)
		remove.triggered.connect(self.on_remove_click)
		toolbar.addAction(remove)

		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)

		vbox.addWidget(self.tab)
	def init(self,index):
		self.tab_label=None


		self.index=index
		lines=[]

		if inp_load_file(lines,"fxdomain"+str(self.index)+".inp")==True:
			self.tab_name=inp_search_token_value(lines, "#sim_menu_name")
		else:
			self.tab_name=""


		self.title_hbox=gtk.HBox()

		self.title_hbox.set_size_request(-1, 25)
		self.label=gtk.Label(self.tab_name.split("@")[0])
		self.label.set_justify(gtk.JUSTIFY_LEFT)
		self.title_hbox.pack_start(self.label, False, True, 0)

		self.close_button = gtk.Button()
		close_image = gtk.Image()
   		close_image.set_from_file(os.path.join(get_image_file_path(),"close.png"))
		close_image.show()
		self.close_button.add(close_image)
		self.close_button.props.relief = gtk.RELIEF_NONE

		self.close_button.set_size_request(25, 25)
		self.close_button.show()

		self.title_hbox.pack_end(self.close_button, False, False, 0)
		self.title_hbox.show_all()

		self.notebook=gtk.Notebook()
		self.notebook.show()
		self.fxmesh = tab_fxmesh()
		self.fxmesh.init(self.index)

		self.notebook.append_page(self.fxmesh, gtk.Label(_("Frequency mesh")))

		self.pack_start(self.notebook, False, False, 0)

		self.circuit=circuit()
		self.circuit.init(self.index)

		self.notebook.append_page(self.circuit, gtk.Label(_("Circuit")))

		self.show()
	def init(self):
		self.label = gtk.Label()

		self.text=_("<big><b>General-purpose photovoltaic device model</b>\n(<a href=\"http://www.gpvdm.com\" title=\"Click to find out more\">www.gpvdm.com</a>)\n\n To make a new simulation directory click <i>new</i> in the <i>file</i> menu\n or to open an existing simulation click on the <i>open</i> button.\n There is more help on the <a href=\"http://www.gpvdm.com/man/index.html\">man pages</a>.  Please report bugs to\[email protected].\n\n Rod\n18/10/13\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n\n")
		#read_page=False


		self.label.set_markup(self.text+"</big>")
		self.label.set_alignment(0, 0.5)
		self.pack_start(self.label, True, True, 0)
		image = gtk.Image()
   		image.set_from_file(os.path.join(get_image_file_path(),"cell.jpg"))
		self.pack_start(image, False, False, 0)

   		image.show()
		self.label.show()
Example #33
0
    def __init__(self):
        QScrollArea.__init__(self)
        self.main_widget = QWidget()

        hbox = QHBoxLayout()
        self.setStyleSheet("background-color:white;")
        self.label = QLabel()
        #self.label.setStyleSheet("background-color:white;");

        self.label.setAlignment(Qt.AlignTop)
        self.label.setOpenExternalLinks(True)
        #self.label.setSizePolicy( QSizePolicy.Ignored, QSizePolicy.Ignored );
        #self.label.setMaximumSize( QSize(16777215, 16777215) )
        self.label.setWordWrap(True)

        files = os.listdir(get_html_path())
        info_files = []
        for i in range(0, len(files)):
            if files[i].startswith("info") and files[i].endswith("html"):
                info_files.append(files[i])
        file_name = random.choice(info_files)

        f = open(os.path.join(get_html_path(), file_name), encoding='utf-8')
        data = f.readlines()
        f.close()
        text = ""
        for i in range(0, len(data)):
            line = data[i]
            line = bytes(line, 'utf-8').decode('utf-8', 'ignore')
            text = text + '\n' + data[i].rstrip()

        text = text.replace("get_image_file_path()", get_image_file_path())

        self.label.setText(text)
        #self.label.setMinimumSize( QSize(0,0) )

        hbox.addWidget(self.label)

        #image = QLabel()
        #pixmap = QPixmap(os.path.join(get_image_file_path(),"image.jpg"))
        #image.setPixmap(pixmap)

        #hbox.addWidget(image)

        self.main_widget.setLayout(hbox)
        self.main_widget.show()
        self.setWidget(self.main_widget)
Example #34
0
File: about.py Project: Ly0n/gpvdm
    def __init__(self):
        QDialog.__init__(self)
        self.main_hbox = QHBoxLayout()
        self.left_vbox = QVBoxLayout()
        self.main_vbox = QVBoxLayout()
        self.setFixedSize(750, 480)
        self.setWindowTitle(_("About") + " (https://www.gpvdm.com)")
        self.setWindowIcon(icon_get("icon"))
        self.gpvdm = QLabel("<font size=40><b>gpvdm_gui</b></font>")
        self.image = QLabel()
        self.written_by = QLabel(
            _("Written by Roderick MacKenzie 2012-2019, published under the GPL V2.0 license."
              ))
        self.written_by.setWordWrap(True)
        self.ver = QLabel(_("Version ") + ver())
        pixmap = QPixmap(os.path.join(get_image_file_path(), "image.jpg"))
        self.image.setPixmap(pixmap)
        self.left_vbox.addWidget(self.gpvdm)
        self.left_vbox.addWidget(self.image)
        self.left_vbox.addWidget(self.written_by)
        self.left_vbox.addWidget(self.ver)
        self.left = QWidget()
        self.left.setLayout(self.left_vbox)
        self.right = QTabWidget()
        self.right.setMinimumWidth(500)
        self.about = QTextBrowser()
        text = ""
        text = text + _(
            "gpvdm is a general-purpose tool for simulation of light harvesting devices. It was originally written to simulate organic solar cells and OLEDs, but it has recently been extended to simulate other devices including silicon based devices. Currently the model can sumulate:"
        )
        text = text + "<ul>"
        text = text + "<li>" + _("Organic solar cells") + "</li>"
        text = text + "<li>" + _("Organic LEDs") + "</li>"
        text = text + "<li>" + _("Crystalline silicon solar cells") + "</li>"
        text = text + "<li>" + _("a-Si solar cells") + "</li>"
        text = text + "<li>" + _("CIGS solar cells") + "</li>"
        text = text + "</ul> "
        text = text + _(
            "The model solves both electron and hole drift-diffusion, and carrier continuity equations in position space to describe the movement of charge within the device. The model also solves Poisson's equation to calculate the internal electrostatic potential. Recombination and carrier trapping are described within the model using a Shockley-Read-Hall (SRH) formalism, the distribution of trap sates can be arbitrarily defined. All equations can be solved either in steady state or in time domain. A fuller description of the model can be found in the here, in the associated publications and in the manual."
        )
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<center><a href=\"https://www.gpvdm.com\">https://www.gpvdm.com</a></center>"
        self.about.setText(text)
        self.right.addTab(self.about, _("About"))

        self.license = QTextBrowser()
        text = ""
        license_file = os.path.join(get_html_path(), "LICENSE.html")
        if (os.path.isfile(license_file) == True):
            f = open(license_file, mode='rb')
            lines = f.read()
            f.close()
            lines = lines.decode('utf-8')
            lines = lines.split("\n")
            for l in lines:
                text = text + l + "<br>"

        self.license.setText(text)
        self.right.addTab(self.license, _("Legal"))

        self.translations = QTextBrowser()
        text = ""

        text = text + "<big><b>Translations of gpvdm:</b></big>"
        text = text + "<center>"
        text = text + "<br>"
        text = text + "<b>Chinese</b>: Liu Di (刘迪) and Zhao Chenyao (赵辰尧)"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<b>French</b>: Alexis Prel"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<b>Russian</b>: Timofey Golubev (Тимофей Голубев)"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<b>Your language</b>: Translator needed!"
        text = text + "</center>"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<big>Would you like gpvdm translated into your language?</big>"
        text = text + "<br>"
        text = text + "<big>Would you like your name in the credits of gpvdm?</big>"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "If so then please consider joining the gpvdm translation effort.  This is somthing you can put on your CV and it\'s a way to make sure that speakers of your language have access to high quality scientific tools for simulating solar cells."

        self.translations.setText(text)
        #self.right.addTab(self.translations,_("Translations"))

        self.paths = QTextBrowser()
        text = ""

        text = text + "<b>" + _(
            "Materials library path") + ":</b>" + get_materials_path() + "<br>"
        text = text + "<b>" + _(
            "Device library path") + ":</b>" + get_device_lib_path() + "<br>"
        text = text + "<b>" + _(
            "Binary path") + ":</b>" + get_bin_path() + "<br>"
        text = text + "<b>" + _(
            "Plugins path") + ":</b>" + get_plugins_path() + "<br>"
        text = text + "<b>" + _(
            "Binary name") + ":</b>" + get_exe_name() + "<br>"
        text = text + "<b>" + _(
            "Install ID") + ":</b>" + get_lock().uid + "<br>"

        self.paths.setText(text)
        self.right.addTab(self.paths, _("Paths"))

        #self.materials=QListWidget()
        #self.right.addTab(self.materials,_("Materials"))

        self.main_hbox.addWidget(self.left)
        self.main_hbox.addWidget(self.right)
        self.widget_main_hbox = QWidget()
        self.widget_main_hbox.setLayout(self.main_hbox)
        self.main_vbox.addWidget(self.widget_main_hbox)

        self.hwidget = QWidget()

        self.closeButton = QPushButton(_("Close"))
        self.closeButton.clicked.connect(self.callback_close)
        hbox = QHBoxLayout()
        hbox.addStretch(1)
        hbox.addWidget(self.closeButton)

        self.hwidget.setLayout(hbox)

        self.main_vbox.addWidget(self.hwidget)

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

        #QDialog.__init__(self)

        #self.materials.setIconSize(QSize(32,32))
        #self.materials.setViewMode(QListView.ListMode)
        #self.materials.setSpacing(8)
        #self.materials.setWordWrap(True)
        #gridsize=self.materials.size()
        #gridsize.setWidth(80)
        #gridsize.setHeight(40)

        #self.materials.setGridSize(gridsize)
        self.mat_icon = icon_get("organic_material")
Example #35
0
    def __init__(self):
        QDialog.__init__(self)
        self.main_hbox = QHBoxLayout()
        self.left_vbox = QVBoxLayout()
        self.main_vbox = QVBoxLayout()
        self.setFixedSize(650, 480)
        self.setWindowTitle(_("About") + " (https://www.gpvdm.com)")
        self.setWindowIcon(icon_get("icon"))
        self.gpvdm = QLabel("<font size=40><b>gpvdm</b></font>")
        self.image = QLabel()
        self.written_by = QLabel(
            _("Written by Roderick MacKenzie 2012-2017, published under GPL v2.0"
              ))
        self.written_by.setWordWrap(True)
        self.ver = QLabel(_("Version ") + ver())
        pixmap = QPixmap(os.path.join(get_image_file_path(), "image.jpg"))
        self.image.setPixmap(pixmap)
        self.left_vbox.addWidget(self.gpvdm)
        self.left_vbox.addWidget(self.image)
        self.left_vbox.addWidget(self.written_by)
        self.left_vbox.addWidget(self.ver)
        self.left = QWidget()
        self.left.setLayout(self.left_vbox)
        self.right = QTabWidget()
        self.right.setMinimumWidth(400)
        self.about = QTextBrowser()
        text = ""
        text = text + _(
            "gpvdm is a free general-purpose tool for simulation of light harvesting devices. It was originally written to simulate organic solar cells and OLEDs, but it has recently been extended to simulate other devices including silicon based devices. Currently the model can sumulate:"
        )
        text = text + "<ul>"
        text = text + "<li>" + _("Organic solar cells") + "</li>"
        text = text + "<li>" + _("Organic LEDs") + "</li>"
        text = text + "<li>" + _("Crystalline silicon solar cells") + "</li>"
        text = text + "<li>" + _("a-Si solar cells") + "</li>"
        text = text + "<li>" + _("CIGS solar cells") + "</li>"
        text = text + "</ul> "
        text = text + _(
            "The model solves both electron and hole drift-diffusion, and carrier continuity equations in position space to describe the movement of charge within the device. The model also solves Poisson's equation to calculate the internal electrostatic potential. Recombination and carrier trapping are described within the model using a Shockley-Read-Hall (SRH) formalism, the distribution of trap sates can be arbitrarily defined. All equations can be solved either in steady state or in time domain. A fuller description of the model can be found in the here, in the associated publications and in the manual."
        )
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<center><a href=\"https://www.gpvdm.com\">https://www.gpvdm.com</a></center>"
        self.about.setText(text)
        self.right.addTab(self.about, _("About"))

        self.license = QTextBrowser()
        text = ""
        text = text + _(
            "General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall model"
        )
        text = text + "<br>"
        text = text + "<br>"

        text = text + _(
            "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2.0, as published by the Free Software Foundation."
        )
        text = text + "<br>"
        text = text + "<br>"

        text = text + _(
            "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details."
        )
        text = text + "<br>"
        text = text + "<br>"

        text = text + _(
            "You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
        )
        text = text + "<br>"
        text = text + "<br>"

        text = text + _(
            "When you start gpvdm the software checks the gpvdm.com server for updates and bug reports.  To do this it transmits your opperating system type, gpvdm version number.  It also tells the gpvdm.com server if opengl is working on your pc.  By installing gpvdm you agree that the gpvdm software may transmit this information to the gpvdm.com server.  The communications  process between gpvdm software and the gpvdm.com server is described in more detail in the manual."
        )
        text = text + "<br>"
        text = text + "<br>"
        text = text + "*****@*****.**"
        text = text + "<br>"
        self.license.setText(text)
        self.right.addTab(self.license, _("License"))

        self.translations = QTextBrowser()
        text = ""

        text = text + "<big><b>Translations of gpvdm:</b></big>"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<center>"
        text = text + "<b>English</b>: Roderick C. I. MacKenzie"
        text = text + "<br>"
        text = text + "<b>Chinese</b>:Liu Di (刘迪) and Zhao Chenyao (赵辰尧)"
        text = text + "<br>"
        text = text + "<b>Russian</b>: Timofey Golubev (Тимофей Голубев)"
        text = text + "<br>"
        text = text + "<b>German</b>: Roderick C. I. MacKenzie"
        text = text + "<br>"
        text = text + "<b>Spanish</b>:Translator needed!"
        text = text + "<br>"
        text = text + "<b>Korean</b>:Translator needed!"
        text = text + "<br>"
        text = text + "<b>Persian</b>:Translator needed!"
        text = text + "<br>"
        text = text + "<b>Your language</b>: Translator needed!"
        text = text + "</center>"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "<big>Would you like gpvdm translated into your language?</big>"
        text = text + "<br>"
        text = text + "<big>Would you like your name in the credits of gpvdm?</big>"
        text = text + "<br>"
        text = text + "<br>"
        text = text + "If so then please consider joining the gpvdm translation effort.  This is somthing you can put on your CV and it\'s a way to make sure that speakers of your language have access to high quality scientific tools for simulating solar cells."

        self.translations.setText(text)
        self.right.addTab(self.translations, _("Translations"))

        self.materials = QListWidget()
        self.right.addTab(self.materials, _("Materials"))

        self.main_hbox.addWidget(self.left)
        self.main_hbox.addWidget(self.right)
        self.widget_main_hbox = QWidget()
        self.widget_main_hbox.setLayout(self.main_hbox)
        self.main_vbox.addWidget(self.widget_main_hbox)

        self.hwidget = QWidget()

        self.closeButton = QPushButton(_("Close"))
        self.closeButton.clicked.connect(self.callback_close)
        hbox = QHBoxLayout()
        hbox.addStretch(1)
        hbox.addWidget(self.closeButton)

        self.hwidget.setLayout(hbox)

        self.main_vbox.addWidget(self.hwidget)

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

        #QDialog.__init__(self)

        self.materials.setIconSize(QSize(32, 32))
        self.materials.setViewMode(QListView.ListMode)
        self.materials.setSpacing(8)
        self.materials.setWordWrap(True)
        gridsize = self.materials.size()
        #gridsize.setWidth(80)
        gridsize.setHeight(40)

        self.materials.setGridSize(gridsize)
        self.mat_icon = icon_get("organic_material")
        self.fill_store()
Example #36
0
    def __init__(self):
        super(gpvdm_main_window, self).__init__()

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

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

        #sys.exit()
        do_import()

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

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

        server_init()
        self.splash.inc_value()

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

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

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

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

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

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

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

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

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

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

        help_init()
        self.splash.inc_value()

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

        #self.show()

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

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

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

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

        self.splash.inc_value()

        self.statusBar()

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

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

        self.show_tabs = True
        self.show_border = True

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

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

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

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

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

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

        resize_window_to_be_sane(self, 0.7, 0.75)

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

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

        from update import update_window
        self.a = update_window()
        self.a.show()
Example #37
0
    def __init__(self):
        super(gpvdm_main_window, self).__init__()
        icon_init_db()
        #from scans_io import scans_io
        #from cal_path import get_sim_path
        #scans=scans_io(get_sim_path())
        #sims=scans.get_scan_dirs()
        #print(sims)
        #asdsa
        self.splash = splash_window()
        self.scan_human_labels = get_scan_human_labels()

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

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

        #sys.exit()
        do_import()

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

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

        server_init()
        self.splash.inc_value()

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

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

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

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

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

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

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

        self.l = lock_gui()

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

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

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

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

        help_init()
        self.splash.inc_value()

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

        #self.show()

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

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

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

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

        self.splash.inc_value()

        self.statusBar()

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

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

        self.show_tabs = True
        self.show_border = True

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

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

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

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

        update_init()

        resize_window_to_be_sane(self, 0.7, 0.75)

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

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

        help_window().show()

        self.enable_disable_buttons()

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

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

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

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

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

        self.cache = cache(only_open_if_full=True)

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

        #from shape_import import shape_import
        #self.shape_import=shape_import("/home/rod/gpvdm_local/shape/pedot")
        #self.shape_import.show()
        check_lib_in_bash_rc()
Example #38
0
	def __init__(self):
		QWidget.__init__(self)
		mul=1.1
		self.counts=0
		width=459*mul
		self.setFixedSize(width, 260)
		self.center()

		self.view=QGraphicsView(self)

		self.view.setStyleSheet("QProgressBar { border: 2px solid grey; border-radius: 5px; text-align: center; }")


		self.view.setFixedSize(width+2+2,261)
		self.view.move(-2,0)
		self.setWindowFlags(Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint)
		self.li=QLabel("ver",self)
		self.li.move(30,170)

		self.font = QFont()
		self.font.setFamily('DejaVu Sans')
		self.font.setBold(True)
		self.font.setStyleHint(QFont.Monospace)
		self.font.setFixedPitch(True)
		self.font.setPointSize(int(72))

		self.terminals=[]
		self.process=[]
	
		self.gpvdm=QLabel("gpvdm",self)
		self.gpvdm.setFont(self.font)
		self.gpvdm.move(80,40)


		self.li.setText(notice()+"\n"+version())
		self.view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
		self.view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
		window_h=self.height()
		window_w=self.width()

		QTimer.singleShot(2000, self.callback_destroy)

		files=glob.glob(os.path.join(get_image_file_path(),"splash","*.jpg"))
		files.extend(glob.glob(os.path.join(get_image_file_path(),"splash","*.png")))

		number=time.localtime().tm_yday

		number=number % len(files)

		if number>=len(files[number]):
			number=0

		image_file=files[number]

		image_path=os.path.join(get_image_file_path(),"splash",image_file)
		if os.path.isfile(image_path):
			image=QPixmap(image_path)
		
			image.scaledToHeight(window_h)

			w=image.width()
			h=image.height()
			x_max=w-window_h-window_w/2

			hour=float(time.strftime("%H"))*60
			m=float(time.strftime("%m"))
			tot=hour+m
			my_max=float(24*60)

			value=tot/my_max

			xpos=int(x_max*value)+window_w/2

			scene=QGraphicsScene();
			scene.setSceneRect(xpos, 0, 0, h)
			self.view.setScene(scene)


			scene.addPixmap(image);
		else:
			print("Image not found",image_path)

		self.pbar = QProgressBar(self)
		self.pbar.setGeometry(0, 261-20, width-5, 15)
		#self.pbar.move(50,150)
		


		self.show()