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()
def __init__(self): QToolBar.__init__(self) self.doping_window = None self.cost_window = None self.parasitic = None self.contacts_window = None self.parasitic_window = None self.layer_editor = None self.dim_editor = None self.electrical_editor = None self.emission_editor = None self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setOrientation(Qt.Vertical) self.setIconSize(QSize(42, 42)) self.tb_layer_editor = QAction_lock("layers", _("Layer\neditor"), self, "ribbon_device_layers") self.tb_layer_editor.clicked.connect(self.callback_layer_editor) self.addAction(self.tb_layer_editor) global_object_register("show_layer_editor", self.callback_layer_editor) self.contacts = QAction_lock("contact", _("Contacts"), self, "ribbon_device_contacts") self.contacts.clicked.connect(self.callback_contacts) self.addAction(self.contacts) self.doping = QAction_lock("doping", _("Doping/\nIons"), self, "ribbon_device_doping") self.doping.clicked.connect(self.callback_doping) self.addAction(self.doping) self.parasitic = QAction_lock("parasitic", _("Parasitic\n components"), self, "ribbon_device_parasitic") self.parasitic.clicked.connect(self.callback_parasitic) self.addAction(self.parasitic) self.tb_electrical_editor = QAction_lock("electrical", _("Electrical\nparameters"), self, "ribbon_device_electrical") self.tb_electrical_editor.clicked.connect( self.callback_electrical_editor) self.addAction(self.tb_electrical_editor) self.tb_emission_editor = QAction_lock("emission", _("Emission\nparameters"), self, "ribbon_device_emission") self.tb_emission_editor.clicked.connect(self.callback_emission_editor) self.addAction(self.tb_emission_editor) self.tb_dimension_editor = QAction_lock("dimensions", _("xz-size"), self, "ribbon_device_dim") self.tb_dimension_editor.clicked.connect( self.callback_dimension_editor) self.addAction(self.tb_dimension_editor) get_watch().add_call_back("diagram.inp", self.callback_circuit_diagram) self.callback_circuit_diagram()
def __init__(self, file_name): QWidget.__init__(self) self.editable = True self.icon_file = "" self.widget_list = [] self.scroll = QScrollArea() self.main_box_widget = QWidget() self.vbox = QVBoxLayout() self.hbox = QHBoxLayout() self.hbox.setAlignment(Qt.AlignTop) self.file_name = file_name self.tab = inp_viewer() self.tab.file_name = file_name self.vbox.addWidget(self.tab) self.f = inp() self.f.load(self.file_name) #if self.lines==False: # error_dlg(self,_("File not found.")+" "+filename) # return self.tab.populate(self.f.lines) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.vbox.addWidget(spacer) self.main_box_widget.setLayout(self.vbox) self.scroll.setWidgetResizable(True) self.scroll.setWidget(self.main_box_widget) self.icon_widget = QWidget() self.icon_widget_vbox = QVBoxLayout() self.icon_widget.setLayout(self.icon_widget_vbox) if self.icon_file != "": self.image = QLabel() icon = icon_get(self.icon_file) self.image.setPixmap(icon.pixmap(icon.actualSize(QSize(32, 32)))) self.icon_widget_vbox.addWidget(self.image) spacer2 = QWidget() spacer2.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding) self.icon_widget_vbox.addWidget(spacer2) self.hbox.addWidget(self.icon_widget) self.hbox.addWidget(self.scroll) self.setLayout(self.hbox) self.tab.changed.connect(self.callback_edit) get_watch().add_call_back(self.file_name, self.update)
def __init__(self): QToolBar.__init__(self) self.electrical_mesh=None self.doping_window=None self.electrical_editor=None self.setToolButtonStyle( Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.doping = QAction_lock("doping", _("Doping/\nIons"), self,"ribbon_device_doping") self.doping.clicked.connect(self.callback_doping) self.addAction(self.doping) self.mesh = QAction_lock("mesh", _("Electrical\nmesh"), self,"ribbon_config_mesh") self.mesh.triggered.connect(self.callback_edit_mesh) self.addAction(self.mesh) self.tb_electrical_editor = QAction_lock("electrical", _("Electrical\nparameters"), self,"ribbon_device_electrical") self.tb_electrical_editor.clicked.connect(self.callback_electrical_editor) self.addAction(self.tb_electrical_editor) get_watch().add_call_back("diagram.inp",self.callback_circuit_diagram) get_watch().add_call_back("math.inp",self.callback_circuit_diagram) self.callback_circuit_diagram()
def __init__(self, xyz): self.xyz = xyz QGroupBox.__init__(self) rcParams.update({'figure.autolayout': True}) self.setTitle(self.xyz) self.setStyleSheet("QGroupBox { border: 1px solid gray;}") vbox = QVBoxLayout() self.setLayout(vbox) self.toolbar = QToolBar() self.toolbar.setIconSize(QSize(32, 32)) vbox.addWidget(self.toolbar) self.tab = gpvdm_tab(toolbar=self.toolbar) self.tab.tb_add.triggered.connect(self.on_add_mesh_clicked) self.tab.tb_down.triggered.connect(self.on_move_down) self.tab.tb_up.triggered.connect(self.on_move_up) self.tab.user_remove_rows.connect(self.callback_remove_rows) self.tab.resizeColumnsToContents() self.tab.verticalHeader().setVisible(False) self.tab.clear() self.tab.setColumnCount(4) self.tab.setSelectionBehavior(QAbstractItemView.SelectRows) self.tab.cellChanged.connect(self.tab_changed) vbox.addWidget(self.tab) self.fig = Figure(figsize=(5, 2), dpi=100) self.canvas = FigureCanvas(self.fig) self.canvas.figure.patch.set_facecolor('white') self.fig.subplots_adjust(bottom=0.2) self.fig.subplots_adjust(left=0.1) self.ax1 = self.fig.add_subplot(111) self.ax1.ticklabel_format(useOffset=False) vbox.addWidget(self.canvas) if self.xyz == "y": self.mesh = get_mesh().y get_watch().add_call_back("mesh_y.inp", self.load) elif self.xyz == "x": self.mesh = get_mesh().x get_watch().add_call_back("mesh_x.inp", self.load) elif self.xyz == "z": self.mesh = get_mesh().z get_watch().add_call_back("mesh_z.inp", self.load) if self.mesh.circuit_model == True: self.tab.tb_add.setEnabled(False) self.tab.tb_remove.setEnabled(False) self.tab.tb_down.setEnabled(False) self.tab.tb_up.setEnabled(False) self.tab.setEnabled(False) self.load()
def initializeGL(self): self.load_data() #try: glClearDepth(1.0) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) glBlendFunc(GL_SRC_ALPHA, GL_ONE) #GL_ONE_MINUS_SRC_ALPHA glEnable(GL_BLEND) glShadeModel(GL_SMOOTH) #lightZeroPosition = [0, 0, -10, 1.0] #lightZeroColor = [1.0, 1.0, 1.0, 1.0] #glLightfv(GL_LIGHT1, GL_POSITION, lightZeroPosition) #glLightfv(GL_LIGHT1, GL_DIFFUSE, lightZeroColor) #glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 0.1) #glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.05) #glEnable(GL_LIGHT1) #lightZeroPosition = [10, 10, 0, 1.0] #lightZeroColor = [1.0, 1.0, 1.0, 1.0] #glLightfv(GL_LIGHT2, GL_POSITION, lightZeroPosition) #glLightfv(GL_LIGHT2, GL_DIFFUSE, lightZeroColor) #glLightf(GL_LIGHT2, GL_CONSTANT_ATTENUATION, 0.1) #glLightf(GL_LIGHT2, GL_LINEAR_ATTENUATION, 0.05) #glEnable(GL_LIGHT2) #GL_DIFFUSE #glEnable(GL_FOG); #fogColor = [0.5, 0.5, 0.5, 1.0]; #glFogi (GL_FOG_MODE, GL_EXP); #glFogfv (GL_FOG_COLOR, fogColor); #glFogf (GL_FOG_DENSITY, 0.35); #glHint (GL_FOG_HINT, GL_DONT_CARE); #glFogf (GL_FOG_START, 1.0); #glFogf (GL_FOG_END, 5.0); #self.tex = self.read_texture('/home/rod/images/image.jpg') glViewport(0, 0, self.width(), self.height() + 100) glMatrixMode(GL_PROJECTION) glLoadIdentity() #glScalef(1.0, 1.0, -1.0) gluPerspective(45.0, float(self.width()) / float(self.height() + 100), 0.1, 1000.0) glMatrixMode(GL_MODELVIEW) glEnable(GL_POLYGON_SMOOTH) #glEnable(GL_MULTISAMPLE) #self.resizeEvent.connect(self.resize) if self.lit == True: for l in self.lights: glEnable(GL_LIGHTING) lightZeroColor = [1.0, 1.0, 1.0, 1.0] #print(l.number,GL_LIGHT1) glLightfv(l.number, GL_POSITION, [l.xyz[0], -l.xyz[1], -l.xyz[2]]) glLightfv(l.number, GL_DIFFUSE, lightZeroColor) #glLightfv(l.number, GL_SPOT_DIRECTION, [ 1,1,1]); glLightf(l.number, GL_CONSTANT_ATTENUATION, 0.1) glLightf(l.number, GL_LINEAR_ATTENUATION, 0.05) glEnable(l.number) self.failed = False global_object_register("gl_force_redraw", self.force_redraw) get_watch().add_call_back("light.inp", self.force_redraw) get_epi().add_callback(self.force_redraw)
def __init__(self, file_name): QWidget.__init__(self) self.dos_file = file_name self.dos_dir = os.path.join(get_sim_path(), file_name[:-4]) if os.path.isdir(self.dos_dir) == False: os.mkdir(self.dos_dir) ext = file_name[3:] self.lumo_file = "lumo" + ext self.homo_file = "h**o" + ext self.setWindowTitle(_("Complex Density of states editor - gpvdm")) self.setWindowIcon(icon_get("electrical")) self.setMinimumSize(1400, 500) edit_boxes = QWidget() vbox = QVBoxLayout() self.lumo = equation_editor("lumo" + ext, "LUMO") vbox.addWidget(self.lumo) self.h**o = equation_editor("h**o" + ext, "H**O") vbox.addWidget(self.h**o) self.plot = plot_widget(enable_toolbar=False) self.plot.set_labels( [_("LUMO"), _("H**O"), _("LUMO numerical"), _("H**O numerical")]) self.gen_mesh() edit_boxes.setLayout(vbox) hbox = QHBoxLayout() self.plot.do_plot() #self.plot.do_plot() hbox.addWidget(self.plot) hbox.addWidget(edit_boxes) self.ribbon = ribbon_complex_dos() self.ribbon.tb_save.triggered.connect(self.callback_save) self.ribbon.tb_trap_depth.triggered.connect(self.callback_trap_depth) self.main_layout_widget = QWidget() self.main_layout_widget.setLayout(hbox) self.big_vbox = QVBoxLayout() self.big_vbox.addWidget(self.ribbon) self.big_vbox.addWidget(self.main_layout_widget) self.setLayout(self.big_vbox) self.lumo.changed.connect(self.update_graph) self.h**o.changed.connect(self.update_graph) get_watch().add_call_back(self.dos_file, self.update_graph) get_watch().add_call_back(self.lumo_file, self.lumo.load) get_watch().add_call_back(self.homo_file, self.h**o.load)
def __init__(self): QWidgetSavePos.__init__(self, "doping") self.setMinimumSize(900, 600) self.setWindowIcon(icon_get("doping")) self.setWindowTitle( _("Doping/Mobilie ion profile editor") + " (https://www.gpvdm.com)") self.epi = get_epi() self.main_vbox = QVBoxLayout() toolbar = QToolBar() toolbar.setIconSize(QSize(48, 48)) self.save = QAction(icon_get("document-save-as"), _("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(icon_get("help"), _("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 = gpvdm_tab() self.tab.resizeColumnsToContents() self.tab.verticalHeader().setVisible(False) self.tab.clear() self.tab.setColumnCount(6) self.tab.setSelectionBehavior(QAbstractItemView.SelectRows) self.load() self.build_mesh() self.tab.cellChanged.connect(self.tab_changed) self.tab.setColumnWidth(2, 150) self.tab.setColumnWidth(3, 150) self.tab.setColumnWidth(4, 180) self.tab.setColumnWidth(5, 180) self.main_vbox.addWidget(self.tab) self.draw_graph() self.setLayout(self.main_vbox) layers = epitaxy_get_layers() for i in range(0, layers): dos_file = epitaxy_get_dos_file(i) + ".inp" if dos_file.startswith("dos") == True: get_watch().add_call_back(dos_file, self.load) return