Add steel material saving

This commit is contained in:
Evgeny Redikultsev
2025-12-20 21:32:02 +05:00
parent 68b15682bb
commit 7e82e5ee9d
47 changed files with 1160 additions and 381 deletions

View File

@@ -5,11 +5,6 @@ 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
{
@@ -17,7 +12,9 @@ namespace DataAccess.DTOs
{
const MaterialTypes materialType = MaterialTypes.Reinforcement;
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get; }
[JsonProperty("MaterialEntityId")]
public Guid MaterialEntityId
{
@@ -46,6 +43,10 @@ namespace DataAccess.DTOs
[JsonIgnore]
public List<IMaterialLogic> MaterialLogics { get; } = ProgramSetting.MaterialLogics.Where(x => x.MaterialType == materialType).ToList();
public ReinforcementLibMaterialDTO(Guid id)
{
Id = id;
}
public object Clone()
{

View File

@@ -0,0 +1,81 @@
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;
namespace DataAccess.DTOs
{
public class SteelLibMaterialDTO : ISteelLibMaterial
{
const MaterialTypes materialType = MaterialTypes.Steel;
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("UlsFactor")]
public double UlsFactor { get; set; } = 1.025;
[JsonProperty("SlsFactor")]
public double SlsFactor { get; set; } = 1.0;
[JsonProperty("WorkConditionFactor")]
public double WorkConditionFactor { get; set; } = 1.0;
[JsonProperty("ThicknessFactor")]
public double ThicknessFactor { get; set; } = 1.0;
[JsonProperty("MaxPlasticStrainRatio")]
public double MaxPlasticStrainRatio { get; set; } = 3.0;
[JsonIgnore]
public ILibMaterialEntity MaterialEntity { get; set; }
[JsonProperty("SafetyFactors")]
public List<IMaterialSafetyFactor> SafetyFactors { get; set; } = [];
[JsonProperty("MaterialEntityId")]
public Guid MaterialEntityId
{
get => MaterialEntity.Id;
set
{
MaterialEntity = ProgramSetting.MaterialRepository.Repository.Single(x => x.Id == value);
}
}
[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 SteelLibMaterialDTO(Guid id)
{
Id = id;
}
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();
}
}
}

View File

@@ -117,6 +117,7 @@ namespace DataAccess.DTOs
{ (typeof(List<IMaterialSafetyFactor>), "ListOfMaterialSafetyFactor") },
{ (typeof(MaterialPartialFactorDTO), "MaterialPartialFactor") },
{ (typeof(ReinforcementLibMaterialDTO), "ReinforcementLibMaterial") },
{ (typeof(SteelLibMaterialDTO), "SteelLibMaterial") },
};
return newList;
}