Add converting strategies for beam shear actions
This commit is contained in:
@@ -19,6 +19,12 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
protected ConvertStrategy(IBaseConvertStrategy baseConvertStrategy)
|
||||
{
|
||||
ReferenceDictionary = baseConvertStrategy.ReferenceDictionary;
|
||||
TraceLogger = baseConvertStrategy.TraceLogger;
|
||||
}
|
||||
|
||||
protected ConvertStrategy(IConvertStrategy<ISaveable, ISaveable> convertStrategy)
|
||||
{
|
||||
ReferenceDictionary = convertStrategy.ReferenceDictionary;
|
||||
|
||||
@@ -28,6 +28,12 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
TraceLogger = baseConvertStrategy.TraceLogger;
|
||||
ConvertStrategy = convertStrategy;
|
||||
}
|
||||
public DictionaryConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger? traceLogger, IConvertStrategy<T, V> convertStrategy)
|
||||
{
|
||||
ReferenceDictionary = referenceDictionary;
|
||||
TraceLogger = traceLogger;
|
||||
ConvertStrategy = convertStrategy;
|
||||
}
|
||||
public DictionaryConvertStrategy()
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
{
|
||||
public interface IProcessStrategy<T>
|
||||
{
|
||||
void Process(T entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
{
|
||||
public interface IRepository
|
||||
{
|
||||
void ClearRepository();
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ namespace StructureHelperCommon.Infrastructures.Settings
|
||||
return new FileVersion()
|
||||
{
|
||||
VersionNumber = 1,
|
||||
SubVersionNumber = 1
|
||||
SubVersionNumber = 2 //Add Beam shear analysis
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,9 @@ namespace StructureHelperCommon.Models.Analyses
|
||||
|
||||
public VersionProcessor(Guid id)
|
||||
{
|
||||
|
||||
Id = id;
|
||||
Versions = new();
|
||||
}
|
||||
public VersionProcessor() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void AddVersion(IDateVersion version)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user