Ejemplo n.º 1
0
    def get_fu_fy_I_section_suptng(self):
        material_grade = self[0]
        designation = self[1].get(KEY_SUPTNGSEC, None)
        fu = ''
        fy = ''
        if material_grade != "Select Material" and designation != "Select Section":
            table = "Beams" if designation in connectdb("Beams", "popup") else "Columns"
            I_sec_attributes = ISection(designation)
            I_sec_attributes.connect_to_database_update_other_attributes(table, designation, material_grade)
            fu = str(I_sec_attributes.fu)
            fy = str(I_sec_attributes.fy)
        else:
            pass

        d = {KEY_SUPTNGSEC_FU: fu,
             KEY_SUPTNGSEC_FY: fy}

        return d
Ejemplo n.º 2
0
    def select_section(self, selectedsize):

        "selecting components class based on the section passed "

        if self.sec_profile == 'RHS':
            self.section_size = RHS(designation=selectedsize,
                                    material_grade=self.material)
        elif self.sec_profile == 'CHS':
            self.section_size = CHS(designation=selectedsize,
                                    material_grade=self.material)
        elif self.sec_profile == 'SHS':
            self.section_size = SHS(designation=selectedsize,
                                    material_grade=self.material)
        elif self.sec_profile in ['Beams', 'Columns']:
            self.section_size = ISection(designation=selectedsize,
                                         material_grade=self.material)
        else:
            pass

        print(self.section_size)
