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,12 +1,6 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Loggers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
@@ -24,11 +18,33 @@ namespace DataAccess.DTOs
}
public ForceTupleToDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
: base(referenceDictionary, traceLogger)
{
}
public override ForceTupleDTO GetNewItem(IForceTuple source)
{
ForceTupleDTO newItem = new(source.Id);
updateStrategy.Update(newItem, source);
return newItem;
try
{
GetNewBeamForceTuple(source);
return NewItem;
}
catch (Exception ex)
{
TraceErrorByEntity(this, ex.Message);
throw;
}
}
private void GetNewBeamForceTuple(IForceTuple source)
{
TraceLogger?.AddMessage($"Converting of force tuple Id = {source.Id} has been started", TraceLogStatuses.Debug);
updateStrategy ??= new ForceTupleUpdateStrategy();
NewItem = new(source.Id);
updateStrategy.Update(NewItem, source);
TraceLogger?.AddMessage($"Converting of force tuple Id = {source.Id} has been finished", TraceLogStatuses.Debug);
}
}
}