Add beam shear calculator view

This commit is contained in:
Evgeny Redikultsev
2025-03-29 21:45:49 +05:00
parent 15bb7030cc
commit a0a25f183a
71 changed files with 969 additions and 472 deletions

View File

@@ -16,9 +16,9 @@ namespace StructureHelperLogics.Models.BeamShears
/// <inheritdoc/>
public List<IBeamShearAction> BeamShearActions { get; } = new();
public List<IBeamShearAction> Actions { get; } = new();
/// <inheritdoc/>
public List<IBeamShearSection> ShearSections { get; } = new();
public List<IBeamShearSection> Sections { get; } = new();
/// <inheritdoc/>
public List<IStirrup> Stirrups { get; } = new();
public BeamShearCalculatorInputData(Guid id)

View File

@@ -67,11 +67,11 @@ namespace StructureHelperLogics.Models.BeamShears
private void GetSectionInputDatas(IBeamShearCalculatorInputData inputData)
{
sectionInputDatas = new();
foreach (var beamShearSection in inputData.ShearSections)
foreach (var beamShearSection in inputData.Sections)
{
foreach (var stirrup in inputData.Stirrups)
{
foreach (var beamShearAction in inputData.BeamShearActions)
foreach (var beamShearAction in inputData.Actions)
{
BeamShearSectionCalculatorInputData newInputData = new(Guid.NewGuid())
{

View File

@@ -14,11 +14,11 @@ namespace StructureHelperLogics.Models.BeamShears
public Guid Id { get; }
public List<IBeamShearAction> BeamShearActions { get; } = new();
public List<IBeamShearAction> Actions { get; } = new();
public List<ICalculator> Calculators { get; } = new();
public List<IBeamShearSection> ShearSections { get; } = new();
public List<IBeamShearSection> Sections { get; } = new();
public List<IStirrup> Stirrups { get; } = new();
@@ -28,65 +28,9 @@ namespace StructureHelperLogics.Models.BeamShears
Id = id;
}
public void DeleteBeamShearAction(IBeamShearAction beamShearAction)
{
foreach (var calculator in Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
var inputData = beamShearCalculator.InputData;
inputData.BeamShearActions.Remove(beamShearAction);
}
}
BeamShearActions.Remove(beamShearAction);
}
public object Clone()
{
throw new NotImplementedException();
}
public void DeleteSection(IBeamShearSection section)
{
foreach (var calculator in Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
if (beamShearCalculator.InputData.ShearSections.Contains(section))
{
beamShearCalculator.InputData.DeleteSection(section);
beamShearCalculator.InputData.ShearSections.Remove(section);
}
}
}
}
public void DeleteAction(IBeamShearAction action)
{
foreach (var calculator in Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
if (beamShearCalculator.InputData.BeamShearActions.Contains(action))
{
beamShearCalculator.InputData.DeleteAction(action);
beamShearCalculator.InputData.BeamShearActions.Remove(action);
}
}
}
}
public void DeleteStirrup(IStirrup stirrup)
{
foreach (var calculator in Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
if (beamShearCalculator.InputData.Stirrups.Contains(stirrup))
{
beamShearCalculator.InputData.DeleteStirrup(stirrup);
beamShearCalculator.InputData.Stirrups.Remove(stirrup);
}
}
}
}
}
}

View File

@@ -1,4 +1,4 @@
using StructureHelperCommon.Models.Materials;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.Materials;
@@ -6,24 +6,30 @@ namespace StructureHelperLogics.Models.BeamShears
{
public class BeamShearSection : IBeamShearSection
{
private IUpdateStrategy<IBeamShearSection> updateStrategy;
public Guid Id { get; }
public string? Name { get; set; }
/// <inheritdoc/>
public IMaterialStrength MaterialStrength { get; } = new MaterialStrengthByLibMaterial(Guid.NewGuid(), new ConcreteLibMaterial(Guid.NewGuid()));
public IConcreteLibMaterial Material { get; set; }
/// <inheritdoc/>
public IShape Shape { get; } = new RectangleShape(Guid.NewGuid()) { Height = 0.6, Width = 0.4};
public double CenterCover { get; set; }
public double CenterCover { get; set; } = 0.05;
public BeamShearSection(Guid id)
{
Id = id;
Material = ConcreteLibMaterialFactory.GetConcreteLibMaterial(ConcreteLibTypes.Concrete25);
Material.TensionForULS = true;
}
public object Clone()
{
throw new NotImplementedException();
BeamShearSection newItem = new(Guid.NewGuid());
updateStrategy ??= new BeamShearSectionUpdateStrategy();
updateStrategy.Update(newItem, this);
return newItem;
}
}
}

