Add calculators saving

This commit is contained in:
Evgeny Redikultsev
2024-10-19 20:32:25 +05:00
parent d16c0e1f79
commit d3a1992f4d
131 changed files with 1742 additions and 375 deletions

View File

@@ -0,0 +1,21 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Calculators;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs.DTOEntities
{
public class AccuracyDTO : IAccuracy
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("IterationAccuracy")]
public double IterationAccuracy { get; set; }
[JsonProperty("MaxIterationCount")]
public int MaxIterationCount { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Sections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class CompressedMemberDTO : ICompressedMember
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Bucling")]
public bool Buckling { get; set; }
[JsonProperty("GeometryLength")]
public double GeometryLength { get; set; }
[JsonProperty("LengthFactorX")]
public double LengthFactorX { get; set; }
[JsonProperty("DiagramFactorX")]
public double DiagramFactorX { get; set; }
[JsonProperty("LengthFactorY")]
public double LengthFactorY { get; set; }
[JsonProperty("DiagramFactorY")]
public double DiagramFactorY { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,37 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Calculators;
using StructureHelperLogics.NdmCalculations.Cracking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class CrackCalculatorDTO : ICrackCalculator
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("InputData")]
public ICrackCalculatorInputData InputData { get; set; } = new CrackCalculatorInputDataDTO();
[JsonIgnore]
public IResult Result { get; }
[JsonIgnore]
public IShiftTraceLogger? TraceLogger { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
public void Run()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,20 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.NdmCalculations.Cracking;
using StructureHelperLogics.NdmCalculations.Primitives;
namespace DataAccess.DTOs
{
public class CrackCalculatorInputDataDTO : ICrackCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("ForceActions")]
public List<IForceAction> ForceActions { get; set; } = new();
[JsonProperty("ForcePrimitives")]
public List<INdmPrimitive> Primitives { get; set; } = new();
[JsonProperty("UserCrackInputData")]
public IUserCrackInputData UserCrackInputData { get; set; } = new UserCrackInputDataDTO();
}
}

View File

@@ -12,7 +12,7 @@ using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class EllipseNdmPrimitiveDTO : IEllipsePrimitive
public class EllipseNdmPrimitiveDTO : IEllipseNdmPrimitive
{
private IRectangleShape shape = new RectangleShapeDTO();
@@ -36,14 +36,15 @@ namespace DataAccess.DTOs
public IPoint2D Center { get; set; } = new Point2DDTO();
[JsonProperty("DivisionSize")]
public IDivisionSize DivisionSize { get; set; } = new DivisionSizeDTO();
[JsonProperty("RotationAngle")]
public double RotationAngle { get; set; }
[JsonIgnore]
public double Width { get; set; }
[JsonIgnore]
public double Height {get; set; }
[JsonIgnore]
public double Angle { get; set; }
[JsonIgnore]
public ICrossSection? CrossSection { get; set; }
public object Clone()
{
throw new NotImplementedException();

View File

@@ -0,0 +1,38 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Calculators;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class ForceCalculatorDTO : IForceCalculator
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("InputData")]
public IForceCalculatorInputData InputData { get; set; } = new ForceCalculatorInputDataDTO();
[JsonIgnore]
public IShiftTraceLogger? TraceLogger { get; set; }
[JsonIgnore]
public Action<IResult> ActionToOutputResults { get; set; }
[JsonIgnore]
public IResult Result => throw new NotImplementedException();
public object Clone()
{
throw new NotImplementedException();
}
public void Run()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,37 @@
using DataAccess.DTOs.DTOEntities;
using Newtonsoft.Json;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Sections;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class ForceCalculatorInputDataDTO : IForceCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("ForceActions")]
public List<IForceAction> ForceActions { get; set; } = new();
[JsonProperty("Primitives")]
public List<INdmPrimitive> Primitives { get; set; } = new();
[JsonProperty("LimitStatesList")]
public List<LimitStates> LimitStatesList { get; set; } = new();
[JsonProperty("CalcTermList")]
public List<CalcTerms> CalcTermsList { get; set; } = new();
[JsonProperty("Accuracy")]
public IAccuracy Accuracy { get; set; } = new AccuracyDTO();
[JsonProperty("CompressedMember")]
public ICompressedMember CompressedMember { get; set; } = new CompressedMemberDTO();
[JsonIgnore]
public List<IForceCombinationList> ForceCombinationLists { get; set; } = new();
}
}

