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.")]) self.ribbon.tb_save.setEnabled(False) self.ribbon.import_data.setEnabled(False) 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.")]) self.ribbon.tb_save.setEnabled(False) self.ribbon.import_data.setEnabled(False) if self.notebook.tabText(self.notebook.currentIndex()).strip()==_("Absorption"): text=get_ref_text(os.path.join(self.path,"alpha.ref")) if text==None: text="" help_window().help_set_help(["alpha.png",_("<big><b>Absorption</b></big><br>"+text)]) self.ribbon.tb_save.setEnabled(True) self.ribbon.import_data.setEnabled(True) 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)]) self.ribbon.tb_save.setEnabled(True) self.ribbon.import_data.setEnabled(True)
def draw_graph(self): self.fig.clf() 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) self.ax1.set_ylabel(self.ylabel) if self.x != None: x_nm = [x * 1e9 for x in self.x] frequency, = self.ax1.plot(x_nm, self.y, 'ro-', linewidth=3, alpha=1.0) if os.path.isfile(os.path.join(self.path, self.exp_file)) == True: dat_file_read(self.data, os.path.join(self.path, self.exp_file)) title = get_ref_text(os.path.join(self.path, self.exp_file), html=False) if title != None: self.fig.suptitle(title) x_nm = [x * 1e9 for x in self.data.y_scale] frequency, = self.ax1.plot(x_nm, self.data.data[0][0], 'bo-', linewidth=3, alpha=1.0) self.ax1.set_xlabel(_("Wavelength") + " (nm)")
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)])
def fill_store(self): self.materials.clear() print(get_materials_path()) all_files = find_materials() for fl in all_files: text = get_ref_text(os.path.join(get_materials_path(), fl, "n.omat"), html=False) if text != None: itm = QListWidgetItem(os.path.basename(fl) + " " + text) itm.setIcon(self.mat_icon) itm.setToolTip(text) self.materials.addItem(itm)
def on_selection_changed(self): if len(self.selectedItems()) > 0: item = self.selectedItems()[0] if type(item) != None: file_name = self.decode_name(item.text()) if file_name == None: return self.file_path = os.path.join(self.path, file_name) return if (file_name.endswith(".dat") == True): state = dat_file() 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.data_label + " (" + latex_to_html( state.data_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 = dat_file() 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(["folder.png", summary]) if os.path.isdir(full_path) == True: if os.path.isfile(os.path.join(full_path, "mat.inp")): summary = "<b><big>" + file_name + "</b></big><br>" ref_path = os.path.join(full_path, "n.ref") ref = get_ref_text(ref_path) if ref != None: summary = summary + ref help_window().help_set_help(["organic_material", summary])