View File

@@ -32,14 +32,15 @@ namespace StructureHelperLogics.Models.BeamShears
BeamShearRepository shearRepository = new(Guid.Empty);
IBeamShearAction shearAction = BeamShearActionFactory.GetBeamShearAction(ShearActionTypes.DistributedLoad);
shearAction.Name = "New shear action";
shearRepository.BeamShearActions.Add(shearAction);
shearRepository.Actions.Add(shearAction);
BeamShearSection section = new(Guid.Empty) { Name = "New shear section"};
shearRepository.ShearSections.Add(section);
StirrupByUniformRebar stirrupByUniformRebar = new(Guid.Empty) { Name = "New uniform stirrup"};
shearRepository.Sections.Add(section);
StirrupByRebar stirrupByUniformRebar = new(Guid.Empty) { Name = "New uniform stirrup"};
shearRepository.Stirrups.Add(stirrupByUniformRebar);
BeamShearCalculator beamShearCalculator = new(Guid.Empty) { Name = "New shear calculator"};
beamShearCalculator.InputData.ShearSections.Add(section);
beamShearCalculator.InputData.Sections.Add(section);
beamShearCalculator.InputData.Stirrups.Add(stirrupByUniformRebar);
beamShearCalculator.InputData.Actions.Add(shearAction);
shearRepository.Calculators.Add(beamShearCalculator);
return shearRepository;
}

View File

@@ -19,7 +19,7 @@ namespace StructureHelperLogics.Models.BeamShears
/// <summary>
/// Concrete of cross-section
/// </summary>
IMaterialStrength MaterialStrength { get;}
IConcreteLibMaterial Material { get; set; }
/// <summary>
/// Shape of cross-section
/// </summary>

View File

@@ -8,7 +8,6 @@ namespace StructureHelperLogics.Models.BeamShears
{
public interface IHasBeamShearSections
{
List<IBeamShearSection> ShearSections { get; }
void DeleteSection(IBeamShearSection section);
List<IBeamShearSection> Sections { get; }
}
}

View File

@@ -9,6 +9,5 @@ namespace StructureHelperLogics.Models.BeamShears
public interface IHasStirrups
{
List<IStirrup> Stirrups { get; }
void DeleteStirrup(IStirrup stirrup);
}
}

View File

@@ -1,9 +1,7 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
namespace StructureHelperLogics.Models.BeamShears
{

View File

@@ -10,7 +10,7 @@ namespace StructureHelperLogics.Models.BeamShears
/// <summary>
/// Implement properties for uniformly distributed stirrups
/// </summary>
public interface IStirrupByUniformRebar : IStirrup
public interface IStirrupByRebar : IStirrup
{
/// <summary>
/// Material of stirrups
@@ -27,6 +27,6 @@ namespace StructureHelperLogics.Models.BeamShears
/// <summary>
/// Step of uniformly distibuted stirrup along axis of beam, m
/// </summary>
double Step { get; set; }
double Spacing { get; set; }
}
}

View File

@@ -11,8 +11,8 @@ namespace StructureHelperLogics.Models.BeamShears
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; };
targetObject.BeamShearActions.AddRange(sourceObject.BeamShearActions);
targetObject.ShearSections.AddRange(sourceObject.ShearSections);
targetObject.Actions.AddRange(sourceObject.Actions);
targetObject.Sections.AddRange(sourceObject.Sections);
targetObject.Stirrups.AddRange(sourceObject.Stirrups);
targetObject.Calculators.AddRange(sourceObject.Calculators);
}

View File

