Add primitive visual property
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public interface IHasStartEndCoordinate
|
||||
{
|
||||
/// <summary>
|
||||
/// Coordinate of start of zone of stirrups
|
||||
/// </summary>
|
||||
double StartCoordinate { get; set; }
|
||||
/// <summary>
|
||||
/// Coordinate of end of zone of stirrups
|
||||
/// </summary>
|
||||
double EndCoordinate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -8,12 +9,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <summary>
|
||||
/// Implement properties of stirrups
|
||||
/// </summary>
|
||||
public interface IStirrup : ISaveable, ICloneable
|
||||
public interface IStirrup : ISaveable, ICloneable, IHasVisualProperty
|
||||
{
|
||||
string? Name { get; set; }
|
||||
/// <summary>
|
||||
/// Distance from axis of comressed rebar to edge of comressed zone, m
|
||||
/// </summary>
|
||||
double CompressedGap { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <summary>
|
||||
/// Implement logic for calculation of bearing capacity of stirrups by value of their density
|
||||
/// </summary>
|
||||
public interface IStirrupByDensity : IStirrup
|
||||
public interface IStirrupByDensity : IStirrup, IHasStartEndCoordinate
|
||||
{
|
||||
/// <summary>
|
||||
/// Direct density of stirrups, N/m
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <summary>
|
||||
/// Implement properties for uniformly distributed stirrups
|
||||
/// </summary>
|
||||
public interface IStirrupByRebar : IStirrup
|
||||
public interface IStirrupByRebar : IStirrup, IHasStartEndCoordinate
|
||||
{
|
||||
/// <summary>
|
||||
/// Material of stirrups
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using System.Windows.Media;
|
||||
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -9,10 +12,17 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public double StirrupDensity { get; set; }
|
||||
public double CompressedGap { get; set; }
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
public double StartCoordinate { get; set; } = 0;
|
||||
public double EndCoordinate { get; set; } = 100;
|
||||
|
||||
public StirrupByDensity(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
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.BeamShears
|
||||
{
|
||||
@@ -64,10 +66,15 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public IRebarSection RebarSection { get; set; } = new RebarSection(Guid.NewGuid());
|
||||
/// <inheritdoc>
|
||||
public double LegCount { get; set; } = 2;
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupByInclinedRebar(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -62,11 +64,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public double CompressedGap { get; set; } = 0;
|
||||
/// <inheritdoc/>
|
||||
public bool IsSpiral { get; set; } = false;
|
||||
public double StartCoordinate { get; set; } = 0;
|
||||
public double EndCoordinate { get; set; } = 100;
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupByRebar(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
Material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400).HelperMaterial as IReinforcementLibMaterial;
|
||||
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -13,10 +9,15 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public List<IStirrup> Stirrups { get; } = new();
|
||||
public double CompressedGap { get; set; }
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupGroup(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,31 +1,14 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public interface IVisualProperty : ISaveable
|
||||
public interface IVisualProperty : IPrimitiveVisualProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// Flag of visibility
|
||||
/// </summary>
|
||||
bool IsVisible { get; set; }
|
||||
Color Color { get; set; }
|
||||
/// <summary>
|
||||
/// Flag of assigning of color from material or from primitive's settings
|
||||
/// </summary>
|
||||
bool SetMaterialColor { get; set; }
|
||||
/// <summary>
|
||||
/// Index by z-coordinate
|
||||
/// </summary>
|
||||
int ZIndex { get; set; }
|
||||
/// <summary>
|
||||
/// Opacity of filling
|
||||
/// </summary>
|
||||
double Opacity { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,5 +41,10 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user