Add logic for converting beam shear calculator input data

This commit is contained in:
Evgeny Redikultsev
2025-03-30 17:34:00 +05:00
parent a0a25f183a
commit cefe30f103
41 changed files with 346 additions and 162 deletions

View File

@@ -11,15 +11,15 @@ namespace StructureHelperLogics.Models.BeamShears
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
{
private IBeamShearCalculatorResult result;
private IBeamShearSectionCalculator beamShearSectionCalculator;
private List<IBeamShearSectionCalculatorInputData> sectionInputDatas;
private IBeamShearSectionLogic beamShearSectionLogic;
private List<IBeamShearSectionLogicInputData> sectionInputDatas;
public IShiftTraceLogger? TraceLogger { get; set; }
public BeamShearCalculatorLogic(IShiftTraceLogger? traceLogger)
{
TraceLogger = traceLogger;
}
public IShiftTraceLogger? TraceLogger { get; set; }
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
{
@@ -43,16 +43,16 @@ namespace StructureHelperLogics.Models.BeamShears
{
foreach (var sectionInputData in sectionInputDatas)
{
beamShearSectionCalculator.InputData = sectionInputData;
beamShearSectionCalculator.Run();
var sectionResult = beamShearSectionCalculator.Result as IBeamShearSectionCalculatorResult;
beamShearSectionLogic.InputData = sectionInputData;
beamShearSectionLogic.Run();
var sectionResult = beamShearSectionLogic.Result as IBeamShearSectionLogicResult;
result.SectionResults.Add(sectionResult);
}
}
private void InitializeStrategies()
{
beamShearSectionCalculator ??= new BeamShearSectionCalculator();
beamShearSectionLogic ??= new BeamShearSectionLogic();
}
private void PrepareNewResult()
@@ -66,23 +66,23 @@ namespace StructureHelperLogics.Models.BeamShears
private void GetSectionInputDatas(IBeamShearCalculatorInputData inputData)
{
sectionInputDatas = new();
foreach (var beamShearSection in inputData.Sections)
{
foreach (var stirrup in inputData.Stirrups)
{
foreach (var beamShearAction in inputData.Actions)
{
BeamShearSectionCalculatorInputData newInputData = new(Guid.NewGuid())
{
BeamShearSection = beamShearSection,
Stirrup = stirrup,
BeamShearAction = beamShearAction
};
sectionInputDatas.Add(newInputData);
}
}
}
//sectionInputDatas = new();
//foreach (var beamShearSection in inputData.Sections)
//{
// foreach (var stirrup in inputData.Stirrups)
// {
// foreach (var beamShearAction in inputData.Actions)
// {
// BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
// {
// BeamShearSection = beamShearSection,
// Stirrup = stirrup,
// BeamShearAction = beamShearAction
// };
// sectionInputDatas.Add(newInputData);
// }
// }
//}
}
}
}