Add function material interface and button
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using NLog.MessageTemplates;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
@@ -20,7 +21,8 @@ namespace StructureHelperLogics.Models.Materials
|
||||
Reinforecement500,
|
||||
Elastic200,
|
||||
Carbon1400,
|
||||
Glass1200
|
||||
Glass1200,
|
||||
Function,
|
||||
}
|
||||
|
||||
public static class HeadMaterialFactory
|
||||
@@ -37,6 +39,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
if (type == HeadmaterialType.Elastic200) { return GetElastic200(); }
|
||||
if (type == HeadmaterialType.Carbon1400) { return GetCarbon1400(); }
|
||||
if (type == HeadmaterialType.Glass1200) { return GetGlass1200(); }
|
||||
if (type == HeadmaterialType.Function) { return GetFunction(); }
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + nameof(type));
|
||||
}
|
||||
|
||||
@@ -102,5 +105,11 @@ namespace StructureHelperLogics.Models.Materials
|
||||
material.HelperMaterial = libMat;
|
||||
return material;
|
||||
}
|
||||
private static IHeadMaterial GetFunction()
|
||||
{
|
||||
var material = new HeadMaterial();
|
||||
material.HelperMaterial = new
|
||||
return material;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
49
StructureHelperLogics/Models/Materials/FunctionMaterial.cs
Normal file
49
StructureHelperLogics/Models/Materials/FunctionMaterial.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,20 +10,16 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public class HeadMaterialRepository : IHeadMaterialRepository
|
||||
{
|
||||
public object Parent { get; private set; }
|
||||
|
||||
public List<IHeadMaterial> HeadMaterials { get; set; }
|
||||
|
||||
public HeadMaterialRepository()
|
||||
{
|
||||
HeadMaterials = new List<IHeadMaterial>();
|
||||
}
|
||||
|
||||
public HeadMaterialRepository(object parent)
|
||||
{
|
||||
Parent = parent;
|
||||
HeadMaterials = new List<IHeadMaterial>();
|
||||
}
|
||||
|
||||
public void RegisterParent(object obj)
|
||||
{
|
||||
Parent = obj;
|
||||
|
||||
13
StructureHelperLogics/Models/Materials/IFunctionMaterial.cs
Normal file
13
StructureHelperLogics/Models/Materials/IFunctionMaterial.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal interface IFunctionMaterial : IHelperMaterial
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
114
StructureHelperLogics/Models/Materials/MaterialDC.cd
Normal file
114
StructureHelperLogics/Models/Materials/MaterialDC.cd
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||
<Class Name="StructureHelperLogics.Models.Materials.ConcreteLibMaterial" Collapsed="true" BaseTypeListCollapsed="true">
|
||||
<Position X="9.75" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAACAgAQAQEBAAADEQAiBQAAAgQAAgAAAAAACAAAAhA=</HashCode>
|
||||
<FileName>Models\Materials\ConcreteLibMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" Collapsed="true" />
|
||||
</Class>
|
||||
<Class Name="StructureHelperLogics.Models.Materials.ElasticMaterial" Collapsed="true" BaseTypeListCollapsed="true">
|
||||
<Position X="11.5" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAQgAEBAAAAAQAAAAAQAAAAAAAAAAAAAAAAABA=</HashCode>
|
||||
<FileName>Models\Materials\ElasticMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" Collapsed="true" />
|
||||
</Class>
|
||||
<Class Name="StructureHelperLogics.Models.Materials.HeadMaterialRepository" Collapsed="true" BaseTypeListCollapsed="true">
|
||||
<Position X="9.75" Y="1.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAEAAAAAIAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\HeadMaterialRepository.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" Collapsed="true" />
|
||||
</Class>
|
||||
<Class Name="StructureHelperLogics.Models.Materials.LibMaterial" Collapsed="true" BaseTypeListCollapsed="true">
|
||||
<Position X="11.5" Y="1.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAIBQCAMBAQIAAAAABAQAAAAAAgAEAgAEAAAAAhA=</HashCode>
|
||||
<FileName>Models\Materials\LibMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" Collapsed="true" />
|
||||
</Class>
|
||||
<Class Name="StructureHelper.Models.Materials.HeadMaterial" Collapsed="true" BaseTypeListCollapsed="true">
|
||||
<Position X="13.25" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAIAUAAABAAAAEAAAAAQAgAAAAACAAAAAgAAAABA=</HashCode>
|
||||
<FileName>Models\Materials\HeadMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" Collapsed="true" />
|
||||
</Class>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IConcreteLibMaterial" Collapsed="true">
|
||||
<Position X="7.25" Y="5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAQAAAQAAAgAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IConcreteLibMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IElasticMaterial" Collapsed="true">
|
||||
<Position X="3.25" Y="2" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAgAEAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IElasticMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IHasHeadMaterials" Collapsed="true">
|
||||
<Position X="9.75" Y="2.75" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IHasHeadMaterials.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IHeadMaterialRepository" Collapsed="true">
|
||||
<Position X="13.25" Y="2.75" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAEAAAAAIAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IHeadMaterialRepository.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IHelperMaterial" Collapsed="true">
|
||||
<Position X="4.25" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAQAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IHelperMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.ILibMaterial">
|
||||
<Position X="6" Y="2" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAEAAAAAAAAABAAAAAAAAgAAAAAAAAAAAgA=</HashCode>
|
||||
<FileName>Models\Materials\ILibMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IMaterialOptionLogic" Collapsed="true">
|
||||
<Position X="9.75" Y="3.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IMaterialOptionLogic.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IReinforcementLibMaterial" Collapsed="true">
|
||||
<Position X="5" Y="5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IReinforcementLibMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelper.Models.Materials.IHeadMaterial" Collapsed="true">
|
||||
<Position X="11.5" Y="2.75" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAUAAABAAAAAAAAAAQAAAAAAAAAAAAAgAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IHeadMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IFunctionMaterial">
|
||||
<Position X="0.75" Y="2" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IFunctionMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
||||
Reference in New Issue
Block a user