Example #1
0
    def change_dir_and_refresh_interface(self, new_dir):
        used_files_add(os.path.join(new_dir, "sim.gpvdm"))
        self.scan_human_labels.clear()
        inp_callbacks_clear()
        get_watch().reset()
        self.splash.inc_value()

        self.scan_human_labels.populate_from_known_tokens()
        self.splash.inc_value()

        self.splash.inc_value()

        set_sim_path(new_dir)
        self.splash.inc_value()

        calculate_paths()
        self.splash.inc_value()

        epi = get_epi()
        epi.load(get_sim_path())
        self.splash.inc_value()

        self.splash.inc_value()

        if get_mesh().load(epi) == False:
            error_dlg(
                self,
                _("There was a problem loading the electrical mesh, I suspect you are trying to open a file generated in a very old version of gpvdm."
                  ))
            return

        self.statusBar().showMessage(get_sim_path())
        self.splash.inc_value()

        self.notebook.load()

        self.update_interface()
        self.enable_disable_buttons()

        self.splash.inc_value()

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

        if self.notebook.update_display_function != None:
            self.my_server.set_display_function(
                self.notebook.update_display_function)

        self.scan_human_labels.add_item("sim.inp", "#simmode", "sim mode")
        self.scan_human_labels.add_item("light.inp", "#Psun",
                                        "light intensity")
        #scan_populate_from_file("light.inp")

        self.ribbon.update()
        self.splash.inc_value()

        if self.notebook.is_loaded() == True:
            self.l.run()
            self.notebook.tab_main.three_d.update()
        get_watch().rebase()
Example #2
0
    def change_dir_and_refresh_interface(self, new_dir):
        scan_items_clear()
        self.splash.inc_value()

        scan_items_populate_from_known_tokens()
        self.splash.inc_value()

        self.splash.inc_value()

        set_sim_path(new_dir)
        self.splash.inc_value()

        calculate_paths()
        self.splash.inc_value()

        epitaxy_load(get_sim_path())
        self.splash.inc_value()

        contacts_load()
        self.splash.inc_value()

        if mesh_load_all() == False:
            error_dlg(
                self,
                _("There was a problem loading the electrical mesh, I suspect you are trying to open a file generated in a very old version of gpvdm."
                  ))
            return

        self.statusBar().showMessage(get_sim_path())
        self.splash.inc_value()

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

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

        if self.notebook.update_display_function != None:
            self.my_server.set_display_function(
                self.notebook.update_display_function)

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

        self.ribbon.update()
        self.splash.inc_value()
Example #3
0
## @package gpvdm_api
#  An api used to run gpvdm
#

#import sys
import os
import sys
import shutil
from shutil import copyfile
from cal_path import calculate_paths
from cal_path import calculate_paths_init
from cal_path import set_sim_path

calculate_paths_init()
calculate_paths()

from server import base_server
from server import server_get
from cal_path import get_sim_path
from progress_class import progress_class
from spectral2 import spectral2
from inp import inp_update_token_value
from inp import inp_get_token_value
from inp import inp

#scan
from scan_io import scan_build_nested_simulation
from scan_io import scan_io
from scans_io import scans_io
Example #4
0
	def change_dir_and_refresh_interface(self,new_dir):
		print "rod",os.getcwd(),new_dir
 		scan_items_clear()
		os.chdir(new_dir)
		calculate_paths()
		epitaxy_load()
		self.config.load(os.getcwd())
		print "rod",os.getcwd(),new_dir
		self.status_bar.push(self.context_id, os.getcwd())
		#self.plot_open.set_sensitive(False)

		self.notebook.set_item_factory(self.item_factory)
		if self.notebook.load()==True:
			self.sim_mode.update()
			self.ti_light.connect('refresh', self.notebook.main_tab.update)
			self.play.set_sensitive(True)
			self.stop.set_sensitive(True)
			self.examine.set_sensitive(True)
			self.param_scan.set_sensitive(True)
			self.plot_select.set_sensitive(True)
			self.undo.set_sensitive(True)
			#self.save_sim.set_sensitive(True)
			self.experiment_window_button.set_sensitive(True)
			my_help_class.help_set_help(["play.png",_("<big><b>Now run the simulation</b></big>\n Click on the play icon to start a simulation.")])

			my_item=self.item_factory.get_item(_("/File/Import data"))
			if my_item!=None:
				my_item.set_sensitive(True)
			my_item=self.item_factory.get_item(_("/File/Export data"))
			if my_item!=None:
				my_item.set_sensitive(True)
			my_item=self.item_factory.get_item(_("/File/Import data"))
			if my_item!=None:
				my_item.set_sensitive(True)
			my_item=self.item_factory.get_item(_("/File/Import from library"))
			if my_item!=None:
				my_item.set_sensitive(True)
			my_item=self.item_factory.get_item(_("/Simulate/Run"))
			if my_item!=None:
				my_item.set_sensitive(True)
			my_item=self.item_factory.get_item(_("/Simulate/Parameter scan"))
			if my_item!=None:
				my_item.set_sensitive(True)

		else:
			self.play.set_sensitive(False)
			self.stop.set_sensitive(False)
			self.examine.set_sensitive(False)
			self.param_scan.set_sensitive(False)
			self.plot_select.set_sensitive(False)
			self.undo.set_sensitive(False)
			#self.save_sim.set_sensitive(False)
			self.experiment_window_button.set_sensitive(False)
			my_help_class.help_set_help(["icon.png",_("<big><b>Hi!</b></big>\n 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.")])

			my_item=self.item_factory.get_item(_("/File/Import data"))
			if my_item!=None:
				my_item.set_sensitive(False)
			my_item=self.item_factory.get_item(_("/File/Export data"))
			if my_item!=None:
				my_item.set_sensitive(False)
			my_item=self.item_factory.get_item(_("/File/Import data"))
			if my_item!=None:
				my_item.set_sensitive(False)
			my_item=self.item_factory.get_item(_("/File/Import from library"))
			if my_item!=None:
				my_item.set_sensitive(False)
			my_item=self.item_factory.get_item(_("/Simulate/Run"))
			if my_item!=None:
				my_item.set_sensitive(False)
			my_item=self.item_factory.get_item(_("/Simulate/Parameter scan"))
			if my_item!=None:
				my_item.set_sensitive(False)

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

		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)


		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.qe_window!=None:
			del self.qe_window
			self.qe_window=None
Example #5
0
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.



import sys

lib_dir='/usr/lib64/opvdm/'
sys.path.append('./gui/')
sys.path.append(lib_dir)

from win_lin import running_on_linux
from cal_path import get_exe_command
from cal_path import get_exe_name
from cal_path import get_image_file_path
from cal_path import calculate_paths
calculate_paths()

import i18n
_ = i18n.language.gettext

from ver import ver_load_info
from ver import ver_error
ver_load_info()

from command_args import command_args
command_args(len(sys.argv),sys.argv)


import pdb
import pygtk
import gtk
Example #6
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