Headmaterial was repaired
This commit is contained in:
@@ -53,9 +53,8 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
string materialName = MaterialName;
|
||||
ICenter center = new Center { X = CenterX, Y = CenterY };
|
||||
IShape shape = new StructureHelperCommon.Models.Shapes.Point { Area = this.Area };
|
||||
IPrimitiveMaterial primitiveMaterial = GetPrimitiveMaterial();
|
||||
//IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = Material.DesignCompressiveStrength };
|
||||
INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial,
|
||||
INdmPrimitive ndmPrimitive = new NdmPrimitive(HeadMaterial)
|
||||
{ Center = center, Shape = shape,
|
||||
PrestrainKx = PrestrainKx,
|
||||
PrestrainKy = PrestrainKy,
|
||||
PrestrainEpsZ = PrestrainEpsZ
|
||||
|
||||
@@ -369,9 +369,5 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
else { throw new StructureHelperException(ErrorStrings.MaterialTypeIsUnknown); }
|
||||
return materialTypes;
|
||||
}
|
||||
public IPrimitiveMaterial GetPrimitiveMaterial()
|
||||
{
|
||||
return HeadMaterial.HelperMaterial.GetPrimitiveMaterial();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +49,8 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
double centerY = CenterY;
|
||||
ICenter center = new Center { X = centerX, Y = centerY };
|
||||
IShape shape = new StructureHelperCommon.Models.Shapes.Rectangle { Height = height, Width = width, Angle = 0 };
|
||||
IPrimitiveMaterial primitiveMaterial = GetPrimitiveMaterial();
|
||||
//IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = Material.DesignCompressiveStrength };
|
||||
INdmPrimitive ndmPrimitive = new NdmPrimitive
|
||||
{ Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial,
|
||||
INdmPrimitive ndmPrimitive = new NdmPrimitive(HeadMaterial)
|
||||
{ Center = center, Shape = shape,
|
||||
NdmMaxSize = MaxElementSize, NdmMinDivision = MinElementDivision,
|
||||
PrestrainKx = PrestrainKx,
|
||||
PrestrainKy = PrestrainKy,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace StructureHelperLogics.Infrastructures.CommonEnums
|
||||
namespace StructureHelperCommon.Infrastructures.Enums
|
||||
{
|
||||
public enum CalcTerms
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace StructureHelperLogics.Infrastructures.CommonEnums
|
||||
namespace StructureHelperCommon.Infrastructures.Enums
|
||||
{
|
||||
public enum LimitStates
|
||||
{
|
||||
@@ -46,7 +46,9 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Infrastructures\Enums\CalcTerms.cs" />
|
||||
<Compile Include="Infrastructures\Enums\CodeTypes.cs" />
|
||||
<Compile Include="Infrastructures\Enums\LimitStates.cs" />
|
||||
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
|
||||
<Compile Include="Infrastructures\Interfaces\IHasParent.cs" />
|
||||
<Compile Include="Infrastructures\Strings\ErrorString.cs" />
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
{
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -11,14 +13,14 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public double Modulus { get; set; }
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return new ElasticMaterial() { Modulus = Modulus };
|
||||
}
|
||||
|
||||
public IPrimitiveMaterial GetPrimitiveMaterial()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
@@ -13,17 +15,22 @@ namespace StructureHelper.Models.Materials
|
||||
{
|
||||
public class HeadMaterial : IHeadMaterial
|
||||
{
|
||||
public string Id { get; }
|
||||
public string Name { get; set; }
|
||||
public Color Color { get; set; }
|
||||
public IHelperMaterial HelperMaterial {get; set;}
|
||||
|
||||
//public MaterialDefinitionBase Material { get; set; }
|
||||
|
||||
public HeadMaterial()
|
||||
{
|
||||
Id = Convert.ToString(Guid.NewGuid());
|
||||
Color = ColorProcessor.GetRandomColor();
|
||||
}
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
return HelperMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
IHeadMaterial material = new HeadMaterial
|
||||
@@ -34,5 +41,6 @@ namespace StructureHelper.Models.Materials
|
||||
};
|
||||
return material;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,9 +12,11 @@ namespace StructureHelper.Models.Materials
|
||||
{
|
||||
public interface IHeadMaterial : ICloneable
|
||||
{
|
||||
string Id { get; }
|
||||
string Name { get; set; }
|
||||
Color Color { get; set; }
|
||||
IHelperMaterial HelperMaterial { get; set; }
|
||||
//MaterialDefinitionBase Material { get; set; }
|
||||
IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -8,6 +9,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public interface IHelperMaterial : ICloneable
|
||||
{
|
||||
IPrimitiveMaterial GetPrimitiveMaterial();
|
||||
IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -10,7 +9,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public interface ILibMaterial : IHelperMaterial
|
||||
{
|
||||
MaterialTypes MaterialType { get; set; }
|
||||
CodeTypes CodeType { get; set; }
|
||||
//CodeTypes CodeType { get; set; }
|
||||
string Name { get; set; }
|
||||
double MainStrength { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public interface IPrimitiveMaterial
|
||||
{
|
||||
string Id { get;}
|
||||
MaterialTypes MaterialType { get; }
|
||||
CodeTypes CodeType { get; set; }
|
||||
string ClassName { get; }
|
||||
double Strength { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,73 +1,85 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LCM = LoaderCalculator.Data.Materials;
|
||||
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public class LibMaterial : ILibMaterial
|
||||
{
|
||||
private LCMB.IMaterialOptions materialOptions;
|
||||
|
||||
public MaterialTypes MaterialType { get; set; }
|
||||
public CodeTypes CodeType { get; set; }
|
||||
private CodeTypes codeType;
|
||||
|
||||
private LimitStates limitState;
|
||||
private CalcTerms calcTerm;
|
||||
public string Name { get; set; }
|
||||
public double MainStrength { get; set; }
|
||||
|
||||
public LibMaterial(MaterialTypes materialType, CodeTypes codeType, string name, double mainStrength)
|
||||
{
|
||||
MaterialType = materialType;
|
||||
CodeType = codeType;
|
||||
this.MaterialType = materialType;
|
||||
this.codeType = codeType;
|
||||
Name = name;
|
||||
MainStrength = mainStrength;
|
||||
}
|
||||
|
||||
public IPrimitiveMaterial GetPrimitiveMaterial()
|
||||
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
if (MaterialType == MaterialTypes.Concrete & CodeType == CodeTypes.EuroCode_2_1990)
|
||||
{ return GetConcreteEurocode();}
|
||||
else if (MaterialType == MaterialTypes.Reinforcement & CodeType == CodeTypes.EuroCode_2_1990)
|
||||
{ return GetReinfrocementeEurocode();}
|
||||
if (MaterialType == MaterialTypes.Concrete & CodeType == CodeTypes.SP63_13330_2018)
|
||||
{ return GetConcreteSP63(); }
|
||||
else if (MaterialType == MaterialTypes.Reinforcement & CodeType == CodeTypes.SP63_13330_2018)
|
||||
{ return GetReinfrocementeSP63(); }
|
||||
else throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown}: material type = {MaterialType}, code type = {CodeType}");
|
||||
this.limitState = limitState;
|
||||
this.calcTerm = calcTerm;
|
||||
if (MaterialType == MaterialTypes.Concrete)
|
||||
{ return GetConcrete();}
|
||||
else if (MaterialType == MaterialTypes.Reinforcement)
|
||||
{ return GetReinfrocemente();}
|
||||
else throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown}: material type = {MaterialType}, code type = {codeType}");
|
||||
}
|
||||
|
||||
private IPrimitiveMaterial GetReinfrocementeSP63()
|
||||
|
||||
private LCM.IMaterial GetReinfrocemente()
|
||||
{
|
||||
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial
|
||||
{ MaterialType = MaterialType, CodeType = CodeTypes.SP63_13330_2018, ClassName = $"Reinforcement {Name}", Strength = MainStrength };
|
||||
return primitiveMaterial;
|
||||
materialOptions = new LCMB.ReinforcementOptions();
|
||||
SetMaterialOptions();
|
||||
LCMB.IMaterialBuilder builder = new LCMB.ReinforcementBuilder(materialOptions);
|
||||
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
}
|
||||
|
||||
private IPrimitiveMaterial GetConcreteSP63()
|
||||
private LCM.IMaterial GetConcrete()
|
||||
{
|
||||
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial
|
||||
{ MaterialType = MaterialType, CodeType = CodeTypes.SP63_13330_2018, ClassName = $"Concrete {Name}", Strength = MainStrength };
|
||||
return primitiveMaterial;
|
||||
materialOptions = new LCMB.ConcreteOptions();
|
||||
SetMaterialOptions();
|
||||
LCMB.IMaterialBuilder builder = new LCMB.ConcreteBuilder(materialOptions);
|
||||
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
}
|
||||
|
||||
private IPrimitiveMaterial GetReinfrocementeEurocode()
|
||||
private void SetMaterialOptions()
|
||||
{
|
||||
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial
|
||||
{ MaterialType = MaterialType, CodeType = CodeTypes.EuroCode_2_1990, ClassName = $"Reinforcement {Name}", Strength = MainStrength };
|
||||
return primitiveMaterial;
|
||||
}
|
||||
|
||||
private IPrimitiveMaterial GetConcreteEurocode()
|
||||
{
|
||||
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial
|
||||
{ MaterialType = MaterialType, CodeType = CodeTypes.EuroCode_2_1990, ClassName = $"Concrete {Name}", Strength = MainStrength };
|
||||
return primitiveMaterial;
|
||||
materialOptions.Strength = MainStrength;
|
||||
if (codeType == CodeTypes.EuroCode_2_1990)
|
||||
{
|
||||
materialOptions.CodesType = LCMB.CodesType.EC2_1990;
|
||||
}
|
||||
else if (codeType == CodeTypes.SP63_13330_2018)
|
||||
{
|
||||
materialOptions.CodesType = LCMB.CodesType.SP63_2018;
|
||||
}
|
||||
else { throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown} : {codeType}"); }
|
||||
if (limitState == LimitStates.Collapse) { materialOptions.LimitState = LCMB.LimitStates.Collapse; }
|
||||
else if (limitState == LimitStates.ServiceAbility) { materialOptions.LimitState = LCMB.LimitStates.ServiceAbility; }
|
||||
else if (limitState == LimitStates.Special) { materialOptions.LimitState = LCMB.LimitStates.Special; }
|
||||
else { throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid); }
|
||||
if (calcTerm == CalcTerms.ShortTerm) { materialOptions.IsShortTerm = true; }
|
||||
else if (calcTerm == CalcTerms.LongTerm) { materialOptions.IsShortTerm = false; }
|
||||
else { throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid); }
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return new LibMaterial(this.MaterialType, this.CodeType, this.Name, this.MainStrength);
|
||||
return new LibMaterial(this.MaterialType, this.codeType, this.Name, this.MainStrength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public class PrimitiveMaterial : IPrimitiveMaterial
|
||||
{
|
||||
public string Id { get; }
|
||||
public MaterialTypes MaterialType { get; set; }
|
||||
public CodeTypes CodeType { get; set; }
|
||||
IHeadMaterial HeadMaterial { get; set; }
|
||||
public string ClassName { get; set; }
|
||||
public double Strength { get; set; }
|
||||
|
||||
|
||||
public PrimitiveMaterial()
|
||||
{
|
||||
Id = Convert.ToString(Guid.NewGuid());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelper.Models.Materials;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
@@ -7,7 +8,7 @@ namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
ICenter Center { get; set; }
|
||||
IShape Shape { get; set; }
|
||||
IPrimitiveMaterial PrimitiveMaterial {get;set;}
|
||||
IHeadMaterial HeadMaterial { get; }
|
||||
double NdmMaxSize { get; set; }
|
||||
int NdmMinDivision { get; set; }
|
||||
double PrestrainKx { get; set; }
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelper.Models.Materials;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
public class NdmPrimitive : INdmPrimitive
|
||||
{
|
||||
private IHeadMaterial headMaterial;
|
||||
|
||||
public ICenter Center { get; set; }
|
||||
public IShape Shape { get; set; }
|
||||
public IPrimitiveMaterial PrimitiveMaterial { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get => headMaterial; }
|
||||
public double NdmMaxSize { get; set; }
|
||||
public int NdmMinDivision { get; set; }
|
||||
public double PrestrainKx { get; set; }
|
||||
public double PrestrainKy { get; set; }
|
||||
public double PrestrainEpsZ { get; set; }
|
||||
|
||||
public NdmPrimitive(IHeadMaterial material)
|
||||
{
|
||||
headMaterial = material;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelper.Models.Materials;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
@@ -17,13 +18,13 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public static IEnumerable<INdm> GetNdms(IEnumerable<INdmPrimitive> ndmPrimitives, ITriangulationOptions options)
|
||||
{
|
||||
List<INdm> ndms = new List<INdm>();
|
||||
Dictionary<string, IPrimitiveMaterial> primitiveMaterials = GetPrimitiveMaterials(ndmPrimitives);
|
||||
Dictionary<string, IMaterial> materials = GetMaterials(primitiveMaterials, options);
|
||||
var headMaterials = GetPrimitiveMaterials(ndmPrimitives);
|
||||
Dictionary<string, IMaterial> materials = GetMaterials(headMaterials, options);
|
||||
foreach (var ndmPrimitive in ndmPrimitives)
|
||||
{
|
||||
IPrimitiveMaterial primitiveMaterial = ndmPrimitive.PrimitiveMaterial;
|
||||
IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial;
|
||||
IMaterial material;
|
||||
if (materials.TryGetValue(primitiveMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
|
||||
if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
|
||||
IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, material);
|
||||
ndms.AddRange(localNdms);
|
||||
}
|
||||
@@ -34,15 +35,15 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
/// </summary>
|
||||
/// <param name="ndmPrimitives"></param>
|
||||
/// <returns></returns>
|
||||
private static Dictionary<string, IPrimitiveMaterial> GetPrimitiveMaterials(IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
private static Dictionary<string, IHeadMaterial> GetPrimitiveMaterials(IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
Dictionary<string, IPrimitiveMaterial> primitiveMaterials = new Dictionary<string, IPrimitiveMaterial>();
|
||||
Dictionary<string, IHeadMaterial> headMaterials = new Dictionary<string, IHeadMaterial>();
|
||||
foreach (var ndmPrimitive in ndmPrimitives)
|
||||
{
|
||||
IPrimitiveMaterial material = ndmPrimitive.PrimitiveMaterial;
|
||||
if (!primitiveMaterials.ContainsKey(material.Id)) { primitiveMaterials.Add(material.Id, material); }
|
||||
IHeadMaterial material = ndmPrimitive.HeadMaterial;
|
||||
if (!headMaterials.ContainsKey(material.Id)) { headMaterials.Add(material.Id, material); }
|
||||
}
|
||||
return primitiveMaterials;
|
||||
return headMaterials;
|
||||
}
|
||||
/// <summary>
|
||||
/// Return dictionary of ndm-materials by dictionary of primirive materials
|
||||
@@ -51,16 +52,16 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="StructureHelperException"></exception>
|
||||
private static Dictionary<string, IMaterial> GetMaterials(Dictionary<string, IPrimitiveMaterial> PrimitiveMaterials, ITriangulationOptions options)
|
||||
private static Dictionary<string, IMaterial> GetMaterials(Dictionary<string, IHeadMaterial> PrimitiveMaterials, ITriangulationOptions options)
|
||||
{
|
||||
Dictionary<string, IMaterial> materials = new Dictionary<string, IMaterial>();
|
||||
IEnumerable<string> keyCollection = PrimitiveMaterials.Keys;
|
||||
IMaterial material;
|
||||
foreach (string id in keyCollection)
|
||||
{
|
||||
IPrimitiveMaterial primitiveMaterial;
|
||||
if (PrimitiveMaterials.TryGetValue(id, out primitiveMaterial) == false) { throw new StructureHelperException("Material dictionary is not valid"); }
|
||||
material = GetMaterial(primitiveMaterial, options);
|
||||
IHeadMaterial headMaterial;
|
||||
if (PrimitiveMaterials.TryGetValue(id, out headMaterial) == false) { throw new StructureHelperException("Material dictionary is not valid"); }
|
||||
material = headMaterial.GetLoaderMaterial(options.LimiteState, options.CalcTerm);
|
||||
materials.Add(id, material);
|
||||
}
|
||||
return materials;
|
||||
@@ -87,53 +88,49 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
else { throw new StructureHelperException($"{ErrorStrings.ShapeIsNotCorrect} :{nameof(primitive.Shape)}"); }
|
||||
return ndms;
|
||||
}
|
||||
|
||||
private static IMaterial GetMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
IMaterial material;
|
||||
if (primitiveMaterial.MaterialType == MaterialTypes.Concrete) { material = GetConcreteMaterial(primitiveMaterial, options); }
|
||||
else if (primitiveMaterial.MaterialType == MaterialTypes.Reinforcement) { material = GetReinforcementMaterial(primitiveMaterial, options); }
|
||||
else { throw new StructureHelperException(ErrorStrings.MaterialTypeIsUnknown); }
|
||||
return material;
|
||||
}
|
||||
|
||||
private static IMaterial GetConcreteMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
IMaterialOptions materialOptions = new ConcreteOptions();
|
||||
SetMaterialOptions(materialOptions, primitiveMaterial, options);
|
||||
IMaterialBuilder builder = new ConcreteBuilder(materialOptions);
|
||||
IBuilderDirector director = new BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
}
|
||||
|
||||
private static IMaterial GetReinforcementMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
IMaterialOptions materialOptions = new ReinforcementOptions();
|
||||
SetMaterialOptions(materialOptions, primitiveMaterial, options);
|
||||
IMaterialBuilder builder = new ReinforcementBuilder(materialOptions);
|
||||
IBuilderDirector director = new BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
}
|
||||
|
||||
private static void SetMaterialOptions(IMaterialOptions materialOptions, IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
materialOptions.Strength = primitiveMaterial.Strength;
|
||||
if (primitiveMaterial.CodeType == CodeTypes.EuroCode_2_1990)
|
||||
{
|
||||
materialOptions.CodesType = CodesType.EC2_1990;
|
||||
}
|
||||
else if (primitiveMaterial.CodeType == CodeTypes.SP63_13330_2018)
|
||||
{
|
||||
materialOptions.CodesType = CodesType.SP63_2018;
|
||||
}
|
||||
else { throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown} : {primitiveMaterial.CodeType}"); }
|
||||
if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Collapse) { materialOptions.LimitState = LimitStates.Collapse; }
|
||||
else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.ServiceAbility) { materialOptions.LimitState = LimitStates.ServiceAbility; }
|
||||
else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Special) { materialOptions.LimitState = LimitStates.Special; }
|
||||
else { throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid); }
|
||||
if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.ShortTerm) { materialOptions.IsShortTerm = true; }
|
||||
else if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.LongTerm) { materialOptions.IsShortTerm = false; }
|
||||
else { throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid); }
|
||||
}
|
||||
//private static IMaterial GetMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
//{
|
||||
// IMaterial material;
|
||||
// if (primitiveMaterial.MaterialType == MaterialTypes.Concrete) { material = GetConcreteMaterial(primitiveMaterial, options); }
|
||||
// else if (primitiveMaterial.MaterialType == MaterialTypes.Reinforcement) { material = GetReinforcementMaterial(primitiveMaterial, options); }
|
||||
// else { throw new StructureHelperException(ErrorStrings.MaterialTypeIsUnknown); }
|
||||
// return material;
|
||||
//}
|
||||
//private static IMaterial GetConcreteMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
//{
|
||||
// IMaterialOptions materialOptions = new ConcreteOptions();
|
||||
// SetMaterialOptions(materialOptions, primitiveMaterial, options);
|
||||
// IMaterialBuilder builder = new ConcreteBuilder(materialOptions);
|
||||
// IBuilderDirector director = new BuilderDirector(builder);
|
||||
// return director.BuildMaterial();
|
||||
//}
|
||||
//private static IMaterial GetReinforcementMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
//{
|
||||
// IMaterialOptions materialOptions = new ReinforcementOptions();
|
||||
// SetMaterialOptions(materialOptions, primitiveMaterial, options);
|
||||
// IMaterialBuilder builder = new ReinforcementBuilder(materialOptions);
|
||||
// IBuilderDirector director = new BuilderDirector(builder);
|
||||
// return director.BuildMaterial();
|
||||
//}
|
||||
//private static void SetMaterialOptions(IMaterialOptions materialOptions, IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
//{
|
||||
// materialOptions.Strength = primitiveMaterial.Strength;
|
||||
// if (primitiveMaterial.CodeType == CodeTypes.EuroCode_2_1990)
|
||||
// {
|
||||
// materialOptions.CodesType = CodesType.EC2_1990;
|
||||
// }
|
||||
// else if (primitiveMaterial.CodeType == CodeTypes.SP63_13330_2018)
|
||||
// {
|
||||
// materialOptions.CodesType = CodesType.SP63_2018;
|
||||
// }
|
||||
// else { throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown} : {primitiveMaterial.CodeType}"); }
|
||||
// if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Collapse) { materialOptions.LimitState = LimitStates.Collapse; }
|
||||
// else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.ServiceAbility) { materialOptions.LimitState = LimitStates.ServiceAbility; }
|
||||
// else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Special) { materialOptions.LimitState = LimitStates.Special; }
|
||||
// else { throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid); }
|
||||
// if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.ShortTerm) { materialOptions.IsShortTerm = true; }
|
||||
// else if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.LongTerm) { materialOptions.IsShortTerm = false; }
|
||||
// else { throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid); }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
|
||||
@@ -5,11 +5,11 @@ using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.SourceData;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using StructureHelperLogics.Models.Calculations.CalculationsResults;
|
||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
||||
using System;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
|
||||
namespace StructureHelperLogics.Services
|
||||
{
|
||||
|
||||
@@ -17,4 +17,8 @@
|
||||
<Reference Include="System.Windows" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Infrastructures\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,18 +1,7 @@
|
||||
using StructureHelper.Windows.ViewModels.Calculations.CalculationProperies;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculationPropertyWindow
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ using StructureHelper.Services.Primitives;
|
||||
using StructureHelper.UnitSystem;
|
||||
using StructureHelper.UnitSystem.Systems;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.Models.Materials.Factories;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
Reference in New Issue
Block a user