@@ -0,0 +1,52 @@
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Forces.BeamShearActions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears
{
public static class BeamShearRepositoryService
{
public static void DeleteAction(IBeamShearRepository repository, IBeamShearAction action)
{
foreach (var calculator in repository.Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
var inputData = beamShearCalculator.InputData;
inputData.Actions.Remove(action);
}
}
repository.Actions.Remove(action);
}
public static void DeleteSection(IBeamShearRepository repository, IBeamShearSection section)
{
foreach (var calculator in repository.Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
if (beamShearCalculator.InputData.Sections.Contains(section))
{
beamShearCalculator.InputData.Sections.Remove(section);
}
}
}
}
public static void DeleteStirrup(IBeamShearRepository repository, IStirrup stirrup)
{
foreach (var calculator in repository.Calculators)
{
if (calculator is IBeamShearCalculator beamShearCalculator)
{
if (beamShearCalculator.InputData.Stirrups.Contains(stirrup))
{
beamShearCalculator.InputData.Stirrups.Remove(stirrup);
}
}
}
}
}
}

View File

@@ -0,0 +1,37 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Models.Shapes.Logics;
using StructureHelperCommon.Services;
using StructureHelperLogics.Models.Materials;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears
{
public class BeamShearSectionUpdateStrategy : IUpdateStrategy<IBeamShearSection>
{
private IUpdateStrategy<IShape> shapeUpdateStrategy;
private IUpdateStrategy<IConcreteLibMaterial> concreteUpdateStrategy;
public void Update(IBeamShearSection targetObject, IBeamShearSection sourceObject)
{
CheckObject.IsNull(targetObject);
CheckObject.IsNull(sourceObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; }
InitializeStrategies();
targetObject.Name = sourceObject.Name;
shapeUpdateStrategy.Update(targetObject.Shape, sourceObject.Shape);
targetObject.Material ??= new ConcreteLibMaterial();
concreteUpdateStrategy.Update(targetObject.Material, sourceObject.Material);
targetObject.CenterCover = sourceObject.CenterCover;
}
private void InitializeStrategies()
{
shapeUpdateStrategy ??= new ShapeUpdateStrategy();
concreteUpdateStrategy ??= new ConcreteLibUpdateStrategy();
}
}
}

View File

