Example #1
0
	def __init__(self):
		QWidget.__init__(self)
		self.sun=1
		hbox=QHBoxLayout(self)
		mainLayout = QSplitter(Qt.Horizontal)
       # splitter1 = QtGui.QSplitter(QtCore.Qt.Horizontal)
		self.three_d=display_widget()
		self.three_d.show()

		self.frame=layer_widget()

		self.frame.changed.connect(self.three_d.recalculate)
		
		mainLayout.addWidget(self.frame)
		mainLayout.addWidget(self.three_d)
		hbox.addWidget(mainLayout)
		
		self.setLayout(hbox)

		if enable_webupdates()==True:
			print("Looking for updates")
			self.web_update=update_thread()
			self.web_update.got_data.connect(self.got_help)
			self.web_update.start()
		self.frame.tab.itemSelectionChanged.connect(self.layer_selection_changed)
Example #2
0
    def __init__(self):
        QWidget.__init__(self)
        self.sun = 1
        hbox = QHBoxLayout(self)
        mainLayout = QSplitter(Qt.Horizontal)
        #splitter1 = QtGui.QSplitter(QtCore.Qt.Horizontal)
        self.three_d = display_widget()
        #self.three_d.show()

        self.frame = ribbon_device()

        mainLayout.addWidget(self.frame)
        self.frame.setMinimumSize(100, 0)
        mainLayout.addWidget(self.three_d)
        mainLayout.setStretchFactor(1, 1)
        hbox.addWidget(mainLayout)

        self.setLayout(hbox)

        if enable_webupdates() == True:
            print("Looking for updates")
            self.web_update = update_thread()
            self.web_update.got_data.connect(self.got_help)
            self.web_update.start()
Example #3
0
	def __init__(self):
		self.undo_list=undo_list_class()
		super(gpvdm_main_window,self).__init__()
		self.setGeometry(200, 100, 1300, 600)
		self.setWindowTitle(_("General-purpose Photovoltaic Device Model (www.gpvdm.com)"))

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

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

		#self.show()

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

		self.notebook=gpvdm_notebook()
		self.setCentralWidget(self.notebook)
		self.show()

		self.statusBar()

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

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

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



		self.experiment_window=None

		self.fxexperiment_window=None

		self.jvexperiment_window=None

		self.fit_window=None

		self.config_window=None

		self.qe_window=None

		self.lasers_window=None

		self.sim_info_window=None

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

		self.show_tabs = True
		self.show_border = True

		menubar = self.menuBar()


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

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

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

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

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

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

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

		simulation_menu = menubar.addMenu('&Simulation')

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

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

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

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


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


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


		help_menu = menubar.addMenu('Help')

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

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

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

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




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


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

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


		toolbar.addSeparator()

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


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

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

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


		toolbar.addSeparator()

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


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


		toolbar.addSeparator()


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

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

		toolbar.addSeparator()

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


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


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

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


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


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



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


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



#		self.menubar.show()

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



#		self.window.show()

#		process_events()

		self.show()
		
		self.light_button.changed.connect(self.notebook.update)