View File

@@ -18,7 +18,7 @@ namespace DataAccess.DTOs
[JsonProperty("SetInGravityCenter")]
public bool SetInGravityCenter { get; set; }
[JsonProperty("ForcePoint")]
public IPoint2D ForcePoint { get; set; }
public IPoint2D ForcePoint { get; set; } = new Point2DDTO();
[JsonProperty("DesignForces")]
public List<IDesignForceTuple> DesignForces { get; set; } = new();

View File

@@ -0,0 +1,53 @@
using LoaderCalculator.Data.Ndms;
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class PointNdmPrimitiveDTO : IPointNdmPrimitive
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; } = new VisualPropertyDTO();
[JsonProperty("Center")]
public IPoint2D Center { get; set; } = new Point2DDTO();
[JsonProperty("RotationAngle")]
public double RotationAngle { get; set; } = 0d;
[JsonProperty("Area")]
public double Area { get; set; } = 0d;
[JsonIgnore]
public ICrossSection? CrossSection { get; set; }
[JsonIgnore]
public IShape Shape { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{
throw new NotImplementedException();
}
public List<INamedAreaPoint> GetValuePoints()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,64 @@
using LoaderCalculator.Data.Ndms;
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs.DTOEntities
{
public class RebarNdmPrimitiveDTO : IRebarNdmPrimitive
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonIgnore]
public IShape Shape { get; set; }
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
[JsonIgnore]
public ICrossSection? CrossSection { get; set; }
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; } = new VisualPropertyDTO();
[JsonProperty("Center")]
public IPoint2D Center { get; set; } = new Point2DDTO();
[JsonProperty("RotationAngle")]
public double RotationAngle { get; set; } = 0d;
[JsonProperty("Area")]
public double Area { get; set; } = 0d;
public INdmPrimitive? HostPrimitive { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
public Ndm GetConcreteNdm(ITriangulationOptions triangulationOptions)
{
throw new NotImplementedException();
}
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{
throw new NotImplementedException();
}
public RebarNdm GetRebarNdm(ITriangulationOptions triangulationOptions)
{
throw new NotImplementedException();
}
public List<INamedAreaPoint> GetValuePoints()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,68 @@
using LoaderCalculator.Data.Ndms;
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class RectangleNdmPrimitiveDTO : IRectangleNdmPrimitive
{
private IRectangleShape shape = new RectangleShapeDTO();
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("RectangleShape")]
public IRectangleShape RectangleShape
{
get => shape;
set => shape = value;
}
[JsonIgnore]
public IShape Shape => shape;
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; } = new VisualPropertyDTO();
[JsonProperty("Center")]
public IPoint2D Center { get; set; } = new Point2DDTO();
[JsonProperty("DivisionSize")]
public IDivisionSize DivisionSize { get; set; } = new DivisionSizeDTO();
[JsonProperty("RotationAngle")]
public double RotationAngle { get; set; }
[JsonIgnore]
public double Width { get; set; }
[JsonIgnore]
public double Height { get; set; }
[JsonIgnore]
public ICrossSection? CrossSection { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{
throw new NotImplementedException();
}
public List<INamedAreaPoint> GetValuePoints()
{
throw new NotImplementedException();
}
public bool IsPointInside(IPoint2D point)
{
throw new NotImplementedException();
}
}
}

View File

@@ -16,8 +16,6 @@ namespace DataAccess.DTOs
public double Width { get; set; }
[JsonProperty("Height")]
public double Height { get; set; }
[JsonProperty("Angle")]
public double Angle { get; set; }
}
}

View File

