Change convert strategies to save xls imported forces

This commit is contained in:
Evgeny Redikultsev
2025-01-20 16:19:14 +05:00
parent f508399846
commit 50b173c805
80 changed files with 1684 additions and 617 deletions

View File

@@ -6,16 +6,19 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs.DTOEntities
namespace DataAccess.DTOs
{
public class AccuracyDTO : IAccuracy
{
[JsonProperty("Id")]
public Guid Id { get; set; } = Guid.NewGuid();
public Guid Id { get;}
[JsonProperty("IterationAccuracy")]
public double IterationAccuracy { get; set; }
[JsonProperty("MaxIterationCount")]
public int MaxIterationCount { get; set; }
public AccuracyDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -0,0 +1,30 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Forces;
namespace DataAccess.DTOs
{
public class ColumnFilePropertyDTO : IColumnFileProperty
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("SearchingName")]
public string SearchingName { get; set; }
[JsonProperty("Index")]
public int Index { get; set; }
[JsonProperty("Factor")]
public double Factor { get; set; }
public ColumnFilePropertyDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -0,0 +1,33 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Forces;
namespace DataAccess.DTOs
{
public class ColumnedFilePropertyDTO : IColumnedFileProperty
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("FilePath")]
public string FilePath { get; set; } = string.Empty;
[JsonProperty("SkipRowBeforeHeaderCount")]
public int SkipRowBeforeHeaderCount { get; set; }
[JsonProperty("SkipRowHeaderCount")]
public int SkipRowHeaderCount { get; set; }
[JsonProperty("GlobalFactor")]
public double GlobalFactor { get; set; }
[JsonProperty("ColumnProperties")]
public List<IColumnFileProperty> ColumnProperties { get; } = new();
public ColumnedFilePropertyDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -13,16 +13,20 @@ namespace DataAccess.DTOs
public class CrackCalculatorDTO : ICrackCalculator
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get;}
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("InputData")]
public ICrackCalculatorInputData InputData { get; set; } = new CrackCalculatorInputDataDTO();
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()
{

View File

@@ -8,13 +8,17 @@ namespace DataAccess.DTOs
public class CrackCalculatorInputDataDTO : ICrackCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; } = Guid.NewGuid();
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; } = new UserCrackInputDataDTO();
public IUserCrackInputData UserCrackInputData { get; set; }
public CrackCalculatorInputDataDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -16,7 +16,7 @@ namespace DataAccess.DTOs
[JsonProperty("CalcTerm")]
public CalcTerms CalcTerm { get; set; }
[JsonProperty("ForceTuple")]
public IForceTuple ForceTuple { get; set; } = new ForceTupleDTO();
public IForceTuple ForceTuple { get; set; } = new ForceTupleDTO(Guid.NewGuid());
public object Clone()

View File

@@ -4,8 +4,10 @@ using StructureHelperCommon.Models.Forces;
namespace DataAccess.DTOs
{
public class ForceFactoredCombinationPropertyDTO : IFactoredCombinationProperty
public class FactoredCombinationPropertyDTO : IFactoredCombinationProperty
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("CalctTerm")]
public CalcTerms CalcTerm { get; set; }
[JsonProperty("LimitState")]
@@ -14,5 +16,9 @@ namespace DataAccess.DTOs
public double LongTermFactor { get; set; }
[JsonProperty("ULSFactor")]
public double ULSFactor { get; set; }
public FactoredCombinationPropertyDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -17,7 +17,7 @@ namespace DataAccess.DTOs
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("InputData")]
public IForceCalculatorInputData InputData { get; set; } = new ForceCalculatorInputDataDTO();
public IForceCalculatorInputData InputData { get; set; }
[JsonIgnore]
public IShiftTraceLogger? TraceLogger { get; set; }
[JsonIgnore]

View File

