Beispiel #1
0
	def callback_plot_select(self):
		help_window().help_set_help(["dat_file.png",_("<big>Select a file to plot</big><br>Single clicking shows you the content of the file")])

		dialog=gpvdm_open(os.getcwd())
		dialog.show_inp_files=False
		dialog.show_directories=False
		ret=dialog.window.exec_()
		if ret==QDialog.Accepted:
			split=dialog.get_filename().split(".")
			if len(split)>1:
				if split[1]=="xlsx" or split[1]=="xls":
					desktop_open(dialog.get_filename())
	
					print("open with excel")
					return
				
			if os.path.basename(dialog.get_filename())=="sim_info.dat":
				if self.sim_info_window==None:
					self.sim_info_window=sim_info(dialog.get_filename())

				if self.sim_info_window.isVisible()==True:
					self.sim_info_window.hide()
				else:
					self.sim_info_window.show()
				return

			plot_gen([dialog.get_filename()],[],"auto")
Beispiel #2
0
	def callback_contacts(self):
		help_window().help_set_help(["contact.png",_("<big><b>Contacts window</b></big>\nUse this window to change the layout of the contacts on the device")])

		if self.contacts_window.isVisible()==True:
			self.contacts_window.hide()
		else:
			self.contacts_window.show()
Beispiel #3
0
    def update_ui(self, update_help):
        self.blockSignals(True)
        f = inp()
        f.load(os.path.join(get_sim_path(), "thermal.inp"))
        v = f.get_token("#thermal")
        self.thermal = str2bool(v)
        #print(self.thermal)

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

        if self.thermal == False:
            self.setIcon(icon_get("thermal-off"))
            self.setText(_("Iso-thermal\nmodel"))
            if update_help == True:
                help_window().help_set_help([
                    "thermal-off.png",
                    _("<big><b>Isothermal mode</b></big><br>A single temperature will be assumed across the entire device."
                      )
                ])
        self.blockSignals(False)
Beispiel #4
0
	def update_interface(self):
		if self.notebook.load()==True:
			#self.ti_light.connect('refresh', self.notebook.main_tab.update)
			self.check_sim_exists.set_dir(get_sim_path())
			self.ribbon.home.setEnabled(True)
			self.ribbon.simulations.setEnabled(True)
			#self.save_sim.setEnabled(True)
			#self.ribbon.device.setEnabled(True)
			help_window().help_set_help(["media-playback-start",_("<big><b>Now run the simulation</b></big><br> Click on the play icon to start a simulation.")])

			self.ribbon.home_export.setEnabled(True)
			#self.menu_import_lib.setEnabled(True)
			self.ribbon.configure.setEnabled(True)
			self.ribbon.goto_page(_("Home"))
			if enable_betafeatures()==True:
				self.ribbon.simulations.qe.setVisible(True)
		else:
			self.check_sim_exists.set_dir("")
			self.ribbon.home.setEnabled(False)

			self.ribbon.simulations.setEnabled(False)
			#self.ribbon.device.setEnabled(False)
			self.ribbon.goto_page(_("File"))
			help_window().help_set_help(["icon.png",_("<big><b>Hi!</b></big><br> I'm the on-line help system :).  If you find any bugs please report them to <a href=\"mailto:[email protected]\">[email protected]</a>."),"document-new.png",_("Click on the new icon to make a new simulation directory.")])
			language_advert()

			self.ribbon.home_export.setEnabled(False)
			self.ribbon.configure.setEnabled(False)
			if enable_betafeatures()==True:
				self.ribbon.simulations.qe.setVisible(True)
Beispiel #5
0
    def update_interface(self):
        if self.notebook.is_loaded() == True:
            self.check_sim_exists.set_dir(get_sim_path())

            help_window().help_set_help([
                "media-playback-start",
                _("<big><b>Now run the simulation</b></big><br> Click on the play icon to start a simulation."
                  )
            ])

            if enable_betafeatures() == True:
                self.ribbon.simulations.qe.setVisible(True)
        else:
            self.check_sim_exists.set_dir("")
            help_window().help_set_help([
                "icon.png",
                _("<big><b>Hi!</b></big><br> I'm the on-line help system :).  If you have any questions or find any bugs please send them to <a href=\"mailto:"
                  + get_email() + "\">" + get_email() + "</a>."),
                "document-new.png",
                _("Click on the new icon to make a new simulation directory.")
            ])
            language_advert()

            if enable_betafeatures() == True:
                self.ribbon.simulations.qe.setVisible(True)
