static int Main ()
	{
		Concrete c = new Concrete ();

		if (c.A () != 1)
			return 1;

		return 0;
	}
 public static float[] concreteMaterials(float foundamentVolume, Concrete type)
 {
     float[] st = new float[3];
     st = props[(int)type];
     float mCon = 1 + st[1] + st[2];
     float K = 2400*foundamentVolume/mCon;
     st[0] *= K;
     st[1] *= K;
     st[2] *= K;
     return st;
 }
Exemple #3
0
	public static int Main ()
	{
		int failure = 0;
		Concrete val = new Concrete ();

		failure |= DoTest ("A", "A", ((A) val).Spec, 0x01);
		failure |= DoTest ("B", "B", ((B) val).Spec, 0x02);
		failure |= DoTest ("C", "B", ((C) val).Spec, 0x04);
		failure |= DoTest ("Concrete", "Concrete", val.Spec, 0x08);

		return failure;
	}
        public static Dictionary<string, object> StraightBarTensionLapSpliceLengthDetailed(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b1, double d_b2,
            RebarMaterial RebarMaterial, string RebarSpliceClass, string RebarCoatingType, string RebarCastingPosition, double s_clear, double c_c,
            double A_tr, double s_tr, double n, string Code = "ACI318-14")
        {
            //Default values
            double l_st = 0;


            //Calculation logic:
            IRebarMaterial mat = RebarMaterial.Material;

            bool IsEpoxyCoated = false;
            switch (RebarCoatingType)
            {
                case "Uncoated": IsEpoxyCoated = false; break;
                case "EpoxyCoated": IsEpoxyCoated = true; break;

                default: throw new Exception("Unrecognized rebar coating. Please check string input"); break;
            }

            Rebar rebar1 = new Rebar(d_b1, IsEpoxyCoated, mat);
            Rebar rebar2 = new Rebar(d_b2, IsEpoxyCoated, mat);

            bool IsTopRebar = false;
            switch (RebarCastingPosition)
            {
                case "Other": IsTopRebar = false; break;
                case "Top": IsTopRebar = true; break;

                default: throw new Exception("Unrecognized rebar casting position. Please check string input"); break;
            }

            
            TensionLapSpliceClass _RebarSpliceClass;
            bool IsValidRebarSpliceClass = Enum.TryParse(RebarSpliceClass, true, out _RebarSpliceClass);
            if (IsValidRebarSpliceClass == false)
            {
                throw new Exception("Failed to convert string. RebarSpliceClass not recognzed (A and B are acceptable inputs). Please check input");
            }


            CalcLog log = new CalcLog();

            TensionLapSplice ls = new TensionLapSplice(ConcreteMaterial.Concrete,rebar1,rebar2, s_clear, c_c, IsTopRebar,A_tr,s_tr,n, _RebarSpliceClass, log);
            l_st = ls.Length;

            return new Dictionary<string, object>
            {
                { "l_st", l_st }
 
            };
        }
        public void ShouldRegisterAndResolveSingletonInstance()
        {
            var componentUnderTest = new WindsorServiceBusResolver();

             var instance = new Concrete();
             componentUnderTest.Register<IContract>(instance);

             var resultA = componentUnderTest.Resolve<IContract>();
             var resultB = componentUnderTest.Resolve<IContract>();

             Assert.That(resultA, Is.SameAs(instance));
             Assert.That(resultB, Is.SameAs(instance));
        }
        public static Dictionary<string, object> CompressionLapSpliceLength(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b,
            RebarMaterial RebarMaterial, bool HasConfiningReinforcement = false, string Code = "ACI318-14")
        {
            //Default values
            double l_sc = 0;


            //Calculation logic:
            IRebarMaterial mat = RebarMaterial.Material;
            Rebar rebar = new Rebar(d_b, false, mat);

            return new Dictionary<string, object>
            {
                { "l_sc", l_sc }
 
            };
        }
        public static Dictionary<string, object> OneWayShearStrengthProvidedByRebar(double A_v, Concrete.ACI318.General.Reinforcement.RebarMaterial TransverseRebarMaterial,
            double d, double s, string Code = "ACI318-14")
        {
            //Default values
            double phiV_s = 0;


            //Calculation logic:
            OneWayShearReinforcedSectionNonPrestressed section = new OneWayShearReinforcedSectionNonPrestressed(d, TransverseRebarMaterial.Material, A_v, s);
            phiV_s = section.GetSteelShearStrength() / 1000.0; //default ACI units are psi. Convert to ksi, consistent with Dynamo nodes

            return new Dictionary<string, object>
            {
                { "phiV_s", phiV_s }
 
            };
        }
        public static Dictionary<string, object> StraightBarTensionDevelopmentLengthBasic(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b, 
            Concrete.ACI318.General.Reinforcement.RebarMaterial RebarMaterial,
            string RebarCoatingType, string RebarCastingPosition, double ExcessRebarRatio, bool MeetsRebarSpacingAndEdgeDistance,
            bool HasMinimumTransverseReinforcement = false, string Code = "ACI318-14")
        {
            //Default values
            double l_d = 0;


            //Calculation logic:

            IRebarMaterial mat = RebarMaterial.Material;
            
            bool IsEpoxyCoated = false;
            switch (RebarCoatingType)
            {
                case "Uncoated"   :  IsEpoxyCoated= false; break;
                case "EpoxyCoated":  IsEpoxyCoated=true; break;

                default: throw new Exception("Unrecognized rebar coating. Please check string input"); break;
            }

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

            bool IsTopRebar = false;
            switch (RebarCastingPosition)
            {
                case "Other"   :  IsTopRebar= false; break;
                case "Top":  IsTopRebar=true; break;

                default: throw new Exception("Unrecognized rebar casting position. Please check string input"); break;
            }

            CalcLog log = new CalcLog();

            DevelopmentTension d = new DevelopmentTension(ConcreteMaterial.Concrete, rebar, MeetsRebarSpacingAndEdgeDistance, IsTopRebar, ExcessRebarRatio, true, log);
            l_d = d.GetTensionDevelopmentLength(HasMinimumTransverseReinforcement);

            return new Dictionary<string, object>
            {
                { "l_d", l_d }
 
            };
        }
        public static Dictionary<string, object> StraightBarTensionDevelopmentLengthDetailed(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b, 
            RebarMaterial RebarMaterial, string RebarCoatingType, string RebarCastingPosition, double ExcessRebarRatio, double s_clear, double c_c,
            double A_tr, double s_tr, double n, string Code = "ACI318-14")
        {
            //Default values
            double l_d = 0;


            //Calculation logic:
            IRebarMaterial mat = RebarMaterial.Material;

            bool IsEpoxyCoated = false;
            switch (RebarCoatingType)
            {
                case "Uncoated": IsEpoxyCoated = false; break;
                case "EpoxyCoated": IsEpoxyCoated = true; break;

                default: throw new Exception("Unrecognized rebar coating. Please check string input"); break;
            }

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


            bool IsTopRebar = false;
            switch (RebarCastingPosition)
            {
                case "Other": IsTopRebar = false; break;
                case "Top": IsTopRebar = true; break;

                default: throw new Exception("Unrecognized rebar casting position. Please check string input"); break;
            }

            CalcLog log = new CalcLog();

            DevelopmentTension d = new DevelopmentTension(ConcreteMaterial.Concrete,rebar,s_clear,c_c,IsTopRebar,ExcessRebarRatio,true,log);
            l_d = d.GetTensionDevelopmentLength(A_tr,s_tr,n);


            return new Dictionary<string, object>
            {
                { "l_d", l_d }
 
            };
        }
        public static Dictionary<string, object> UpperLimitOnShearStrength(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial,
            double b_w, double d, double phiV_c, string Code = "ACI318-14")
        {
            //Default values
            double phiV_nMax = 0;


            //Calculation logic:
            IConcreteMaterial mat = ConcreteMaterial.Concrete;
            CrossSectionRectangularShape shape = new CrossSectionRectangularShape(mat,null, b_w, d);
            ConcreteSectionOneWayShearNonPrestressed section = new ConcreteSectionOneWayShearNonPrestressed(d,shape);
            phiV_nMax = section.GetUpperLimitShearStrength(phiV_c*1000.0) / 1000.0; //default ACI units are psi. Convert to ksi, consistent with Dynamo nodes

            return new Dictionary<string, object>
            {
                { "phiV_nMax", phiV_nMax }
 
            };
        }
        public static Dictionary<string, object> OneWayShearStrengthProvidedByConcrete(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial,
            double b_w, double d, double h, double N_u = 0.0, double rho_w = 0.0, double M_u = 0.0, double V_u = 0.0, string Code = "ACI318-14")
        {
            //Default values
            double phiV_c = 0;


            //Calculation logic:
            IConcreteMaterial mat = ConcreteMaterial.Concrete;
            CrossSectionRectangularShape shape = new CrossSectionRectangularShape(mat,null, b_w, h);
            ConcreteSectionOneWayShearNonPrestressed section = new ConcreteSectionOneWayShearNonPrestressed(d,shape);
            phiV_c = section.GetConcreteShearStrength(N_u, rho_w, M_u, V_u)/1000.0; //default ACI units are psi. Convert to ksi, consistent with Dynamo nodes

            return new Dictionary<string, object>
            {
                { "phiV_c", phiV_c }
 
            };
        }
        public static Dictionary<string, object> CompressionDevelopmentLengthBasic(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b,
            RebarMaterial RebarMaterial, bool HasConfiningReinforcement=false, string Code = "ACI318-14")
        {
            //Default values
            double l_dc = 0;


            //Calculation logic:
            IRebarMaterial mat = RebarMaterial.Material;
            Rebar rebar = new Rebar(d_b, false, mat);

            CalcLog log = new CalcLog();
            DevelopmentCompression cd = new DevelopmentCompression(ConcreteMaterial.Concrete, rebar, log, HasConfiningReinforcement);
            l_dc = cd.Length;

            return new Dictionary<string, object>
            {
                { "l_dc", l_dc }
 
            };
        }
        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 string GetVisibleText()
 {
     return(Concrete.GetVisibleText());
 }
 public System.Drawing.Rectangle[] GetTextLocations(string textToFind, System.Drawing.Rectangle textArea)
 {
     return(Concrete.GetTextLocations(textToFind, textArea));
 }
 public uint HighlightMatches <TChild>(HP.LFT.SDK.IDescription description)  where TChild : class, HP.LFT.SDK.ITestObject
 {
     return(Concrete.HighlightMatches <TChild>(description));
 }
 public void Highlight()
 {
     Concrete.Highlight();
 }
 public System.Drawing.Image GetSnapshot()
 {
     return(Concrete.GetSnapshot());
 }
 public bool Exists(uint timeout)
 {
     return(Concrete.Exists(timeout));
 }
