Icons were added

This commit is contained in:
Evgeny Redikultsev
2023-08-12 14:53:38 +05:00
parent ce97586d2b
commit 80302525b3
103 changed files with 1133 additions and 449 deletions

View File

@@ -0,0 +1,33 @@
using LoaderCalculator.Data.Ndms;
using StructureHelperCommon.Infrastructures.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public class AverageDiameterLogic : IAverageDiameterLogic
{
public IEnumerable<RebarNdm> Rebars { get; set; }
public double GetAverageDiameter()
{
Check();
var rebarArea = Rebars
.Sum(x => x.Area);
var rebarCount = Rebars.Count();
var averageArea = rebarArea / rebarCount;
var diameter = Math.Sqrt(averageArea / Math.PI);
return diameter;
}
private void Check()
{
if (!Rebars.Any())
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": rebars count must be greater then zero");
}
}
}
}