Beispiel #6
0
	def callback_edit(self, file_name,token,widget):
		if type(widget)==QLineEdit:
			a=undo_list_class()
			a.add([file_name, token, inp_get_token_value(self.file_name, token),widget])
			inp_update_token_value(file_name, token, widget.text())
		elif type(widget)==gtkswitch:
			inp_update_token_value(file_name, token, widget.get_value())
		elif type(widget)==leftright:
			inp_update_token_value(file_name, token, widget.get_value())
		elif type(widget)==gpvdm_select:
			inp_update_token_value(file_name, token, widget.text())
		elif type(widget)==QComboBox:
			inp_update_token_value(file_name, token, widget.itemText(widget.currentIndex()))
		elif type(widget)==QComboBoxLang:
			inp_update_token_value(file_name, token, widget.currentText_english())
		elif type(widget)==QColorPicker:
			inp_update_token_array(file_name, token, [str(widget.r),str(widget.g),str(widget.b)])
		elif type(widget)==QChangeLog:
			a=undo_list_class()
			a.add([file_name, token, inp_get_token_value(self.file_name, token),widget])
			inp_update_token_array(file_name, token, widget.toPlainText().split("\n"))
		elif type(widget)==QParasitic:
			inp_update_token_value(file_name, token, widget.text())
		help_window().help_set_help(["document-save-as","<big><b>Saved to disk</b></big>\n"])
		
		self.changed.emit()
Beispiel #7
0
	def changed_click(self):

		if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("Shape"):
			b=bibtex()
			if b.load(os.path.join(self.path,"shape.bib"))!=False:
				text=b.get_text()
				help_window().help_set_help(["shape.png",_("<big><b>Shape file</b></big><br>"+text)])
Beispiel #8
0
	def callback_edit_mesh(self):
		help_window().help_set_help(["mesh.png",_("<big><b>Mesh editor</b></big>\nUse this window to setup the mesh, the window can also be used to change the dimensionality of the simulation.")])

		if self.electrical_mesh.isVisible()==True:
			self.electrical_mesh.hide()
		else:
			self.electrical_mesh.show()
Beispiel #9
0
	def callback_electrical_editor(self):
		help_window().help_set_help(["electrical.png",_("<big><b>Electrical parameters</b></big>\nUse this window to change the electrical parameters of each layer.")])

		if self.electrical_editor!=None:
			del self.electrical_editor

		self.electrical_editor=dos_main()
		self.electrical_editor.show()
Beispiel #10
0
	def callback_new(self):
		help_window().help_set_help(["p3ht_pcbm.png",_("<big><b>New simulation!</b></big><br> Now selected the type of device you would like to simulate.")])

		dialog=new_simulation()
		dialog.exec_()
		ret=dialog.ret_path
		if ret!=None:
			self.change_dir_and_refresh_interface(dialog.ret_path)
Beispiel #11
0
	def add_line(self,data):
		help_window().help_set_help(["add.png",_("<big><b>The scan window</b></big><br> Now using the drop down menu in the prameter to change 'column', select the device parameter you wish to vary, an example may be dos0/Electron Mobility. Now enter the values you would like it to scan oveer in the  'Values', an example could be '1e-3 1e-4 1e-5 1e-6'.  And hit the double arrorw to run the simulation.")])

		self.insert_row(self.tab.rowCount(),data[0],data[1],data[2],data[3],data[4])
		
		self.rebuild_op_type_widgets()
		
		self.save_combo()
Beispiel #12
0
	def callback_new(self):
		help_window().help_set_help(["p3ht_pcbm.png",_("<big><b>New simulation!</b></big><br> Now selected the type of device you would like to simulate.")])

		dialog=new_simulation()
		dialog.window.exec_()
		ret=dialog.ret_path
		if ret!=None:
			self.change_dir_and_refresh_interface(dialog.ret_path)
Beispiel #13
0
	def callback_configure(self):
		if self.fit_configure_window==None:
			self.fit_configure_window=fit_configure_window("fit_config")
			
		help_window().help_set_help(["vars.png",_("<big><b>The fitting variables window</b></big><br> Use this window to select the variables use to perform the fit.")])
		if self.fit_configure_window.isVisible()==True:
			self.fit_configure_window.hide()
		else:
			self.fit_configure_window.show()
	def callback_interfaces(self):
		help_window().help_set_help(["interfaces.png",_("<big><b>Interface editor</b></big>\nUse this window to edit how electrical interfaces behave.")])

		if self.electrical_interfaces==None:
			self.electrical_interfaces=interface_editor()
		if self.electrical_interfaces.isVisible()==True:
			self.electrical_interfaces.hide()
		else:
			self.electrical_interfaces.show()
	def callback_config_window(self):

		self.config_window=gpvdm_open("/gpvdmroot/gpvdm_configure",show_inp_files=False,title=_("Configure"))
		self.config_window.toolbar.hide()
		self.config_window.show_directories=False
		ret=self.config_window.exec_()
		#self.config_window.changed.connect(self.dump.refresh)

		help_window().help_set_help(["preferences-system.png",_("<big><b>Configuration editor</b></big><br> Use this window to control advanced simulation parameters.")])
