44 lines
1.7 KiB
C#
44 lines
1.7 KiB
C#
using StructureHelperCommon.Models;
|
|
using StructureHelperCommon.Models.Calculators;
|
|
|
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
|
{
|
|
public class CrackWidthSimpleCalculator : ICalculator
|
|
{
|
|
ICrackWidthLogic crackWidthLogic = new CrackWidthLogicSP63();
|
|
CrackWidthSimpleCalculatorResult result;
|
|
public string Name { get; set; }
|
|
public ICrackWidthSimpleCalculatorInputData InputData { get; set; }
|
|
public IResult Result => result;
|
|
|
|
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
public IShiftTraceLogger? TraceLogger { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
public void Run()
|
|
{
|
|
result = new() { IsValid = true};
|
|
var crackWidthLogicType = CrackWidthLogicType.SP63;
|
|
var logicInputData = CrackWidthLogicInputDataFactory.GetCrackWidthLogicInputData(crackWidthLogicType, InputData);
|
|
crackWidthLogic.InputData = logicInputData;
|
|
double crackWidth = 0d;
|
|
try
|
|
{
|
|
crackWidth = crackWidthLogic.GetCrackWidth();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.IsValid = false;
|
|
result.Description += "\n" + ex;
|
|
}
|
|
result.RebarPrimitive = InputData.RebarPrimitive;
|
|
result.CrackWidth = crackWidth;
|
|
result.RebarStrain = logicInputData.RebarStrain;
|
|
result.ConcreteStrain = logicInputData.ConcreteStrain;
|
|
}
|
|
public object Clone()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|