Add steel material saving
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Models.Materials.Libraries.Factories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -18,6 +19,22 @@ namespace StructureHelperLogics.Models.Materials
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + ": " + codeType);
|
||||
}
|
||||
|
||||
public static List<IMaterialSafetyFactor> GetDefaultSteelSafetyFactors(CodeTypes codeType)
|
||||
{
|
||||
if (codeType == CodeTypes.SP16_2017) return GetSteelFactorsSP16_2017();
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + ": " + codeType);
|
||||
}
|
||||
|
||||
private static List<IMaterialSafetyFactor> GetSteelFactorsSP16_2017()
|
||||
{
|
||||
List<IMaterialSafetyFactor> factors = new List<IMaterialSafetyFactor>();
|
||||
IMaterialSafetyFactor coefficient;
|
||||
coefficient = SteelFactorsFactory.GetFactor(SteelFactorTypes.WorkCondition);
|
||||
coefficient.Take = true;
|
||||
factors.Add(coefficient);
|
||||
return factors;
|
||||
}
|
||||
|
||||
public static List<IMaterialSafetyFactor> GetDefaultFRSafetyFactors(CodeTypes codeType, MaterialTypes materialType)
|
||||
{
|
||||
if (codeType == CodeTypes.SP164_2014) return GetFRFactorsSP164_2014(materialType);
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public interface ISteelLibMaterial : ILibMaterial
|
||||
{
|
||||
double UlsFactor { get; set; }
|
||||
double SlsFactor { get; set; }
|
||||
double WorkConditionFactor { get; set; }
|
||||
double ThicknessFactor { get; set; }
|
||||
double MaxPlasticStrainRatio { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.Materials.Logics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
@@ -67,7 +61,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
if (sourceObject is IConcreteLibMaterial concreteLibMaterial)
|
||||
{
|
||||
concreteUpdateStrategy.Update(targetObject as IConcreteLibMaterial, concreteLibMaterial);
|
||||
ConcreteUpdateStrategy.Update(targetObject as IConcreteLibMaterial, concreteLibMaterial);
|
||||
}
|
||||
else if (sourceObject is IReinforcementLibMaterial reinforcementLibMaterial)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace StructureHelperLogics.Models.Materials
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
LibUpdateStrategy.Update(targetObject, sourceObject);
|
||||
targetObject.MaxPlasticStrainRatio = sourceObject.MaxPlasticStrainRatio;
|
||||
targetObject.UlsFactor = sourceObject.UlsFactor;
|
||||
targetObject.ThicknessFactor = sourceObject.ThicknessFactor;
|
||||
targetObject.WorkConditionFactor = sourceObject.WorkConditionFactor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public class SteelLibMaterial : ISteelLibMaterial
|
||||
{
|
||||
const MaterialTypes materialType = MaterialTypes.Steel;
|
||||
private const double safetyFactorForULS = 1.05;
|
||||
private const double safetyFactorforSLS = 1.0;
|
||||
|
||||
private IMaterialFactorLogic factorLogic => new MaterialFactorLogic(SafetyFactors);
|
||||
private readonly List<IMaterialLogic> materialLogics = ProgramSetting.MaterialLogics.Where(x => x.MaterialType == materialType).ToList();
|
||||
@@ -25,6 +23,10 @@ namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; } = [];
|
||||
public double MaxPlasticStrainRatio { get; set; } = 3.0;
|
||||
public double UlsFactor { get; set; } = 1.025;
|
||||
public double SlsFactor { get; set; } = 1.0;
|
||||
public double ThicknessFactor { get; set; } = 1.0;
|
||||
public double WorkConditionFactor { get; set; } = 1.0;
|
||||
|
||||
public SteelLibMaterial(Guid id)
|
||||
{
|
||||
@@ -55,6 +57,10 @@ namespace StructureHelperLogics.Models.Materials
|
||||
MaxPlasticStrainRatio = MaxPlasticStrainRatio,
|
||||
LimitState = limitState,
|
||||
CalcTerm = calcTerm,
|
||||
UlsFactor = UlsFactor,
|
||||
SlsFactor = SlsFactor,
|
||||
ThicknessFactor = ThicknessFactor,
|
||||
WorkConditionFactor = WorkConditionFactor,
|
||||
};
|
||||
MaterialLogic.Options = options;
|
||||
var material = MaterialLogic.GetLoaderMaterial();
|
||||
@@ -72,17 +78,17 @@ namespace StructureHelperLogics.Models.Materials
|
||||
double factor;
|
||||
if (limitState == LimitStates.ULS)
|
||||
{
|
||||
factor = safetyFactorForULS;
|
||||
factor = UlsFactor;
|
||||
}
|
||||
else if (limitState == LimitStates.SLS)
|
||||
{
|
||||
factor = safetyFactorforSLS;
|
||||
factor = SlsFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(limitState));
|
||||
}
|
||||
double strength = baseStength / factor;
|
||||
double strength = baseStength * ThicknessFactor / factor;
|
||||
return (strength * compressionFactor, strength * tensionFactor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user