Beispiel #16
0
	def callback_edit_mesh(self):
		help_window().help_set_help(["mesh.png",_("<big><b>Mesh editor</b></big>\nUse this window to setup the mesh, the window can also be used to change the dimensionality of the simulation.")])

		if self.electrical_mesh==None:
			self.electrical_mesh=tab_electrical_mesh()
		if self.electrical_mesh.isVisible()==True:
			self.electrical_mesh.hide()
		else:
			self.electrical_mesh.show()
Beispiel #17
0
	def callback_run_fit(self, widget, data=None):
		if self.fit_window==None:
			self.fit_window=fit_window()
			self.fit_window.init()

		help_window().help_set_help(["fit.png",_("<big><b>Fit window</b></big><br> Use this window to fit the simulation to experimental data.")])
		if self.fit_window.isVisible()==True:
			self.fit_window.hide()
		else:
			self.fit_window.show()
Beispiel #18
0
	def callback_optics_sim(self, widget, data=None):
		help_window().help_set_help(["optics.png",_("<big><b>The optical simulation window</b></big><br>Use this window to perform optical simulations.  Click on the play button to run a simulation."),"play.png",_("Click on the play button to run an optical simulation.  The results will be displayed in the tabs to the right.")])

		if self.optics_window==False:
			self.optics_window=class_optical()

		if self.optics_window.isVisible()==True:
			self.optics_window.hide()
		else:
			self.optics_window.show()
 def changed_click(self):
     if self.notebook.tabText(
             self.notebook.currentIndex()).strip() == _("Emission"):
         help_window().help_set_help([
             "tab.png",
             _("<big><b>Emission spectrum</b></big><br>Use this tab to edit the emission spectrum."
               )
         ])
         self.ribbon.tb_save.setEnabled(True)
         self.ribbon.import_data.setEnabled(True)
Beispiel #20
0
	def callback_electrical_editor(self):
		help_window().help_set_help(["electrical.png",_("<big><b>Electrical parameters</b></big>\nUse this window to change the electrical parameters of each layer.")])

		if self.electrical_editor==None:
			self.electrical_editor=electrical()

		if self.electrical_editor.isVisible()==True:
			self.electrical_editor.hide()
		else:
			self.electrical_editor.show()
Beispiel #21
0
	def callback_layer_editor(self):
		help_window().help_set_help(["layers.png",_("<big><b>Device layers</b></big>\nUse this window to configure the structure of the device.")])

		if self.layer_editor==None:
			self.layer_editor=layer_widget()

		if self.layer_editor.isVisible()==True:
			self.layer_editor.hide()
		else:
			self.layer_editor.show()
Beispiel #22
0
	def callback_dimension_editor(self):
		help_window().help_set_help(["dimension.png",_("<big><b>xz dimension editor</b></big>\nUse this window to configure the xz size of the device.")])

		if self.dim_editor==None:
			self.dim_editor=dim_editor()

		if self.dim_editor.isVisible()==True:
			self.dim_editor.hide()
		else:
			self.dim_editor.show()
Beispiel #23
0
	def callback_cost(self):
		help_window().help_set_help(["cost.png",_("<big><b>Costs window</b></big>\nUse this window to calculate the cost of the solar cell and the energy payback time.")])

		if self.cost_window==False:
			self.cost_window=cost()

		if self.cost_window.isVisible()==True:
			self.cost_window.hide()
		else:
			self.cost_window.show()
Beispiel #24
0
	def callback_run_fit(self, widget):
		if self.fit_window==None:
			self.fit_window=fit_window("fit")
			server_get().set_fit_update_function(self.fit_window.update)

		help_window().help_set_help(["fit.png",_("<big><b>Fit window</b></big><br> Use this window to fit the simulation to experimental data.  Gpvdm uses advanced and optimized fitting algorithms to fit the model to your experimental data, so that material parameters such as mobilities and recombination rates can be extracted."),"youtube",_("<big><b><a href=\"https://www.youtube.com/watch?v=61umU4hrsqk\">Watch the tutorial video 1</b></big><br>Fitting gpvdm to experimental data to extract mobility and recombination rate parameters."),"youtube",_("<big><b><a href=\"https://www.youtube.com/watch?v=_cm3Cb3kzUg\">Watch the tutorial video 2</b></big><br>Fitting gpvdm to large area solar cells")])
		if self.fit_window.isVisible()==True:
			self.fit_window.hide()
		else:
			self.fit_window.show()
