public Rebar(double Diameter, bool IsEpoxyCoated, IRebarMaterial rebarMaterial) { Section = new RebarSection(Diameter, 0); this.db = Diameter; this.isEpoxyCoated = IsEpoxyCoated; this.rebarMaterial = rebarMaterial; }
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; } } }
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 Rebar(double Area, IRebarMaterial rebarMaterial) { Section = new RebarSection(0, Area); this.A = Area; this.rebarMaterial = rebarMaterial; }