Ejemplo n.º 3
0
    def tab_supported_section(self, input_dictionary):
        """ show properties of the supported section (beam) """

        if not input_dictionary or input_dictionary[KEY_SUPTDSEC] == 'Select Section' or input_dictionary[
            KEY_MATERIAL] == 'Select Material':
            designation = ''
            material_grade = ''
            source = 'Custom'
            fu = ''
            fy = ''
            depth = ''
            flange_width = ''
            flange_thickness = ''
            web_thickness = ''
            flange_slope = ''
            root_radius = ''
            toe_radius = ''
            m_o_e = "200"
            m_o_r = "76.9"
            p_r = "0.3"
            t_e = "12"
            mass = ''
            area = ''
            mom_inertia_z = ''
            mom_inertia_y = ''
            rad_of_gy_z = ''
            rad_of_gy_y = ''
            elast_sec_mod_z = ''
            elast_sec_mod_y = ''
            plast_sec_mod_z = ''
            plast_sec_mod_y = ''
            torsion_const = ''
            warping_const = ''
            image = VALUES_IMG_BEAM[0]
        else:
            designation = str(input_dictionary[KEY_SUPTDSEC])
            material_grade = str(input_dictionary[KEY_MATERIAL])
            I_sec_attributes = ISection(designation)
            table = "Beams" if designation in connectdb("Beams", "popup") else "Columns"

            I_sec_attributes.connect_to_database_update_other_attributes(table, designation,material_grade)
            source = str(I_sec_attributes.source)
            fu = str(I_sec_attributes.fu)
            fy = str(I_sec_attributes.fy)
            depth = str(I_sec_attributes.depth)
            flange_width = str(I_sec_attributes.flange_width)
            flange_thickness = str(I_sec_attributes.flange_thickness)
            web_thickness = str(I_sec_attributes.web_thickness)
            flange_slope = float(I_sec_attributes.flange_slope)
            root_radius = str(I_sec_attributes.root_radius)
            toe_radius = str(I_sec_attributes.toe_radius)
            m_o_e = "200"
            m_o_r = "76.9"
            p_r = "0.3"
            t_e = "12"
            mass = str(I_sec_attributes.mass)
            area = str(round((I_sec_attributes.area / 10 ** 2), 2))
            mom_inertia_z = str(round((I_sec_attributes.mom_inertia_z / 10 ** 4), 2))
            mom_inertia_y = str(round((I_sec_attributes.mom_inertia_y / 10 ** 4), 2))
            rad_of_gy_z = str(round((I_sec_attributes.rad_of_gy_z / 10), 2))
            rad_of_gy_y = str(round((I_sec_attributes.rad_of_gy_y / 10), 2))
            elast_sec_mod_z = str(round((I_sec_attributes.elast_sec_mod_z / 10 ** 3), 2))
            elast_sec_mod_y = str(round((I_sec_attributes.elast_sec_mod_y / 10 ** 3), 2))
            plast_sec_mod_z = str(round((I_sec_attributes.plast_sec_mod_z / 10 ** 3), 2))
            plast_sec_mod_y = str(round((I_sec_attributes.plast_sec_mod_y / 10 ** 3), 2))
            torsion_const = str(round((I_sec_attributes.It / 10 ** 4), 2))
            warping_const = str(round((I_sec_attributes.Iw / 10 ** 6), 2))
            if flange_slope != 90:
                image = VALUES_IMG_BEAM[0]
            else:
                image = VALUES_IMG_BEAM[1]

        if KEY_SUPTDSEC_MATERIAL in input_dictionary.keys():
            material_grade = input_dictionary[KEY_SUPTDSEC_MATERIAL]
            material_attributes = Material(material_grade)
            fu = material_attributes.fu
            fy = material_attributes.fy

        supporting_section = []
        t1 = (KEY_SUPTDSEC, KEY_DISP_DESIGNATION, TYPE_TEXTBOX, None, designation)
        supporting_section.append(t1)

        t2 = (None, KEY_DISP_MECH_PROP, TYPE_TITLE, None, None)
        supporting_section.append(t2)

        material = connectdb("Material", call_type="popup")
        t34 = (KEY_SUPTDSEC_MATERIAL, KEY_DISP_MATERIAL, TYPE_COMBOBOX, material, material_grade)
        supporting_section.append(t34)

        t3 = (KEY_SUPTDSEC_FU, KEY_DISP_FU, TYPE_TEXTBOX, None, fu)
        supporting_section.append(t3)

        t4 = (KEY_SUPTDSEC_FY, KEY_DISP_FY, TYPE_TEXTBOX, None, fy)
        supporting_section.append(t4)

        t15 = ('Label_9', KEY_DISP_MOD_OF_ELAST, TYPE_TEXTBOX, None, m_o_e)
        supporting_section.append(t15)

        t16 = ('Label_10', KEY_DISP_MOD_OF_RIGID, TYPE_TEXTBOX, None, m_o_r)
        supporting_section.append(t16)

        t31 = ('Label_24', KEY_DISP_POISSON_RATIO, TYPE_TEXTBOX, None, p_r)
        supporting_section.append(t31)

        t32 = ('Label_25', KEY_DISP_THERMAL_EXP, TYPE_TEXTBOX, None, t_e)
        supporting_section.append(t32)

        t14 = ('Label_8', KEY_DISP_TYPE, TYPE_COMBOBOX, ['Rolled', 'Welded'], 'Rolled')
        supporting_section.append(t14)

        t29 = (KEY_SOURCE, KEY_DISP_SOURCE, TYPE_TEXTBOX, None, source)
        supporting_section.append(t29)

        t28 = (None, None, TYPE_BREAK, None, None)
        supporting_section.append(t28)

        t5 = (None, KEY_DISP_DIMENSIONS, TYPE_TITLE, None, None)
        supporting_section.append(t5)

        t6 = ('Label_1', KEY_DISP_DEPTH, TYPE_TEXTBOX, None, depth)
        supporting_section.append(t6)

        t7 = ('Label_2', KEY_DISP_FLANGE_W, TYPE_TEXTBOX, None, flange_width)
        supporting_section.append(t7)

        t8 = ('Label_3', KEY_DISP_FLANGE_T, TYPE_TEXTBOX, None, flange_thickness)
        supporting_section.append(t8)

        t9 = ('Label_4', KEY_DISP_WEB_T, TYPE_TEXTBOX, None, web_thickness)
        supporting_section.append(t9)

        t10 = ('Label_5', KEY_DISP_FLANGE_S, TYPE_TEXTBOX, None, flange_slope)
        supporting_section.append(t10)

        t11 = ('Label_6', KEY_DISP_ROOT_R, TYPE_TEXTBOX, None, root_radius)
        supporting_section.append(t11)

        t12 = ('Label_7', KEY_DISP_TOE_R, TYPE_TEXTBOX, None, toe_radius)
        supporting_section.append(t12)

        t17 = (None, KEY_DISP_SEC_PROP, TYPE_TITLE, None, None)
        supporting_section.append(t17)

        t18 = ('Label_11', KEY_DISP_MASS, TYPE_TEXTBOX, None, mass)
        supporting_section.append(t18)

        t19 = ('Label_12', KEY_DISP_AREA, TYPE_TEXTBOX, None, area)
        supporting_section.append(t19)

        t20 = ('Label_13', KEY_DISP_MOA_IZ, TYPE_TEXTBOX, None, mom_inertia_z)
        supporting_section.append(t20)

        t21 = ('Label_14', KEY_DISP_MOA_IY, TYPE_TEXTBOX, None, mom_inertia_y)
        supporting_section.append(t21)

        t22 = ('Label_15', KEY_DISP_ROG_RZ, TYPE_TEXTBOX, None, rad_of_gy_z)
        supporting_section.append(t22)

        t23 = ('Label_16', KEY_DISP_ROG_RY, TYPE_TEXTBOX, None, rad_of_gy_y)
        supporting_section.append(t23)

        t24 = ('Label_17', KEY_DISP_EM_ZZ, TYPE_TEXTBOX, None, elast_sec_mod_z)
        supporting_section.append(t24)

        t25 = ('Label_18', KEY_DISP_EM_ZY, TYPE_TEXTBOX, None, elast_sec_mod_y)
        supporting_section.append(t25)

        t28 = (None, None, TYPE_BREAK, None, None)
        supporting_section.append(t28)

        # if flange_slope != 90:
        t33 = (KEY_IMAGE, None, TYPE_IMAGE, None,image)
        # else:
        #     t33 = (KEY_IMAGE, None, TYPE_IMAGE, None, VALUES_IMG_BEAM[1])
        supporting_section.append(t33)

        t17 = (None, KEY_DISP_SEC_PROP, TYPE_TITLE, None, None)
        supporting_section.append(t17)

        t26 = ('Label_19', KEY_DISP_PM_ZPZ, TYPE_TEXTBOX, None, plast_sec_mod_z)
        supporting_section.append(t26)

        t27 = ('Label_20', KEY_DISP_PM_ZPY, TYPE_TEXTBOX, None, plast_sec_mod_y)
        supporting_section.append(t27)

        t26 = ('Label_21', KEY_DISP_It, TYPE_TEXTBOX, None, torsion_const)
        supporting_section.append(t26)

        t27 = ('Label_22', KEY_DISP_Iw, TYPE_TEXTBOX, None, warping_const)
        supporting_section.append(t27)

        return supporting_section