예제 #1
0
    def __init__(self, mainwindow, cell):

        tk.Toplevel.__init__(self, mainwindow)

        self.main_frame = tkinter.ttk.Frame(self)
        self.main_frame.grid(sticky='nsew')
        self.mainwindow = mainwindow
        self.project = self.mainwindow.projects[self.mainwindow.currentprojectid]
        self.bfpp = cell.bfpp
        self.cell = cell
        
        self.title(self.cell.treetitle + ' Band Fit Window')
        
        # -------------------------------------------------- VARIABLES -------------------------------------------------
        self.label1 = tk.Label(self.main_frame, text='Band fit parameters', font='-weight bold')
        self.band_frame = tkinter.ttk.LabelFrame(self.main_frame, labelwidget=self.label1)
        self.band_frame.grid(row=2, column=0, pady=3, sticky='nsew')
        
        self.hs_kpoints_var = tk.StringVar(value=','.join(self.bfpp.hs_kpoints_names))

        # High Symmetry K-points
        hs_kpoints_frame = tkinter.ttk.Frame(self.band_frame)
        hs_kpoints_frame.grid(pady=3, sticky='nsew')
        tkinter.ttk.Label(hs_kpoints_frame, text='High symmetry K-points (comma-separated)').grid(sticky='nsew')
        tkinter.ttk.Entry(hs_kpoints_frame, textvariable=self.hs_kpoints_var, width=20).grid(sticky='nsew')

        # Energy range
        self.vbm_range = tu.RangeFrame(self.band_frame, self.bfpp.bands_fit['VBM'].xfitmin, self.bfpp.bands_fit['VBM'].xfitmax, 'VBM fit range', '', width=6)
        self.vbm_range.grid(sticky='nsew')
        self.cbm_range = tu.RangeFrame(self.band_frame, self.bfpp.bands_fit['CBM'].xfitmin, self.bfpp.bands_fit['CBM'].xfitmax, 'CBM fit range', '', width=6)
        self.cbm_range.grid(sticky='nsew')
        
        # ---------------------------------------------- DISPLAY PARAMS ------------------------------------------------
        
        self.display_param = tu.DisplayParametersFrame(self.main_frame, 'High-symmetry K-points', 'Energy', self.bfpp)
        self.display_param.frame.grid(row=3, column=0, pady=3, sticky='nsew')

        # --------------------------------------------------- BUTTONS --------------------------------------------------

        buttons_frame = tkinter.ttk.Frame(self.main_frame)
        buttons_frame.grid(pady=3, sticky='nsew')

        tkinter.ttk.Button(buttons_frame, text='Apply', command=self.save).grid(row=0, column=0, padx=5)
        tkinter.ttk.Button(buttons_frame, text='OK', command=lambda: self.save(close=True)).grid(row=0, column=1, padx=5)
        tkinter.ttk.Button(buttons_frame, text='Cancel', command=self.destroy).grid(row=0, column=2, padx=5)
