示例#1
0
        private void ButtonZginanieObliczenia_Click(object sender, EventArgs e)
        {
            //otrzymanie wartości z pól
            var    b            = double.Parse(TextBoxBendingB.Text);
            var    h            = double.Parse(TextBoxBendingH.Text);
            var    a            = double.Parse(TextBoxBendingA.Text);
            var    m            = Math.Abs(double.Parse(TextBoxBendingM.Text));
            string nameConcrete = ComboBoxBendingConcrete.Text;
            string nameSteele   = ComboBoxBendingSteele.Text;

            double d, fck, fcd, fyd, fyk, fctm, pow, ni, f, asmax, asmin;
            double as1, as2;
            string warning;

            d   = (h - a);
            pow = b * h / 100;

            //Obiekty betonu i stali oraz parametry
            var concrete = new ConcreteProps(nameConcrete);
            var steele   = new SteeleProps(nameSteele);

            //wytrzymalosci dla betonu betonu
            var concretePropResult = concrete.ConcretePropResult();

            fctm = concretePropResult.Fctm;
            fck  = concretePropResult.Fck;

            //wytrzymalosci dla stali
            var steelePropResult = steele.StleelePropResult();

            fyk = steelePropResult.Fyk;

            fcd = Math.Round((fck / 1.4), 2);
            fyd = Math.Round((fyk / 1.15), 2);

            //obiekty BeamBend
            BeamBendCalculation bbc    = new BeamBendCalculation();
            BeamBendResults     result = bbc.Calculate(m, b, d, a, 1, fcd, fyd);

            as1     = result.As1;
            as2     = result.As2;
            ni      = result.Ni;
            f       = result.ZasiegStrefySciskanej;
            warning = result.Warning;
            asmin   = bbc.CalculationAsmin(b, d, fctm, fyk);
            asmax   = bbc.CalculationAsmax(b, d);


            labelBendingFcd.Text     = fcd + "";
            labelBendingFyd.Text     = fyd + "";
            labelBendingAmin.Text    = asmin + "";
            labelBendingAmax.Text    = asmax + "";
            labelBendingD.Text       = d + "";
            labelBendingA.Text       = pow + "";
            labelBendingN.Text       = ni + "";
            labelBendingF.Text       = f + "";
            labelBendingAs1.Text     = as1 + "";
            labelBendingAs2.Text     = as2 + "";
            labelBendingWarning.Text = warning;
        }
        //double Asmin, Asmax;

        public BeamBendResults Calculate(double my, double b, double d, double a, double n, double fcd, double fyd)
        {
            ks = 0.000001 * b * d * d * fcd;
            ni = my / ks;
            x  = 1 - 2 * ni;
            y  = Math.Sqrt(x);
            zasiegStrefySciskanej    = 1 - y;
            zasiegStrefySciskanejLim = 0.493;

            if (zasiegStrefySciskanej < zasiegStrefySciskanejLim)
            {
                ramieSil = (1 - 0.5 * zasiegStrefySciskanej) * d;
                As1      = 10000 * my / (ramieSil * fyd);
                As2      = 0;
            }
            else
            {
                mRd = 0.3715 * b * d * d * fcd * n * 0.000001;
                As2 = (my - mRd) / ((d - a) * fyd) * (10000);
                As1 = ((mRd) / (0.7535 * d * fyd)) * 10000 + As2;
            }

            ni = Math.Round(ni, 3);
            zasiegStrefySciskanej = Math.Round(zasiegStrefySciskanej, 3);
            As1  = Math.Round(As1, 2);
            As2  = Math.Round(As2, 2);
            warn = "";

            if (ni > 0.50)
            {
                As1 = 0;
                As2 = 0;
                zasiegStrefySciskanej = 0;
                ni   = 0;
                warn = "Obliczenia błędne. Zwiększ przekrój!";
            }


            BeamBendResults result = new BeamBendResults
            {
                Ni = ni,
                ZasiegStrefySciskanej = zasiegStrefySciskanej,
                As1     = As1,
                As2     = As2,
                Warning = warn,
            };

            return(result);
        }