@@ -1,17 +1,13 @@
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Loggers;
using StructureHelperCommon.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
namespace StructureHelperLogics.Models.BeamShears
{
/// <inheritdoc/>
public class BeamShearStrengthByStirrupDensityLogic : IBeamShearStrenghLogic
{
private readonly IStirrupEffectiveness stirrupEffectiveness;
@@ -32,7 +28,7 @@ namespace StructureHelperLogics.Models.BeamShears
}
public IShiftTraceLogger? TraceLogger { get; set; }
/// <inheritdoc/>
public double GetShearStrength()
{
Check();

View File

@@ -34,13 +34,13 @@ namespace StructureHelperLogics.Models.BeamShears
string errorString = ErrorStrings.ParameterIsNull + ": Input data";
throw new StructureHelperException(errorString);
}
if (InputData.BeamShearActions is null || ! InputData.BeamShearActions.Any())
if (InputData.Actions is null || ! InputData.Actions.Any())
{
result = false;
string errorString = "Collection of actions does not contain any action";
TraceMessage(errorString);
}
if (InputData.ShearSections is null || ! InputData.ShearSections.Any())
if (InputData.Sections is null || ! InputData.Sections.Any())
{
result = false;
string errorString = "Collection of sections does not contain any section";

View File

@@ -1,12 +1,7 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears.Logics
namespace StructureHelperLogics.Models.BeamShears
{
public class StirrupBaseUpdateStrategy : IUpdateStrategy<IStirrup>
{

View File

@@ -4,7 +4,7 @@ using StructureHelperCommon.Services;
//Copyright (c) 2026 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
namespace StructureHelperLogics.Models.BeamShears.Logics
namespace StructureHelperLogics.Models.BeamShears
{
public class StirrupByDensityUpdateStrategy : IUpdateStrategy<IStirrupByDensity>
{

View File

@@ -1,15 +1,10 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears
{
public class StirrupByUniformRebarToDensityConvertStrategy : IConvertStrategy<IStirrupByDensity, IStirrupByUniformRebar>
public class StirrupByRebarToDensityConvertStrategy : IConvertStrategy<IStirrupByDensity, IStirrupByRebar>
{
private const double stirrupStrengthFactor = 1d;
private const double maxStirrupStrength = 3e8;
@@ -18,30 +13,30 @@ namespace StructureHelperLogics.Models.BeamShears
public Dictionary<(Guid id, Type type), ISaveable> ReferenceDictionary { get; set; }
public IShiftTraceLogger TraceLogger { get; set; }
public StirrupByUniformRebarToDensityConvertStrategy(IUpdateStrategy<IStirrup> updateStrategy, IShiftTraceLogger traceLogger)
public StirrupByRebarToDensityConvertStrategy(IUpdateStrategy<IStirrup> updateStrategy, IShiftTraceLogger traceLogger)
{
this.updateStrategy = updateStrategy;
TraceLogger = traceLogger;
}
public IStirrupByDensity Convert(IStirrupByUniformRebar source)
public IStirrupByDensity Convert(IStirrupByRebar source)
{
updateStrategy ??= new StirrupUpdateStrategy();
updateStrategy ??= new StirrupBaseUpdateStrategy();
StirrupByDensity stirrupByDensity = new(Guid.NewGuid());
updateStrategy.Update(stirrupByDensity, source);
stirrupByDensity.StirrupDensity = GetStirrupDensity(source);
return stirrupByDensity;
}
private double GetStirrupDensity(IStirrupByUniformRebar source)
private double GetStirrupDensity(IStirrupByRebar source)
{
double area = Math.PI * source.Diameter * source.Diameter / 4d;
TraceLogger?.AddMessage($"Area of rebar = {Math.PI} * ({source.Diameter})^2 / 4 = {area}, m^2");
double strength = stirrupStrengthFactor * source.Material.GetStrength(LimitStates.ULS, CalcTerms.ShortTerm).Tensile;
TraceLogger?.AddMessage($"Strength of rebar = {strength}, Pa");
strength = Math.Min(strength, maxStirrupStrength);
double density = strength * area * source.LegCount / source.Step;
TraceLogger?.AddMessage($"Density of stirrups = {strength} * {area} * {source.LegCount} / {source.Step} = {density}, N/m");
double density = strength * area * source.LegCount / source.Spacing;
TraceLogger?.AddMessage($"Density of stirrups = {strength} * {area} * {source.LegCount} / {source.Spacing} = {density}, N/m");
return density;
}
}

View File

@@ -7,12 +7,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears.Logics
namespace StructureHelperLogics.Models.BeamShears
{
public class StirrupByUniformRebarUpdateStrategy : IUpdateStrategy<IStirrupByUniformRebar>
public class StirrupByRebarUpdateStrategy : IUpdateStrategy<IStirrupByRebar>
{
private IUpdateStrategy<IStirrup>? baseUpdateStrategy;
public void Update(IStirrupByUniformRebar targetObject, IStirrupByUniformRebar sourceObject)
public void Update(IStirrupByRebar targetObject, IStirrupByRebar sourceObject)
{
CheckObject.IsNull(targetObject);
CheckObject.IsNull(sourceObject);
@@ -23,7 +23,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
targetObject.Material = sourceObject.Material.Clone() as IReinforcementLibMaterial;
targetObject.Diameter = sourceObject.Diameter;
targetObject.LegCount = sourceObject.LegCount;
targetObject.Step = sourceObject.Step;
targetObject.Spacing = sourceObject.Spacing;
}
}
}

View File

@@ -12,7 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
public class StirrupUpdateStrategy : IUpdateStrategy<IStirrup>
{
private IUpdateStrategy<IStirrupByDensity> densityUpdateStrategy;
private IUpdateStrategy<IStirrupByUniformRebar> uniformUpdateStrategy;
private IUpdateStrategy<IStirrupByRebar> uniformUpdateStrategy;
public void Update(IStirrup targetObject, IStirrup sourceObject)
{
CheckObject.IsNull(targetObject);
@@ -22,7 +22,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
{
UpdateByDensity(targetObject, density);
}
else if (sourceObject is IStirrupByUniformRebar stirrupByUniformRebar)
else if (sourceObject is IStirrupByRebar stirrupByUniformRebar)
{
UpdateByUniformRebar(targetObject, stirrupByUniformRebar);
}
@@ -32,10 +32,10 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
}
}
private void UpdateByUniformRebar(IStirrup targetObject, IStirrupByUniformRebar stirrupByUniformRebar)
private void UpdateByUniformRebar(IStirrup targetObject, IStirrupByRebar stirrupByUniformRebar)
{
uniformUpdateStrategy ??= new StirrupByUniformRebarUpdateStrategy();
if (targetObject is IStirrupByUniformRebar targetUniformRebar)
uniformUpdateStrategy ??= new StirrupByRebarUpdateStrategy();
if (targetObject is IStirrupByRebar targetUniformRebar)
{
uniformUpdateStrategy.Update(targetUniformRebar, stirrupByUniformRebar);
}

View File

@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StructureHelperCommon.Infrastructures.Interfaces;
namespace StructureHelperLogics.Models.BeamShears
{
public class StirrupByDensity : IStirrupByDensity
{
private IUpdateStrategy<IStirrupByDensity> updateStrategy;
public Guid Id { get; }
public string Name { get; set; } = string.Empty;
public double StirrupDensity { get; set; }
@@ -20,7 +17,10 @@ namespace StructureHelperLogics.Models.BeamShears
public object Clone()
{
throw new NotImplementedException();
StirrupByDensity newItem = new(Guid.NewGuid());
updateStrategy ??= new StirrupByDensityUpdateStrategy();
updateStrategy.Update(newItem, this);
return newItem;
}
}
}

View File

@@ -0,0 +1,75 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperLogics.Models.Materials;
namespace StructureHelperLogics.Models.BeamShears
{
/// <inheritdoc/>
public class StirrupByRebar : IStirrupByRebar
{
private IUpdateStrategy<IStirrupByRebar> updateStrategy;
private double diameter = 0.008;
private double step = 0.1;
private double legCount = 2;
/// <inheritdoc/>
public Guid Id { get; }
public string? Name { get; set; }
/// <inheritdoc/>
public IReinforcementLibMaterial Material { get; set; }
/// <inheritdoc/>
public double LegCount
{
get => legCount; set
{
if (value < 0)
{
throw new StructureHelperException("Number of legs of stirrup must be greater than zero");
}
legCount = value;
}
} /// <inheritdoc/>
public double Diameter
{
get => diameter; set
{
if (value < 0.001)
{
throw new StructureHelperException("Diameter of stirrup must not be less than 1mm");
}
if (value > 0.050)
{
throw new StructureHelperException("Diameter of stirrup must be less or equal than 50mm");
}
diameter = value;
}
} /// <inheritdoc/>
public double Spacing
{
get => step; set
{
if (value < 0.01)
{
throw new StructureHelperException("Spacing of stirrups must not be less than 10mm");
}
step = value;
}
} /// <inheritdoc/>
public double CompressedGap { get; set; } = 0;
public StirrupByRebar(Guid id)
{
Id = id;
Material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400).HelperMaterial as IReinforcementLibMaterial;
}
public object Clone()
{
StirrupByRebar stirrupByRebar = new(Guid.NewGuid());
updateStrategy ??= new StirrupByRebarUpdateStrategy();
updateStrategy.Update(stirrupByRebar, this);
return stirrupByRebar;
}
}
}

View File

@@ -1,38 +0,0 @@
using StructureHelperLogics.Models.Materials;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears
{
/// <inheritdoc/>
public class StirrupByUniformRebar : IStirrupByUniformRebar
{
/// <inheritdoc/>
public Guid Id { get; }
public string? Name { get; set; }
/// <inheritdoc/>
public IReinforcementLibMaterial Material { get; set; }
/// <inheritdoc/>
public double LegCount { get; set; } = 2;
/// <inheritdoc/>
public double Diameter { get; set; } = 0.008;
/// <inheritdoc/>
public double Step { get; set; } = 0.1;
/// <inheritdoc/>
public double CompressedGap { get; set; } = 0;
public StirrupByUniformRebar(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();
}
}
}

View File

@@ -1,23 +0,0 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears
{
internal class StirrupUpdateStrategy : IUpdateStrategy<IStirrup>
{
public void Update(IStirrup targetObject, IStirrup sourceObject)
{
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; };
targetObject.CompressedGap = sourceObject.CompressedGap;
targetObject.Name = sourceObject.Name;
}
}
}

View File

@@ -28,17 +28,17 @@ namespace StructureHelperLogics.Models.Materials
/// <inheritdoc/>
public List<IMaterialSafetyFactor> SafetyFactors { get; set; }
/// <inheritdoc/>
public bool TensionForULS { get ; set; }
public bool TensionForULS { get; set; } = false;
/// <inheritdoc/>
public bool TensionForSLS { get; set; }
public bool TensionForSLS { get; set; } = true;
/// <inheritdoc/>
public double RelativeHumidity { get; set; }
public double RelativeHumidity { get; set; } = 0.55d;
/// <inheritdoc/>
public IMaterialLogic MaterialLogic { get; set; }
/// <inheritdoc/>
public double MinAge { get; set; }
public double MinAge { get; set; } = 0d;
/// <inheritdoc/>
public double MaxAge { get; set; }
public double MaxAge { get; set; } = maxAge;
/// <inheritdoc/>
public List<IMaterialLogic> MaterialLogics => materialLogics;
@@ -51,11 +51,6 @@ namespace StructureHelperLogics.Models.Materials
SafetyFactors = new List<IMaterialSafetyFactor>();
lmOptions = new LMBuilders.ConcreteOptions();
SafetyFactors.AddRange(PartialCoefficientFactory.GetDefaultConcreteSafetyFactors(ProgramSetting.CodeType));
TensionForULS = false;
TensionForSLS = true;
RelativeHumidity = 0.55d;
MinAge = 0d;
MaxAge = maxAge;
}
public ConcreteLibMaterial() : this (Guid.NewGuid())

View File

@@ -0,0 +1,49 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models.Materials.Libraries;
namespace StructureHelperLogics.Models.Materials
{
public enum ConcreteLibTypes
{
Concrete15,
Concrete20,
Concrete25,
Concrete30,
Concrete35,
Concrete40,
}
public static class ConcreteLibMaterialFactory
{
private static IEnumerable<ILibMaterialEntity> LibConcreteMaterials => LibMaterialPepository.GetConcreteRepository();
public static IConcreteLibMaterial GetConcreteLibMaterial(ConcreteLibTypes concreteLibTypes)
{
if (concreteLibTypes == ConcreteLibTypes.Concrete25)
{
return GetConcrete(25);
}
if (concreteLibTypes == ConcreteLibTypes.Concrete40)
{
return GetConcrete(40);
}
else
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(concreteLibTypes));
}
}
private static IConcreteLibMaterial GetConcrete(double strength)
{
string stringStrength = Convert.ToString(strength);
var libMaterial = LibConcreteMaterials
.Where(x => x.Name.Contains(stringStrength))
.First();
var libMat = new ConcreteLibMaterial
{
MaterialEntity = libMaterial,
TensionForULS = false,
TensionForSLS = true
};
return libMat;
}
}
}

View File

@@ -1,15 +1,7 @@
using StructureHelper.Models.Materials;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Codes;
using StructureHelperCommon.Models.Materials.Libraries;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Materials
{
@@ -17,7 +9,7 @@ namespace StructureHelperLogics.Models.Materials
{
Concrete40,
Reinforcement400,
Reinforecement500,
Reinforcement500,
Elastic200,
Carbon1400,
Glass1200
@@ -33,7 +25,7 @@ namespace StructureHelperLogics.Models.Materials
{
if (type == HeadmaterialType.Concrete40) { return GetConcrete40(); }
if (type == HeadmaterialType.Reinforcement400) { return GetReinforcement400(); }
if (type == HeadmaterialType.Reinforecement500) { return GetReinforcement500(); }
if (type == HeadmaterialType.Reinforcement500) { return GetReinforcement500(); }
if (type == HeadmaterialType.Elastic200) { return GetElastic200(); }
if (type == HeadmaterialType.Carbon1400) { return GetCarbon1400(); }
if (type == HeadmaterialType.Glass1200) { return GetGlass1200(); }
@@ -94,12 +86,7 @@ namespace StructureHelperLogics.Models.Materials
private static IHeadMaterial GetConcrete40()
{
var material = new HeadMaterial();
var libMaterial = LibConcreteMaterials.Where(x => x.Name.Contains("40")).First();
var libMat = new ConcreteLibMaterial();
libMat.MaterialEntity = libMaterial;
libMat.TensionForULS = false;
libMat.TensionForSLS = true;
material.HelperMaterial = libMat;
material.HelperMaterial = ConcreteLibMaterialFactory.GetConcreteLibMaterial(ConcreteLibTypes.Concrete40);
return material;
}
}

View File

@@ -1,12 +1,5 @@
using StructureHelper.Models.Materials;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Materials.Libraries;
using StructureHelperLogics.Models.Materials;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace StructureHelperLogics.Models.Templates.CrossSections.RCs