예제 #2
0
    def __init__(self, mainwindow, material_study):

        tk.Toplevel.__init__(self, mainwindow)

        self.mainwindow = mainwindow

        self.material_study = material_study

        self.cpp = material_study.cpp

        self.main_frame = ttk.Frame(self)
        self.main_frame.grid(sticky='nsew')
        self.main_frame.grid_columnconfigure(0, weight=1)
        self.title(material_study.treetitle +
                   ' Defect Concentrations Plot Parameters Window')

        # --------------------------------------------- EFFECTIVE MASSE --------------------------------------------------

        label0 = tk.Label(self.main_frame,
                          text='Charge Carriers Effective Masses',
                          font='-weight bold')
        masses_frame = ttk.LabelFrame(self.main_frame, labelwidget=label0)
        masses_frame.grid(sticky='nsew')

        self.m_e_entry = tu.QuantityEntry(masses_frame,
                                          'Electrons effective mass',
                                          self.cpp.m_e,
                                          ' me',
                                          width=5)
        self.m_e_entry.pack(padx=5, pady=5)
        self.m_h_entry = tu.QuantityEntry(masses_frame,
                                          'Holes effective mass',
                                          self.cpp.m_h,
                                          ' me',
                                          width=5)
        self.m_h_entry.pack(padx=5, pady=5)

        # --------------------------------------------- TEMPERATURES --------------------------------------------------

        label1 = tk.Label(self.main_frame,
                          text='Temperatures',
                          font='-weight bold')
        temperature_frame = ttk.LabelFrame(self.main_frame, labelwidget=label1)
        temperature_frame.grid()

        tk.Label(temperature_frame,
                 text='Ambiant Temperature (fixed) ').grid(row=0, column=0)
        self.cte_temp = tu.QuantityEntry(temperature_frame,
                                         '',
                                         self.cpp.temperature,
                                         'K',
                                         width=7)
        self.cte_temp.grid(row=0, column=1)

        self.temp_range = tu.RangeFrame(temperature_frame,
                                        self.cpp.xmin,
                                        self.cpp.xmax,
                                        'Growth Temperature',
                                        'K',
                                        step=self.cpp.dt,
                                        width=7)
        self.temp_range.grid(row=1, column=0, columnspan=2, pady=5, padx=5)

        # --------------------------------------------- SPECIFIC OPTIONS --------------------------------------------------
        self.charge_carriers_var = tk.BooleanVar(
            value=self.cpp.charge_carriers)
        self.fill_type_var = tk.IntVar(value=self.cpp.fill_type)

        label11 = tk.Label(self.main_frame,
                           text='Specific options',
                           font='-weight bold')
        options_frame = ttk.LabelFrame(self.main_frame, labelwidget=label11)
        options_frame.grid(sticky='nsew')

        # Display charge carriers
        ttk.Checkbutton(
            options_frame,
            text='Display charge carriers concentrations ',
            variable=self.charge_carriers_var,
            command=self.set_display_charge_carriers).pack(side='left')
        # Fill conductivity type
        ttk.Checkbutton(options_frame,
                        text='Fill conductivity type ',
                        variable=self.fill_type_var,
                        command=self.set_fill_type).pack(side='left')

        # ---------------------------------------------- DISPLAY PARAMS ------------------------------------------------

        self.display_param = tu.DisplayParametersFrame(
            self.main_frame, 'Growth Temperature', 'Defect Concentrations',
            self.cpp)
        self.display_param.frame.grid(row=3, column=0, pady=3, sticky='nsew')

        # ---------------------------------------------- COLORS ------------------------------------------------
        self.label2 = tk.Label(self.main_frame,
                               text='Colors',
                               font='-weight bold')
        self.colors_pane = ttk.LabelFrame(self.main_frame,
                                          labelwidget=self.label2)
        self.colors = {}
        self.labels = {}
        self.index = 0

        def title(key):
            if key in ['n (electrons)', 'n (holes)', 'n type', 'p type']:
                return key
            else:
                return self.material_study.defect_studies[key].treetitle

        sort_list = [[key, title(key)] for key in self.cpp.colors.keys()]
        sort_list.sort(key=lambda x: x[1])

        for key, treetitle in sort_list:
            if key in self.cpp.data_id or (key in ['n type', 'p type']
                                           and self.cpp.fill_type):
                self.colors[key] = tk.Button(
                    self.colors_pane,
                    text='\t\t',
                    bg=self.cpp.colors[key],
                    command=lambda port=key: self.set_color(port))
                self.colors[key].grid(row=self.index, column=0, sticky='w')
                self.labels[key] = tk.Label(self.colors_pane, text=treetitle)
                self.labels[key].grid(row=self.index, column=1, sticky='w')
                self.index += 1

        self.colors_pane.grid(row=4, column=0, pady=3, sticky='nsew')

        # --------------------------------------------------- BUTTONS --------------------------------------------------

        buttons_frame = ttk.Frame(self.main_frame)
        buttons_frame.grid(row=5, column=0, pady=3, sticky='nsew')

        ttk.Button(buttons_frame, text='Apply',
                   command=self.save).grid(row=0, column=0, padx=5)
        ttk.Button(buttons_frame,
                   text='OK',
                   command=lambda: self.save(close=True)).grid(row=0,
                                                               column=1,
                                                               padx=5)
        ttk.Button(buttons_frame, text='Cancel',
                   command=self.destroy).grid(row=0, column=2, padx=5)
