Add primitive visual property
This commit is contained in:
@@ -37,16 +37,31 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Entity.StirrupDensity < minDensity)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} density d = {Entity.StirrupDensity} must not be less than dmin = {minDensity}");
|
||||
}
|
||||
CheckEntity();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CheckEntity()
|
||||
{
|
||||
if (Entity.StirrupDensity < minDensity)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} density d = {Entity.StirrupDensity} must not be less than dmin = {minDensity}");
|
||||
}
|
||||
if (Entity.StartCoordinate < 0)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} start coordinate must not be less than zero, but was {Entity.StartCoordinate}");
|
||||
}
|
||||
if (Entity.EndCoordinate <= Entity.StartCoordinate)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} start coordinate must be less than end coordinte, but was Xstart = {Entity.StartCoordinate}(m), Xend = {Entity.EndCoordinate}(m)");
|
||||
}
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
|
||||
@@ -41,34 +41,50 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Entity.Diameter < minDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} diameter d = {Entity.Diameter} must not be less than dmin = {minDiameter}");
|
||||
}
|
||||
if (Entity.Diameter > maxDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} diameter d = {Entity.Diameter} must be less or equal than dmax = {maxDiameter}");
|
||||
}
|
||||
if (Entity.Spacing < minSpacing)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} spacing s = {Entity.Spacing} must not be less than smin = {minSpacing}");
|
||||
}
|
||||
if (Entity.Spacing > maxSpacing)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} spacing s = {Entity.Spacing} must be less or equal than smax = {maxSpacing}");
|
||||
}
|
||||
if (Entity.LegCount < minLegCount)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} leg count n = {Entity.LegCount} must not be less than nmin = {minLegCount}");
|
||||
}
|
||||
CheckEntity();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CheckEntity()
|
||||
{
|
||||
if (Entity.Diameter < minDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} diameter d = {Entity.Diameter} must not be less than dmin = {minDiameter}");
|
||||
}
|
||||
if (Entity.Diameter > maxDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} diameter d = {Entity.Diameter} must be less or equal than dmax = {maxDiameter}");
|
||||
}
|
||||
if (Entity.Spacing < minSpacing)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} spacing s = {Entity.Spacing} must not be less than smin = {minSpacing}");
|
||||
}
|
||||
if (Entity.Spacing > maxSpacing)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} spacing s = {Entity.Spacing} must be less or equal than smax = {maxSpacing}");
|
||||
}
|
||||
if (Entity.LegCount < minLegCount)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} leg count n = {Entity.LegCount} must not be less than nmin = {minLegCount}");
|
||||
}
|
||||
if (Entity.StartCoordinate < 0)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} start coordinate must not be less than zero, but was {Entity.StartCoordinate}");
|
||||
}
|
||||
if (Entity.EndCoordinate <= Entity.StartCoordinate)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nStirrup {Entity.Name} start coordinate must be less than end coordinte, but was Xstart = {Entity.StartCoordinate}(m), Xend = {Entity.EndCoordinate}(m)");
|
||||
}
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -91,7 +93,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private void GetAreas()
|
||||
{
|
||||
reducingFactor = reinforcementModulus / concreteModulus;
|
||||
concreteArea = inclinedSection.WebWidth * inclinedSection.FullDepth;
|
||||
if (inclinedSection.BeamShearSection.Shape is IRectangleShape)
|
||||
{
|
||||
concreteArea = inclinedSection.WebWidth * inclinedSection.FullDepth;
|
||||
}
|
||||
else if (inclinedSection.BeamShearSection.Shape is ICircleShape)
|
||||
{
|
||||
concreteArea = inclinedSection.WebWidth * inclinedSection.FullDepth * 0.785398; // * 0.785398 = PI/4
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(inclinedSection.BeamShearSection.Shape));
|
||||
}
|
||||
TraceLogger?.AddMessage($"Concrete area Ac = {concreteArea}(m^2)");
|
||||
reinforcementArea = inclinedSection.BeamShearSection.ReinforcementArea;
|
||||
TraceLogger?.AddMessage($"Reinforcement area As = {reinforcementArea}(m^2)");
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupBaseUpdateStrategy : IUpdateStrategy<IStirrup>
|
||||
public class StirrupBaseUpdateStrategy : IParentUpdateStrategy<IStirrup>
|
||||
{
|
||||
private IUpdateStrategy<IPrimitiveVisualProperty> visualUpdateStrategy;
|
||||
public bool UpdateChildren { get; set; } = true;
|
||||
|
||||
public void Update(IStirrup targetObject, IStirrup sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
@@ -12,6 +16,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.CompressedGap = sourceObject.CompressedGap;
|
||||
if (UpdateChildren == true)
|
||||
{
|
||||
UpdateTargetChildren(targetObject, sourceObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTargetChildren(IStirrup targetObject, IStirrup sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject.VisualProperty);
|
||||
CheckObject.IsNull(targetObject.VisualProperty);
|
||||
visualUpdateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy();
|
||||
visualUpdateStrategy.Update(targetObject.VisualProperty, sourceObject.VisualProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,10 +38,14 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger?.AddMessage("Calculation has been started", TraceLogStatuses.Debug);
|
||||
double crackLength = inclinedSection.EndCoord - inclinedSection.StartCoord;
|
||||
TraceLogger?.AddMessage($"Length of crack = {inclinedSection.EndCoord} - {inclinedSection.StartCoord} = {crackLength}(m)");
|
||||
double crackEndCoord = Math.Min(stirrupByDensity.EndCoordinate, inclinedSection.EndCoord);
|
||||
double crackStartCoord = Math.Max(stirrupByDensity.StartCoordinate, inclinedSection.StartCoord);
|
||||
double crackLengthViaStirrup = crackEndCoord - crackStartCoord;
|
||||
TraceLogger?.AddMessage($"Length of crack via stirrup = {crackEndCoord} - {crackStartCoord} = {crackLengthViaStirrup}(m)");
|
||||
double maxCrackLength = stirrupEffectiveness.MaxCrackLengthRatio * inclinedSection.EffectiveDepth;
|
||||
TraceLogger?.AddMessage($"Max length of crack = {stirrupEffectiveness.MaxCrackLengthRatio} * {inclinedSection.EffectiveDepth} = {maxCrackLength}(m)");
|
||||
double finalCrackLength = Math.Min(crackLength, maxCrackLength);
|
||||
TraceLogger?.AddMessage($"Length of crack = Min({crackLength}, {maxCrackLength}) = {finalCrackLength}(m)");
|
||||
double finalCrackLength = Math.Min(crackLengthViaStirrup, maxCrackLength);
|
||||
TraceLogger?.AddMessage($"Length of crack = Min({crackLengthViaStirrup}, {maxCrackLength}) = {finalCrackLength}(m)");
|
||||
double finalDensity = stirrupEffectiveness.StirrupShapeFactor * stirrupEffectiveness.StirrupPlacementFactor * stirrupByDensity.StirrupDensity;
|
||||
TraceLogger?.AddMessage($"Stirrups design density qsw = {stirrupEffectiveness.StirrupShapeFactor} * {stirrupEffectiveness.StirrupPlacementFactor} * {stirrupByDensity.StirrupDensity} = {finalDensity}(N/m)");
|
||||
double concreteDensity = inclinedSection.WebWidth * inclinedSection.ConcreteTensionStrength;
|
||||
|
||||
@@ -17,6 +17,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy();
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
targetObject.StirrupDensity = sourceObject.StirrupDensity;
|
||||
targetObject.StartCoordinate = sourceObject.StartCoordinate;
|
||||
targetObject.EndCoordinate = sourceObject.EndCoordinate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
StirrupByDensity stirrupByDensity = new(Guid.NewGuid());
|
||||
updateStrategy.Update(stirrupByDensity, source);
|
||||
stirrupByDensity.StirrupDensity = GetStirrupDensity(source);
|
||||
stirrupByDensity.StartCoordinate = source.StartCoordinate;
|
||||
stirrupByDensity.EndCoordinate = source.EndCoordinate;
|
||||
return stirrupByDensity;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
targetObject.LegCount = sourceObject.LegCount;
|
||||
targetObject.Spacing = sourceObject.Spacing;
|
||||
targetObject.IsSpiral = sourceObject.IsSpiral;
|
||||
targetObject.StartCoordinate = sourceObject.StartCoordinate;
|
||||
targetObject.EndCoordinate = sourceObject.EndCoordinate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
double parameter = GetInclinedCrackRatio();
|
||||
double parameter = GetCrackLengthRatio();
|
||||
BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(parameter);
|
||||
TraceLogger?.AddMessage($"New value of dangerous inclinated crack has been obtained: start point Xstart = {newInputData.InclinedSection.StartCoord}(m), end point Xend = {newInputData.InclinedSection.EndCoord}(m)");
|
||||
stirrupLogic = new(newInputData, TraceLogger);
|
||||
@@ -31,7 +31,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="StructureHelperException"></exception>
|
||||
private double GetInclinedCrackRatio()
|
||||
private double GetCrackLengthRatio()
|
||||
{
|
||||
var parameterCalculator = new FindParameterCalculator();
|
||||
parameterCalculator.InputData.Predicate = GetPredicate;
|
||||
@@ -48,6 +48,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
crackLengthRatio += 0.0001;
|
||||
}
|
||||
crackLengthRatio = Math.Max(crackLengthRatio, 0);
|
||||
return crackLengthRatio;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -16,7 +16,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy();
|
||||
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy()
|
||||
{
|
||||
UpdateChildren = this.UpdateChildren
|
||||
};
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
if (UpdateChildren == true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user