Add function material interface and button

This commit is contained in:
Иван Ивашкин
2025-01-28 14:31:34 +05:00
parent ceefe3dbca
commit 4ec3ef25fb
8 changed files with 199 additions and 7 deletions

View File

@@ -0,0 +1,49 @@
using LoaderCalculator.Data.Materials;
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 StructureHelperLogics.Models.Materials
{
public class FunctionMaterial
{
private IElasticMaterialLogic elasticMaterialLogic => new ElasticMaterialLogic();
public double Modulus { get; set; }
public double CompressiveStrength { get; set; }
public double TensileStrength { get; set; }
public List<IMaterialSafetyFactor> SafetyFactors { get; } = new();
public Guid Id { get; }
public FunctionMaterial(Guid id)
{
Id = id;
}
public FunctionMaterial() : this(Guid.NewGuid())
{
}
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
{
var material = elasticMaterialLogic.GetLoaderMaterial(this, limitState, calcTerm);
return material;
}
public object Clone()
{
var newItem = new ElasticMaterial();
var updateStrategy = new ElasticUpdateStrategy();
updateStrategy.Update(newItem, this);
return newItem;
}
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
{
return GetLoaderMaterial(limitState, calcTerm);
}
}
}