@@ -1,23 +1,17 @@
using DataAccess.DTOs.DTOEntities;
using Newtonsoft.Json;
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; } = Guid.NewGuid();
public Guid Id { get; }
[JsonProperty("ForceActions")]
public List<IForceAction> ForceActions { get; set; } = new();
[JsonProperty("Primitives")]
@@ -27,11 +21,14 @@ namespace DataAccess.DTOs
[JsonProperty("CalcTermList")]
public List<CalcTerms> CalcTermsList { get; set; } = new();
[JsonProperty("Accuracy")]
public IAccuracy Accuracy { get; set; } = new AccuracyDTO();
public IAccuracy Accuracy { get; set; }
[JsonProperty("CompressedMember")]
public ICompressedMember CompressedMember { get; set; } = new CompressedMemberDTO();
//[JsonIgnore]
//public List<IForceCombinationList> ForceCombinationLists { get; set; } = new();
public ForceCalculatorInputDataDTO(Guid id)
{
Id = id;
}
}
}

View File

@@ -0,0 +1,42 @@
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 ForceCombinationFromFileDTO : IForceCombinationFromFile
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("ForceFiles")]
public List<IColumnedFileProperty> ForceFiles { get; set; } = new();
[JsonProperty("CombinationProperty")]
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationPropertyDTO(Guid.NewGuid());
[JsonProperty("SetInGravityCenter")]
public bool SetInGravityCenter { get; set; }
[JsonProperty("ForcePoint")]
public IPoint2D ForcePoint { get; set; } = new Point2DDTO();
public ForceCombinationFromFileDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
public List<IForceCombinationList> GetCombinations()
{
throw new NotImplementedException();
}
}
}

View File

