Beam shear load views have been created;
This commit is contained in:
@@ -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 StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearAction : IBeamShearAction
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearAction> updateStrategy;
|
||||
public Guid Id { get; }
|
||||
public string Name { get; set; }
|
||||
public IBeamShearAxisAction XAxisShearAction { get; } = new BeamShearAxisAction(Guid.NewGuid());
|
||||
|
||||
public IBeamShearAxisAction YAxisShearAction { get; } = new BeamShearAxisAction(Guid.NewGuid());
|
||||
|
||||
public BeamShearAction(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
BeamShearAction beamShearAction = new(Guid.NewGuid());
|
||||
updateStrategy ??= new BeamShearActionUpdateStrategy();
|
||||
updateStrategy.Update(beamShearAction, this);
|
||||
return beamShearAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearActionUpdateStrategy : IUpdateStrategy<IBeamShearAction>
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearAxisAction> axisActionUpdateStrategy;
|
||||
public void Update(IBeamShearAction targetObject, IBeamShearAction sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
CheckObject.IsNull(targetObject.XAxisShearAction);
|
||||
CheckObject.IsNull(sourceObject.XAxisShearAction);
|
||||
axisActionUpdateStrategy.Update(targetObject.XAxisShearAction, sourceObject.XAxisShearAction);
|
||||
CheckObject.IsNull(sourceObject.YAxisShearAction);
|
||||
CheckObject.IsNull(targetObject.YAxisShearAction);
|
||||
axisActionUpdateStrategy.Update(targetObject.YAxisShearAction, sourceObject.YAxisShearAction);
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
axisActionUpdateStrategy ??= new BeamShearAxisActionUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class BeamShearAxisAction : IBeamShearAxisAction
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearAxisAction> updateStrategy;
|
||||
///<inheritdoc/>
|
||||
public Guid Id { get; }
|
||||
///<inheritdoc/>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
///<inheritdoc/>
|
||||
public double SupportShearForce { get; set; }
|
||||
///<inheritdoc/>
|
||||
public IFactoredCombinationProperty FactoredCombinationProperty { get; } = new FactoredCombinationProperty(Guid.NewGuid());
|
||||
///<inheritdoc/>
|
||||
public List<IBeamShearLoad> ShearLoads { get; }
|
||||
|
||||
|
||||
public BeamShearAxisAction(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
BeamShearAxisAction beamShearAxisAction = new(Guid.NewGuid());
|
||||
return beamShearAxisAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces.Logics;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearAxisActionUpdateStrategy : IUpdateStrategy<IBeamShearAxisAction>
|
||||
{
|
||||
private IUpdateStrategy<IFactoredCombinationProperty> combinationUpdateStrategy;
|
||||
public void Update(IBeamShearAxisAction targetObject, IBeamShearAxisAction sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.SupportShearForce = sourceObject.SupportShearForce;
|
||||
CheckObject.IsNull(targetObject.FactoredCombinationProperty);
|
||||
CheckObject.IsNull(sourceObject.FactoredCombinationProperty);
|
||||
combinationUpdateStrategy.Update(targetObject.FactoredCombinationProperty, sourceObject.FactoredCombinationProperty);
|
||||
CheckObject.IsNull(targetObject.ShearLoads);
|
||||
targetObject.ShearLoads.Clear();
|
||||
CheckObject.IsNull(sourceObject.ShearLoads);
|
||||
foreach (var item in sourceObject.ShearLoads)
|
||||
{
|
||||
IBeamShearLoad beamShearLoad = item.Clone() as IBeamShearLoad;
|
||||
targetObject.ShearLoads.Add(beamShearLoad);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
combinationUpdateStrategy ??= new FactoredCombinationPropertyUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearLoadBaseUpdateStrategy : IUpdateStrategy<IBeamShearLoad>
|
||||
{
|
||||
public void Update(IBeamShearLoad targetObject, IBeamShearLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.LoadRatio = sourceObject.LoadRatio;
|
||||
targetObject.RelativeLoadLevel = sourceObject.RelativeLoadLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearLoadUpdateStrategy : IUpdateStrategy<IBeamShearLoad>
|
||||
{
|
||||
private IUpdateStrategy<IConcentratedForce> concentratedForceUpdateStrategy;
|
||||
private IUpdateStrategy<IDistributedLoad> distributedLoadUpdateStrategy;
|
||||
public void Update(IBeamShearLoad targetObject, IBeamShearLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
UpdateObjects(targetObject, sourceObject);
|
||||
}
|
||||
|
||||
private void UpdateObjects(IBeamShearLoad targetObject, IBeamShearLoad sourceObject)
|
||||
{
|
||||
if (sourceObject is IDistributedLoad distributedSource)
|
||||
{
|
||||
if (targetObject is IDistributedLoad distributedTarget)
|
||||
{
|
||||
distributedLoadUpdateStrategy.Update(distributedTarget, distributedSource);
|
||||
return;
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(targetObject) + ": target object is not distributed load");
|
||||
}
|
||||
if (sourceObject is IConcentratedForce concentratedSource)
|
||||
{
|
||||
if (targetObject is IConcentratedForce concentratedTarget)
|
||||
{
|
||||
concentratedForceUpdateStrategy.Update(concentratedTarget, concentratedSource);
|
||||
return;
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(targetObject) + ": target object is not concentrated force");
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(sourceObject));
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
concentratedForceUpdateStrategy ??= new ConcentratedForceUpdateStrategy();
|
||||
distributedLoadUpdateStrategy ??= new DistributedLoadUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using NLog;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,12 +10,15 @@ using System.Threading.Tasks;
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class ConcentratedForce : IConcenratedForce
|
||||
public class ConcentratedForce : IConcentratedForce
|
||||
{
|
||||
private double relativeLoadLevel;
|
||||
private IUpdateStrategy<IConcentratedForce>? updateStrategy;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Guid Id { get; set; }
|
||||
public Guid Id { get;}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name { get; set; }
|
||||
/// <inheritdoc/>
|
||||
@@ -33,10 +38,18 @@ namespace StructureHelperCommon.Models.Forces
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public double LoadRatio { get; set; } = 1;
|
||||
public ConcentratedForce(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
ConcentratedForce concentratedForce = new(Guid.NewGuid());
|
||||
updateStrategy ??= new ConcentratedForceUpdateStrategy();
|
||||
updateStrategy.Update(concentratedForce, this);
|
||||
return concentratedForce;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class ConcentratedForceUpdateStrategy : IUpdateStrategy<IConcentratedForce>
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearLoad> baseUpdateStrategy;
|
||||
public void Update(IConcentratedForce targetObject, IConcentratedForce sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
targetObject.ForceValue = sourceObject.ForceValue;
|
||||
targetObject.ForceCoordinate = sourceObject.ForceCoordinate;
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
baseUpdateStrategy ??= new BeamShearLoadBaseUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -6,9 +8,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class UniformlyDistributedLoad : IUniformlyDistributedLoad
|
||||
public class DistributedLoad : IDistributedLoad
|
||||
{
|
||||
private double relativeLoadLevel;
|
||||
private IUpdateStrategy<IDistributedLoad> updateStrategy;
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
@@ -30,14 +33,17 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <inheritdoc/>
|
||||
public double LoadRatio { get; set; } = 1;
|
||||
|
||||
public UniformlyDistributedLoad(Guid id)
|
||||
public DistributedLoad(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
DistributedLoad distributedLoad = new(Guid.NewGuid());
|
||||
updateStrategy ??= new DistributedLoadUpdateStrategy();
|
||||
updateStrategy.Update(distributedLoad, this);
|
||||
return distributedLoad;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class DistributedLoadUpdateStrategy : IUpdateStrategy<IDistributedLoad>
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearLoad> baseUpdateStrategy;
|
||||
public void Update(IDistributedLoad targetObject, IDistributedLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
targetObject.LoadValue = sourceObject.LoadValue;
|
||||
targetObject.StartCoordinate = sourceObject.StartCoordinate;
|
||||
targetObject.EndCoordinate = sourceObject.EndCoordinate;
|
||||
}
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
baseUpdateStrategy ??= new BeamShearLoadBaseUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public interface IBeamShearAction : IAction
|
||||
{
|
||||
IBeamShearAxisAction XAxisSheaAction { get; }
|
||||
IBeamShearAxisAction YAxisSheaAction { get; }
|
||||
IBeamShearAxisAction XAxisShearAction { get; }
|
||||
IBeamShearAxisAction YAxisShearAction { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,17 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// </summary>
|
||||
public interface IBeamShearAxisAction : IAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Shear force at support point, N
|
||||
/// </summary>
|
||||
double SupportShearForce { get; set; }
|
||||
/// <summary>
|
||||
/// Properties of combination of forces
|
||||
/// </summary>
|
||||
IFactoredCombinationProperty FactoredCombinationProperty { get; }
|
||||
/// <summary>
|
||||
/// Collection of loads which are applyed on beam at its span
|
||||
/// </summary>
|
||||
List<IBeamShearLoad> ShearLoads {get;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
public interface IBeamShearLoad : IAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Value of level where action is applyied at, 0.5 is top surface, -0.5 is bottom surface
|
||||
/// Value of level where action is applyied at, 0.5 is top surface of beam, -0.5 is bottom surface of beam
|
||||
/// </summary>
|
||||
double RelativeLoadLevel { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <summary>
|
||||
/// Implement properties for concentrated load in beam
|
||||
/// </summary>
|
||||
public interface IConcenratedForce : IBeamShearLoad
|
||||
public interface IConcentratedForce : IBeamShearLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// Coordinate of location of force along beam, m
|
||||
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// Implement properties of
|
||||
/// </summary>
|
||||
public interface IUniformlyDistributedLoad : IBeamShearLoad
|
||||
public interface IDistributedLoad : IBeamShearLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// Value of uniformly distributed load, N/m
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces.Logics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,6 +12,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <inheritdoc/>
|
||||
public class FactoredCombinationProperty : IFactoredCombinationProperty
|
||||
{
|
||||
private IUpdateStrategy<IFactoredCombinationProperty> updateStrategy;
|
||||
/// <inheritdoc/>
|
||||
public Guid Id { get; }
|
||||
/// <inheritdoc/>
|
||||
@@ -25,9 +28,13 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
public FactoredCombinationProperty() : this(Guid.NewGuid())
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
|
||||
FactoredCombinationProperty factoredCombinationProperty = new(Guid.NewGuid());
|
||||
updateStrategy ??= new FactoredCombinationPropertyUpdateStrategy();
|
||||
updateStrategy.Update(factoredCombinationProperty, this);
|
||||
return factoredCombinationProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
public bool SetInGravityCenter { get; set; } = true;
|
||||
public IPoint2D ForcePoint { get; set; } = new Point2D();
|
||||
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationProperty();
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationProperty(Guid.NewGuid());
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <inheritdoc/>
|
||||
public List<IForceTuple> ForceTuples { get; } = new() { new ForceTuple()};
|
||||
/// <inheritdoc/>
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; }= new FactoredCombinationProperty();
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; }= new FactoredCombinationProperty(Guid.NewGuid());
|
||||
|
||||
|
||||
public ForceFactoredList(Guid id)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <summary>
|
||||
/// Properties of factored combination of forces
|
||||
/// </summary>
|
||||
public interface IFactoredCombinationProperty : ISaveable
|
||||
public interface IFactoredCombinationProperty : ISaveable, ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Term of calculation for assigned combination
|
||||
|
||||
@@ -8,9 +8,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class UniformlyDisributedLoadUpdateStrategy : IUpdateStrategy<IUniformlyDistributedLoad>
|
||||
public class UniformlyDisributedLoadUpdateStrategy : IUpdateStrategy<IDistributedLoad>
|
||||
{
|
||||
public void Update(IUniformlyDistributedLoad targetObject, IUniformlyDistributedLoad sourceObject)
|
||||
public void Update(IDistributedLoad targetObject, IDistributedLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
|
||||
Reference in New Issue
Block a user