Add converting strategies for beam shear actions

This commit is contained in:
Evgeny Redikultsev
2025-06-07 19:37:37 +05:00
parent 957ab62ece
commit ece04ae406
45 changed files with 965 additions and 247 deletions

View File

@@ -1,15 +1,12 @@
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 BeamShearLoadBaseUpdateStrategy : IUpdateStrategy<IBeamSpanLoad>
{
private IUpdateStrategy<IFactoredCombinationProperty> combinationUpdateStrategy;
public void Update(IBeamSpanLoad targetObject, IBeamSpanLoad sourceObject)
{
CheckObject.IsNull(targetObject);
@@ -18,6 +15,10 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
targetObject.Name = sourceObject.Name;
targetObject.LoadRatio = sourceObject.LoadRatio;
targetObject.RelativeLoadLevel = sourceObject.RelativeLoadLevel;
CheckObject.IsNull(sourceObject.CombinationProperty);
CheckObject.IsNull(targetObject.CombinationProperty);
combinationUpdateStrategy ??= new FactoredCombinationPropertyUpdateStrategy();
combinationUpdateStrategy.Update(targetObject.CombinationProperty, sourceObject.CombinationProperty);
}
}
}

View File

@@ -26,7 +26,7 @@ namespace StructureHelperCommon.Models.Forces
public object Clone()
{
var newTuple = new DesignForceTuple();
var newTuple = new DesignForceTuple(Guid.NewGuid());
updateStrategy.Update(newTuple, this);
return newTuple;
}

View File

@@ -27,7 +27,12 @@ namespace StructureHelperCommon.Models.Forces
public ForceCombinationList(Guid id)
{
Id = id;
DesignForces = new List<IDesignForceTuple>
DesignForces = AddDefaultForces();
}
private static List<IDesignForceTuple> AddDefaultForces()
{
return new List<IDesignForceTuple>
{
new DesignForceTuple()
{
@@ -51,6 +56,7 @@ namespace StructureHelperCommon.Models.Forces
}
};
}
public ForceCombinationList() : this (Guid.NewGuid()) { }
/// <inheritdoc/>
public object Clone()

View File

@@ -1,11 +1,6 @@
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
{

View File

@@ -1,10 +1,5 @@
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.Logics
{