@@ -10,10 +10,10 @@ using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class ForceCombinationByFactorDTO : IForceFactoredList
public class ForceFactoredListDTO : IForceFactoredList
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get;}
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("ForceTuples")]
@@ -23,8 +23,12 @@ namespace DataAccess.DTOs
[JsonProperty("ForcePoint")]
public IPoint2D ForcePoint { get; set; } = new Point2DDTO();
[JsonProperty("CombinationProperty")]
public IFactoredCombinationProperty CombinationProperty { get; } = new ForceFactoredCombinationPropertyDTO();
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationPropertyDTO(Guid.NewGuid());
public ForceFactoredListDTO(Guid id)
{
Id = id;
}
public object Clone()
{

View File

@@ -25,6 +25,10 @@ namespace DataAccess.DTOs
[JsonProperty("Mz")]
public double Mz { get; set; }
public ForceTupleDTO(Guid id)
{
Id = id;
}
public void Clear()
{

View File

@@ -19,9 +19,9 @@ namespace DataAccess.DTOs
[JsonProperty("Triangulate")]
public bool Triangulate { get; set; }
[JsonProperty("UsersPrestrain")]
public IForceTuple UsersPrestrain { get; set; } = new ForceTupleDTO();
public IForceTuple UsersPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
[JsonProperty("AutoPrestrain")]
public IForceTuple AutoPrestrain { get; set; } = new ForceTupleDTO();
public IForceTuple AutoPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
public object Clone()

View File

@@ -21,7 +21,7 @@ namespace DataAccess.DTOs
[JsonProperty("CalcTerm")]
public CalcTerms CalcTerm { get; set; } = CalcTerms.ShortTerm;
[JsonProperty("FullSLSForces")]
public IForceTuple ForceTuple { get; set; } = new ForceTupleDTO();
public IForceTuple ForceTuple { get; set; } = new ForceTupleDTO(Guid.NewGuid());
[JsonProperty("ULSFactor")]
public double ULSFactor { get; set; }
[JsonProperty("LongTermFactor")]
@@ -31,13 +31,23 @@ namespace DataAccess.DTOs
[JsonProperty("ForcePoint")]
public IPoint2D ForcePoint { get; set; } = new Point2DDTO();
[JsonIgnore]
public IFactoredCombinationProperty CombinationProperty => new FactoredCombinationProperty()
public IFactoredCombinationProperty CombinationProperty
{
CalcTerm = CalcTerm,
LimitState = LimitState,
LongTermFactor = LongTermFactor,
ULSFactor = ULSFactor,
};
get
{
return new FactoredCombinationProperty()
{
CalcTerm = CalcTerm,
LimitState = LimitState,
LongTermFactor = LongTermFactor,
ULSFactor = ULSFactor,
};
}
set
{
throw new NotImplementedException();
}
}
[JsonIgnore]
public List<IForceTuple> ForceTuples => new() { ForceTuple};

View File

@@ -1,5 +1,4 @@
using DataAccess.DTOs.DTOEntities;
using StructureHelper.Models.Materials;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models.Analyses;
@@ -7,11 +6,6 @@ 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
{
@@ -40,6 +34,8 @@ namespace DataAccess.DTOs
{
{ (typeof(AccuracyDTO), "Accuracy") },
{ (typeof(ConcreteLibMaterialDTO), "ConcreteLibMaterial") },
{ (typeof(ColumnFilePropertyDTO), "ColumnFileProperty") },
{ (typeof(ColumnedFilePropertyDTO), "ColumnedFileProperty") },
{ (typeof(CompressedMemberDTO), "CompressedMember") },
{ (typeof(CrackCalculatorDTO), "CrackCalculator") },
{ (typeof(CrackCalculatorInputDataDTO), "CrackCalculatorInputData") },
@@ -55,9 +51,10 @@ namespace DataAccess.DTOs
{ (typeof(ForceCalculatorDTO), "ForceCalculator") },
{ (typeof(ForceCalculatorInputDataDTO), "ForceCalculatorInputData") },
{ (typeof(ForceCombinationByFactorV1_0DTO), "ForceCombinationByFactor") },
{ (typeof(ForceCombinationByFactorDTO), "ForceCombinationByFactor_v1_1") },
{ (typeof(ForceFactoredListDTO), "ForceCombinationByFactor_v1_1") },
{ (typeof(ForceCombinationFromFileDTO), "ForceCombinationFromFile") },
{ (typeof(ForceCombinationListDTO), "ForceCombinationList") },
{ (typeof(ForceFactoredCombinationPropertyDTO), "ForceFactoredCombinationProperty") },
{ (typeof(FactoredCombinationPropertyDTO), "ForceFactoredCombinationProperty") },
{ (typeof(ForceTupleDTO), "ForceTuple") },
{ (typeof(FRMaterialDTO), "FRMaterial") },
{ (typeof(HeadMaterialDTO), "HeadMaterial") },
@@ -65,6 +62,8 @@ namespace DataAccess.DTOs
{ (typeof(NdmElementDTO), "NdmElement") },
{ (typeof(IVisualAnalysis), "IVisualAnalysis") },
{ (typeof(List<CalcTerms>), "ListOfCalcTerms") },
{ (typeof(List<IColumnFileProperty>), "ColumnFileProperties") },
{ (typeof(List<IColumnedFileProperty>), "ColumnedFileProperties") },
{ (typeof(List<ICalculator>), "ListOfICalculator") },
{ (typeof(List<IDateVersion>), "ListOfIDateVersion") },
{ (typeof(List<IDesignForceTuple>), "ListOfIDesignForceTuple") },

View File

@@ -11,7 +11,7 @@ namespace DataAccess.DTOs
public class UserCrackInputDataDTO : IUserCrackInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; } = Guid.NewGuid();
public Guid Id { get;}
[JsonProperty("LengthBetweenCracks")]
public double LengthBetweenCracks { get; set; }
[JsonProperty("SetLengthBetweenCracks")]
@@ -25,5 +25,9 @@ namespace DataAccess.DTOs
[JsonProperty("UltimateShortCrackWidths")]
public double UltimateShortCrackWidth { get; set; }
public UserCrackInputDataDTO(Guid id)
{
Id = id;
}
}
}