Add value diagram calculator saving

This commit is contained in:
Evgeny Redikultsev
2025-11-16 13:56:09 +05:00
parent 43f46b83af
commit f7e60e0bb3
30 changed files with 786 additions and 80 deletions

View File

@@ -0,0 +1,26 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
namespace DataAccess.DTOs
{
public class Point2DRangeDTO : IPoint2DRange
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("StartPoint")]
public IPoint2D StartPoint { get; set; }
[JsonProperty("EndPoint")]
public IPoint2D EndPoint { get; set; }
public Point2DRangeDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -0,0 +1,11 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.States;
namespace DataAccess.DTOs
{
public class StateCalcTermPairDTO : IStateCalcTermPair
{
public LimitStates LimitState { get; set; }
public CalcTerms CalcTerm { get; set; }
}
}

View File

@@ -7,6 +7,7 @@ using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Materials.Libraries;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams;
using StructureHelperLogics.NdmCalculations.Primitives;
namespace DataAccess.DTOs
@@ -45,6 +46,7 @@ namespace DataAccess.DTOs
{ (typeof(List<LimitStates>), "ListOfLimitState") },
{ (typeof(List<IPartialFactor>), "ListOfPartialFactor") },
{ (typeof(RebarSectionDTO), "RebarSection") },
{ (typeof(StateCalcTermPairDTO), "StateCalcTermPair") },
{ (typeof(VisualPropertyDTO), "VisualProperty") },
{ (typeof(WorkPlanePropertyDTO), "WorkPlanePropertyDTO") },
};
@@ -55,6 +57,20 @@ namespace DataAccess.DTOs
newList.AddRange(GetCalculatorList());
newList.AddRange(GetNdmPrimitiveList());
newList.AddRange(GetBeamShearList());
newList.AddRange(GetValueDiagramList());
return newList;
}
private static IEnumerable<(Type type, string name)> GetValueDiagramList()
{
List<(Type type, string name)> newList = new()
{
{ (typeof(List<IValueDiagramEntity>), "ListOfValueDiagramEntity") },
{ (typeof(ValueDiagramCalculatorDTO), "ValueDiagramCalculator") },
{ (typeof(ValueDiagramCalculatorInputDataDTO), "ValueDiagramCalculatorInputData") },
{ (typeof(ValueDiagramEntityDTO), "ValueDiagramEntity") },
{ (typeof(ValueDiagramDTO), "ValueDiagram") },
};
return newList;
}
@@ -131,6 +147,7 @@ namespace DataAccess.DTOs
{
{ (typeof(List<IVertex>), "ListOfVertex2D") },
{ (typeof(Point2DDTO), "Point2D") },
{ (typeof(Point2DRangeDTO), "Point2DRange") },
{ (typeof(VertexDTO), "Vertex2D") },
{ (typeof(RectangleShapeDTO), "RectangleShape") },
{ (typeof(CircleShapeDTO), "CircleShape") },

View File

@@ -0,0 +1,39 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Calculators;
using StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams;
namespace DataAccess.DTOs
{
public class ValueDiagramCalculatorDTO : IValueDiagramCalculator
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("InputData")]
public IValueDiagramCalculatorInputData InputData { get; set; }
[JsonProperty("ShowTraceData")]
public bool ShowTraceData { get; set; }
[JsonIgnore]
public IResult Result => throw new NotImplementedException();
[JsonIgnore]
public IShiftTraceLogger? TraceLogger { get; set; }
public ValueDiagramCalculatorDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
public void Run()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,32 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.States;
using StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams;
using StructureHelperLogics.NdmCalculations.Primitives;
namespace DataAccess.DTOs
{
public class ValueDiagramCalculatorInputDataDTO : IValueDiagramCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("StateTermPair")]
public IStateCalcTermPair StateTermPair { get; set; } = new StateCalcTermPairDTO();
[JsonProperty("Diagrams")]
public List<IValueDiagramEntity> Digrams { get; } = [];
[JsonProperty("CheckStrainLimits")]
public bool CheckStrainLimit { get; set; } = true;
[JsonProperty("ForceActions")]
public List<IForceAction> ForceActions { get; } = [];
[JsonProperty("Primitives")]
public List<INdmPrimitive> Primitives { get; } = [];
public ValueDiagramCalculatorInputDataDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -0,0 +1,26 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams;
namespace DataAccess.DTOs
{
public class ValueDiagramDTO : IValueDiagram
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Point2DRange")]
public IPoint2DRange Point2DRange { get; set; }
[JsonProperty("StepNumber")]
public int StepNumber { get; set; }
public ValueDiagramDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -0,0 +1,28 @@
using Newtonsoft.Json;
using StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams;
namespace DataAccess.DTOs
{
public class ValueDiagramEntityDTO : IValueDiagramEntity
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("IsTaken")]
public bool IsTaken { get; set; }
[JsonProperty("ValueDiagram")]
public IValueDiagram ValueDigram { get; set; }
public ValueDiagramEntityDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}