Beispiel #25
0
	def callback_jv_window(self):

		if self.jvexperiment_window==None:
			self.jvexperiment_window=jv()

		help_window().help_set_help(["jv.png",_("<big><b>JV simulation editor</b></big><br> Use this window to select the step size and parameters of the JV simulations.")])
		if self.jvexperiment_window.isVisible()==True:
			self.jvexperiment_window.hide()
		else:
			self.jvexperiment_window.show()
Beispiel #26
0
	def callback_configure_lasers(self):

		if self.lasers_window==None:
			self.lasers_window=lasers()

		help_window().help_set_help(["lasers.png",_("<big><b>Laser setup</b></big><br> Use this window to set up your lasers.")])
		if self.lasers_window.isVisible()==True:
			self.lasers_window.hide()
		else:
			self.lasers_window.show()
Beispiel #27
0
    def changed_click(self):

        if self.notebook.tabText(
                self.notebook.currentIndex()).strip() == _("Refractive index"):
            text = get_ref_text(os.path.join(self.path, "n.ref"))
            if text == None:
                text = ""
            help_window().help_set_help(
                ["n.png",
                 _("<big><b>Refractive index</b></big><br>" + text)])
Beispiel #28
0
	def callback_capacitance_voltage(self):

		if self.capacitance_voltage_window==None:
			self.capacitance_voltage_window=cv_editor()
			
		help_window().help_set_help(["cv.png",_("<big><b>Capacitance voltage editor</b></big><br> Use this editor to change serup capacitance voltage simulation.")])
		if self.capacitance_voltage_window.isVisible()==True:
			self.capacitance_voltage_window.hide()
		else:
			self.capacitance_voltage_window.show()
Beispiel #29
0
	def callback_cost(self):
		help_window().help_set_help(["cost.png",_("<big><b>Costs window</b></big>\nUse this window to calculate the cost of the solar cell and the energy payback time.")])

		if self.cost_window==None:
			self.cost_window=cost()

		if self.cost_window.isVisible()==True:
			self.cost_window.hide()
		else:
			self.cost_window.show()
Beispiel #30
0
	def callback_sunsjsc_window(self):

		if self.sunsjsc_experiment_window==None:
			self.sunsjsc_experiment_window=sunsjsc()

		help_window().help_set_help(["jv.png",_("<big><b>Suns Jsc simulation editor</b></big><br> Use this window to select the step size and parameters of the JV simulations.")])
		if self.sunsjsc_experiment_window.isVisible()==True:
			self.sunsjsc_experiment_window.hide()
		else:
			self.sunsjsc_experiment_window.show()
Beispiel #31
0
	def callback_configure_measure(self):

		if self.measure_window==None:
			self.measure_window=measure()

		help_window().help_set_help(["measure.png",_("<big><b>Measure window</b></big><br>Use this window to set up measurement points.  If for example you want to extract the value of current density from jv.dat at 0.2 Volts, set a measurement point for jv.dat to 0.2 V.  This will work with any file")])
		if self.measure_window.isVisible()==True:
			self.measure_window.hide()
		else:
			self.measure_window.show()
Beispiel #32
0
	def callback_fdtd(self):

		if self.fdtd_window==None:
			self.fdtd_window=fdtd()

		help_window().help_set_help(["fdtd.png",_("<big><b>FDTD</b></big><br> Use this window to setup a finite difference time domain simulation.")])
		if self.fdtd_window.isVisible()==True:
			self.fdtd_window.hide()
		else:
			self.fdtd_window.show()
Beispiel #33
0
	def callback_ray_tracing_window(self):

		if self.ray_trace_window==None:
			self.ray_trace_window=ray_trace_editor()

		help_window().help_set_help(["ray.png",_("<big><b>The ray tracing editor</b></big><br> Use this window to configure ray tracing.")])
		if self.ray_trace_window.isVisible()==True:
			self.ray_trace_window.hide()
		else:
			self.ray_trace_window.show()
Beispiel #34
0
	def callback_fxexperiment_window(self):

		if self.fxexperiment_window==None:
			self.fxexperiment_window=fxexperiment()
			
		help_window().help_set_help(["spectrum.png",_("<big><b>Frequency domain mesh editor</b></big><br> Some times it is useful to do frequency domain simulations such as when simulating impedance spectroscopy.  This window will allow you to choose which frequencies will be simulated.")])
		if self.fxexperiment_window.isVisible()==True:
			self.fxexperiment_window.hide()
		else:
			self.fxexperiment_window.show()
Beispiel #35
0
	def callback_doping(self):
		help_window().help_set_help(["doping.png",_("<big><b>Doping window</b></big>\nUse this window to add doping to the simulation")])

		if self.doping_window==False:
			self.doping_window=doping_window()

		if self.doping_window.isVisible()==True:
			self.doping_window.hide()
		else:
			self.doping_window.show()