@@ -1,4 +1,6 @@
using StructureHelper.Models.Materials;
using DataAccess.DTOs.DTOEntities;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models.Analyses;
using StructureHelperCommon.Models.Calculators;
@@ -34,18 +36,24 @@ namespace DataAccess.DTOs
private static List<(Type type, string name)> GetVersionV1()
{
return new List<(Type type, string name)>
List<(Type type, string name)> newList = new List<(Type type, string name)>
{
{ (typeof(AccuracyDTO), "Accuracy") },
{ (typeof(ConcreteLibMaterialDTO), "ConcreteLibMaterial") },
{ (typeof(CompressedMemberDTO), "CompressedMember") },
{ (typeof(CrackCalculatorDTO), "CrackCalculator") },
{ (typeof(CrackCalculatorInputDataDTO), "CrackCalculatorInputData") },
{ (typeof(CrossSectionDTO), "CrossSection") },
{ (typeof(CrossSectionNdmAnalysisDTO), "CrossSectionNdmAnalysis") },
{ (typeof(CrossSectionRepositoryDTO), "CrossSectionRepository") },
{ (typeof(DateVersionDTO), "DateVersion") },
{ (typeof(EllipseNdmPrimitiveDTO), "EllipseNdmPrimitive") },
{ (typeof(DesignForceTupleDTO), "DesignForceTuple") },
{ (typeof(DivisionSizeDTO), "DivisionSize") },
{ (typeof(ElasticMaterialDTO), "ElasticMaterial") },
{ (typeof(EllipseNdmPrimitiveDTO), "EllipseNdmPrimitive") },
{ (typeof(FileVersionDTO), "FileVersion") },
{ (typeof(ForceCalculatorDTO), "ForceCalculator") },
{ (typeof(ForceCalculatorInputDataDTO), "ForceCalculatorInputData") },
{ (typeof(ForceCombinationByFactorDTO), "ForceCombinationByFactor") },
{ (typeof(ForceCombinationListDTO), "ForceCombinationList") },
{ (typeof(ForceTupleDTO), "ForceTuple") },
@@ -54,25 +62,32 @@ namespace DataAccess.DTOs
{ (typeof(MaterialSafetyFactorDTO), "MaterialSafetyFactor") },
{ (typeof(NdmElementDTO), "NdmElement") },
{ (typeof(IVisualAnalysis), "IVisualAnalysis") },
{ (typeof(List<CalcTerms>), "ListOfCalcTerms") },
{ (typeof(List<ICalculator>), "ListOfICalculator") },
{ (typeof(List<IDateVersion>), "ListOfIDateVersion") },
{ (typeof(List<IDesignForceTuple>), "ListOfIDesignForceTuple") },
{ (typeof(List<IForceAction>), "ListOfIForceAction") },
{ (typeof(List<IHeadMaterial>), "ListOfIHeadMaterial") },
{ (typeof(List<LimitStates>), "ListOfLimitState") },
{ (typeof(List<IMaterialSafetyFactor>), "ListOfMaterialSafetyFactor") },
{ (typeof(List<IMaterialPartialFactor>), "ListOfMaterialPartialFactor") },
{ (typeof(List<INdmPrimitive>), "ListOfINdmPrimitive") },
{ (typeof(List<IPartialFactor>), "ListOfPartialFactor") },
{ (typeof(List<IVisualAnalysis>), "ListOfIVisualAnalysis") },
{ (typeof(Point2DDTO), "Point2D") },
{ (typeof(PointNdmPrimitiveDTO), "PointNdmPrimitive") },
{ (typeof(ProjectDTO), "Project") },
{ (typeof(RebarNdmPrimitiveDTO), "RebarNdmPrimitive") },
{ (typeof(RectangleNdmPrimitiveDTO), "RectangleNdmPrimitive") },
{ (typeof(RectangleShapeDTO), "RectangleShape") },
{ (typeof(ReinforcementLibMaterialDTO), "ReinforcementLibMaterial") },
{ (typeof(MaterialPartialFactorDTO), "MaterialPartialFactor") },
{ (typeof(VersionProcessorDTO), "VersionProcessor") },
{ (typeof(VisualAnalysisDTO), "VisualAnalysis") },
{ (typeof(VisualPropertyDTO), "VisualProperty") },
{ (typeof(UserCrackInputDataDTO), "UserCrackInputData") },
};
return newList;
}
}
}

View File

@@ -0,0 +1,29 @@
using Newtonsoft.Json;
using StructureHelperLogics.NdmCalculations.Cracking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class UserCrackInputDataDTO : IUserCrackInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("LengthBetweenCracks")]
public double LengthBetweenCracks { get; set; }
[JsonProperty("SetLengthBetweenCracks")]
public bool SetLengthBetweenCracks { get; set; }
[JsonProperty("SetSofteningFactors")]
public bool SetSofteningFactor { get; set; }
[JsonProperty("SofteningFactors")]
public double SofteningFactor { get; set; }
[JsonProperty("UltimateLongCrackWidths")]
public double UltimateLongCrackWidth { get; set; }
[JsonProperty("UltimateShortCrackWidths")]
public double UltimateShortCrackWidth { get; set; }
}
}