Add EllipsePrimitive to DTO Converter
This commit is contained in:
80
DataAccess/DTOs/DTOEntities/ConcreteLibMaterialDTO.cs
Normal file
80
DataAccess/DTOs/DTOEntities/ConcreteLibMaterialDTO.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ConcreteLibMaterialDTO : IConcreteLibMaterial
|
||||
{
|
||||
const MaterialTypes materialType = MaterialTypes.Concrete;
|
||||
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("RelativeHumidity")]
|
||||
public double RelativeHumidity { get; set; }
|
||||
[JsonProperty("MinAge")]
|
||||
public double MinAge { get; set; }
|
||||
[JsonProperty("MaxAge")]
|
||||
public double MaxAge { get; set; }
|
||||
[JsonProperty("MaterialEntityId")]
|
||||
public Guid MaterialEntityId
|
||||
{
|
||||
get => MaterialEntity.Id;
|
||||
set
|
||||
{
|
||||
MaterialEntity = ProgramSetting.MaterialRepository.Repository.Single(x => x.Id == value);
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
[JsonProperty("SafetyFactors")]
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; } = new();
|
||||
[JsonProperty("TensionForULS")]
|
||||
public bool TensionForULS { get; set; }
|
||||
[JsonProperty("TensionForSLS")]
|
||||
public bool TensionForSLS { get; set; }
|
||||
[JsonProperty("MaterialLogicId")]
|
||||
public Guid MaterialLogicId
|
||||
{
|
||||
get => MaterialLogic.Id;
|
||||
set
|
||||
{
|
||||
MaterialLogic = MaterialLogics.Single(x => x.Id == value);
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public IMaterialLogic MaterialLogic { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<IMaterialLogic> MaterialLogics { get; } = ProgramSetting.MaterialLogics.Where(x => x.MaterialType == materialType).ToList();
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
23
DataAccess/DTOs/DTOEntities/CrossSectionDTO.cs
Normal file
23
DataAccess/DTOs/DTOEntities/CrossSectionDTO.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class CrossSectionDTO : ICrossSection
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("SectionRepository")]
|
||||
public ICrossSectionRepository SectionRepository { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
DataAccess/DTOs/DTOEntities/CrossSectionNdmAnalysisDTO.cs
Normal file
28
DataAccess/DTOs/DTOEntities/CrossSectionNdmAnalysisDTO.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using StructureHelperLogic.Models.Analyses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class CrossSectionNdmAnalysisDTO : ICrossSectionNdmAnalysis
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("Tags")]
|
||||
public string Tags { get; set; }
|
||||
[JsonProperty("VersionProcessor")]
|
||||
public IVersionProcessor VersionProcessor { get; set; } = new VersionProcessorDTO();
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
29
DataAccess/DTOs/DTOEntities/CrossSectionRepositoryDTO.cs
Normal file
29
DataAccess/DTOs/DTOEntities/CrossSectionRepositoryDTO.cs
Normal 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();
|
||||
|
||||
}
|
||||
}
|
||||
22
DataAccess/DTOs/DTOEntities/DateVersionDTO.cs
Normal file
22
DataAccess/DTOs/DTOEntities/DateVersionDTO.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class DateVersionDTO : IDateVersion
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("DateTime")]
|
||||
public DateTime DateTime { get; set; }
|
||||
[JsonProperty("AnalysisVersion")]
|
||||
public ISaveable AnalysisVersion { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
29
DataAccess/DTOs/DTOEntities/DesignForceTupleDTO.cs
Normal file
29
DataAccess/DTOs/DTOEntities/DesignForceTupleDTO.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class DesignForceTupleDTO : IDesignForceTuple
|
||||
{
|
||||
private IUpdateStrategy<IDesignForceTuple> updateStrategy;
|
||||
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("LimitState")]
|
||||
public LimitStates LimitState { get; set; }
|
||||
[JsonProperty("CalcTerm")]
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
[JsonProperty("ForceTuple")]
|
||||
public IForceTuple ForceTuple { get; set; } = new ForceTupleDTO();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
DesignForceTupleDTO newItem = new();
|
||||
updateStrategy.Update(newItem, this);
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
DataAccess/DTOs/DTOEntities/DivisionSizeDTO.cs
Normal file
23
DataAccess/DTOs/DTOEntities/DivisionSizeDTO.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Newtonsoft.Json;
|
||||
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 DivisionSizeDTO : IDivisionSize
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("NdmMaxSize")]
|
||||
public double NdmMaxSize { get; set; }
|
||||
[JsonProperty("NdmMinDivision")]
|
||||
public int NdmMinDivision { get; set; }
|
||||
[JsonProperty("ClearUnderlying")]
|
||||
public bool ClearUnderlying { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
43
DataAccess/DTOs/DTOEntities/ElasticMaterialDTO.cs
Normal file
43
DataAccess/DTOs/DTOEntities/ElasticMaterialDTO.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ElasticMaterialDTO : IElasticMaterial
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Modulus")]
|
||||
public double Modulus { get; set; }
|
||||
[JsonProperty("CompressiveStrength")]
|
||||
public double CompressiveStrength { get; set; }
|
||||
[JsonProperty("TensileStrength")]
|
||||
public double TensileStrength { get; set; }
|
||||
[JsonProperty("SafetyFactors")]
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; } = new();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
67
DataAccess/DTOs/DTOEntities/EllipseNdmPrimitiveDTO.cs
Normal file
67
DataAccess/DTOs/DTOEntities/EllipseNdmPrimitiveDTO.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
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 EllipseNdmPrimitiveDTO : IEllipsePrimitive
|
||||
{
|
||||
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();
|
||||
[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();
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public List<INamedAreaPoint> GetValuePoints()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool IsPointInside(IPoint2D point)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
DataAccess/DTOs/DTOEntities/FRMaterialDTO.cs
Normal file
49
DataAccess/DTOs/DTOEntities/FRMaterialDTO.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class FRMaterialDTO : IFRMaterial
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("ULSConcreteStrength")]
|
||||
public double ULSConcreteStrength { get; set; }
|
||||
[JsonProperty("SunThickness")]
|
||||
public double SumThickness { get; set; }
|
||||
[JsonIgnore]
|
||||
public double GammaF2 { get; }
|
||||
[JsonProperty("Modulus")]
|
||||
public double Modulus { get; set; }
|
||||
[JsonProperty("CompressiveStrength")]
|
||||
public double CompressiveStrength { get; set; }
|
||||
[JsonProperty("TensileStrength")]
|
||||
public double TensileStrength { get; set; }
|
||||
[JsonProperty("SafetyFactors")]
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; } = new();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
27
DataAccess/DTOs/DTOEntities/FileVersionDTO.cs
Normal file
27
DataAccess/DTOs/DTOEntities/FileVersionDTO.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Projects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
|
||||
[JsonObject(IsReference = true)]
|
||||
public class FileVersionDTO : IFileVersion
|
||||
{
|
||||
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("VersionNumber")]
|
||||
public int VersionNumber { get; set; }
|
||||
[JsonProperty("SubVersionNumber")]
|
||||
public int SubVersionNumber { get; set; }
|
||||
public FileVersionDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
40
DataAccess/DTOs/DTOEntities/ForceCombinationByFactorDTO.cs
Normal file
40
DataAccess/DTOs/DTOEntities/ForceCombinationByFactorDTO.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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
|
||||
{
|
||||
public class ForceCombinationByFactorDTO : IForceCombinationByFactor
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("FullSLSForces")]
|
||||
public IForceTuple FullSLSForces { get; set; } = new ForceTupleDTO();
|
||||
[JsonProperty("ULSFactor")]
|
||||
public double ULSFactor { get; set; }
|
||||
[JsonProperty("LongTermFactor")]
|
||||
public double LongTermFactor { get; set; }
|
||||
[JsonProperty("SetInGravityCenter")]
|
||||
public bool SetInGravityCenter { get; set; }
|
||||
[JsonProperty("ForcePoint")]
|
||||
public IPoint2D ForcePoint { get; set; } = new Point2DDTO();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IForceCombinationList GetCombinations()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
DataAccess/DTOs/DTOEntities/ForceCombinationListDTO.cs
Normal file
35
DataAccess/DTOs/DTOEntities/ForceCombinationListDTO.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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
|
||||
{
|
||||
public class ForceCombinationListDTO : IForceCombinationList
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("SetInGravityCenter")]
|
||||
public bool SetInGravityCenter { get; set; }
|
||||
[JsonProperty("ForcePoint")]
|
||||
public IPoint2D ForcePoint { get; set; }
|
||||
[JsonProperty("DesignForces")]
|
||||
public List<IDesignForceTuple> DesignForces { get; set; } = new();
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IForceCombinationList GetCombinations()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
DataAccess/DTOs/DTOEntities/ForceTupleDTO.cs
Normal file
39
DataAccess/DTOs/DTOEntities/ForceTupleDTO.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ForceTupleDTO : IForceTuple
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Mx")]
|
||||
public double Mx { get; set; }
|
||||
[JsonProperty("My")]
|
||||
public double My { get; set; }
|
||||
[JsonProperty("Nz")]
|
||||
public double Nz { get; set; }
|
||||
[JsonProperty("Qx")]
|
||||
public double Qx { get; set; }
|
||||
[JsonProperty("Qy")]
|
||||
public double Qy { get; set; }
|
||||
[JsonProperty("Mz")]
|
||||
public double Mz { get; set; }
|
||||
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
DataAccess/DTOs/DTOEntities/HeadMaterialDTO.cs
Normal file
44
DataAccess/DTOs/DTOEntities/HeadMaterialDTO.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class HeadMaterialDTO : IHeadMaterial
|
||||
{
|
||||
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("Color")]
|
||||
public Color Color { get; set; }
|
||||
[JsonProperty("HelperMaterial")]
|
||||
public IHelperMaterial HelperMaterial { get; set; }
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
24
DataAccess/DTOs/DTOEntities/MaterialPartialFactorDTO.cs
Normal file
24
DataAccess/DTOs/DTOEntities/MaterialPartialFactorDTO.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class MaterialPartialFactorDTO : IMaterialPartialFactor
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public double FactorValue { get; set; }
|
||||
public StressStates StressState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
DataAccess/DTOs/DTOEntities/MaterialSafetyFactorDTO.cs
Normal file
36
DataAccess/DTOs/DTOEntities/MaterialSafetyFactorDTO.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class MaterialSafetyFactorDTO : IMaterialSafetyFactor
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[JsonProperty("Take")]
|
||||
public bool Take { get; set; }
|
||||
[JsonProperty("Description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
[JsonProperty("PartialFactors")]
|
||||
public List<IMaterialPartialFactor> PartialFactors { get; } = new();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public double GetFactor(StressStates stressState, CalcTerms calcTerm, LimitStates limitStates)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
DataAccess/DTOs/DTOEntities/NdmElementDTO.cs
Normal file
32
DataAccess/DTOs/DTOEntities/NdmElementDTO.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Newtonsoft.Json;
|
||||
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; }
|
||||
[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();
|
||||
[JsonProperty("AutoPrestrain")]
|
||||
public IForceTuple AutoPrestrain { get; set; } = new ForceTupleDTO();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
27
DataAccess/DTOs/DTOEntities/Point2DDTO.cs
Normal file
27
DataAccess/DTOs/DTOEntities/Point2DDTO.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class Point2DDTO : IPoint2D
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("X")]
|
||||
public double X { get; set; }
|
||||
[JsonProperty("Y")]
|
||||
public double Y { get; set; }
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
29
DataAccess/DTOs/DTOEntities/ProjectDTO.cs
Normal file
29
DataAccess/DTOs/DTOEntities/ProjectDTO.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using StructureHelperCommon.Models.Projects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ProjectDTO : IProject
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonIgnore]
|
||||
public string FullFileName { get; set; }
|
||||
[JsonIgnore]
|
||||
public bool IsNewFile { get; set; }
|
||||
[JsonIgnore]
|
||||
public bool IsActual { get; set; }
|
||||
|
||||
[JsonProperty("VisualAnalyses")]
|
||||
public List<IVisualAnalysis> VisualAnalyses { get; private set; } = new();
|
||||
|
||||
[JsonIgnore]
|
||||
public string FileName { get; set; }
|
||||
}
|
||||
}
|
||||
23
DataAccess/DTOs/DTOEntities/RectangleShapeDTO.cs
Normal file
23
DataAccess/DTOs/DTOEntities/RectangleShapeDTO.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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; }
|
||||
[JsonProperty("Width")]
|
||||
public double Width { get; set; }
|
||||
[JsonProperty("Height")]
|
||||
public double Height { get; set; }
|
||||
[JsonProperty("Angle")]
|
||||
public double Angle { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
70
DataAccess/DTOs/DTOEntities/ReinforcementLibMaterialDTO.cs
Normal file
70
DataAccess/DTOs/DTOEntities/ReinforcementLibMaterialDTO.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ReinforcementLibMaterialDTO : IReinforcementLibMaterial
|
||||
{
|
||||
const MaterialTypes materialType = MaterialTypes.Reinforcement;
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("MaterialEntityId")]
|
||||
public Guid MaterialEntityId
|
||||
{
|
||||
get => MaterialEntity.Id;
|
||||
set
|
||||
{
|
||||
MaterialEntity = ProgramSetting.MaterialRepository.Repository.Single(x => x.Id == value);
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
[JsonProperty("SafetyFactors")]
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; } = new();
|
||||
[JsonProperty("MaterialLogicId")]
|
||||
public Guid MaterialLogicId
|
||||
{
|
||||
get => MaterialLogic.Id;
|
||||
set
|
||||
{
|
||||
MaterialLogic = MaterialLogics.Single(x => x.Id == value);
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public IMaterialLogic MaterialLogic { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<IMaterialLogic> MaterialLogics { get; } = ProgramSetting.MaterialLogics.Where(x => x.MaterialType == materialType).ToList();
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
DataAccess/DTOs/DTOEntities/TypeBinder.cs
Normal file
42
DataAccess/DTOs/DTOEntities/TypeBinder.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class TypeBinder : ISerializationBinder
|
||||
{
|
||||
private List<(Type type, string name)> typesNames;
|
||||
public static IShiftTraceLogger TraceLogger;
|
||||
public TypeBinder(List<(Type type, string name)> typesNames, IShiftTraceLogger traceLogger = null)
|
||||
{
|
||||
this.typesNames = typesNames;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public void BindToName(Type serializedType, out string? assemblyName, out string? typeName)
|
||||
{
|
||||
assemblyName = null;
|
||||
if (typesNames.Any(x => x.type == serializedType))
|
||||
{
|
||||
typeName = typesNames.Single(x => x.type == serializedType).name;
|
||||
}
|
||||
else
|
||||
{
|
||||
typeName = serializedType.FullName;
|
||||
}
|
||||
}
|
||||
|
||||
public Type BindToType(string? assemblyName, string typeName)
|
||||
{
|
||||
return typesNames.SingleOrDefault(x => x.name == typeName).type;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
78
DataAccess/DTOs/DTOEntities/TypeBinderListFactory.cs
Normal file
78
DataAccess/DTOs/DTOEntities/TypeBinderListFactory.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
internal enum TypeFileVersion
|
||||
{
|
||||
version_v1
|
||||
}
|
||||
internal static class TypeBinderListFactory
|
||||
{
|
||||
public static List<(Type type, string name)> GetTypeNameList(TypeFileVersion fileVersion)
|
||||
{
|
||||
if (fileVersion == TypeFileVersion.version_v1)
|
||||
{
|
||||
List<(Type type, string name)> typesNames = GetVersionV1();
|
||||
return typesNames;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(fileVersion));
|
||||
}
|
||||
}
|
||||
|
||||
private static List<(Type type, string name)> GetVersionV1()
|
||||
{
|
||||
return new List<(Type type, string name)>
|
||||
{
|
||||
{ (typeof(ConcreteLibMaterialDTO), "ConcreteLibMaterial") },
|
||||
{ (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(FileVersionDTO), "FileVersion") },
|
||||
{ (typeof(ForceCombinationByFactorDTO), "ForceCombinationByFactor") },
|
||||
{ (typeof(ForceCombinationListDTO), "ForceCombinationList") },
|
||||
{ (typeof(ForceTupleDTO), "ForceTuple") },
|
||||
{ (typeof(FRMaterialDTO), "FRMaterial") },
|
||||
{ (typeof(HeadMaterialDTO), "HeadMaterial") },
|
||||
{ (typeof(MaterialSafetyFactorDTO), "MaterialSafetyFactor") },
|
||||
{ (typeof(NdmElementDTO), "NdmElement") },
|
||||
{ (typeof(IVisualAnalysis), "IVisualAnalysis") },
|
||||
{ (typeof(List<ICalculator>), "ListOfICalculator") },
|
||||
{ (typeof(List<IDateVersion>), "ListOfIDateVersion") },
|
||||
{ (typeof(List<IDesignForceTuple>), "ListOfIDesignForceTuple") },
|
||||
{ (typeof(List<IForceAction>), "ListOfIForceAction") },
|
||||
{ (typeof(List<IHeadMaterial>), "ListOfIHeadMaterial") },
|
||||
{ (typeof(List<IMaterialSafetyFactor>), "ListOfMaterialSafetyFactor") },
|
||||
{ (typeof(List<IMaterialPartialFactor>), "ListOfMaterialPartialFactor") },
|
||||
{ (typeof(List<INdmPrimitive>), "ListOfINdmPrimitive") },
|
||||
{ (typeof(List<IPartialFactor>), "ListOfPartialFactor") },
|
||||
{ (typeof(List<IVisualAnalysis>), "ListOfIVisualAnalysis") },
|
||||
{ (typeof(Point2DDTO), "Point2D") },
|
||||
{ (typeof(ProjectDTO), "Project") },
|
||||
{ (typeof(RectangleShapeDTO), "RectangleShape") },
|
||||
{ (typeof(ReinforcementLibMaterialDTO), "ReinforcementLibMaterial") },
|
||||
{ (typeof(MaterialPartialFactorDTO), "MaterialPartialFactor") },
|
||||
{ (typeof(VersionProcessorDTO), "VersionProcessor") },
|
||||
{ (typeof(VisualAnalysisDTO), "VisualAnalysis") },
|
||||
{ (typeof(VisualPropertyDTO), "VisualProperty") },
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
30
DataAccess/DTOs/DTOEntities/VersionProcessorDTO.cs
Normal file
30
DataAccess/DTOs/DTOEntities/VersionProcessorDTO.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class VersionProcessorDTO : IVersionProcessor
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Versions")]
|
||||
public List<IDateVersion> Versions { get; } = new();
|
||||
|
||||
public void AddVersion(ISaveable newItem)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IDateVersion GetCurrentVersion()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
29
DataAccess/DTOs/DTOEntities/VisualAnalysisDTO.cs
Normal file
29
DataAccess/DTOs/DTOEntities/VisualAnalysisDTO.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class VisualAnalysisDTO : IVisualAnalysis
|
||||
{
|
||||
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("Analysis")]
|
||||
public IAnalysis Analysis { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
DataAccess/DTOs/DTOEntities/VisualPropertyDTO.cs
Normal file
28
DataAccess/DTOs/DTOEntities/VisualPropertyDTO.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class VisualPropertyDTO : IVisualProperty
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set; }
|
||||
[JsonProperty("IsVisible")]
|
||||
public bool IsVisible { get; set; }
|
||||
[JsonProperty("Color")]
|
||||
public Color Color { get; set; }
|
||||
[JsonProperty("SetMaterialColor")]
|
||||
public bool SetMaterialColor { get; set; }
|
||||
[JsonProperty("ZIndex")]
|
||||
public int ZIndex { get; set; }
|
||||
[JsonProperty("Opacity")]
|
||||
public double Opacity { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user