Add beam shear converting to DTO

This commit is contained in:
Evgeny Redikultsev
2025-06-08 15:49:17 +05:00
parent 3dab65e3bd
commit 0d7f47653b
150 changed files with 710 additions and 259 deletions

View File

@@ -0,0 +1,38 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Calculators;
using StructureHelperLogics.NdmCalculations.Cracking;
namespace DataAccess.DTOs
{
public class CrackCalculatorDTO : ICrackCalculator
{
[JsonProperty("Id")]
public Guid Id { get;}
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("ShowTraceData")]
public bool ShowTraceData { get; set; } = false;
[JsonProperty("InputData")]
public ICrackCalculatorInputData InputData { get; set; }
[JsonIgnore]
public IResult Result { get; }
[JsonIgnore]
public IShiftTraceLogger? TraceLogger { get; set; }
public CrackCalculatorDTO(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();
}
public void Run()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,24 @@
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; }
[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; }
public CrackCalculatorInputDataDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -0,0 +1,21 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.WorkPlanes;
using StructureHelperLogics.Models.CrossSections;
namespace DataAccess.DTOs
{
public class CrossSectionDTO : ICrossSection
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("SectionRepository")]
public ICrossSectionRepository SectionRepository { get; set; }
public IWorkPlaneProperty WorkPlaneProperty { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,33 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Analyses;
using StructureHelperLogic.Models.Analyses;
using System.Windows.Media;
namespace DataAccess.DTOs
{
public class CrossSectionNdmAnalysisDTO : ICrossSectionNdmAnalysis
{
[JsonProperty("Id")]
public Guid Id { get;}
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("Tags")]
public string Tags { get; set; }
[JsonProperty("VersionProcessor")]
public IVersionProcessor VersionProcessor { get; set; } = new VersionProcessorDTO(Guid.NewGuid());
[JsonProperty("Comment")]
public string Comment { get; set; } = string.Empty;
[JsonProperty("Color")]
public Color Color { get; set; } = new();
public CrossSectionNdmAnalysisDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -0,0 +1,29 @@
using Newtonsoft.Json;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections;
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 CrossSectionRepositoryDTO : ICrossSectionRepository
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("HeadMaterials")]
public List<IHeadMaterial> HeadMaterials { get; } = new();
[JsonProperty("ForceActions")]
public List<IForceAction> ForceActions { get; } = new();
[JsonProperty("Primitives")]
public List<INdmPrimitive> Primitives { get; } = new();
[JsonProperty("Calculators")]
public List<ICalculator> Calculators { get; } = new();
}
}

View File

@@ -0,0 +1,63 @@
using LoaderCalculator.Data.Ndms;
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
namespace DataAccess.DTOs
{
public class EllipseNdmPrimitiveDTO : IEllipseNdmPrimitive
{
private IRectangleShape shape = new RectangleShapeDTO(Guid.Empty);
[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(Guid.Empty);
[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

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

View File

@@ -0,0 +1,34 @@
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;
namespace DataAccess.DTOs
{
public class ForceCalculatorInputDataDTO : IForceCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; }
[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; }
[JsonProperty("CompressedMember")]
public ICompressedMember CompressedMember { get; set; } = new CompressedMemberDTO();
public ForceCalculatorInputDataDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -0,0 +1,31 @@
using Newtonsoft.Json;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.NdmCalculations.Primitives;
namespace DataAccess.DTOs
{
public class NdmElementDTO : INdmElement
{
[JsonProperty("Id")]
public Guid Id { get;}
[JsonProperty("HeadMaterial")]
public IHeadMaterial? HeadMaterial { get; set; } = new HeadMaterial();
[JsonProperty("Triangulate")]
public bool Triangulate { get; set; }
[JsonProperty("UsersPrestrain")]
public IForceTuple UsersPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
[JsonProperty("AutoPrestrain")]
public IForceTuple AutoPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
public NdmElementDTO(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();
}
}
}

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(Guid.Empty);
[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
{
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(Guid.Empty);
[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(Guid.Empty);
[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(Guid.Empty);
[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

@@ -0,0 +1,33 @@
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;}
[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; }
public UserCrackInputDataDTO(Guid id)
{
Id = id;
}
}
}