Add Design range for shear
This commit is contained in:
@@ -21,6 +21,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public List<IBeamShearSection> Sections { get; } = new();
|
||||
/// <inheritdoc/>
|
||||
public List<IStirrup> Stirrups { get; } = new();
|
||||
public IBeamShearDesignRangeProperty DesignRangeProperty { get; set; } = new BeamShearDesignRangeProperty(Guid.NewGuid());
|
||||
|
||||
public BeamShearCalculatorInputData(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <inheritdoc>
|
||||
public class BeamShearDesignRangeProperty : IBeamShearDesignRangeProperty
|
||||
{
|
||||
private const int minStepCount = 0;
|
||||
private const int maxStepCount = 1000;
|
||||
private double absoluteRangeValue = 0.0;
|
||||
private double relativeEffectiveDepthRangeValue = 3.0;
|
||||
private int stepCount = 50;
|
||||
|
||||
/// <inheritdoc>
|
||||
public Guid Id { get; }
|
||||
/// <inheritdoc>
|
||||
public double AbsoluteRangeValue
|
||||
{
|
||||
get => absoluteRangeValue;
|
||||
set
|
||||
{
|
||||
if (value < 0.0)
|
||||
{
|
||||
throw new StructureHelperException($"Absolute value of beam shear design range must be positive, but was {value}");
|
||||
}
|
||||
absoluteRangeValue = value;
|
||||
}
|
||||
}
|
||||
/// <inheritdoc>
|
||||
public double RelativeEffectiveDepthRangeValue
|
||||
{
|
||||
get => relativeEffectiveDepthRangeValue;
|
||||
set
|
||||
{
|
||||
if (value < 0.0)
|
||||
{
|
||||
throw new StructureHelperException($"Relative value of beam shear design range must be positive, but was {value}");
|
||||
}
|
||||
relativeEffectiveDepthRangeValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int StepCount
|
||||
{
|
||||
get => stepCount;
|
||||
set
|
||||
{
|
||||
if (value < minStepCount)
|
||||
{
|
||||
throw new StructureHelperException($"Number of step design range must be greater or equal {minStepCount}, but was {value}");
|
||||
}
|
||||
if (value > maxStepCount)
|
||||
{
|
||||
throw new StructureHelperException($"Number of step design range must be less or equal {maxStepCount}, but was {value}");
|
||||
}
|
||||
stepCount = value;
|
||||
}
|
||||
}
|
||||
public BeamShearDesignRangeProperty(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
/// <inheritdoc>
|
||||
public object Clone()
|
||||
{
|
||||
var updateStrategy = new BeamShearDesignRangePropertyUpdateStrategy();
|
||||
BeamShearDesignRangeProperty newitem = new(Guid.NewGuid());
|
||||
updateStrategy.Update(newitem, this);
|
||||
return newitem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public interface IBeamShearCalculatorInputData : ISaveable, IInputData, IHasBeamShearActions, IHasBeamShearSections, IHasStirrups
|
||||
{
|
||||
|
||||
IBeamShearDesignRangeProperty DesignRangeProperty { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements properties for calculting maximum range for considering of inclined sections
|
||||
/// </summary>
|
||||
public interface IBeamShearDesignRangeProperty : ISaveable, ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Absolute value of range in metres
|
||||
/// </summary>
|
||||
double AbsoluteRangeValue { get; set; }
|
||||
/// <summary>
|
||||
/// Relative value of range as factor of effective depth of cross-section
|
||||
/// </summary>
|
||||
double RelativeEffectiveDepthRangeValue { get; set; }
|
||||
/// <summary>
|
||||
/// Number of step of solvation
|
||||
/// </summary>
|
||||
int StepCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
private List<IInclinedSection> GetInclinedSections(IBeamShearSection beamShearSection)
|
||||
{
|
||||
IGetInclinedSectionListInputData inclinedSectionInputDataLogic = new GetInclinedSectionListInputData(beamShearSection);
|
||||
IGetInclinedSectionListInputData inclinedSectionInputDataLogic = new GetInclinedSectionListInputData(inputData.DesignRangeProperty, beamShearSection);
|
||||
//IGetInclinedSectionListLogic getInclinedSectionListLogic = new GetInclinedSectionListLogic(inclinedSectionInputDataLogic, TraceLogger);
|
||||
IGetInclinedSectionListLogic getInclinedSectionListLogic = new GetInclinedSectionListLogic(inclinedSectionInputDataLogic, null);
|
||||
return getInclinedSectionListLogic.GetInclinedSections();
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private string checkResult;
|
||||
private ICheckEntityLogic<IBeamShearAction> checkActionsLogic;
|
||||
private ICheckEntityLogic<IBeamShearSection> checkSectionLogic;
|
||||
private ICheckEntityLogic<IStirrup> checkStirrupLogic;
|
||||
private ICheckEntityLogic<IHasStirrups> StirrupCheckLogic;
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
public IBeamShearCalculatorInputData InputData { get; set; }
|
||||
@@ -65,23 +65,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
private void CheckStirrups()
|
||||
{
|
||||
if (InputData.Stirrups is null)
|
||||
StirrupCheckLogic ??= new HasStirrupsCheckLogic(TraceLogger);
|
||||
StirrupCheckLogic.Entity = InputData;
|
||||
if (StirrupCheckLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage("\nCollection of stirrups is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
checkStirrupLogic ??= new CheckStirrupsLogic(TraceLogger);
|
||||
foreach (var stirrup in InputData.Stirrups)
|
||||
{
|
||||
checkStirrupLogic.Entity = stirrup;
|
||||
if (checkStirrupLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += checkStirrupLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
checkResult += StirrupCheckLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class CheckStirrupsLogic : ICheckEntityLogic<IStirrup>
|
||||
{
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
private ICheckEntityLogic<IStirrupByDensity> checkDensityLogic;
|
||||
private ICheckEntityLogic<IStirrupByRebar> checkRebarLogic;
|
||||
|
||||
public CheckStirrupsLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IStirrup Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
checkResult = string.Empty;
|
||||
result = true;
|
||||
if (Entity is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = "\nStirrup is not assigned";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Entity is IStirrupByDensity density)
|
||||
{
|
||||
checkDensityLogic ??= new CheckStirrupsByDensityLogic(TraceLogger);
|
||||
checkDensityLogic.Entity = density;
|
||||
if (checkDensityLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += checkDensityLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
else if (Entity is IStirrupByRebar rebar)
|
||||
{
|
||||
checkRebarLogic ??= new CheckStirrupsByRebarLogic(TraceLogger);
|
||||
checkRebarLogic.Entity = rebar;
|
||||
if (checkRebarLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += checkRebarLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
else if (Entity is IStirrupGroup stirrupGroup)
|
||||
{
|
||||
|
||||
}
|
||||
else if (Entity is IStirrupByInclinedRebar inclinedRebar)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
string errorString = ErrorStrings.ObjectTypeIsUnknownObj(Entity) + $": name = {Entity.Name}, id = {Entity.Id}";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class HasStirrupsCheckLogic : ICheckEntityLogic<IHasStirrups>
|
||||
{
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
private ICheckEntityLogic<IStirrup> checkStirrupLogic;
|
||||
|
||||
public IHasStirrups Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public HasStirrupsCheckLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
checkResult = string.Empty;
|
||||
result = true;
|
||||
if (Entity is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = "\nHasSturrup element is not assigned";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Entity.Stirrups is null)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage("\nCollection of stirrups is null");
|
||||
}
|
||||
checkStirrupLogic ??= new StirrupsCheckLogic(TraceLogger);
|
||||
foreach (var stirrup in Entity.Stirrups)
|
||||
{
|
||||
checkStirrupLogic.Entity = stirrup;
|
||||
if (checkStirrupLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += checkStirrupLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class CheckStirrupsByDensityLogic : ICheckEntityLogic<IStirrupByDensity>
|
||||
internal class StirrupByDensityCheckLogic : ICheckEntityLogic<IStirrupByDensity>
|
||||
{
|
||||
private const int minDensity = 0;
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
|
||||
public CheckStirrupsByDensityLogic(IShiftTraceLogger? traceLogger)
|
||||
public StirrupByDensityCheckLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupByInclinedRebarCheckLogic : ICheckEntityLogic<IStirrupByInclinedRebar>
|
||||
{
|
||||
private const int minLegCount = 0;
|
||||
private const double minTransferLength = 0.010;
|
||||
private const double minStartCoordinate = 0.0;
|
||||
private const int minAngleOfInclination = 30;
|
||||
private const int maxAngleOfInclination = 60;
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
private ICheckEntityLogic<IRebarSection> checkRebarSectionLogic;
|
||||
|
||||
public IStirrupByInclinedRebar Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public StirrupByInclinedRebarCheckLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
result = true;
|
||||
checkResult = string.Empty;
|
||||
if (Entity is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = "\nInclined rebar is not assigned";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckRebarSection();
|
||||
CheckEntityProperties();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CheckEntityProperties()
|
||||
{
|
||||
if (Entity.StartCoordinate < minStartCoordinate)
|
||||
{
|
||||
result = false;
|
||||
checkResult += $"\nInclined rebar Name = {Entity.Name} start coordinate must be greater than {minStartCoordinate}, but was {Entity.StartCoordinate}";
|
||||
}
|
||||
if (Entity.AngleOfInclination < minAngleOfInclination)
|
||||
{
|
||||
result = false;
|
||||
checkResult += $"\nInclined rebar Name = {Entity.Name} angle of inclination must be greater than {minAngleOfInclination}, but was {Entity.AngleOfInclination}";
|
||||
}
|
||||
if (Entity.AngleOfInclination > maxAngleOfInclination)
|
||||
{
|
||||
result = false;
|
||||
checkResult += $"\nInclined rebar Name = {Entity.Name} angle of inclination must be less than {maxAngleOfInclination}, but was {Entity.AngleOfInclination}";
|
||||
}
|
||||
if (Entity.LegCount < minLegCount)
|
||||
{
|
||||
result = false;
|
||||
checkResult += $"\nInclined rebar Name = {Entity.Name} leg count n = {Entity.LegCount} is less than minimum leg count nmin = {minLegCount}";
|
||||
}
|
||||
if (Entity.TransferLength < minTransferLength)
|
||||
{
|
||||
result = false;
|
||||
checkResult += $"\nInclined rebar Name = {Entity.Name} transfer length Ltr = {Entity.TransferLength} is less than minimum trancfer length Ltr,min = {minTransferLength}";
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckRebarSection()
|
||||
{
|
||||
if (Entity.RebarSection is null)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"Inclined rebar Name = {Entity.Name} does not have rebar section");
|
||||
}
|
||||
else
|
||||
{
|
||||
checkRebarSectionLogic ??= new CheckRebarSectionLogic(TraceLogger)
|
||||
{
|
||||
Entity = Entity.RebarSection,
|
||||
MinDiameter = 0.003,
|
||||
MaxDiameter = 0.036
|
||||
};
|
||||
if (checkRebarSectionLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += checkRebarSectionLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class CheckStirrupsByRebarLogic : ICheckEntityLogic<IStirrupByRebar>
|
||||
internal class StirrupByRebarCheckLogic : ICheckEntityLogic<IStirrupByRebar>
|
||||
{
|
||||
private const double minDiameter = 0.003;
|
||||
private const double maxDiameter = 0.025;
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
|
||||
public CheckStirrupsByRebarLogic(IShiftTraceLogger? traceLogger)
|
||||
public StirrupByRebarCheckLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupGroupCheckLogic : ICheckEntityLogic<IStirrupGroup>
|
||||
{
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
private ICheckEntityLogic<IHasStirrups> hasStirrupsCheckLogic;
|
||||
public IStirrupGroup Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public StirrupGroupCheckLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
checkResult = string.Empty;
|
||||
result = true;
|
||||
if (Entity is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = "\nStirrup group is not assigned";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasStirrupsCheckLogic ??= new HasStirrupsCheckLogic(TraceLogger);
|
||||
hasStirrupsCheckLogic.Entity = Entity;
|
||||
if (hasStirrupsCheckLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += "\nStirrup group has some errors";
|
||||
checkResult += hasStirrupsCheckLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupsCheckLogic : ICheckEntityLogic<IStirrup>
|
||||
{
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
private ICheckEntityLogic<IStirrupByDensity> densityCheckLogic;
|
||||
private ICheckEntityLogic<IStirrupByRebar> rebarCheckLogic;
|
||||
private ICheckEntityLogic<IStirrupGroup> stirrupGroupCheckLogic;
|
||||
private ICheckEntityLogic<IStirrupByInclinedRebar> inclinedRebarCheckLogic;
|
||||
|
||||
public StirrupsCheckLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IStirrup Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
checkResult = string.Empty;
|
||||
result = true;
|
||||
if (Entity is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = "\nStirrup is not assigned";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckStirrups();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CheckStirrups()
|
||||
{
|
||||
if (Entity is IStirrupByDensity density)
|
||||
{
|
||||
CheckStirrupByDensity(density);
|
||||
}
|
||||
else if (Entity is IStirrupByRebar rebar)
|
||||
{
|
||||
CheckStirrupByRebar(rebar);
|
||||
}
|
||||
else if (Entity is IStirrupGroup stirrupGroup)
|
||||
{
|
||||
CheckStirrupGroup(stirrupGroup);
|
||||
}
|
||||
else if (Entity is IStirrupByInclinedRebar inclinedRebar)
|
||||
{
|
||||
CheckInclinedRebar(inclinedRebar);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
string errorString = ErrorStrings.ObjectTypeIsUnknownObj(Entity) + $": name = {Entity.Name}, id = {Entity.Id}";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckInclinedRebar(IStirrupByInclinedRebar inclinedRebar)
|
||||
{
|
||||
inclinedRebarCheckLogic ??= new StirrupByInclinedRebarCheckLogic(TraceLogger);
|
||||
inclinedRebarCheckLogic.Entity = inclinedRebar;
|
||||
if (inclinedRebarCheckLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += inclinedRebarCheckLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckStirrupGroup(IStirrupGroup stirrupGroup)
|
||||
{
|
||||
stirrupGroupCheckLogic ??= new StirrupGroupCheckLogic(TraceLogger);
|
||||
stirrupGroupCheckLogic.Entity = stirrupGroup;
|
||||
if (stirrupGroupCheckLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += stirrupGroupCheckLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckStirrupByRebar(IStirrupByRebar rebar)
|
||||
{
|
||||
rebarCheckLogic ??= new StirrupByRebarCheckLogic(TraceLogger);
|
||||
rebarCheckLogic.Entity = rebar;
|
||||
if (rebarCheckLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += rebarCheckLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckStirrupByDensity(IStirrupByDensity density)
|
||||
{
|
||||
densityCheckLogic ??= new StirrupByDensityCheckLogic(TraceLogger);
|
||||
densityCheckLogic.Entity = density;
|
||||
if (densityCheckLogic.Check() == false)
|
||||
{
|
||||
result = false;
|
||||
checkResult += densityCheckLogic.CheckResult;
|
||||
}
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,12 @@
|
||||
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
|
||||
{
|
||||
public class HasStirrupsUpdateCloneStrategy : IUpdateStrategy<IHasStirrups>
|
||||
{
|
||||
private readonly ICloningStrategy cloningStrategy;
|
||||
private ICloneStrategy<IStirrupGroup> groupCloneStrategy;
|
||||
|
||||
public HasStirrupsUpdateCloneStrategy(ICloningStrategy cloningStrategy)
|
||||
{
|
||||
@@ -26,7 +22,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
targetObject.Stirrups.Clear();
|
||||
foreach (var item in sourceObject.Stirrups)
|
||||
{
|
||||
IStirrup newStirrup = cloningStrategy.Clone(item);
|
||||
IStirrup newStirrup;
|
||||
newStirrup = cloningStrategy.Clone(item);
|
||||
targetObject.Stirrups.Add(newStirrup);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupGroupCloneStrategy : ICloneStrategy<IStirrupGroup>
|
||||
{
|
||||
private IUpdateStrategy<IStirrupGroup> updateStrategy;
|
||||
private IUpdateStrategy<IHasStirrups> hasStirrupsUpdateStrategy;
|
||||
private readonly ICloningStrategy cloningStrategy;
|
||||
|
||||
public StirrupGroupCloneStrategy(ICloningStrategy cloningStrategy)
|
||||
{
|
||||
this.cloningStrategy = cloningStrategy;
|
||||
}
|
||||
|
||||
public IStirrupGroup GetClone(IStirrupGroup sourceObject)
|
||||
{
|
||||
//updateStrategy ??= new StirrupGroupUpdateStrategy() { UpdateChildren = false };
|
||||
//hasStirrupsUpdateStrategy ??= new HasStirrupsUpdateCloneStrategy(cloningStrategy);
|
||||
//StirrupGroup newItem = new(Guid.NewGuid());
|
||||
//updateStrategy.Update(newItem,sourceObject);
|
||||
//hasStirrupsUpdateStrategy.Update(newItem,sourceObject);
|
||||
//return newItem;
|
||||
return cloningStrategy.Clone(sourceObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <inheritdoc/>
|
||||
public class GetInclinedSectionListInputData : IGetInclinedSectionListInputData
|
||||
{
|
||||
public int StepCount { get; set; } = 50;
|
||||
public double MaxInclinedSectionLegthFactor { get; set; } = 3d;
|
||||
public IBeamShearDesignRangeProperty DesignRangeProperty { get; }
|
||||
public IGetInclinedSectionLogic? GetInclinedSectionLogic { get; set; }
|
||||
public IBeamShearSection BeamShearSection { get; set; }
|
||||
|
||||
public GetInclinedSectionListInputData(IBeamShearSection beamShearSection)
|
||||
public GetInclinedSectionListInputData(IBeamShearDesignRangeProperty designRangeProperty, IBeamShearSection beamShearSection)
|
||||
{
|
||||
DesignRangeProperty = designRangeProperty;
|
||||
BeamShearSection = beamShearSection;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,17 +44,26 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
private void GetCoordinates()
|
||||
{
|
||||
double maxSectionLength = inputData.MaxInclinedSectionLegthFactor * effectiveDepth;
|
||||
double step = maxSectionLength / inputData.StepCount;
|
||||
double maxSectionLength = GetMaxSectionLength();
|
||||
int stepCount = inputData.DesignRangeProperty.StepCount;
|
||||
double step = maxSectionLength / stepCount;
|
||||
inclinedSections = new();
|
||||
coordinates = new();
|
||||
for (int i = 0; i < inputData.StepCount + 1; i++)
|
||||
for (int i = 0; i < stepCount + 1; i++)
|
||||
{
|
||||
double endCoord = step * i;
|
||||
double roundedEndCoord = Math.Round(endCoord, 6);
|
||||
coordinates.Add(roundedEndCoord);
|
||||
}
|
||||
}
|
||||
|
||||
private double GetMaxSectionLength()
|
||||
{
|
||||
double relativeLength = inputData.DesignRangeProperty.RelativeEffectiveDepthRangeValue * effectiveDepth;
|
||||
double length = Math.Max(relativeLength, inputData.DesignRangeProperty.AbsoluteRangeValue);
|
||||
return length;
|
||||
}
|
||||
|
||||
private void Check()
|
||||
{
|
||||
CheckObject.IsNull(inputData);
|
||||
|
||||
@@ -4,8 +4,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public interface IGetInclinedSectionListInputData : IInputData
|
||||
{
|
||||
int StepCount { get; set; }
|
||||
double MaxInclinedSectionLegthFactor { get; set; }
|
||||
IBeamShearDesignRangeProperty DesignRangeProperty { get; }
|
||||
IGetInclinedSectionLogic? GetInclinedSectionLogic { get; set; }
|
||||
IBeamShearSection BeamShearSection { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupByInclinedRebarStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
const double stirrupEffectivenessFactor = 0.75;
|
||||
private readonly IStirrupByInclinedRebar inclinedRebar;
|
||||
private readonly IInclinedSection inclinedSection;
|
||||
private IRebarSectionStrengthLogic rebarSectionStrengthLogic;
|
||||
@@ -57,6 +53,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger?.AddMessage($"Inclined section end point coordinate X = {inclinedSection.EndCoord} is in start transfer zone");
|
||||
return GetStartTransferValue();
|
||||
}
|
||||
TraceLogger?.AddMessage($"Inclined section with start point coordinate Xstart = {inclinedSection.StartCoord}(m) and end point Xend = {inclinedSection.EndCoord}(m) intersects inclined rebar in main zone with Xstart = {rebarTrueStartPoint}(m) and Xend = {rebarTrueEndPoint}(m)");
|
||||
return GetInclinedRebarStrength();
|
||||
}
|
||||
|
||||
@@ -98,9 +95,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
};
|
||||
rebarSectionStrengthLogic.RebarSection = inclinedRebar.RebarSection;
|
||||
double rebarStrength = rebarSectionStrengthLogic.GetRebarMaxTensileForce();
|
||||
double inclinedRebarStrength = rebarStrength * Math.Sin(angleInRad) * inclinedRebar.LegCount;
|
||||
TraceLogger?.AddMessage($"Inclinated rebar {inclinedRebar.Name}, start point {rebarStartPoint}(m), end point {rebarEndPoint}(m), angle of inclination {inclinedRebar.AngleOfInclination}(deg), number of legs {inclinedRebar.LegCount}");
|
||||
TraceLogger?.AddMessage($"Force in inclined rebar = {rebarStrength}(N) * sin({inclinedRebar.AngleOfInclination}) * {inclinedRebar.LegCount} = {inclinedRebarStrength}(N)");
|
||||
double inclinedRebarStrength = stirrupEffectivenessFactor * rebarStrength * Math.Sin(angleInRad) * inclinedRebar.LegCount;
|
||||
TraceLogger?.AddMessage($"Inclined rebar Name = {inclinedRebar.Name}, start point {rebarStartPoint}(m), end point {rebarEndPoint}(m), angle of inclination {inclinedRebar.AngleOfInclination}(deg), number of legs {inclinedRebar.LegCount}");
|
||||
TraceLogger?.AddMessage($"Inclined rebar effectiveness factor fi_sw = {stirrupEffectivenessFactor}(dimensionless)");
|
||||
TraceLogger?.AddMessage($"Force in inclined rebar = fi_sw * Fsw * sin(alpha) * n = {stirrupEffectivenessFactor} * {rebarStrength}(N) * sin({inclinedRebar.AngleOfInclination}) * {inclinedRebar.LegCount} = {inclinedRebarStrength}(N)");
|
||||
return inclinedRebarStrength;
|
||||
}
|
||||
|
||||
@@ -113,6 +111,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
rebarEndPoint = rebarStartPoint + rebarHeight / Math.Tan(angleInRad);
|
||||
rebarTrueStartPoint = rebarStartPoint + transferLength;
|
||||
rebarTrueEndPoint = rebarEndPoint - transferLength;
|
||||
if (rebarTrueStartPoint >= rebarTrueEndPoint)
|
||||
{
|
||||
throw new StructureHelperException("Transfer aone in inclined rebar is too big");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,20 +4,30 @@ using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearCalculatorInputDataUpdateStrategy : IUpdateStrategy<IBeamShearCalculatorInputData>
|
||||
public class BeamShearCalculatorInputDataUpdateStrategy : IParentUpdateStrategy<IBeamShearCalculatorInputData>
|
||||
{
|
||||
private IUpdateStrategy<IHasBeamShearActions>? hasActionUpdateStrategy;
|
||||
private IUpdateStrategy<IHasStirrups>? hasStirrupsUpdateStrategy;
|
||||
private IUpdateStrategy<IHasBeamShearSections> hasSectionsUpdateStrategy;
|
||||
private IUpdateStrategy<IBeamShearDesignRangeProperty> designRangeUpdateStrategy;
|
||||
|
||||
public bool UpdateChildren { get; set; } = true;
|
||||
|
||||
public void Update(IBeamShearCalculatorInputData targetObject, IBeamShearCalculatorInputData sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||
InitializeStrategies();
|
||||
hasActionUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
hasSectionsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
hasStirrupsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
if (UpdateChildren)
|
||||
{
|
||||
InitializeStrategies();
|
||||
hasActionUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
hasSectionsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
hasStirrupsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
CheckObject.IsNull(sourceObject.DesignRangeProperty);
|
||||
CheckObject.IsNull(targetObject.DesignRangeProperty);
|
||||
designRangeUpdateStrategy.Update(targetObject.DesignRangeProperty, sourceObject.DesignRangeProperty);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +36,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
hasActionUpdateStrategy ??= new HasBeamShearActionUpdateStrategy();
|
||||
hasStirrupsUpdateStrategy ??= new HasStirrupsUpdateStrategy();
|
||||
hasSectionsUpdateStrategy ??= new HasBeamShearSectionUpdateStrategy();
|
||||
designRangeUpdateStrategy ??= new BeamShearDesignRangePropertyUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearDesignRangePropertyUpdateStrategy : IUpdateStrategy<IBeamShearDesignRangeProperty>
|
||||
{
|
||||
public void Update(IBeamShearDesignRangeProperty targetObject, IBeamShearDesignRangeProperty sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.AbsoluteRangeValue = sourceObject.AbsoluteRangeValue;
|
||||
targetObject.RelativeEffectiveDepthRangeValue = sourceObject.RelativeEffectiveDepthRangeValue;
|
||||
targetObject.StepCount = sourceObject.StepCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,12 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupByInclinedRebarUpdateStrategy : IUpdateStrategy<IStirrupByInclinedRebar>
|
||||
public class StirrupByInclinedRebarUpdateStrategy : IParentUpdateStrategy<IStirrupByInclinedRebar>
|
||||
{
|
||||
private IUpdateStrategy<IStirrup>? baseUpdateStrategy;
|
||||
|
||||
public bool UpdateChildren { get; set; } = true;
|
||||
|
||||
public void Update(IStirrupByInclinedRebar targetObject, IStirrupByInclinedRebar sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
@@ -20,8 +23,11 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
targetObject.TransferLength = sourceObject.TransferLength;
|
||||
targetObject.AngleOfInclination = sourceObject.AngleOfInclination;
|
||||
targetObject.LegCount = sourceObject.LegCount;
|
||||
CheckObject.IsNull(sourceObject.RebarSection, "Rebar section");
|
||||
targetObject.RebarSection = sourceObject.RebarSection.Clone() as IRebarSection;
|
||||
if (UpdateChildren)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject.RebarSection, "Rebar section");
|
||||
targetObject.RebarSection = sourceObject.RebarSection.Clone() as IRebarSection;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupGroupUpdateStrategy : IUpdateStrategy<IStirrupGroup>
|
||||
public class StirrupGroupUpdateStrategy : IParentUpdateStrategy<IStirrupGroup>
|
||||
{
|
||||
private StirrupBaseUpdateStrategy baseUpdateStrategy;
|
||||
|
||||
public bool UpdateChildren { get; set; } = true;
|
||||
|
||||
public void Update(IStirrupGroup targetObject, IStirrupGroup sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
@@ -16,6 +18,14 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy();
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
if (UpdateChildren == true)
|
||||
{
|
||||
UpdateTargetChildren(targetObject, sourceObject);
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateTargetChildren(IStirrupGroup targetObject, IStirrupGroup sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject.Stirrups);
|
||||
CheckObject.IsNull(targetObject.Stirrups);
|
||||
targetObject.Stirrups.Clear();
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
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.Materials
|
||||
{
|
||||
internal class CheckRebarSectionLogic : ICheckEntityLogic<IRebarSection>
|
||||
{
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
public IRebarSection Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
public double MinDiameter { get; set; } = 0.003;
|
||||
public double MaxDiameter { get; set; } = 0.090;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CheckRebarSectionLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
checkResult = string.Empty;
|
||||
result = true;
|
||||
if (Entity is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = "\nRebar section is not assigned";
|
||||
TraceMessage(errorString);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Entity.Diameter < MinDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nRebar diameter d = {Entity.Diameter} must not be less than dmin = {MinDiameter}");
|
||||
}
|
||||
if (Entity.Diameter > MaxDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nRebar diameter d = {Entity.Diameter} must be less or equal than dmax = {MaxDiameter}");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
double minimizedStrength = Math.Min(rebarStrength, MaxRebarStrength);
|
||||
TraceLogger?.AddMessage($"Strength of rebar Rs = Min({rebarStrength}, {MaxRebarStrength})= {minimizedStrength}(Pa)");
|
||||
double rebarForce = minimizedStrength * rebarArea;
|
||||
TraceLogger?.AddMessage($"Force in rebar Ns = {minimizedStrength}(Pa) * {rebarArea}(m2) = {rebarForce}");
|
||||
TraceLogger?.AddMessage($"Force in rebar Ns = {minimizedStrength}(Pa) * {rebarArea}(m2) = {rebarForce}(N)");
|
||||
return rebarForce;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,21 @@ using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public class RebarSectionUpdateStrategy : IUpdateStrategy<IRebarSection>
|
||||
public class RebarSectionUpdateStrategy : IParentUpdateStrategy<IRebarSection>
|
||||
{
|
||||
public bool UpdateChildren { get; set; } = true;
|
||||
|
||||
public void Update(IRebarSection targetObject, IRebarSection sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject);
|
||||
CheckObject.IsNull(targetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
CheckObject.IsNull(sourceObject.Material);
|
||||
targetObject.Material = sourceObject.Material.Clone() as IReinforcementLibMaterial;
|
||||
targetObject.Diameter = sourceObject.Diameter;
|
||||
if (UpdateChildren)
|
||||
{
|
||||
targetObject.Material = sourceObject.Material.Clone() as IReinforcementLibMaterial;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user