Beispiel #36
0
	def callback_doping(self):
		help_window().help_set_help(["doping.png",_("<big><b>Doping window</b></big>\nUse this window to add doping to the simulation")])

		if self.doping_window==None:
			self.doping_window=doping_window()

		if self.doping_window.isVisible()==True:
			self.doping_window.hide()
		else:
			self.doping_window.show()
Beispiel #37
0
	def callback_parasitic(self):
		help_window().help_set_help(["parasitic.png",_("<big><b>Parasitic components</b></big>\nUse this window to edit the shunt and series resistance.")])

		if self.parasitic_window==None:
			self.parasitic_window=parasitic()

		if self.parasitic_window.isVisible()==True:
			self.parasitic_window.hide()
		else:
			self.parasitic_window.show()
Beispiel #38
0
	def callback_jv_window(self):

		if self.jvexperiment_window==None:
			self.jvexperiment_window=jvexperiment()
			#self.experiment_window.changed.connect(self.callback_experiments_changed)

		help_window().help_set_help(["jv.png",_("<big><b>JV simulation editor</b></big><br> Use this window to configure the Suns Voc simulations.")])
		if self.jvexperiment_window.isVisible()==True:
			self.jvexperiment_window.hide()
		else:
			self.jvexperiment_window.show()
Beispiel #39
0
	def callback_pl_window(self):

		if self.plexperiment_window==None:
			self.plexperiment_window=plexperiment()
			#self.experiment_window.changed.connect(self.callback_experiments_changed)

		help_window().help_set_help(["pl.png",_("<big><b>PL simulation editor</b></big><br> Use this window to configure the steady state photoluminescence simulation."),"youtube",_("<big><b><a href=\"https://www.youtube.com/watch?v=pgaJg6dErP4\">Watch the youtube video</a></b></big><br>Watch the video on simulating PL using gpvdm")])
		if self.plexperiment_window.isVisible()==True:
			self.plexperiment_window.hide()
		else:
			self.plexperiment_window.show()
Beispiel #40
0
	def callback_fxexperiment_window(self):

		if self.fxexperiment_window==None:
			self.fxexperiment_window=fxexperiment()
			self.fxexperiment_window.changed.connect(self.sim_mode_button.update)
			
		help_window().help_set_help(["spectrum.png",_("<big><b>Frequency domain mesh editor</b></big><br> Some times it is useful to do frequency domain simulations such as when simulating impedance spectroscopy.  This window will allow you to choose which frequencies will be simulated.")])
		if self.fxexperiment_window.isVisible()==True:
			self.fxexperiment_window.hide()
		else:
			self.fxexperiment_window.show()
Beispiel #41
0
	def callback_edit_experiment_window(self):

		if self.experiment_window==None:
			self.experiment_window=experiment()
			self.experiment_window.changed.connect(self.callback_experiments_changed)
			
		help_window().help_set_help(["time.png",_("<big><b>The time mesh editor</b></big><br> To do time domain simulations one must define how voltage the light vary as a function of time.  This can be done in this window.  Also use this window to define the simulation length and time step.")])
		if self.experiment_window.isVisible()==True:
			self.experiment_window.hide()
		else:
			self.experiment_window.show()
Beispiel #42
0
	def callback_config_window(self):

		if self.config_window==None:
			self.config_window=class_config_window()
			self.config_window.init()

		help_window().help_set_help(["cog.png",_("<big><b>Configuration editor</b></big><br> Use this window to control advanced simulation parameters.")])
		if self.config_window.isVisible()==True:
			self.config_window.hide()
		else:
			self.config_window.show()
Beispiel #43
0
    def __init__(self):
        QWidgetSavePos.__init__(self, "cmpclass")
        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()
        print(self.snapshot_dirs)
        if len(self.snapshot_dirs) != 0:
            self.slider.set_path(
                os.path.join(get_sim_path(), self.snapshot_dirs[0]))
        self.slider.changed.connect(self.update)
        self.plot = plot_widget()
        self.plot.init()

        self.tb_video = QAction(icon_get("video"), _("Save video"), self)
        self.tb_video.triggered.connect(self.callback_save)
        self.plot.plot_ribbon.file_toolbar.addAction(self.tb_video)
        self.plot.plot_ribbon.plot_toolbar.addAction(self.slider.tb_play)

        self.main_vbox.addWidget(self.plot)

        self.main_vbox.addWidget(self.snapshots_widget)

        self.main_vbox.addWidget(self.slider)

        self.setLayout(self.main_vbox)

        if os.path.isfile(
                os.path.join(get_sim_path(), "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."
                  )
            ])

        #self.light.currentIndexChanged.connect(self.call_back_light_changed)
        self.update()
