Exemple #1
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)
Exemple #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)