Esempio n. 1
0
 public Rebar(double Diameter, bool IsEpoxyCoated, IRebarMaterial rebarMaterial)
 {
     Section            = new RebarSection(Diameter, 0);
     this.db            = Diameter;
     this.isEpoxyCoated = IsEpoxyCoated;
     this.rebarMaterial = rebarMaterial;
 }
Esempio n. 2
0
 private void CalculateProperties()
 {
     if (DesignationSet == true)
     {
         RebarSectionFactory factory = new RebarSectionFactory();
         RebarSection        sec     = factory.GetRebarSection(Designation);
         if (sec != null)
         {
             this.A  = sec.A;
             this.db = sec.Diameter;
         }
     }
 }
Esempio n. 3
0
        public RebarSection GetRebarSection(RebarDesignation BarDesignation)
        {
            RebarSection Bar = null;

            //remove "No" from BarDesignation
            string DesignationStr = BarDesignation.ToString().Substring(2);

           #region Read Table Data

            var Tv11 = new { Designation = "", Diam = 0.0, Area = 0.0, }; // sample
                var ResultList = ListFactory.MakeList(Tv11);

                using (StringReader reader = new StringReader(Resources.ACI_MildRebarProperties))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        string[] Vals = line.Split(',');
                        if (Vals.Count() == 4)
                        {
                            string V1 = Vals[0];
                            double V2 = double.Parse(Vals[1], CultureInfo.InvariantCulture);
                            double V3 = double.Parse(Vals[2], CultureInfo.InvariantCulture);
                            ResultList.Add(new { Designation = V1, Diam = V2, Area= V3});
                        }
                    }

                }

                #endregion

                var RebarValues = from v in ResultList where (v.Designation == DesignationStr) select v;
                var foundValues = (RebarValues.ToList());
                if (foundValues.Count>=1)
                {
                    var thisBar = foundValues.First();
                    Bar = new RebarSection(BarDesignation, thisBar.Diam, thisBar.Area);
                }
                return Bar;

        }
Esempio n. 4
0
        public RebarSection GetRebarSection(RebarDesignation BarDesignation)
        {
            RebarSection Bar = null;

            //remove "No" from BarDesignation
            string DesignationStr = BarDesignation.ToString().Substring(2);

            #region Read Table Data

            var Tv11       = new { Designation = "", Diam = 0.0, Area = 0.0, }; // sample
            var ResultList = ListFactory.MakeList(Tv11);

            using (StringReader reader = new StringReader(Resources.ACI_MildRebarProperties))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 4)
                    {
                        string V1 = Vals[0];
                        double V2 = double.Parse(Vals[1], CultureInfo.InvariantCulture);
                        double V3 = double.Parse(Vals[2], CultureInfo.InvariantCulture);
                        ResultList.Add(new { Designation = V1, Diam = V2, Area = V3 });
                    }
                }
            }

            #endregion

            var RebarValues = from v in ResultList where (v.Designation == DesignationStr) select v;
            var foundValues = (RebarValues.ToList());
            if (foundValues.Count >= 1)
            {
                var thisBar = foundValues.First();
                Bar = new RebarSection(BarDesignation, thisBar.Diam, thisBar.Area);
            }
            return(Bar);
        }
        public static Dictionary<string, object> RebarAreaByIdAndNumberOfBars(string RebarSizeId,double N_bars)
        {
            //Default values
            double A_s = 0;


            //Calculation logic:
            RebarDesignation des;
            bool IsValidString = Enum.TryParse(RebarSizeId, true, out des);
            if (IsValidString == false)
            {
                throw new Exception("Rebar size is not recognized. Check input.");
            }
            RebarSection sec = new RebarSection(des);
            double A_b = sec.Area;
            A_s = N_bars * A_b;


            return new Dictionary<string, object>
            {
                { "A_s", A_s }
 
            };
        }
Esempio n. 6
0
        public static Dictionary<string, object> BarArea(string RebarSizeId)
        {
            //Default values
            double A_b = 0;
            double d_b = 0;

            //Calculation logic:
            RebarDesignation des;
            bool IsValidString = Enum.TryParse(RebarSizeId, true, out des);
            if (IsValidString == false)
            {
                throw new Exception("Rebar size is not recognized. Check input.");
            }
            RebarSection sec = new RebarSection(des);
            A_b = sec.Area;
            d_b = sec.Diameter;

            return new Dictionary<string, object>
            {
                { "A_b", A_b },
                { "d_b", d_b }
 
            };
        }
Esempio n. 7
0
 public Rebar(double Area, IRebarMaterial rebarMaterial)
 {
     Section = new RebarSection(0,Area);
     this.A = Area;
     this.rebarMaterial = rebarMaterial;
 }
Esempio n. 8
0
 public Rebar(double Diameter, bool IsEpoxyCoated, IRebarMaterial rebarMaterial)
 {
     Section = new RebarSection(Diameter, 0);
     this.db = Diameter;
     this.isEpoxyCoated = IsEpoxyCoated;
     this.rebarMaterial = rebarMaterial;
 }
Esempio n. 9
0
 public Rebar(double Area, IRebarMaterial rebarMaterial)
 {
     Section            = new RebarSection(0, Area);
     this.A             = Area;
     this.rebarMaterial = rebarMaterial;
 }
Esempio n. 10
0
 public void RebarSectionReturnsArea()
 {
     RebarSection sec = new RebarSection(ACI.Entities.RebarDesignation.No6);
     Assert.AreEqual(0.44, sec.Area);
 }