Exemple #20
0
        static void Main()
        {
            var c = new Concrete {Id = "1", Name = "one"};

            Concrete p = c.Clone() as Concrete;
        }
 public TemplateMethod()
 {
     AbstractClass concrete = new Concrete();
     concrete.TemplateMathod();
 }
        public void RegisterSingletonRegistersConcreteTypeAsSingletonAgainstInterface()
        {
            var concreteViaFunc = new Concrete();
            _provider.RegisterSingleton<IInterface>(() => concreteViaFunc);
            Assert.Equal(concreteViaFunc, _provider.Resolve<IInterface>());
            Assert.Same(_provider.Resolve<IInterface>(), _provider.Resolve<IInterface>());

            var concreteInstance = new Concrete();
            _provider.RegisterSingleton<IInterface>(concreteInstance);
            Assert.Equal(concreteInstance, _provider.Resolve<IInterface>());
            Assert.Same(_provider.Resolve<IInterface>(), _provider.Resolve<IInterface>());
        }
 public bool VerifyImageMatch(System.Drawing.Image expectedImage, byte pixelTolerance = 0, byte rgbTolerance = 0)
 {
     return(Concrete.VerifyImageMatch(expectedImage, pixelTolerance, rgbTolerance));
 }
        public void RegisterSingletonRegistersConcreteTypeAsSingletonAgainstInterface()
        {
            var concreteViaFunc = new Concrete();
            provider.RegisterSingleton<Interface>(() => concreteViaFunc);
            Assert.That(provider.Resolve<Interface>(), Is.EqualTo(concreteViaFunc));
            Assert.That(provider.Resolve<Interface>(), Is.SameAs(provider.Resolve<Interface>()));

            var concreteInstance = new Concrete();
            provider.RegisterSingleton<Interface>(concreteInstance);
            Assert.That(provider.Resolve<Interface>(), Is.EqualTo(concreteInstance));
            Assert.That(provider.Resolve<Interface>(), Is.SameAs(provider.Resolve<Interface>()));
        }
 public string GetVisibleText(System.Drawing.Rectangle textArea)
 {
     return(Concrete.GetVisibleText(textArea));
 }
 public bool Exists()
 {
     return(Concrete.Exists());
 }
 public System.Nullable <System.Drawing.Point> VerifyImageExists(System.Drawing.Image imageToFind, byte similarity = 100)
 {
     return(Concrete.VerifyImageExists(imageToFind, similarity));
 }
            public static Concrete[] BuildAt(Point point)
            {
                var a = new List<Concrete>();

                System.Action<int, int> Add =
                    delegate(int x, int y)
                    {
                        var c = new Concrete();

                        c.MoveTo(x, y);

                        a.Add(c);
                    };

                Add(point.X - Size * 2, point.Y);
                Add(point.X - Size * 2, point.Y - Size);
                Add(point.X - Size * 1, point.Y - Size);
                Add(point.X, point.Y - Size);
                Add(point.X + Size * 1, point.Y - Size);
                Add(point.X + Size * 1, point.Y);

                return a.ToArray();
            }
 public bool VerifyImageMatch(System.Drawing.Image expectedImage, HP.LFT.SDK.Utils.ImageMaskArea maskArea, byte pixelTolerance = 0, byte rgbTolerance = 0)
 {
     return(Concrete.VerifyImageMatch(expectedImage, maskArea, pixelTolerance, rgbTolerance));
 }
 public void Swipe(HP.LFT.SDK.SwipeDirection direction)
 {
     Concrete.Swipe(direction);
 }
 public void Swipe(HP.LFT.SDK.Web.WebSwipeArgs args)
 {
     Concrete.Swipe(args);
 }
 public HP.LFT.SDK.IDescription GetDescription()
 {
     return(Concrete.GetDescription());
 }
Exemple #33
0
 /// <summary>
 /// Initializes a new instance of the Generator class.
 /// </summary>
 /// <param name="grammar">Concrete grammar</param>
 public Generator(Concrete grammar)
 {
     this.concrete = grammar;
 }
 public TChild[] FindChildren <TChild>(HP.LFT.SDK.IDescription selector)  where TChild : class, HP.LFT.SDK.ITestObject
 {
     return(Concrete.FindChildren <TChild>(selector));
 }
        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 }
 
            };
        }
Exemple #36
0
 /// <summary>
 /// Initializes a new instance of the Linearizer class.
 /// Linearizes an expression to a bracketed token
 /// and further on to a string
 /// not implemented to dependent categories, implicit argument,
 /// and higher-order abstract syntax
 /// </summary>
 /// <param name="pgf">PGF-file containing the concrete grammar</param>
 /// <param name="concrete">Concrete grammar</param>
 public Linearizer(CSPGF.PGF pgf, Concrete concrete)
 {
     this.pgf = pgf;
     this.cnc = concrete;
     this.linProd = this.GetLProductions();
 }