Interpolation View for calculation result was added
This commit is contained in:
@@ -9,12 +9,14 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public class ConcreteLibMaterial : IConcreteLibMaterial
|
||||
{
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public bool TensionForULS { get ; set; }
|
||||
public bool TensionForSLS { get; set; }
|
||||
|
||||
@@ -22,6 +24,8 @@ namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
public ConcreteLibMaterial()
|
||||
{
|
||||
SafetyFactors = new List<IMaterialSafetyFactor>();
|
||||
SafetyFactors.AddRange(PartialCoefficientFactory.GetDefaultConcreteSafetyFactors(ProgramSetting.CodeType));
|
||||
optionLogic = new MaterialOptionLogic(new LCMB.ConcreteOptions());
|
||||
}
|
||||
|
||||
@@ -33,6 +37,15 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm);
|
||||
double compressionVal = 1d;
|
||||
double tensionVal = 1d;
|
||||
foreach (var item in SafetyFactors.Where(x => x.Take == true))
|
||||
{
|
||||
compressionVal *= item.GetFactor(StressStates.Compression, calcTerm, limitState);
|
||||
tensionVal *= item.GetFactor(StressStates.Tension, calcTerm, limitState);
|
||||
}
|
||||
materialOptions.ExternalFactor.Compressive = compressionVal;
|
||||
materialOptions.ExternalFactor.Tensile = tensionVal;
|
||||
LCMB.IMaterialBuilder builder = new LCMB.ConcreteBuilder(materialOptions);
|
||||
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public static class PartialCoefficientFactory
|
||||
{
|
||||
public static List<IMaterialSafetyFactor> GetDefaultConcreteSafetyFactors(CodeTypes codeType)
|
||||
{
|
||||
if (codeType == CodeTypes.SP63_13330_2018) return GetConcreteFactorsSP63_2018();
|
||||
else if (codeType == CodeTypes.EuroCode_2_1990) return GetConcreteFactorsEC2_1990();
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + ": " + codeType);
|
||||
}
|
||||
|
||||
private static List<IMaterialSafetyFactor> GetConcreteFactorsEC2_1990()
|
||||
{
|
||||
List<IMaterialSafetyFactor> factors = new List<IMaterialSafetyFactor>();
|
||||
return factors;
|
||||
}
|
||||
|
||||
private static List<IMaterialSafetyFactor> GetConcreteFactorsSP63_2018()
|
||||
{
|
||||
List<IMaterialSafetyFactor> factors = new List<IMaterialSafetyFactor>();
|
||||
IMaterialSafetyFactor coefficient;
|
||||
coefficient = ConcreteFactorsFactory.GetFactor(FactorType.LongTermFactor);
|
||||
coefficient.Take = true;
|
||||
factors.Add(coefficient);
|
||||
coefficient = ConcreteFactorsFactory.GetFactor(FactorType.PlainConcreteFactor);
|
||||
coefficient.Take = false;
|
||||
factors.Add(coefficient);
|
||||
coefficient = ConcreteFactorsFactory.GetFactor(FactorType.BleedingFactor);
|
||||
coefficient.Take = false;
|
||||
factors.Add(coefficient);
|
||||
return factors;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,5 +10,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public interface ILibMaterial : IHelperMaterial
|
||||
{
|
||||
ILibMaterialEntity MaterialEntity { get; set; }
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System.Collections.Generic;
|
||||
using LCM = LoaderCalculator.Data.Materials;
|
||||
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
|
||||
@@ -18,7 +19,10 @@ namespace StructureHelperLogics.Models.Materials
|
||||
private CalcTerms calcTerm;
|
||||
public string Name { get; set; }
|
||||
public double MainStrength { get; set; }
|
||||
public ILibMaterialEntity MaterialEntity { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
|
||||
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
|
||||
public LibMaterial(MaterialTypes materialType, CodeTypes codeType, string name, double mainStrength)
|
||||
{
|
||||
|
||||
@@ -13,11 +13,13 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public class ReinforcementLibMaterial : IReinforcementLibMaterial
|
||||
{
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
|
||||
private IMaterialOptionLogic optionLogic;
|
||||
|
||||
public ReinforcementLibMaterial()
|
||||
{
|
||||
SafetyFactors = new List<IMaterialSafetyFactor>();
|
||||
optionLogic = new MaterialOptionLogic(new LCMB.ReinforcementOptions());
|
||||
}
|
||||
|
||||
@@ -29,6 +31,15 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm);
|
||||
double compressionVal = 1d;
|
||||
double tensionVal = 1d;
|
||||
foreach (var item in SafetyFactors.Where(x => x.Take == true))
|
||||
{
|
||||
compressionVal *= item.GetFactor(StressStates.Compression, calcTerm, limitState);
|
||||
tensionVal *= item.GetFactor(StressStates.Tension, calcTerm, limitState);
|
||||
}
|
||||
materialOptions.ExternalFactor.Compressive = compressionVal;
|
||||
materialOptions.ExternalFactor.Tensile = tensionVal;
|
||||
LCMB.IMaterialBuilder builder = new LCMB.ReinforcementBuilder(materialOptions);
|
||||
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
Reference in New Issue
Block a user