Trace logger calls were adde in limit curve calculator
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -18,6 +19,8 @@ namespace StructureHelper.Models.Calculators
|
||||
|
||||
public IResult Result => result;
|
||||
|
||||
public ITraceLogger? TraceLogger { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public void Run()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -4,6 +4,7 @@ using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
@@ -35,6 +36,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
public int StepCount => ValidTupleList.Count();
|
||||
|
||||
public ITraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
TupleList = tupleList;
|
||||
|
||||
@@ -5,6 +5,7 @@ using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
@@ -40,6 +41,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public Action<int> SetProgress { get; set; }
|
||||
public bool Result { get; set; }
|
||||
public ITraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public InteractionDiagramLogic(LimitCurveInputData inputData)
|
||||
{
|
||||
@@ -57,8 +59,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var convertLogic = InputData.SurroundData.ConvertLogicEntity;
|
||||
var calculator = new LimitCurvesCalculator()
|
||||
{
|
||||
InputData = InputData
|
||||
InputData = InputData,
|
||||
};
|
||||
if (TraceLogger is not null) { calculator.TraceLogger = TraceLogger; }
|
||||
calculator.ActionToOutputResults = SetProgressByResult;
|
||||
SafetyProcessor.RunSafeProcess(() =>
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
@@ -27,6 +28,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public Action<int> SetProgress { get; set; }
|
||||
public bool Result { get; set; }
|
||||
public ITraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public void WorkerDoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using StructureHelper.Windows.ViewModels.Calculations.Calculators;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
|
||||
@@ -33,7 +34,8 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
{
|
||||
NewItem = new ForceCalculator()
|
||||
{
|
||||
Name = "New force calculator"
|
||||
Name = "New force calculator",
|
||||
TraceLogger = new TraceLogger(),
|
||||
};
|
||||
}
|
||||
else if (parameterType == CalculatorTypes.LimitCurveCalculator)
|
||||
@@ -42,7 +44,8 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
NewItem = new LimitCurvesCalculator()
|
||||
{
|
||||
Name = "New interaction diagram calculator",
|
||||
InputData = inputData
|
||||
InputData = inputData,
|
||||
TraceLogger = new TraceLogger(),
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -133,7 +136,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
{
|
||||
var calculator = SelectedItem as LimitCurvesCalculator;
|
||||
var inputData = calculator.InputData;
|
||||
ShowInteractionDiagramByInputData(inputData);
|
||||
ShowInteractionDiagramByInputData(calculator);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -151,9 +154,10 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowInteractionDiagramByInputData(LimitCurveInputData inputData)
|
||||
private void ShowInteractionDiagramByInputData(LimitCurvesCalculator calculator)
|
||||
{
|
||||
interactionDiagramLogic = new(inputData);
|
||||
interactionDiagramLogic = new(calculator.InputData);
|
||||
interactionDiagramLogic.TraceLogger = calculator.TraceLogger;
|
||||
showProgressLogic = new(interactionDiagramLogic)
|
||||
{
|
||||
WindowTitle = "Diagram creating...",
|
||||
|
||||
Reference in New Issue
Block a user