Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Original
            this.zoznamMenuNazvy.Clear();
            this.zoznamMenuHodnoty.Clear();
            this.zoznamMenuJednotky.Clear();
            this.naplnZoznamy();

            /////////////////// LOADING OF MAIN CLASS ///////////////////

            //Main class object

            EN1993_1_1 en = new EN1993_1_1(comboBox1.Text, comboBox2.Text,item3_check,item4_check,item5_check,item6_check);

            //pridanie producera1
            // zoznamMenuNazvy.Add("producer");
            // zoznamMenuHodnoty.Add(en.Csproducer1);
            // zoznamMenuJednotky.Add("-");

            //test ci boli zadane vsetky hodnoty v polickach oznacenych zltou farbou
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
                for (int j = 0; j < dataGridView1.ColumnCount; j++)
                {
                    try
                    {
                        if (dataGridView1.Rows[i].Cells[j].Value.Equals("_"))
                        {
                            MessageBox.Show("Enter all required input data. \n Fill all yellow cells with numerical values, please.");
                            return;
                        }
                    }
                    catch (NullReferenceException) { }
                }

            #region // Database loaded data checking
            if (item0_check == true)
            #region Steel attributes
            {

                MessageBox.Show
                    ((" Control of loaded variables " + "\n"

                + "Steel variables: " + "\n"
                + "\n"
                + " fy1 = " + en.Fy1 + "\n"
                + " fu1 = " + en.Fu1 + "\n"
                + " fy2 = " + en.Fy2 + "\n"
                + " fu2 = " + en.Fu2 + "\n"
                + "\n"
                + " used fy = " + en.Fy + "\n"
                + " used fu = " + en.Fu + "\n"
                + "\n"
                + " γM0 = " + en.GamaM0 + "\n"
                + " γM1 = " + en.GamaM1 + "\n"
                + " γM2 = " + en.GamaM2 + "\n"
                + "\n"
                + " βw = " + en.Betaw + "\n"
                + " η = " + en.Eta_shear + "\n"
                + "\n"
                + " E = " + en.E + "\n"
                + " G = " + en.G + "\n"
                + "\n"
                + " ν = " + en.Nu_pois + "\n"
                + " α = " + en.Alpha_temp + ""), "Material data");

            }
            #endregion
            if (item1_check == true)
            #region Cross-section attributes

            {

                MessageBox.Show
                    ((" Checking of loaded variables " + "\n"

                + " Cross-section variables: " + "\n"
                + "\n"
                + " Csprof_namenum " + en.Csprof_namenum + "\n"
                + " Csprof_name " + en.Csprof_name + "\n"
                + " Csprofshape " + en.Csprofshape + "\n"
                + " Csprof_production " + en.Csprof_production + "\n"
                + " Csprodcode1_name1 " + en.Csprodcode1_name1 + "\n"
                + " Csprodcode1_name2 " + en.Csprodcode1_name2 + "\n"
                + " Csprodcode2_name1 " + en.Csprodcode2_name1 + "\n"
                + " Csprodcode2_name2 " + en.Csprodcode2_name2 + "\n"
                + " Csproducer1 " + en.Csproducer1 + "\n"
                + " Csproducer2 " + en.Csproducer2 + "\n"
                + " Csprof_weight " + en.Csprof_weight + "\n"
                + "\n"
                + " Geometrical properties:" + "\n"
                + "\n"
                + " A = " + en.A + "\n"
                + " Asu = " + en.A_su + "\n"
                + " Af = " + en.Af + "\n"
                + " Aw = " + en.Aw + "\n"
                + " Av = " + en.Av + "\n"
                + " Ay.v = " + en.Ay_v + "\n"
                + " Az.v = " + en.Az_v + "\n"
                + "\n"
                + " Sy = " + en.Sy + "\n"
                + " Sz = " + en.Sz + "\n"
                + " Wy.el = " + en.Wy_el + "\n"
                + " Wz.el = " + en.Wz_el + "\n"
                + " Wy.pl = " + en.Wy_pl + "\n"
                + " Wz.pl = " + en.Wz_pl + "\n"
                + "\n"
                + " Iy = " + en.Iy + "\n"
                + " Iz = " + en.Iz + "\n"
                + " It = " + en.IT + "\n"
                + " Iw = " + en.Iw + "\n"
                + " Wt = " + en.Wt + "\n"
                + " iy = " + en.Iy_r + "\n"
                + " iz = " + en.Iz_r + "\n"
                + "\n"
                + " Cross-section data for class determination: " + "\n"
                + "\n"
                + " cy1 = " + en.Cy1 + "\n"
                + " ty1 = " + en.Ty1 + "\n"
                + " cz1 = " + en.Cz1 + "\n"
                + " tz1 = " + en.Tz1 + "\n"
                + "\n"
                + " cy2 = " + en.Cy2 + "\n"
                + " ty2 = " + en.Ty2 + "\n"
                + " cz2 = " + en.Cz2 + "\n"
                + " tz2 = " + en.Tz2 + " "
                ), "Cross-section data");
            }
            #endregion
            #endregion

            #region Variable property for User input data

            // Input - User

            en.N_Ed = this.N;
            en.Vy_Ed = this.Vy;
            en.Vz_Ed = this.Vz;
            en.Mx_Ed = this.Mx;
            en.My_Ed = this.My;
            en.Mz_Ed = this.Mz;

            en.My_a = this.My_a;
            en.My_b = this.My_b;
            en.Mz_a = this.Mz_a;
            en.Mz_b = this.Mz_b;

            en.My_s = this.My_s;
            en.Mz_s = this.Mz_s;

            en.My_Ed_x = this.My_Ed_x;
            en.Mz_Ed_x = this.Mz_Ed_x;

            en.Deflection_y_x = this.Deflection_y_x;
            en.Deflection_z_x = this.Deflection_z_x;

            en.C1y = this.C1y;
            en.C2y = this.C2y;
            en.C3y = this.C3y;

            en.Kz_LT = this.Kz_LT;
            en.Kw_LT = this.Kw_LT;

            en.L_teor = this.L_teor;
            en.L_y_buck = this.L_y_buck;
            en.L_z_buck = this.L_z_buck;
            en.L_y_LT = this.L_y_LT;
            en.L_z_LT = this.L_z_LT;
            en.L_T = this.L_T;

            en.Anet = this.Anet;

            en.MEd_T = this.MEd_T;
            en.VEd_T = this.VEd_T;
            en.E_T = this.E_T;

            #endregion

            /////////////////////////////////// USER INPUT DEFINITION /////////////////////////////////
            ///////////////////////////////////      COMBOBOXes       /////////////////////////////////

            // diagram for Kc

            // (comboBoxMomentDiag_kc.SelectedIndex)

            en.Kc_diagram = comboBoxMomentDiag_kc.SelectedIndex;
            //MessageBox.Show(en.Kc_diagram.ToString());

            // type of load index

            en.Loading_type_y = comboBoxLoad_y.SelectedIndex;
            en.Loading_type_z = comboBoxLoad_z.SelectedIndex;

            //MessageBox.Show(en.Loading_type_y + "  " + en.Loading_type_z);

            // Moment diagram in Method 1 - Annex A

            en.Moment_diagram_My1 = comboBoxMomentDiag_y.SelectedIndex;
            //en.Moment_diagram_Mz1 = ;

            // Moment diagram in Method 2 - Annex B

            en.Moment_diagram_My2 = comboBoxMomentDiag_y.SelectedIndex;
            //en.Moment_diagram_Mz2 = ;

            en.Torsion_koeficientNADCZ = comboBoxTorsionNADCZ.SelectedIndex;

            ////////////////////////////////     CALCULATION   ////////////////////////////
            //////////////////////////////// CLASS EN 1993-1-1 ////////////////////////////

            // Material properties definition
            en.EN_1993_1_1_Material();

            // Basic method: EN 1993-1-1 and EN 1993-1-5 - class of cross-section
            // Table 5.2
            en.EN_1993_1_1_55();

            #region // CS class determination and Class 4 data solution

            /*MessageBox.Show
                (" Checking of CS class determination and Class 4 data solution " + "\n"
            + "\n"
            + "Classes of cross section parts" + "\n"
            + "\n"
            + " Class.y1 = " + en.Class_y1 + "\n"
            + " Class.z1 = " + en.Class_z1 + "\n"
            + " Class.y2 = " + en.Class_y2 + "\n"
            + " Class.z2 = " + en.Class_z2 + "\n"
            + "\n"
            + "\n"
            + " Class.w = " + en.Class_w + "\n"
            + " Class.f = " + en.Class_f + "\n"
            + " Class = " + en.Classall + "\n"
            + "\n"
            + "\n"
            + "\n"

            + " Aeff = " + en.Aeff + "\n"
            );
             */

            #endregion

            // Basic method: Section 6.2 Resistance of cross-sections
            en.EN_1993_1_1_62();

            if (item2_check == true)
            #region Torsion input attributes
            {
             MessageBox.Show
                (("Auxiliary values EN 1993-1-1: " + "\n"
            + "\n"
            + "Section 6.2.7 Torsion (p. 53)"
            + "\n"
            + " αt = " + en.Alpha_T + "\n"
            + " βt = " + en.Beta_T + "\n"
            ), " NAD of Czech Republic - Table NB.2.1");
            }
            #endregion

            // Basic method: Section 6.3.1 Uniform members in compression (p. 56)
            en.EN_1993_1_1_631();

            // Basic method: Section 6.3.2 Uniform members in bending

            #region EN_1993_1_1_632
            switch (comboBoxChiLT.SelectedIndex)
            {
                case 0:
                    en.EN_1993_1_1_6322();
                    break;
                case 1:
                    en.Chi_y_LT = 1;
                    en.Chi_z_LT = 1;
                    en.My_b_Rd = en.My_c_Rd; /// !!!! Other moment resistance decreasing -rho,N, V combination !!!
                    en.Mz_b_Rd = en.Mz_c_Rd;
                    break;
                case 2:
                    en.EN_1993_1_1_6322();
                    break;
                case 3:
                    en.EN_1993_1_1_6323();
                    break;
                case 4:
                    en.EN_1993_1_1_6324();
                    break;

            }
            #endregion

            // Section 6.3.3 Uniform members in bending and axial compression - basic data Definition
            en.EN_1993_1_1_633();

            // Section 6.3.3 Uniform members in bending and axial compression - kij calculation -> Annex A or B
            #region EN_1993_1_633 - Annexes
            switch (comboBoxAnex.SelectedIndex)
            {
                case 0:
                    switch (comboBoxMomentDiag_y.SelectedIndex)
                    {
                        case 0:
                            en.AnnexB_mDiag1();
                            break;
                        case 1:
                            en.AnnexB_mDiag2();
                            break;
                        case 2:
                            en.AnnexB_mDiag3();
                            break;
                    }
                    en.AnnexB();

                    break;
                case 1:
                    en.Kyy = 1; // it should to be kij = 1 and solve ratio 661
                    en.Kyz = 1;
                    en.Kzy = 1; // it should to be kij = 1 and solve ratio 662
                    en.Kzz = 1;

                    break;
                case 2:
                    switch (comboBoxMomentDiag_y.SelectedIndex)
                    {
                        case 0:
                            en.AnnexA_mDiag1();
                            break;
                        case 1:
                            en.AnnexA_mDiag2();
                            break;
                        case 2:
                            en.AnnexA_mDiag3();
                            break;
                        case 3:
                            en.AnnexA_mDiag4();
                            break;
                    }
                    en.AnnexA();

                    break;
                case 3:
                    switch (comboBoxMomentDiag_y.SelectedIndex)
                    {
                        case 0:
                            en.AnnexB_mDiag1();
                            break;
                        case 1:
                            en.AnnexB_mDiag2();
                            break;
                        case 2:
                            en.AnnexB_mDiag3();
                            break;
                    }
                    en.AnnexB();

                    break;
                default: break;

            }

            #endregion

            // Final ratios calculation
            en.final_Check_Ratio();

            // Output textbox - text box Ratio max
            this.Ratio_max.Text = Math.Round(en.Ratio_maxtot, 2).ToString();

            //////////////////////////////////////////////////////////////////////////////
            this.checkOutputVariables(en);

               this.updateDataGridView();
        }