Beispiel #44
0
	def callback_edit_experiment_window(self):

		if self.experiment_window==None:
			self.experiment_window=experiment()
			self.experiment_window.changed.connect(self.sim_mode_button.update)
			
		help_window().help_set_help(["time.png",_("<big><b>The time mesh editor</b></big><br> To do time domain simulations one must define how voltage the light vary as a function of time.  This can be done in this window.  Also use this window to define the simulation length and time step.")])
		if self.experiment_window.isVisible()==True:
			self.experiment_window.hide()
		else:
			self.experiment_window.show()
Beispiel #45
0
	def callback_scan(self, widget, data=None):
		help_window().help_set_help(["scan.png",_("<big><b>The scan window</b></big><br> Very often it is useful to be able to systematically very a device parameter such as mobility or density of trap states.  This window allows you to do just that."),"add.png",_("Use the plus icon to add a new scan line to the list.")])
		self.tb_run_scan.setEnabled(True)

		if self.scan_window==None:
			self.scan_window=scan_class(self.my_server)


		if self.scan_window.isVisible()==True:
			self.scan_window.hide()
		else:
			self.scan_window.show()
Beispiel #46
0
    def callback_edit(self, file_name, token, widget):
        if type(widget) == QLineEdit:
            a = undo_list_class()
            a.add([file_name, token, inp_get_token_value(self.file_name, token), widget])
            inp_update_token_value(file_name, token, widget.text(), 1)
        elif type(widget) == gtkswitch:
            inp_update_token_value(file_name, token, widget.get_value(), 1)
        elif type(widget) == leftright:
            inp_update_token_value(file_name, token, widget.get_value(), 1)
        elif type(widget) == QComboBox:
            inp_update_token_value(file_name, token, widget.itemText(widget.currentIndex()), 1)

        help_window().help_set_help(["32_save.png", "<big><b>Saved to disk</b></big>\n"])
Beispiel #47
0
	def timer_update(self):
		global open_gl_working
		
		open_gl_working=not self.display.failed
		
		if open_gl_working==True:
			print("OpenGL is working")
		else:
			print("OpenGL is not working going to fallback")
			self.hbox.removeWidget(self.display)
			self.display.deleteLater()
			self.display = None
			self.add_fallback()

			help_window().help_append(["warning.png",_("<big><b>OpenGL warning</b></big><br>It looks as if you don't have working 3D graphics acceleration on your computer.  gpvdm will therefore fallback to 2D mode. The model will still be fully functional, but not look quite so nice.")])
Beispiel #48
0
	def callback_examine(self, widget, data=None):
		help_window().help_set_help(["plot_time.png",_("<big><b>Examine the results in time domain</b></big><br> After you have run a simulation in time domain, if is often nice to be able to step through the simulation and look at the results.  This is what this window does.  Use the slider bar to move through the simulation.  When you are simulating a JV curve, the slider sill step through voltage points rather than time points.")])
		self.my_cmp_class=cmp_class()
		self.my_cmp_class.show()

		return
		ret=mycmp.init()
		if ret==False:
			msgBox = QMessageBox(self)
			msgBox.setIcon(QMessageBox.Critical)
			msgBox.setText(self.tr("gpvdm"))
			msgBox.setInformativeText(_("Re-run the simulation with 'dump all slices' set to one to use this tool."))
			msgBox.setStandardButtons(QMessageBox.Ok )
			msgBox.setDefaultButton(QMessageBox.Ok)
			reply = msgBox.exec_()
			return
Beispiel #49
0
	def on_selection_changed(self,item):
		if type(item)!=None:
			file_name=item.text()
			print(file_name)
			full_path=os.path.join(self.dir, file_name)
			if (file_name.endswith(".dat")==True):
				state=plot_state()
				get_plot_file_info(state,full_path)
				summary="<big><b>"+file_name+"</b></big><br>"+_("<br>title: ")+state.title+_("<br>x axis: ")+state.x_label+" ("+latex_to_html(state.x_units)+_(")<br>y axis: ")+state.y_label+" ("+latex_to_html(state.y_units)+_(")<br><br><big><b>Double click to open</b></big>")
				help_window().help_set_help(["dat_file.png",summary])

			if file_name.endswith("equilibrium"):
				state=plot_state()
				get_plot_file_info(state,full_path)
				summary="<big><b>equilibrium</b></big><br>"+_("<br>This contains the simulation output at 0V in the dark.")
				help_window().help_set_help(["dir_file.png",summary])
