Ejemplo n.º 1
0
 private void SetMinimumOf_ρ_and_Max()
 {
     minOf_ρ                = new Generate_ρ_LineForDiagram(_material);
     minOf_ρ.αcc            = αcc;
     minOf_ρ.λ              = λ;
     minOf_ρ.η              = η;
     minOf_ρ.ratio_d_and_h  = ratio_d_and_h;
     minOf_ρ.ratio_d1_and_h = ratio_d1_and_h;
     minOf_ρ.ρ              = 0.004;
     minOf_ρ.GetLineForDiagram();
     maxOf_ρ                = new Generate_ρ_LineForDiagram(_material);
     maxOf_ρ.αcc            = αcc;
     maxOf_ρ.λ              = λ;
     maxOf_ρ.η              = η;
     maxOf_ρ.ratio_d_and_h  = ratio_d_and_h;
     maxOf_ρ.ratio_d1_and_h = ratio_d1_and_h;
     maxOf_ρ.ρ              = 0.04;
     maxOf_ρ.GetLineForDiagram();
     searchingOf_ρ                = new Generate_ρ_LineForDiagram(_material);
     searchingOf_ρ.αcc            = αcc;
     searchingOf_ρ.λ              = λ;
     searchingOf_ρ.η              = η;
     searchingOf_ρ.ratio_d_and_h  = ratio_d_and_h;
     searchingOf_ρ.ratio_d1_and_h = ratio_d1_and_h;
 }
Ejemplo n.º 2
0
        private int CheckDiagram(Generate_ρ_LineForDiagram toCheck, double Mbh, double NbhPower2, int percision = 3)
        {
            toCheck.GetLineForDiagram();
            var test = toCheck.ListOfDotsInLineOfDiagram;



            var NmaxOfM = test.Single(m => m.Mbh == test.Max(n => n.Mbh)).NbhPower2;

            if (NbhPower2 >= NmaxOfM)
            {
                test.RemoveAll(n => n.NbhPower2 < NmaxOfM);
                var closestItemByM = test
                                     .Aggregate((x, y) => Math.Abs(x.Mbh - Mbh) < Math.Abs(y.Mbh - Mbh) ? x : y);

                if (
                    (Math.Round(Mbh, percision) >= Math.Round(closestItemByM.Mbh, percision) && Math.Round(closestItemByM.Mbh, percision) <= Math.Round(Mbh, percision))
                    &&
                    (Math.Round(NbhPower2, percision) >= Math.Round(closestItemByM.NbhPower2, percision) && Math.Round(closestItemByM.NbhPower2, percision) >= Math.Round(NbhPower2, percision)))
                {
                    return(0);
                }
                else if (closestItemByM.NbhPower2 > NbhPower2)
                {
                    return(1);
                }
                else
                {
                    return(2);
                }
            }
            else
            {
                test.RemoveAll(n => n.NbhPower2 > NmaxOfM);
                var closestItemByM = test
                                     .Aggregate((x, y) => Math.Abs(x.Mbh - Mbh) < Math.Abs(y.Mbh - Mbh) ? x : y);

                if (
                    (Math.Round(Mbh, percision) >= Math.Round(closestItemByM.Mbh, percision) && Math.Round(closestItemByM.Mbh, percision) <= Math.Round(Mbh, percision))
                    &&
                    (Math.Round(NbhPower2, percision) >= Math.Round(closestItemByM.NbhPower2, percision) && Math.Round(closestItemByM.NbhPower2, percision) >= Math.Round(NbhPower2, percision)))
                {
                    return(0);
                }
                else if (closestItemByM.NbhPower2 < NbhPower2)
                {
                    return(1);
                }
                else
                {
                    return(2);
                }
            }
        }
        private int CheckDiagram(Generate_ρ_LineForDiagram toCheck, double Mbh, double NbhPower2)
        {
            toCheck.GetLineForDiagram();
            var test = toCheck.ListOfDotsInLineOfDiagram;



            var NmaxOfM = test.Single(m => m.Mbh == test.Max(n => n.Mbh)).NbhPower2;

            if (NbhPower2 >= NmaxOfM)
            {
                test.RemoveAll(n => n.NbhPower2 < NmaxOfM);
                var closestItemByM = test
                                     .Aggregate((x, y) => Math.Abs(x.Mbh - Mbh) < Math.Abs(y.Mbh - Mbh) ? x : y);

                if (
                    (Mbh - 0.05 >= closestItemByM.Mbh && closestItemByM.Mbh <= Mbh + 0.05)
                    &&
                    (NbhPower2 - 0.05 >= closestItemByM.NbhPower2 && closestItemByM.NbhPower2 >= NbhPower2 + 0.05))
                {
                    return(0);
                }
                else if (closestItemByM.NbhPower2 > NbhPower2)
                {
                    return(1);
                }
                else
                {
                    return(2);
                }
            }
            else
            {
                test.RemoveAll(n => n.NbhPower2 > NmaxOfM);
                var closestItemByM = test
                                     .Aggregate((x, y) => Math.Abs(x.Mbh - Mbh) < Math.Abs(y.Mbh - Mbh) ? x : y);

                if (
                    (Mbh - 0.02 >= closestItemByM.Mbh && closestItemByM.Mbh <= Mbh + 0.02)
                    &&
                    (NbhPower2 - 0.02 >= closestItemByM.NbhPower2 && closestItemByM.NbhPower2 >= NbhPower2 + 0.02))
                {
                    return(0);
                }
                else if (closestItemByM.NbhPower2 < NbhPower2)
                {
                    return(1);
                }
                else
                {
                    return(2);
                }
            }
        }
Ejemplo n.º 4
0
        private static void testqq()
        {
            var m = new Material()
            {
                beton    = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"),
                armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"),
            };
            var s = new Generate_ρ_LineForDiagram(m);

            var r = s.ListOfDotsInLineOfDiagram;
        }
Ejemplo n.º 5
0
        private void testqq()
        {
            var m = new Material()
            {
                beton    = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"),
                armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"),
            };
            var s = new Generate_ρ_LineForDiagram(m);

            s.GetLineForDiagram();
            var r      = s.ListOfDotsInLineOfDiagram;
            var points = r.Select(n => new Point(n.Mbh, n.NbhPower2)).AsEnumerable();

            var l = new List <IEnumerable <Point> >();

            l.Add(points);
            list.ItemsSource = l;
        }