Headmaterial was repaired
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user