Add converting strategies for beam shear actions
This commit is contained in:
30
DataAccess/DTOs/DTOEntities/BeamShearActionDTO.cs
Normal file
30
DataAccess/DTOs/DTOEntities/BeamShearActionDTO.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class BeamShearActionDTO : IBeamShearAction
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("ExternalForce")]
|
||||
public IFactoredForceTuple ExternalForce { get; set; } = new FactoredForceTupleDTO(Guid.Empty);
|
||||
[JsonProperty("SupportAction")]
|
||||
public IBeamShearAxisAction SupportAction { get; set; } = new BeamShearAxisActionDTO(Guid.Empty);
|
||||
|
||||
public BeamShearActionDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace DataAccess.DTOs
|
||||
public string Comment { get; set; } = string.Empty;
|
||||
[JsonProperty("Color")]
|
||||
public Color Color { get; set; }
|
||||
public IVersionProcessor VersionProcessor { get; set; } = new VersionProcessorDTO();
|
||||
public IVersionProcessor VersionProcessor { get; set; } = new VersionProcessorDTO(Guid.NewGuid());
|
||||
public BeamShearAnalysisDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
|
||||
31
DataAccess/DTOs/DTOEntities/BeamShearAxisActionDTO.cs
Normal file
31
DataAccess/DTOs/DTOEntities/BeamShearAxisActionDTO.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class BeamShearAxisActionDTO : IBeamShearAxisAction
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("SupportForce")]
|
||||
public IFactoredForceTuple SupportForce { get; set; }
|
||||
[JsonProperty("SpanLoads")]
|
||||
public List<IBeamSpanLoad> ShearLoads { get; } = new();
|
||||
|
||||
public BeamShearAxisActionDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,23 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class BeamShearDTO : IBeamShear
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Repository")]
|
||||
public IBeamShearRepository Repository { get; set; }
|
||||
public IBeamShearRepository Repository { get; set; } = new BeamShearRepositoryDTO(Guid.NewGuid());
|
||||
|
||||
public BeamShearDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class BeamShearRepositoryDTO : IBeamShearRepository
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ConcentratedForceDTO : IConcentratedForce
|
||||
{
|
||||
@@ -10,7 +10,7 @@ namespace DataAccess.DTOs.DTOEntities
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[JsonProperty("ForceValue")]
|
||||
public IForceTuple ForceValue { get; set; }
|
||||
public IForceTuple ForceValue { get; set; } = new ForceTupleDTO(Guid.Empty);
|
||||
[JsonProperty("ForceCoordinate")]
|
||||
public double ForceCoordinate { get; set; }
|
||||
[JsonProperty("RelativeLoadLevel")]
|
||||
@@ -18,12 +18,16 @@ namespace DataAccess.DTOs.DTOEntities
|
||||
[JsonProperty("LoadRatio")]
|
||||
public double LoadRatio { get; set; }
|
||||
[JsonProperty("CombinationProperty")]
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; }
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationPropertyDTO(Guid.Empty);
|
||||
|
||||
public ConcentratedForceDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,18 +8,23 @@ namespace DataAccess.DTOs
|
||||
public class CrossSectionNdmAnalysisDTO : ICrossSectionNdmAnalysis
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; set;}
|
||||
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();
|
||||
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;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class DistributedLoadDTO : IDistributedLoad
|
||||
{
|
||||
@@ -20,12 +20,15 @@ namespace DataAccess.DTOs.DTOEntities
|
||||
[JsonProperty("LoadRatio")]
|
||||
public double LoadRatio { get; set; }
|
||||
[JsonProperty("CombinationProperty")]
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; }
|
||||
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationPropertyDTO(Guid.Empty);
|
||||
public DistributedLoadDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
DataAccess/DTOs/DTOEntities/FactoredForceTupleDTO.cs
Normal file
25
DataAccess/DTOs/DTOEntities/FactoredForceTupleDTO.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class FactoredForceTupleDTO : IFactoredForceTuple
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("ForceTuple")]
|
||||
public IForceTuple ForceTuple { get; set; }
|
||||
[JsonProperty("CombinationProperty")]
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; }
|
||||
|
||||
public FactoredForceTupleDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using StructureHelperCommon.Models.Analyses;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
@@ -50,12 +51,6 @@ namespace DataAccess.DTOs
|
||||
{ (typeof(FileVersionDTO), "FileVersion") },
|
||||
{ (typeof(ForceCalculatorDTO), "ForceCalculator") },
|
||||
{ (typeof(ForceCalculatorInputDataDTO), "ForceCalculatorInputData") },
|
||||
{ (typeof(ForceCombinationByFactorV1_0DTO), "ForceCombinationByFactor") },
|
||||
{ (typeof(ForceFactoredListDTO), "ForceCombinationByFactor_v1_1") },
|
||||
{ (typeof(ForceCombinationFromFileDTO), "ForceCombinationFromFile") },
|
||||
{ (typeof(ForceCombinationListDTO), "ForceCombinationList") },
|
||||
{ (typeof(FactoredCombinationPropertyDTO), "ForceFactoredCombinationProperty") },
|
||||
{ (typeof(ForceTupleDTO), "ForceTuple") },
|
||||
{ (typeof(FRMaterialDTO), "FRMaterial") },
|
||||
{ (typeof(HeadMaterialDTO), "HeadMaterial") },
|
||||
{ (typeof(MaterialSafetyFactorDTO), "MaterialSafetyFactor") },
|
||||
@@ -91,6 +86,42 @@ namespace DataAccess.DTOs
|
||||
{ (typeof(UserCrackInputDataDTO), "UserCrackInputData") },
|
||||
{ (typeof(WorkPlanePropertyDTO), "WorkPlanePropertyDTO") },
|
||||
};
|
||||
newList.AddRange(GetForceList());
|
||||
newList.AddRange(GetListForBeamShear());
|
||||
return newList;
|
||||
}
|
||||
|
||||
private static List<(Type type, string name)> GetForceList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(ConcentratedForceDTO), "ConcentratedForce") },
|
||||
{ (typeof(DistributedLoadDTO), "DistributedLoad") },
|
||||
{ (typeof(FactoredForceTupleDTO), "FactoredForceTuple") },
|
||||
{ (typeof(ForceCombinationByFactorV1_0DTO), "ForceCombinationByFactor") },
|
||||
{ (typeof(ForceFactoredListDTO), "ForceCombinationByFactor_v1_1") },
|
||||
{ (typeof(ForceCombinationFromFileDTO), "ForceCombinationFromFile") },
|
||||
{ (typeof(ForceCombinationListDTO), "ForceCombinationList") },
|
||||
{ (typeof(FactoredCombinationPropertyDTO), "ForceFactoredCombinationProperty") },
|
||||
{ (typeof(ForceTupleDTO), "ForceTuple") },
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
|
||||
private static List<(Type type, string name)> GetListForBeamShear()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(BeamShearDTO), "BeamShear") },
|
||||
{ (typeof(BeamShearActionDTO), "BeamShearAction") },
|
||||
{ (typeof(BeamShearAxisActionDTO), "BeamShearAxisAction") },
|
||||
{ (typeof(BeamShearAnalysisDTO), "BeamShearAnalysis") },
|
||||
{ (typeof(BeamShearRepositoryDTO), "BeamShearRepository") },
|
||||
{ (typeof(List<IBeamShearAction>), "ListOfBeamShearActions") },
|
||||
{ (typeof(List<IBeamShearSection>), "ListOfBeamShearSections") },
|
||||
{ (typeof(List<IBeamSpanLoad>), "ListOfSpanLoads") },
|
||||
{ (typeof(List<IStirrup>), "ListOfStirrups") },
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
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; }
|
||||
public Guid Id { get;}
|
||||
[JsonProperty("Versions")]
|
||||
public List<IDateVersion> Versions { get; } = new();
|
||||
|
||||
public VersionProcessorDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public void AddVersion(ISaveable newItem)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user