예제 #3
0
    def __init__(self, mainwindow, material_study):

        tk.Toplevel.__init__(self, mainwindow)

        self.mainwindow = mainwindow

        self.material_study = material_study

        self.eftpp = material_study.eftpp

        self.main_frame = ttk.Frame(self)
        self.main_frame.grid(sticky='nsew')
        self.main_frame.grid_columnconfigure(0, weight=1)
        self.title(material_study.treetitle +
                   ' Fermi Level Variations Plot Parameters Window')

        # --------------------------------------------- EFFECTIVE MASSE --------------------------------------------------

        label0 = tk.Label(self.main_frame,
                          text='Charge Carriers Effective Masses',
                          font='-weight bold')
        masses_frame = ttk.LabelFrame(self.main_frame, labelwidget=label0)
        masses_frame.grid(sticky='nsew')

        self.m_e_entry = tu.QuantityEntry(masses_frame,
                                          'Electrons effective mass',
                                          self.eftpp.m_e,
                                          ' me',
                                          width=5)
        self.m_e_entry.pack(padx=5, pady=5)
        self.m_h_entry = tu.QuantityEntry(masses_frame,
                                          'Holes effective mass',
                                          self.eftpp.m_h,
                                          ' me',
                                          width=5)
        self.m_h_entry.pack(padx=5, pady=5)

        # --------------------------------------------- TEMPERATURES --------------------------------------------------

        label1 = tk.Label(self.main_frame,
                          text='Temperatures',
                          font='-weight bold')
        temperature_frame = ttk.LabelFrame(self.main_frame, labelwidget=label1)
        temperature_frame.grid()

        tk.Label(temperature_frame,
                 text='Growth Temperature (fixed) ').grid(row=0, column=0)
        self.cte_temp = tu.QuantityEntry(temperature_frame,
                                         '',
                                         self.eftpp.temperature,
                                         'K',
                                         width=7)
        self.cte_temp.grid(row=0, column=1)

        self.temp_range = tu.RangeFrame(temperature_frame,
                                        self.eftpp.xmin,
                                        self.eftpp.xmax,
                                        'Ambiant Temperature',
                                        'K',
                                        step=self.eftpp.dt,
                                        width=7)
        self.temp_range.grid(row=1, column=0, columnspan=2, pady=5, padx=5)

        # Display parameters

        # ---------------------------------------------- DISPLAY PARAMS ------------------------------------------------

        self.display_param = tu.DisplayParametersFrame(
            self.main_frame, 'Ambiant Temperature',
            'Charge Carriers Concentrations', self.eftpp)
        self.display_param.frame.grid(row=2, column=0, pady=3, sticky='nsew')

        # --------------------------------------------------- BUTTONS --------------------------------------------------

        buttons_frame = ttk.Frame(self.main_frame)
        buttons_frame.grid(row=5, column=0, pady=3, sticky='nsew')

        ttk.Button(buttons_frame, text='Apply',
                   command=self.save).grid(row=0, column=0, padx=5)
        ttk.Button(buttons_frame,
                   text='OK',
                   command=lambda: self.save(close=True)).grid(row=0,
                                                               column=1,
                                                               padx=5)
        ttk.Button(buttons_frame, text='Cancel',
                   command=self.destroy).grid(row=0, column=2, padx=5)
예제 #4
0
    def __init__(self, parent, material_study, fpp):

        tk.Toplevel.__init__(self, parent)

        self.material_study = material_study
        self.fpp = fpp

        self.main_frame = ttk.Frame(self)
        self.main_frame.pack(expand=True, fill='both')
        self.main_frame.grid_columnconfigure(0, weight=1)

        ttk.Label(self.main_frame,
                  text=material_study.treetitle,
                  font='-weight bold -size 30').grid(padx=20, pady=20)

        # Energy range
        self.e_range = tu.RangeFrame(self.main_frame,
                                     fpp.energy_range[0],
                                     fpp.energy_range[1],
                                     'Fermi energy',
                                     'eV',
                                     width=7)
        self.e_range.grid(sticky=W, padx=5, pady=5)

        # Transition levels highlight
        self.tr_levels_var = tk.BooleanVar(value=fpp.highlight_charge_change)
        ttk.Checkbutton(self.main_frame,
                        text='Highlight transition levels',
                        onvalue=True,
                        offvalue=False,
                        var=self.tr_levels_var).grid(sticky=W, padx=5, pady=5)

        # Charge display
        self.charge_display_var = tk.BooleanVar(value=fpp.display_charges)
        ttk.Checkbutton(self.main_frame,
                        text='Show charges',
                        onvalue=True,
                        offvalue=False,
                        var=self.charge_display_var).grid(sticky=W,
                                                          padx=5,
                                                          pady=5)

        # Colors
        self.color_choice = None
        ttk.Button(self.main_frame,
                   text='Colours',
                   command=self.open_color_choice).grid(sticky=W,
                                                        padx=5,
                                                        pady=5)

        # Gap legend display
        self.gap_var = tk.BooleanVar(value=fpp.display_gaps_legend)
        ttk.Checkbutton(self.main_frame,
                        text='Show charges',
                        onvalue=True,
                        offvalue=False,
                        var=self.gap_var).grid(sticky=W, padx=5, pady=5)

        # --------------------------------------------------- BUTTONS --------------------------------------------------

        buttons_frame = ttk.Frame(self.main_frame)
        buttons_frame.grid(pady=5, padx=5)

        ttk.Button(buttons_frame, text='OK',
                   command=self.validate).pack(side='left', padx=5)
        ttk.Button(buttons_frame, text='Cancel',
                   command=self.destroy).pack(side='left', padx=5)