示例#1
0
        private StandardHookInTension CreateHookObject(double ConcStrength, double RebarDiameter, bool IsEpoxyCoated,
    ConcreteTypeByWeight typeByWeight, double ExcessFlexureReinforcementRatio)
        {
            MockRepository mocks = new MockRepository();

            IRebarMaterial rebarMat = mocks.Stub<IRebarMaterial>();
            Expect.Call(rebarMat.YieldStress).Return(60000);
            Rebar rebar = new Rebar(RebarDiameter,IsEpoxyCoated, rebarMat);

            ICalcLogEntry entryStub = mocks.Stub<ICalcLogEntry>();
            ICalcLog logStub = mocks.Stub<ICalcLog>();

            //IConcreteMaterial ConcStub = mocks.Stub<IConcreteMaterial>();
            IConcreteMaterial ConcStub = new ConcreteMaterial(ConcStrength, typeByWeight, logStub) as IConcreteMaterial;
            ConcStub.SpecifiedCompressiveStrength = ConcStrength;
            ConcStub.TypeByWeight = typeByWeight;


            using (mocks.Record())
            {
                logStub.CreateNewEntry();
                LastCall.Return(entryStub);
            }

            StandardHookInTension tensHook = new StandardHookInTension(ConcStub, rebar, logStub, ExcessFlexureReinforcementRatio);

            return tensHook;
        }
        public static Dictionary<string, object> StandardHookTensionDevelopmentLengthBasic(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b,
            RebarMaterial RebarMaterial,  double ExcessRebarRatio = 1.0, string RebarCoatingType = "Uncoated",string Code = "ACI318-14")
        {
            //Default values
            double l_dh = 0;


            //Calculation logic:

            IRebarMaterial mat = RebarMaterial.Material;
            bool IsEpoxyCoated = true;

            if (RebarCoatingType.ToLower() == "uncoated")
            {
                IsEpoxyCoated=false;
            }
            else if (RebarCoatingType.ToLower() == "epoxycoated")
            {
                IsEpoxyCoated =true;
            }
            else
            {
                throw new Exception("Unrecognized rebar coating string.");
            }
            Rebar rebar = new Rebar(d_b, IsEpoxyCoated, mat);

            CalcLog log = new CalcLog();

            StandardHookInTension hook = new StandardHookInTension(ConcreteMaterial.Concrete, rebar, log, ExcessRebarRatio);
            l_dh = hook.GetDevelopmentLength();

            return new Dictionary<string, object>
            {
                { "l_dh", l_dh }
 
            };
        }
        public static Dictionary<string, object> StandardHookTensionDevelopmentLengthBasic(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b,
            RebarMaterial RebarMaterial, string HookType, string RebarCoatingType, double ExcessRebarRatio, double c_side, double c_extension, string EnclosingRebarDirection, 
            double s_enclosing, string Code = "ACI318-14")
        {
            //Default values
            double l_dh = 0;
                                                                                                                                                                

            //Calculation logic:

            IRebarMaterial mat = RebarMaterial.Material;

            bool IsEpoxyCoated = true;

            if (RebarCoatingType.ToLower() == "uncoated")
            {
                IsEpoxyCoated=false;
            }
            else if (RebarCoatingType.ToLower() == "epoxycoated")
            {
                IsEpoxyCoated =true;
            }
            else
            {
                throw new Exception("Unrecognized rebar coating string.");
            }

            Rebar rebar = new Rebar(d_b, IsEpoxyCoated, mat);

            CalcLog log = new CalcLog();

            StandardHookInTension hook = new StandardHookInTension(ConcreteMaterial.Concrete, rebar, log, ExcessRebarRatio);
            
            HookType _HookType;
            bool IsValidHookTypeString = Enum.TryParse(HookType, true, out _HookType);
            if (IsValidHookTypeString == false)
            {
                throw new Exception("Failed to convert string. Check HookType string. Please check input");
            }


            bool enclosingRebarIsPerpendicular = false;
            if (EnclosingRebarDirection.ToLower()=="perpendicular")
            {
                enclosingRebarIsPerpendicular = true;
            }
            else if (EnclosingRebarDirection.ToLower() == "parallel")
            {
                enclosingRebarIsPerpendicular = false;
            }
            else
	        {
                throw new Exception("Failed to convert string. Check EnclosingRebarDirection string. Please check input");
	        }


            l_dh = hook.GetDevelopmentLength(_HookType, c_side, c_extension, enclosingRebarIsPerpendicular,s_enclosing);

            return new Dictionary<string, object>
            {
                { "l_dh", l_dh }
 
            };
        }