def accept(self):
     self.save()
     o_table = TableRowHandler(main_window=self.parent)
     o_table.transfer_widget_states(from_key=self.key,
                                    data_type=self.data_type)
     self.parent.check_master_table_column_highlighting(column=self.column)
     self.close()
Exemple #2
0
    def ok(self):
        chemical_formula = str(self.ui.chemical_formula.text())
        if self.retrieving_molecular_mass_and_number_of_atoms_worked(chemical_formula):

            self.parent.material_ui = None

            if self.data_type == 'database':
                ui = self.database_window.list_ui[self.key]['value_label']
                ui.setText(chemical_formula)

            else: # 'sample' or 'normalization'
                text_ui = self.parent.master_table_list_ui[self.key][self.data_type]['material']['text']
                text_ui.setText(chemical_formula)
                # self.calculate_full_molecular_mass()
                o_table = TableRowHandler(main_window=self.parent)
                o_table.transfer_widget_states(from_key=self.key, data_type=self.data_type)
                self.parent.master_table_list_ui[self.key][self.data_type]['mass_density_infos']['molecular_mass'] \
                    = self.molecular_mass
                self.parent.master_table_list_ui[self.key][self.data_type]['mass_density_infos']['total_number_of_atoms'] \
                    = self.total_number_of_atoms

            self.parent.check_master_table_column_highlighting(column=self.column)
            self.close()
        else:
            self.ui.statusbar.setStyleSheet("color: red")
            self.ui.statusbar.showMessage("Unable to calculate Molecular Mass! CHECK YOUR FORMULA!",
                                          self.parent.statusbar_display_time)
Exemple #3
0
    def ok(self):
        chemical_formula = str(self.ui.chemical_formula.text())
        molecular_mass, total_number_of_atoms = retrieving_molecular_mass_and_number_of_atoms_worked(
            chemical_formula)
        if molecular_mass and total_number_of_atoms:
            self.parent.material_ui = None

            if self.data_type == 'database':
                ui = self.database_window.list_ui[self.key]['value_label']
                ui.setText(chemical_formula)

            else:  # 'sample' or 'normalization'
                text_ui = self.parent.master_table_list_ui[self.key][
                    self.data_type]['material']['text']
                text_ui.setText(chemical_formula)
                o_table = TableRowHandler(main_window=self.parent)
                o_table.transfer_widget_states(from_key=self.key,
                                               data_type=self.data_type)
                self.parent.master_table_list_ui[self.key][self.data_type]['mass_density_infos']['molecular_mass'] \
                    = molecular_mass
                self.parent.master_table_list_ui[self.key][self.data_type]['mass_density_infos']['total_number_of_atoms'] \
                    = total_number_of_atoms

            self.parent.check_master_table_column_highlighting(
                column=self.column)
            self.close()
        else:
            self.ui.statusbar.setStyleSheet("color: red")
            self.ui.statusbar.showMessage(
                "Unable to calculate Molecular Mass! CHECK YOUR FORMULA!",
                self.parent.statusbar_display_time)
Exemple #4
0
    def accept(self):

        radius = str(self.ui.radius_value.text())
        radius2 = 'N/A'
        height = 'N/A'

        if self.shape_selected.lower() == 'cylinder':
            height = str(self.ui.height_value.text())
        elif self.shape_selected.lower() == 'sphere':
            pass
        else:
            radius2 = str(self.ui.radius2_value.text())
            height = str(self.ui.height_value.text())

        self.__set_label_value('radius', radius)
        self.__set_label_value('radius2', radius2)
        self.__set_label_value('height', height)

        o_table = TableRowHandler(main_window=self.parent)
        o_table.transfer_widget_states(
            from_key=self.key, data_type=self.data_type)

        self.parent.check_master_table_column_highlighting(column=self.column)

        self.close()
Exemple #5
0
    def accept(self):

        radius = str(self.ui.radius_value.text())
        radius2 = 'N/A'
        height = 'N/A'

        if self.shape_selected.lower() == 'cylindrical':
            height = str(self.ui.height_value.text())
        elif self.shape_selected.lower() == 'spherical':
            pass
        else:
            radius2 = str(self.ui.radius2_value.text())
            height = str(self.ui.height_value.text())

        self.__set_label_value('radius', radius)
        self.__set_label_value('radius2', radius2)
        self.__set_label_value('height', height)

        o_table = TableRowHandler(main_window=self.parent)
        o_table.transfer_widget_states(from_key=self.key, data_type=self.data_type)

        self.parent.check_master_table_column_highlighting(column=self.column)

        self.close()
Exemple #6
0
def normalization_mass_density_line_edit_entered(main_window, key):
    o_table = TableRowHandler(main_window=main_window)
    o_table.transfer_widget_states(from_key=key, data_type='normalization')
    main_window.check_master_table_column_highlighting(
        column=INDEX_OF_COLUMNS_WITH_MASS_DENSITY[1])
Exemple #7
0
def normalization_material_line_edit_entered(main_window, key):
    o_table = TableRowHandler(main_window=main_window)
    o_table.transfer_widget_states(from_key=key, data_type='normalization')
Exemple #8
0
def sample_material_line_edit_entered(main_window, key):
    o_table = TableRowHandler(main_window=main_window)
    o_table.transfer_widget_states(from_key=key, data_type='sample')
 def accept(self):
     self.save()
     o_table = TableRowHandler(main_window=self.parent)
     o_table.transfer_widget_states(from_key=self.key, data_type=self.data_type)
     self.parent.check_master_table_column_highlighting(column=self.column)
     self.close()