diff --git a/DataAccess/DTOs/DTOEntities/AccuracyDTO.cs b/DataAccess/DTOs/DTOEntities/AccuracyDTO.cs index 8b834e9..4c0039f 100644 --- a/DataAccess/DTOs/DTOEntities/AccuracyDTO.cs +++ b/DataAccess/DTOs/DTOEntities/AccuracyDTO.cs @@ -1,10 +1,5 @@ using Newtonsoft.Json; using StructureHelperCommon.Models.Calculators; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DataAccess.DTOs { diff --git a/DataAccess/DTOs/DTOEntities/BeamShearCalculatorDTO.cs b/DataAccess/DTOs/DTOEntities/BeamShearCalculatorDTO.cs new file mode 100644 index 0000000..31f6ef9 --- /dev/null +++ b/DataAccess/DTOs/DTOEntities/BeamShearCalculatorDTO.cs @@ -0,0 +1,41 @@ +using Newtonsoft.Json; +using StructureHelperCommon.Models; +using StructureHelperCommon.Models.Calculators; +using StructureHelperLogics.Models.BeamShears; + +//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia +//All rights reserved. + +namespace DataAccess.DTOs.DTOEntities +{ + internal class BeamShearCalculatorDTO : IBeamShearCalculator + { + [JsonProperty("Id")] + public Guid Id { get; } + [JsonProperty("Name")] + public string Name { get; set; } = string.Empty; + [JsonProperty("InputData")] + public IBeamShearCalculatorInputData InputData { get; set; } + [JsonProperty("ShowTraceData")] + public bool ShowTraceData { get; set; } + [JsonIgnore] + public IResult Result => throw new NotImplementedException(); + [JsonIgnore] + public IShiftTraceLogger? TraceLogger { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public BeamShearCalculatorDTO(Guid id) + { + Id = id; + } + + public object Clone() + { + return this; + } + + public void Run() + { + throw new NotImplementedException(); + } + } +} diff --git a/DataAccess/DTOs/DTOEntities/BeamShearCalculatorInputDataDTO.cs b/DataAccess/DTOs/DTOEntities/BeamShearCalculatorInputDataDTO.cs new file mode 100644 index 0000000..803d7b5 --- /dev/null +++ b/DataAccess/DTOs/DTOEntities/BeamShearCalculatorInputDataDTO.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; +using StructureHelperCommon.Models.Forces; +using StructureHelperLogics.Models.BeamShears; + +namespace DataAccess.DTOs.DTOEntities +{ + internal class BeamShearCalculatorInputDataDTO : IBeamShearCalculatorInputData + { + [JsonProperty("Id")] + public Guid Id { get; } + [JsonProperty("Actions")] + public List Actions { get; } = new(); + [JsonProperty("Sections")] + public List Sections { get; } = new(); + [JsonProperty("Stirrups")] + public List Stirrups { get; } = new(); + } +} diff --git a/DataAccess/DTOs/DTOEntities/BeamShearRepositoryDTO.cs b/DataAccess/DTOs/DTOEntities/BeamShearRepositoryDTO.cs index 1363700..21d191e 100644 --- a/DataAccess/DTOs/DTOEntities/BeamShearRepositoryDTO.cs +++ b/DataAccess/DTOs/DTOEntities/BeamShearRepositoryDTO.cs @@ -17,10 +17,14 @@ namespace DataAccess.DTOs.DTOEntities public List Sections { get; } = new(); [JsonProperty("Stirrups")] public List Stirrups { get; } = new(); + public BeamShearRepositoryDTO(Guid id) + { + Id = id; + } public object Clone() { - throw new NotImplementedException(); + return this; } } } diff --git a/DataAccess/DTOs/DTOEntities/BeamShearSectionDTO.cs b/DataAccess/DTOs/DTOEntities/BeamShearSectionDTO.cs new file mode 100644 index 0000000..24bc75f --- /dev/null +++ b/DataAccess/DTOs/DTOEntities/BeamShearSectionDTO.cs @@ -0,0 +1,33 @@ +using Newtonsoft.Json; +using StructureHelperCommon.Models.Shapes; +using StructureHelperLogics.Models.BeamShears; +using StructureHelperLogics.Models.Materials; + +//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia +//All rights reserved. + +namespace DataAccess.DTOs.DTOEntities +{ + public class BeamShearSectionDTO : IBeamShearSection + { + [JsonProperty("Id")] + public Guid Id { get; } + [JsonProperty("Name")] + public string? Name { get; set; } + [JsonProperty("Shape")] + public IShape Shape { get; set; } + [JsonProperty("Material")] + public IConcreteLibMaterial Material { get; set; } + [JsonProperty("CenterCover")] + public double CenterCover { get; set; } + public BeamShearSectionDTO(Guid id) + { + Id = id; + } + + public object Clone() + { + return this; + } + } +} diff --git a/DataAccess/DTOs/DTOEntities/StirrupByDensityDTO.cs b/DataAccess/DTOs/DTOEntities/StirrupByDensityDTO.cs new file mode 100644 index 0000000..dc8b750 --- /dev/null +++ b/DataAccess/DTOs/DTOEntities/StirrupByDensityDTO.cs @@ -0,0 +1,23 @@ +using Newtonsoft.Json; +using StructureHelperLogics.Models.BeamShears; + +namespace DataAccess.DTOs.DTOEntities +{ + public class StirrupByDensityDTO : IStirrupByDensity + { + [JsonProperty("Id")] + public Guid Id { get; } + [JsonProperty("Name")] + public string? Name { get; set; } = string.Empty; + [JsonProperty("StirrupDensity")] + public double StirrupDensity { get; set; } + [JsonProperty("CompressedGap")] + public double CompressedGap { get; set; } + + + public object Clone() + { + throw new NotImplementedException(); + } + } +} diff --git a/DataAccess/DTOs/DTOEntities/StirrupByRebarDTO.cs b/DataAccess/DTOs/DTOEntities/StirrupByRebarDTO.cs new file mode 100644 index 0000000..9550122 --- /dev/null +++ b/DataAccess/DTOs/DTOEntities/StirrupByRebarDTO.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; +using StructureHelperLogics.Models.BeamShears; +using StructureHelperLogics.Models.Materials; + +namespace DataAccess.DTOs.DTOEntities +{ + public class StirrupByRebarDTO : IStirrupByRebar + { + [JsonProperty("Id")] + public Guid Id { get; } + [JsonProperty("Name")] + public string? Name { get; set; } + [JsonProperty("LegCount")] + public double LegCount { get; set; } + [JsonProperty("Diameter")] + public double Diameter { get; set; } + [JsonProperty("Material")] + public IReinforcementLibMaterial Material { get; set; } + [JsonProperty("Spacing")] + public double Spacing { get; set; } + [JsonProperty("CompressedGap")] + public double CompressedGap { get; set; } + + public StirrupByRebarDTO(Guid id) + { + Id = id; + } + + public object Clone() + { + return this; + } + } +} diff --git a/StructureHelperLogics/Models/BeamShears/BeamShearSectionLogic.cs b/StructureHelperLogics/Models/BeamShears/BeamShearSectionLogic.cs index a618b65..b65bccf 100644 --- a/StructureHelperLogics/Models/BeamShears/BeamShearSectionLogic.cs +++ b/StructureHelperLogics/Models/BeamShears/BeamShearSectionLogic.cs @@ -66,7 +66,7 @@ namespace StructureHelperLogics.Models.BeamShears var sectionEffectiveness = SectionEffectivenessFactory.GetSheaEffectiveness(BeamShearSectionType.Rectangle); double longitudinalForce = InputData.ForceTuple.Nz; concreteLogic = new(sectionEffectiveness, InputData.InclinedSection, longitudinalForce, TraceLogger); - stirrupLogic = new(InputData.Stirrup, InputData.InclinedSection, TraceLogger); + stirrupLogic = new(InputData, TraceLogger); } private void PrepareNewResult() diff --git a/StructureHelperLogics/Models/BeamShears/IBeamShearSection.cs b/StructureHelperLogics/Models/BeamShears/IBeamShearSection.cs index 70dd918..fa09a47 100644 --- a/StructureHelperLogics/Models/BeamShears/IBeamShearSection.cs +++ b/StructureHelperLogics/Models/BeamShears/IBeamShearSection.cs @@ -1,12 +1,6 @@ using StructureHelperCommon.Infrastructures.Interfaces; -using StructureHelperCommon.Models.Materials; using StructureHelperCommon.Models.Shapes; using StructureHelperLogics.Models.Materials; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace StructureHelperLogics.Models.BeamShears { diff --git a/StructureHelperLogics/Models/BeamShears/Logics/StirrupByRebarStrengthLogic.cs b/StructureHelperLogics/Models/BeamShears/Logics/StirrupByRebarStrengthLogic.cs index c7b8861..3667d62 100644 --- a/StructureHelperLogics/Models/BeamShears/Logics/StirrupByRebarStrengthLogic.cs +++ b/StructureHelperLogics/Models/BeamShears/Logics/StirrupByRebarStrengthLogic.cs @@ -1,5 +1,6 @@ using StructureHelperCommon.Infrastructures.Interfaces; using StructureHelperCommon.Models; +using StructureHelperCommon.Models.Forces; //Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia //All rights reserved. @@ -11,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics private IStirrupEffectiveness stirrupEffectiveness; private IStirrupByRebar stirrupByRebar; private IInclinedSection inclinedSection; + private readonly IForceTuple forceTuple; private StirrupByDensityStrengthLogic stirrupDensityStrengthLogic; private IConvertStrategy convertStrategy; public IShiftTraceLogger? TraceLogger { get; set; } @@ -19,6 +21,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics IStirrupEffectiveness stirrupEffectiveness, IStirrupByRebar stirrupByRebar, IInclinedSection inclinedSection, + IForceTuple forceTuple, StirrupByDensityStrengthLogic stirrupDensityStrengthLogic, IConvertStrategy convertStrategy, IShiftTraceLogger? traceLogger) @@ -26,6 +29,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics this.stirrupEffectiveness = stirrupEffectiveness; this.stirrupByRebar = stirrupByRebar; this.inclinedSection = inclinedSection; + this.forceTuple = forceTuple; this.stirrupDensityStrengthLogic = stirrupDensityStrengthLogic; this.convertStrategy = convertStrategy; TraceLogger = traceLogger; @@ -35,17 +39,27 @@ namespace StructureHelperLogics.Models.BeamShears.Logics IStirrupEffectiveness stirrupEffectiveness, IStirrupByRebar stirrupByRebar, IInclinedSection inclinedSection, + IForceTuple forceTuple, IShiftTraceLogger? traceLogger) { this.stirrupEffectiveness = stirrupEffectiveness; this.stirrupByRebar = stirrupByRebar; this.inclinedSection = inclinedSection; + this.forceTuple = forceTuple; TraceLogger = traceLogger; } public double GetShearStrength() { InitializeStrategies(); + double maxSpacingRatio = inclinedSection.ConcreteTensionStrength * inclinedSection.WebWidth * inclinedSection.EffectiveDepth / forceTuple.Qy; + maxSpacingRatio = Math.Min(maxSpacingRatio, 0.5); + double maxStirrupSpacingByEffectibeDepth = maxSpacingRatio * inclinedSection.EffectiveDepth; + if (stirrupByRebar.Spacing > maxStirrupSpacingByEffectibeDepth) + { + TraceLogger?.AddMessage($"Stirrup spacing S = {stirrupByRebar.Spacing}(m) is greater than max stirrup spacing Smax = {maxStirrupSpacingByEffectibeDepth}(m), stirrups are ignored", TraceLogStatuses.Warning); + return 0; + } double shearStrength = stirrupDensityStrengthLogic.GetShearStrength(); return shearStrength; } diff --git a/StructureHelperLogics/Models/BeamShears/Logics/StirrupStrengthLogic.cs b/StructureHelperLogics/Models/BeamShears/Logics/StirrupStrengthLogic.cs index 15f7271..32362af 100644 --- a/StructureHelperLogics/Models/BeamShears/Logics/StirrupStrengthLogic.cs +++ b/StructureHelperLogics/Models/BeamShears/Logics/StirrupStrengthLogic.cs @@ -10,14 +10,14 @@ namespace StructureHelperLogics.Models.BeamShears.Logics { internal class StirrupStrengthLogic : IBeamShearStrenghLogic { - private IStirrup stirrup; - private IInclinedSection inclinedSection; + private readonly IBeamShearSectionLogicInputData inputData; + private IStirrup stirrup => inputData.Stirrup; + private IInclinedSection inclinedSection => inputData.InclinedSection; private IBeamShearStrenghLogic stirrupDensityStrengthLogic; - public StirrupStrengthLogic(IStirrup stirrup, IInclinedSection inclinedSection, IShiftTraceLogger? traceLogger) + public StirrupStrengthLogic(IBeamShearSectionLogicInputData inputData, IShiftTraceLogger? traceLogger) { - this.stirrup = stirrup; - this.inclinedSection = inclinedSection; + this.inputData = inputData; TraceLogger = traceLogger; } @@ -35,7 +35,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics else if (stirrup is IStirrupByRebar stirrupByRebar) { TraceLogger?.AddMessage("Stirrups type is stirrup by rebar"); - stirrupDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, TraceLogger); + stirrupDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, inputData.ForceTuple, TraceLogger); return stirrupDensityStrengthLogic.GetShearStrength(); } else