Beispiel #50
0
	def gui_sim_stop(self):
		print("here")
		text=self.check_warnings()
		self.progress_window.stop()
		help_window().show()
		status_icon_stop(self.cluster)

		help_window().help_set_help(["plot.png",_("<big><b>Simulation finished!</b></big><br>Click on the plot icon to plot the results")])

		if len(text)!=0:
			self.dialog=sim_warnings(text)

		if 	self.callback_when_done!=False:
			self.callback_when_done()
			self.callback_when_done=False
			
		self.sim_finished.emit()
	def callback_next(self):
		help_window().help_set_help(["save.png",_("<big><b>Now save the simulation</b></big><br>Now select where you would like to save the simulation directory.")])

		if len(self.window.listwidget.selectedItems())>0:

			file_path=save_as_gpvdm(self.window)
			if file_path!=None:
				selection=self.window.listwidget.selectedItems()[0].text()
				selection_file=selection[selection.find("(")+1:selection.find(")")]

				if not os.path.exists(file_path):
					os.makedirs(file_path)

				self.ret_path=file_path
				os.chdir(self.ret_path)
				gpvdm_clone(os.getcwd(),True)
				import_archive(os.path.join(get_device_lib_path(),selection_file),os.path.join(os.getcwd(),"sim.gpvdm"),False)
				self.window.close()
		else:
			error_dlg(self.window,_("Please select a device before clicking next"))
Beispiel #52
0
	def changed_click(self):
		if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("JV simulation"):
			help_window().help_set_help(["jv.png",_("<big><b>JV simulation</b></big><br>This controls the jv curve simulation. You can set paramets such as start voltage, stop voltage and voltage step.")])

		if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("Diode equation"):
			help_window().help_set_help(["jv.png",_("<big><b>Diode equation</b></big><br>The model can also use the standard diode equtaion to simulate solar cells (rather than a complex model).  Use this window to configure the simulation.")])
			
		if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("Suns v.s. Voc"):
			help_window().help_set_help(["jv.png",_("<big><b>Suns v.s. Voc</b></big><br>Configure the sun v.s. Voc plot.")])
Beispiel #53
0
	def callback_help(self, widget, data=None):
		help_window().toggle_visible()
Beispiel #54
0
	def gui_sim_start(self):
		help_window().hide()
		self.progress_window.start()
		status_icon_run(self.cluster)
		self.extern_gui_sim_start()
Beispiel #55
0
	def help(self):
		help_window().help_set_help(["device.png",_("<big><b>The device structure tab</b></big>\n Use this tab to change the structure of the device, the layer thicknesses and to perform optical simulations.  You can also browse the materials data base and  edit the electrical mesh.")])
Beispiel #56
0
	def got_help(self,data):
		if data!="":
			help_window().help_append(["star.png",_("<big><b>Update available!</b></big><br>"+data)])
	def changed_click(self):
		if self.tabText(self.currentIndex()).strip()==_("Device"):
			help_window().help_set_help(["tab.png",_("<big><b>Device tab</b></big><br>This tab contains information about the device, such as width breadth, carrier density on the contacts, shunt and contact resistance.")])

		if self.tabText(self.currentIndex()).strip()==_("Device structure"):
			help_window().help_set_help(["device.png",_("<big><b>The device structure tab</b></big><br> Use this tab to change the structure of the device, the layer thicknesses and to perform optical simulations.  You can also browse the materials data base and  edit the electrical mesh.")])

		if self.tabText(self.currentIndex()).strip()==_("Bands"):
			help_window().help_set_help(["tab.png",_("<big><b>The bands tab</b></big><br> Use this tab to edit the energetic distribution of the density of states.")])

		if self.tabText(self.currentIndex()).strip()==_("Density of states"):
			help_window().help_set_help(["tab.png","<big><b>Density of States</b></big>\nThis tab contains the electrical model parameters, such as mobility, tail slope energy, and band gap."])

		if self.tabText(self.currentIndex()).strip()==_("Luminescence"):
			help_window().help_set_help(["tab.png","<big><b>Luminescence</b></big>\nIf you set 'Turn on luminescence' to true, the simulation will assume recombination is a raditave process and intergrate it to produce Voltage-Light intensity curves (lv.dat).  Each number in the tab tells the model how efficient each recombination mechanism is at producing photons."])

		if self.tabText(self.currentIndex()).strip()==_("Terminal"):
			help_window().help_set_help(["command.png","<big><b>The terminal window</b></big>\nThe output of the model will be displayed in this window, watch this screen for debugging and convergence information."])

		if self.tabText(self.currentIndex()).strip()==_("Information"):
			help_window().help_set_help(["help.png","<big><b>On-line help</b></big>\nYou can view the on-line help and manual here."])
	def changed_click(self):
		if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("Electrical parameters"):
			help_window().help_set_help(["tab.png",_("<big><b>Electrical parameters</b></big><br>Use this tab to configure the electrical parameters for the material.")])

		if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("Luminescence"):
			help_window().help_set_help(["tab.png",_("<big><b>Luminescence</b></big><br>Use this tab to edit the materials Luminescence.")])
