Add converting primitives and calculators
This commit is contained in:
@@ -44,6 +44,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
}
|
||||
|
||||
public ForceCalculator(Guid id) : this()
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public class ForceCalculatorInputDataUpdateStrategy : IUpdateStrategy<IForceCalculatorInputData>
|
||||
{
|
||||
private IUpdateStrategy<IHasPrimitives> primitivesUpdateStrategy;
|
||||
private IUpdateStrategy<IHasForceCombinations> forceCombinationUpdateStrategy;
|
||||
private IUpdateStrategy<IHasForceActions> forceCombinationUpdateStrategy;
|
||||
private IUpdateStrategy<IAccuracy> accuracyUpdateStrategy;
|
||||
private IUpdateStrategy<ICompressedMember> compressedMemberUpdateStrategy;
|
||||
public ForceCalculatorInputDataUpdateStrategy(IUpdateStrategy<IHasPrimitives> primitivesUpdateStrategy,
|
||||
IUpdateStrategy<IHasForceCombinations> forceCombinationUpdateStrategy,
|
||||
IUpdateStrategy<IHasForceActions> forceCombinationUpdateStrategy,
|
||||
IUpdateStrategy<IAccuracy> accuracyUpdateStrategy,
|
||||
IUpdateStrategy<ICompressedMember> compressedMemberUpdateStrategy)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForceCalculatorInputData : IInputData, ISaveable, IHasPrimitives, IHasForceCombinations
|
||||
public interface IForceCalculatorInputData : IInputData, ISaveable, IHasPrimitives, IHasForceActions
|
||||
{
|
||||
IAccuracy Accuracy { get; set; }
|
||||
List<CalcTerms> CalcTermsList { get; }
|
||||
|
||||
@@ -51,6 +51,11 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
new ShiftTraceLogger())
|
||||
{ }
|
||||
|
||||
public CrackCalculator(Guid id) : this()
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
CrackCalculatorInputData crackInputData = new CrackCalculatorInputData();
|
||||
|
||||
@@ -12,13 +12,23 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackCalculatorInputData : ICrackCalculatorInputData
|
||||
{
|
||||
public Guid Id { get; } = new();
|
||||
public Guid Id { get; }
|
||||
/// <inheritdoc/>
|
||||
public List<INdmPrimitive> Primitives { get; private set; } = new();
|
||||
/// <inheritdoc/>
|
||||
public List<IForceAction> ForceActions { get; private set; } = new();
|
||||
public IUserCrackInputData UserCrackInputData { get; set; } = GetNewUserData();
|
||||
|
||||
public CrackCalculatorInputData(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public CrackCalculatorInputData() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static UserCrackInputData GetNewUserData()
|
||||
{
|
||||
return new UserCrackInputData()
|
||||
|
||||
@@ -5,7 +5,7 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ICrackCalculatorInputData : IInputData, IHasPrimitives, IHasForceCombinations, ISaveable
|
||||
public interface ICrackCalculatorInputData : IInputData, IHasPrimitives, IHasForceActions, ISaveable
|
||||
{
|
||||
List<IForceAction> ForceActions { get; }
|
||||
List<INdmPrimitive> Primitives { get; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IGetTupleInputDatasLogic : ILogic, IHasPrimitives, IHasForceCombinations
|
||||
public interface IGetTupleInputDatasLogic : ILogic, IHasPrimitives, IHasForceActions
|
||||
{
|
||||
LimitStates LimitState { get; set; }
|
||||
CalcTerms LongTerm { get; set; }
|
||||
|
||||
@@ -3,13 +3,34 @@ using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// User settings for crack width calculation
|
||||
/// </summary>
|
||||
public interface IUserCrackInputData : IInputData, ISaveable
|
||||
{
|
||||
double LengthBetweenCracks { get; set; }
|
||||
/// <summary>
|
||||
/// Flag of assigning of length betweenCracks by user or auto
|
||||
/// </summary>
|
||||
bool SetLengthBetweenCracks { get; set; }
|
||||
/// <summary>
|
||||
/// User value of length between cracks
|
||||
/// </summary>
|
||||
double LengthBetweenCracks { get; set; }
|
||||
/// <summary>
|
||||
/// Flag of assigning of softening factor by user or auto
|
||||
/// </summary>
|
||||
bool SetSofteningFactor { get; set; }
|
||||
/// <summary>
|
||||
/// User value of softening factor
|
||||
/// </summary>
|
||||
double SofteningFactor { get; set; }
|
||||
/// <summary>
|
||||
/// Ultimate value of crack width due to long term loads, m
|
||||
/// </summary>
|
||||
double UltimateLongCrackWidth { get; set; }
|
||||
/// <summary>
|
||||
/// Ultimate value of crack width due to short term loads, m
|
||||
/// </summary>
|
||||
double UltimateShortCrackWidth { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// </summary>
|
||||
public class UserCrackInputData : IUserCrackInputData
|
||||
{
|
||||
public Guid Id { get; } = new();
|
||||
public Guid Id { get; } = Guid.NewGuid();
|
||||
/// <summary>
|
||||
/// Flag of assigning of user value of softening factor
|
||||
/// </summary>
|
||||
@@ -38,5 +38,14 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// </summary>
|
||||
public double UltimateShortCrackWidth { get; set; }
|
||||
|
||||
public UserCrackInputData(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public UserCrackInputData() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
internal class UserCrackInputDataUpdateStrategy : IUpdateStrategy<IUserCrackInputData>
|
||||
public class UserCrackInputDataUpdateStrategy : IUpdateStrategy<IUserCrackInputData>
|
||||
{
|
||||
public void Update(IUserCrackInputData targetObject, IUserCrackInputData sourceObject)
|
||||
{
|
||||
@@ -20,6 +20,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
targetObject.SofteningFactor = sourceObject.SofteningFactor;
|
||||
targetObject.SetLengthBetweenCracks = sourceObject.SetLengthBetweenCracks;
|
||||
targetObject.LengthBetweenCracks = sourceObject.LengthBetweenCracks;
|
||||
targetObject.UltimateLongCrackWidth = sourceObject.UltimateLongCrackWidth;
|
||||
targetObject.UltimateShortCrackWidth = sourceObject.UltimateShortCrackWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (targetObject is PointNdmPrimitive point)
|
||||
{
|
||||
new PointPrimitiveUpdateStrategy().Update(point, (PointNdmPrimitive)sourceObject);
|
||||
new PointNdmPrimitiveUpdateStrategy().Update(point, (PointNdmPrimitive)sourceObject);
|
||||
}
|
||||
else if (targetObject is RebarNdmPrimitive rebar)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public class PointPrimitiveUpdateStrategy : IUpdateStrategy<IPointNdmPrimitive>
|
||||
public class PointNdmPrimitiveUpdateStrategy : IUpdateStrategy<IPointNdmPrimitive>
|
||||
{
|
||||
static readonly BaseUpdateStrategy basePrimitiveUpdateStrategy = new();
|
||||
public void Update(IPointNdmPrimitive targetObject, IPointNdmPrimitive sourceObject)
|
||||
@@ -7,11 +7,11 @@ using StructureHelperLogics.Models.CrossSections;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public class PointNdmPrimitive : IPointNdmPrimitive
|
||||
{
|
||||
static readonly PointPrimitiveUpdateStrategy updateStrategy = new();
|
||||
static readonly PointNdmPrimitiveUpdateStrategy updateStrategy = new();
|
||||
public Guid Id { get; }
|
||||
public string? Name { get; set; }
|
||||
public IPoint2D Center { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user