SectionTemlate was added

This commit is contained in:
Evgeny Redikultsev
2022-12-20 21:37:38 +05:00
parent d240968f29
commit 487cc66c39
36 changed files with 631 additions and 44 deletions

View File

@@ -0,0 +1,14 @@
using StructureHelperLogics.NdmCalculations.Analyses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.CrossSections
{
internal interface ICalculatorLogic
{
IEnumerable<INdmCalculator> GetNdmCalculators();
}
}

View File

@@ -0,0 +1,14 @@
using StructureHelperLogics.Models.CrossSections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.CrossSections
{
public interface ICrossSectionTemplate
{
ICrossSection GetCrossSection();
}
}

View File

@@ -0,0 +1,14 @@
using StructureHelperCommon.Models.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.CrossSections
{
internal interface IForceLogic
{
IEnumerable<IForceCombinationList> GetCombinationList();
}
}

View File

@@ -0,0 +1,14 @@
using StructureHelper.Models.Materials;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.CrossSections
{
internal interface IMaterialLogic
{
IEnumerable<IHeadMaterial> GetHeadMaterials();
}
}

View File

@@ -0,0 +1,14 @@
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.CrossSections
{
internal interface ISectionGeometryLogic
{
IEnumerable<INdmPrimitive> GetNdmPrimitives();
}
}

View File

@@ -0,0 +1,19 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.RCs
{
public interface IRectangleBeamTemplate
{
IShape Shape { get; }
double CoverGap { get; set; }
double TopDiameter { get; set; }
double BottomDiameter { get; set; }
int WidthCount { get; set; }
int HeightCount { get; set; }
}
}

View File

@@ -0,0 +1,65 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Analyses;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.CrossSections
{
public class RCSectionTemplate : ICrossSectionTemplate
{
IForceLogic forceLogic;
IMaterialLogic materialLogic;
ISectionGeometryLogic geometryLogic;
ICalculatorLogic calculatorLogic;
IEnumerable<INdmPrimitive> primitives;
IEnumerable<IForceCombinationList> combinations;
IEnumerable<INdmCalculator> calculators;
public ICrossSection GetCrossSection()
{
ICrossSection section = new CrossSection();
var repository = section.SectionRepository;
var materials = materialLogic.GetHeadMaterials();
primitives = geometryLogic.GetNdmPrimitives();
#error
repository.HeadMaterials.AddRange(materials);
repository.Primitives.AddRange(primitives);
combinations = forceLogic.GetCombinationList();
repository.ForceCombinationLists.AddRange(combinations);
calculators = calculatorLogic.GetNdmCalculators();
ProcessCalculatorsSetForce();
ProcessCalculatorsSetPrimitives();
repository.CalculatorsList.AddRange(calculators);
return section;
}
private void ProcessCalculatorsSetForce()
{
foreach (var calculator in calculators)
{
if (calculator is IHasForceCombinations)
{
var forceCalculator = calculator as IHasForceCombinations;
forceCalculator.ForceCombinationLists.AddRange(combinations);
}
}
}
private void ProcessCalculatorsSetPrimitives()
{
foreach (var calculator in calculators)
{
if (calculator is IHasPrimitives)
{
var primitiveCalculator = calculator as IHasPrimitives;
primitiveCalculator.Primitives.AddRange(primitives);
}
}
}
}
}

View File

@@ -0,0 +1,39 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Templates.RCs
{
public class RectangleBeamTemplate : IRectangleBeamTemplate
{
public IShape Shape { get; }
public double CoverGap { get; set; }
public double TopDiameter { get; set; }
public double BottomDiameter { get; set; }
public int WidthCount { get; set; }
public int HeightCount { get; set; }
public RectangleBeamTemplate()
{
Shape = new RectangleShape() { Width = 0.4d, Height = 0.6d };
CoverGap = 0.05d;
TopDiameter = 0.016d;
BottomDiameter = 0.025d;
WidthCount = 2;
HeightCount = 2;
}
public RectangleBeamTemplate(double width, double height)
{
Shape = new RectangleShape() { Width = width, Height = height };
CoverGap = 0.05d;
TopDiameter = 0.016d;
BottomDiameter = 0.025d;
WidthCount = 2;
HeightCount = 2;
}
}
}