Beispiel #59
0
	def change_dir_and_refresh_interface(self,new_dir):
		scan_items_clear()
		os.chdir(new_dir)
		calculate_paths()
		epitaxy_load()
		contacts_load()
		mesh_load_all()

		#print "rod",os.getcwd(),new_dir
		self.statusBar().showMessage(os.getcwd())
		#self.plot_open.setEnabled(False)

		#self.notebook.set_item_factory(self.item_factory)
		if self.notebook.load()==True:
			self.sim_mode_button.update()
			#self.ti_light.connect('refresh', self.notebook.main_tab.update)
			self.run.setEnabled(True)
			self.stop.setEnabled(True)
			self.examine.setEnabled(True)
			self.param_scan.setEnabled(True)
			self.plot_select.setEnabled(True)
			self.undo.setEnabled(True)
			self.jv_button.setEnabled(True)
			self.laser_button.setEnabled(True)
			self.tb_time_domain.setEnabled(True)
			#self.save_sim.setEnabled(True)
			self.experiment_window_button.setEnabled(True)
			self.light_button.setEnabled(True)
			self.light_button.update()
			help_window().help_set_help(["play.png",_("<big><b>Now run the simulation</b></big><br> Click on the play icon to start a simulation.")])

			self.menu_new_optical_material.setEnabled(True)
			self.menu_export_data.setEnabled(True)
			self.menu_import_data.setEnabled(True)
			self.menu_import_lib.setEnabled(True)
			self.menu_run.setEnabled(True)
			self.menu_stop.setEnabled(True)
			self.menu_scan.setEnabled(True)
			self.menu_configure.setEnabled(True)
			self.sim_mode_button.setEnabled(True)
			if enable_betafeatures()==True:
				self.tb_run_fit.setEnabled(True)
				self.qe_button.setEnabled(True)
		else:
			self.run.setEnabled(False)
			self.stop.setEnabled(False)
			self.examine.setEnabled(False)
			self.param_scan.setEnabled(False)
			self.plot_select.setEnabled(False)
			self.undo.setEnabled(False)
			self.jv_button.setEnabled(False)
			#self.save_sim.setEnabled(False)
			self.experiment_window_button.setEnabled(False)

			self.laser_button.setEnabled(False)
			self.tb_time_domain.setEnabled(False)
			self.sim_mode_button.setEnabled(False)
			self.light_button.setEnabled(False)

			help_window().help_set_help(["icon.png",_("<big><b>Hi!</b></big><br> I'm the on-line help system :).  If you find any bugs please report them to [email protected]."),"new.png",_("Click on the new icon to make a new simulation directory.")])

			self.menu_new_optical_material.setEnabled(False)
			self.menu_export_data.setEnabled(False)
			self.menu_import_data.setEnabled(False)
			self.menu_import_lib.setEnabled(False)
			self.menu_run.setEnabled(False)
			self.menu_stop.setEnabled(False)
			self.menu_scan.setEnabled(False)
			self.menu_configure.setEnabled(False)
			if enable_betafeatures()==True:
				self.tb_run_fit.setEnabled(False)
				self.qe_button.setEnabled(False)

		if self.notebook.terminal!=None:
			self.my_server.set_terminal(self.notebook.terminal)

		#self.plotted_graphs.init(os.getcwd(),self.callback_last_menu_click)

		#set_active_name(self.light, inp_get_token_value("light.inp", "#Psun"))

		scan_item_add("sim.inp","#simmode","sim mode",1)
		scan_item_add("light.inp","#Psun","light intensity",1)
		#scan_populate_from_file("light.inp")

		if self.scan_window!=None:
			del self.scan_window
			self.scan_window=None

		if self.experiment_window!=None:
			del self.experiment_window
			self.experiment_window=None

		if self.fxexperiment_window!=None:
			del self.fxexperiment_window
			self.fxexperiment_window=None

		if self.jvexperiment_window!=None:
			del self.jvexperiment_window
			self.jvexperiment_window=None

		if self.sim_info_window!=None:
			del self.sim_info_window
			self.sim_info_window=None

		if self.fit_window!=None:
			del self.fit_window
			self.fit_window=None

		if self.lasers_window!=None:
			del self.lasers_window
			self.lasers_window=None

		if self.config_window!=None:
			del self.config_window
			self.config_window=None

		if self.qe_window!=None:
			del self.qe_window
			self.qe_window=None
Beispiel #60
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.")])