public IWeld GetWeld(WeldType weldType, double F_y, double F_u, double F_EXX, double Size, double A_nBase, double Length) { IWeld weld = null; switch (weldType) { case WeldType.CJP: weld = new CJPGrooveWeld(F_y, F_u, F_EXX, Size, A_nBase, Length); break; case WeldType.PJP: weld = new PJPGrooveWeld(F_y, F_u, F_EXX, Size, A_nBase, Length); break; case WeldType.Fillet: weld = new FilletWeld(F_y, F_u, F_EXX, Size, A_nBase, Length); break; } return(weld); }
public static Dictionary <string, object> WeldStrength(double l_weld, string WeldType, string WeldLoadTypeId, double t_weld, double F_EXX = 70, double A_nBase = 0, double F_y = 36, double F_u = 58, double theta = 0, bool IgnoreBaseMetalChecks = true, string Code = "AISC360-10") { //Default values double phiR_n = 0; //Calculation logic: WeldType weldType; bool IsValidString = Enum.TryParse(WeldType, true, out weldType); if (IsValidString == true) { WeldLoadType weldLoadType; bool IsValidStringLoadType = Enum.TryParse(WeldLoadTypeId, true, out weldLoadType); if (IsValidStringLoadType == true) { WeldFactory wf = new WeldFactory(); IWeld weld = wf.GetWeld(weldType, F_y, F_u, F_EXX, t_weld, A_nBase, l_weld); phiR_n = weld.GetStrength(weldLoadType, theta, IgnoreBaseMetalChecks); } else { throw new Exception("Weld strength calculation failed. Invalid weld load case (type) designation."); } } else { throw new Exception("Weld strength calculation failed. Invalid weld type designation."); } return(new Dictionary <string, object> { { "phiR_n", phiR_n } }); }