Example #1
0
 public FEditarPredef(ISeccion pSeccion, FInterfaz_Seccion pInterfaz, GDE pgde)
 {
     FInterfaz_ = pInterfaz;
     Seccion    = pSeccion;
     Seccion.CalcNoDBarras();
     gde = pgde;
     InitializeComponent();
 }
 public FAgregarSeccion(GDE pgde, ListBox pLista_secciones)
 {
     gde             = pgde;
     Lista_Secciones = pLista_secciones;
     InitializeComponent();
 }
        private void Crear_Seccion(string Tipo_Seccion, float b, float h, float tw, float tf, float r)
        {
            ISeccion       N_Seccion = null;
            string         Nombre_Seccion = "";
            GDE            gde = GDE.DMO;
            List <float[]> Vertices_Temp = new List <float[]>();
            List <float[]> Vertices = new List <float[]>();
            double         Xc, Yc;
            double         Numerador, Denominador;

            MAT_CONCRETE material = new MAT_CONCRETE()
            {
                Name = "H" + tbFc.Text,
                FC   = Convert.ToSingle(tbFc.Text)
            };

            if (Radio_Dmo.Checked)
            {
                gde = GDE.DMO;
            }

            if (Radio_Des.Checked)
            {
                gde = GDE.DES;
            }

            if (Tipo_Seccion == TipodeSeccion.Rectangular.ToString())
            {
                Nombre_Seccion = $"C{b}X{h}{material.Name}";
                N_Seccion      = new CRectangulo(Nombre_Seccion, b / 100, h / 100, material, TipodeSeccion.Rectangular, null);
                N_Seccion.Calc_vol_inex(r / 100, 4220, gde);
                N_Seccion.Refuerzo_Base(r);
            }

            if (Tipo_Seccion == TipodeSeccion.Circle.ToString())
            {
                Nombre_Seccion = $"C{b}{material.Name}";
                N_Seccion      = new CCirculo(Nombre_Seccion, b / 200, new double[] { 0, 0 }, material, TipodeSeccion.Circle, null);
                N_Seccion.Calc_vol_inex(r / 100, 4220, gde);
                N_Seccion.Refuerzo_Base(r);
            }

            if (Tipo_Seccion == TipodeSeccion.Tee.ToString() | Tipo_Seccion == TipodeSeccion.L.ToString())
            {
                Nombre_Seccion = $"C{b}X{h}X{tw}X{tf}{Tipo_Seccion}{material.Name}";

                if (Tipo_Seccion == TipodeSeccion.Tee.ToString())
                {
                    Vertices_Temp.Add(new float[] { 0, h / 200 });
                    Vertices_Temp.Add(new float[] { 0, (h - tw) / 200 });
                    Vertices_Temp.Add(new float[] { (b - tf) / 400, (h - tw) / 200 });
                    Vertices_Temp.Add(new float[] { (b - tf) / 400, 0 });
                    Vertices_Temp.Add(new float[] { (b + tf) / 400, 0 });
                    Vertices_Temp.Add(new float[] { (b + tf) / 400, (h - tw) / 200 });
                    Vertices_Temp.Add(new float[] { b / 200, (h - tw) / 200 });
                    Vertices_Temp.Add(new float[] { b / 200, h / 200 });

                    Numerador   = ((b / 2) * b * tw) + ((b / 2) * (tf * (h - tw)));
                    Denominador = (b * tw) + (tf * (h - tw));

                    Xc = b / 200;

                    double y1 = (h - tw) * (h - tw) * tf / 2;
                    double y2 = (h - (tw / 2)) * b * tw;

                    Numerador   = y1 + y2;
                    Denominador = (b * tw) + (tf * (h - tw));

                    Yc = h / 200;

                    for (int i = 0; i < Vertices_Temp.Count; i++)
                    {
                        var Aux = B_Operaciones_Matricialesl.Operaciones.Traslacion(Vertices_Temp[i][0] - Xc, Vertices_Temp[i][1] - Yc, Vertices_Temp[i][0], Vertices_Temp[i][1]);
                        Vertices.Add(new float[] { (float)Aux[0], (float)Aux[1] });
                    }

                    N_Seccion = new CSD(Nombre_Seccion, b / 100, h / 100, tw / 100, tf / 100, material, TipodeSeccion.Tee, Vertices);
                }

                if (Tipo_Seccion == TipodeSeccion.L.ToString())
                {
                    Vertices_Temp.Add(new float[] { 0, 0 });
                    Vertices_Temp.Add(new float[] { b / 200, 0 });
                    Vertices_Temp.Add(new float[] { b / 200, tw / 200 });
                    Vertices_Temp.Add(new float[] { tf / 200, tw / 200 });
                    Vertices_Temp.Add(new float[] { tf / 200, h / 200 });
                    Vertices_Temp.Add(new float[] { 0, h / 200 });

                    Numerador   = ((b / 2) * b * tw) + ((tf / 2) * (tf * (h - tw)));
                    Denominador = (b * tw) + (tf * (h - tw));

                    Xc = b / 200;

                    Numerador   = ((tw / 2) * b * tw) + ((h + tf / 2) * (tf * (h - tw)));
                    Denominador = (b * tw) + (tf * (h - tw));

                    Yc = h / 200;

                    for (int i = 0; i < Vertices_Temp.Count; i++)
                    {
                        var Aux = B_Operaciones_Matricialesl.Operaciones.Traslacion(Vertices_Temp[i][0] - Xc, Vertices_Temp[i][1] - Yc, Vertices_Temp[i][0], Vertices_Temp[i][1]);
                        Vertices.Add(new float[] { (float)Aux[0], (float)Aux[1] });
                    }

                    N_Seccion = new CSD(Nombre_Seccion, b / 100, h / 100, tw / 100, tf / 100, material, TipodeSeccion.L, Vertices);
                }

                N_Seccion.Calc_vol_inex(r / 100, 4220, gde);
                N_Seccion.Refuerzo_Base(r);
            }

            if (N_Seccion != null)
            {
                if (Radio_Dmo.Checked)
                {
                    if (Form1.secciones_predef.Secciones_DMO.Exists(x => x.Equals(N_Seccion)) == false)
                    {
                        Form1.secciones_predef.Secciones_DMO.Add(N_Seccion);
                    }
                }
                if (Radio_Des.Checked)
                {
                    if (Form1.secciones_predef.Secciones_DES.Exists(x => x.Equals(N_Seccion)) == false)
                    {
                        Form1.secciones_predef.Secciones_DES.Add(N_Seccion);
                    }
                }
            }
        }
        public void Calc_vol_inex(float r, float FY, GDE gDE)
        {
            float FD1, FD2;

            if (gDE == GDE.DMO)
            {
                FD1 = 0.08f;
                FD2 = 0.08f;
            }
            else
            {
                FD1 = 0.12f;
                FD2 = 0.12f;
            }

            int    pasos;
            int    Indice_min;
            double s_max, s_min, s_d;
            double Ast1, Ast2, G_As1, G_As2;
            float  delta = 0.50f;

            var Num_Ramas_V = new List <int>();    //Numero de ramas en altura del muro para ambos casos de ast
            var GT_As1      = new List <double>(); //Longitud total de los gancho para As1, bajo cada una de las variaciones de la separacion
            var GT_As2      = new List <double>(); //Longitud total de los gancho para As1, bajo cada una de las variaciones de la separacion

            var P_As1 = new List <double>();       //Peso total As1
            var P_As2 = new List <double>();       //Peso total As2

            var Sep = new List <double>();

            Ast1 = 0.71; //Estribo #3
            Ast2 = 1.29; //Estribo #4

            s_min = 7.5;
            s_max = gDE == GDE.DMO ? 2 * radio * 100 / 3 : 2 * radio * 100 / 4;

            G_As1 = 2 * Math.PI * 2 * (radio - r) * 100 + 2 * 14;   //Longitud de gancho a 180 de #3
            G_As2 = 2 * Math.PI * 2 * (radio - r) * 100 + 2 * 16.7; //Longitud de gancho a 180 de #3

            pasos = Convert.ToInt32((s_max - s_min) / delta);
            s_d   = s_min;

            for (int i = 0; i < pasos; i++)
            {
                #region Estribo #3

                Estribo = new Estribo(3) //Estribo temporal
                {
                    Separacion = Convert.ToSingle(s_d)
                };

                Num_Ramas_V.Add(Convert.ToInt32(100 / s_d) + 1);
                Cuanti_Vol(FD1, FD2, r, FY);

                GT_As1.Add(Num_Ramas_V.Last() * (G_As1 * Estribo.NoRamasV1));
                P_As1.Add(GT_As1.Last() * Ast1 * 7850 / Math.Pow(100, 3));

                #endregion Estribo #3

                #region Estribo #4

                Estribo = new Estribo(4) //Estribo temporal
                {
                    Separacion = Convert.ToSingle(s_d)
                };
                Cuanti_Vol(FD1, FD2, r, FY);

                GT_As2.Add(Num_Ramas_V.Last() * (G_As2 * Estribo.NoRamasV1));
                P_As2.Add(GT_As2.Last() * Ast2 * 7850 / Math.Pow(100, 3));

                #endregion Estribo #4

                Sep.Add(s_d);
                s_d += delta;
            }

            if (P_As1.Min() < P_As2.Min())
            {
                Indice_min = P_As1.FindIndex(x => x == P_As1.Min());
                Estribo    = new Estribo(3)
                {
                    Separacion = Convert.ToSingle(Sep[Indice_min])
                };
            }
            else
            {
                Indice_min = P_As2.FindIndex(x => x == P_As2.Min());
                Estribo    = new Estribo(4)
                {
                    Separacion = Convert.ToSingle(Sep[Indice_min])
                };
            }
        }