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

@@ -6,16 +6,16 @@ using StructureHelperLogics.Models.BeamShears;
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
namespace DataAccess.DTOs.DTOEntities
namespace DataAccess.DTOs
{
internal class BeamShearCalculatorDTO : IBeamShearCalculator
public class BeamShearCalculatorDTO : IBeamShearCalculator
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string Name { get; set; } = string.Empty;
[JsonProperty("InputData")]
public IBeamShearCalculatorInputData InputData { get; set; }
public IBeamShearCalculatorInputData InputData { get; set; } = new BeamShearCalculatorInputDataDTO(Guid.Empty);
[JsonProperty("ShowTraceData")]
public bool ShowTraceData { get; set; }
[JsonIgnore]

View File

@@ -2,9 +2,9 @@
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.BeamShears;
namespace DataAccess.DTOs.DTOEntities
namespace DataAccess.DTOs
{
internal class BeamShearCalculatorInputDataDTO : IBeamShearCalculatorInputData
public class BeamShearCalculatorInputDataDTO : IBeamShearCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; }
@@ -14,5 +14,9 @@ namespace DataAccess.DTOs.DTOEntities
public List<IBeamShearSection> Sections { get; } = new();
[JsonProperty("Stirrups")]
public List<IStirrup> Stirrups { get; } = new();
public BeamShearCalculatorInputDataDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -11,12 +11,12 @@ namespace DataAccess.DTOs
public Guid Id { get; }
[JsonProperty("Actions")]
public List<IBeamShearAction> Actions { get; } = new();
[JsonProperty("Calculators")]
public List<ICalculator> Calculators { get; } = new();
[JsonProperty("Sections")]
public List<IBeamShearSection> Sections { get; } = new();
[JsonProperty("Stirrups")]
public List<IStirrup> Stirrups { get; } = new();
[JsonProperty("Calculators")]
public List<ICalculator> Calculators { get; } = new();
public BeamShearRepositoryDTO(Guid id)
{
Id = id;

View File

@@ -6,7 +6,7 @@ using StructureHelperLogics.Models.Materials;
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
namespace DataAccess.DTOs.DTOEntities
namespace DataAccess.DTOs
{
public class BeamShearSectionDTO : IBeamShearSection
{
@@ -15,7 +15,7 @@ namespace DataAccess.DTOs.DTOEntities
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("Shape")]
public IShape Shape { get; set; }
public IShape Shape { get; set; } = new RectangleShapeDTO(Guid.Empty);
[JsonProperty("Material")]
public IConcreteLibMaterial Material { get; set; }
[JsonProperty("CenterCover")]

View File

@@ -1,7 +1,7 @@
using Newtonsoft.Json;
using StructureHelperLogics.Models.BeamShears;
namespace DataAccess.DTOs.DTOEntities
namespace DataAccess.DTOs
{
public class StirrupByDensityDTO : IStirrupByDensity
{
@@ -14,10 +14,14 @@ namespace DataAccess.DTOs.DTOEntities
[JsonProperty("CompressedGap")]
public double CompressedGap { get; set; }
public StirrupByDensityDTO(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();
return this;
}
}
}

View File

@@ -2,7 +2,7 @@
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.Models.Materials;
namespace DataAccess.DTOs.DTOEntities
namespace DataAccess.DTOs
{
public class StirrupByRebarDTO : IStirrupByRebar
{

View File

@@ -1,11 +1,6 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{

View File

@@ -2,11 +2,6 @@
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
{
@@ -16,6 +11,8 @@ namespace DataAccess.DTOs
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]

View File

@@ -1,11 +1,6 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.WorkPlanes;
using StructureHelperLogics.Models.CrossSections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{

View File

@@ -4,17 +4,12 @@ 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 EllipseNdmPrimitiveDTO : IEllipseNdmPrimitive
{
private IRectangleShape shape = new RectangleShapeDTO();
private IRectangleShape shape = new RectangleShapeDTO(Guid.Empty);
[JsonProperty("Id")]
public Guid Id { get; set; }
@@ -29,7 +24,7 @@ namespace DataAccess.DTOs
[JsonIgnore]
public IShape Shape => shape;
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
public INdmElement NdmElement { get; set; } = new NdmElementDTO(Guid.Empty);
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; } = new VisualPropertyDTO();
[JsonProperty("Center")]

View File

@@ -2,20 +2,17 @@
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; }
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]
@@ -25,6 +22,12 @@ namespace DataAccess.DTOs
[JsonIgnore]
public IResult Result => throw new NotImplementedException();
public ForceCalculatorDTO(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();

View File

@@ -2,18 +2,13 @@
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
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 NdmElementDTO : INdmElement
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get;}
[JsonProperty("HeadMaterial")]
public IHeadMaterial? HeadMaterial { get; set; } = new HeadMaterial();
[JsonProperty("Triangulate")]
@@ -23,6 +18,10 @@ namespace DataAccess.DTOs
[JsonProperty("AutoPrestrain")]
public IForceTuple AutoPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
public NdmElementDTO(Guid id)
{
Id = id;
}
public object Clone()
{

View File

@@ -19,7 +19,7 @@ namespace DataAccess.DTOs
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
public INdmElement NdmElement { get; set; } = new NdmElementDTO(Guid.Empty);
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; } = new VisualPropertyDTO();
[JsonProperty("Center")]

View File

@@ -21,7 +21,7 @@ namespace DataAccess.DTOs
[JsonIgnore]
public IShape Shape { get; set; }
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
public INdmElement NdmElement { get; set; } = new NdmElementDTO(Guid.Empty);
[JsonIgnore]
public ICrossSection? CrossSection { get; set; }
[JsonProperty("VisualProperty")]

View File

@@ -14,7 +14,7 @@ namespace DataAccess.DTOs
{
public class RectangleNdmPrimitiveDTO : IRectangleNdmPrimitive
{
private IRectangleShape shape = new RectangleShapeDTO();
private IRectangleShape shape = new RectangleShapeDTO(Guid.Empty);
[JsonProperty("Id")]
public Guid Id { get; set; }
@@ -29,7 +29,7 @@ namespace DataAccess.DTOs
[JsonIgnore]
public IShape Shape => shape;
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; } = new NdmElementDTO();
public INdmElement NdmElement { get; set; } = new NdmElementDTO(Guid.Empty);
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; } = new VisualPropertyDTO();
[JsonProperty("Center")]

View File

@@ -1,21 +1,21 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class RectangleShapeDTO : IRectangleShape
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get;}
[JsonProperty("Width")]
public double Width { get; set; }
[JsonProperty("Height")]
public double Height { get; set; }
public RectangleShapeDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -116,11 +116,16 @@ namespace DataAccess.DTOs
{ (typeof(BeamShearActionDTO), "BeamShearAction") },
{ (typeof(BeamShearAxisActionDTO), "BeamShearAxisAction") },
{ (typeof(BeamShearAnalysisDTO), "BeamShearAnalysis") },
{ (typeof(BeamShearCalculatorDTO), "BeamShearCalculator") },
{ (typeof(BeamShearCalculatorInputDataDTO), "BeamShearCalculatorInputData") },
{ (typeof(BeamShearRepositoryDTO), "BeamShearRepository") },
{ (typeof(BeamShearSectionDTO), "BeamShearSection") },
{ (typeof(List<IBeamShearAction>), "ListOfBeamShearActions") },
{ (typeof(List<IBeamShearSection>), "ListOfBeamShearSections") },
{ (typeof(List<IBeamSpanLoad>), "ListOfSpanLoads") },
{ (typeof(List<IStirrup>), "ListOfStirrups") },
{ (typeof(StirrupByDensityDTO), "StirrupByDensity") },
{ (typeof(StirrupByRebarDTO), "StirrupByRebar") },
};
return newList;
}