Trace logging for sorce of cracking was added
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using StructureHelper.Windows.Errors;
|
||||
using LoaderCalculator;
|
||||
using StructureHelper.Windows.CalculationWindows.ProgressViews;
|
||||
using StructureHelper.Windows.Errors;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
@@ -14,6 +17,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
internal class ShowCrackResultLogic
|
||||
{
|
||||
private CrackForceCalculator calculator;
|
||||
|
||||
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
@@ -33,7 +38,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
private void FindCrackFactor(IForceTuple finishDesignTuple, IForceTuple startDesignTuple)
|
||||
{
|
||||
var calculator = new CrackForceCalculator();
|
||||
calculator = new CrackForceCalculator();
|
||||
calculator.TraceLogger = new ShiftTraceLogger();
|
||||
calculator.StartTuple = startDesignTuple;
|
||||
calculator.EndTuple = finishDesignTuple;
|
||||
calculator.NdmCollection = NdmPrimitivesService.GetNdms(ndmPrimitives, LimitState, CalcTerm);
|
||||
@@ -41,7 +47,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var result = (CrackForceResult)calculator.Result;
|
||||
if (result.IsValid)
|
||||
{
|
||||
ShowResult(result);
|
||||
ShowTraceResult();
|
||||
//ShowResult(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -80,5 +87,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void ShowTraceResult()
|
||||
{
|
||||
if (calculator.TraceLogger is not null)
|
||||
{
|
||||
var wnd = new TraceDocumentView(calculator.TraceLogger.TraceLoggerEntries);
|
||||
wnd.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Windows.PrimitivePropertiesWindow;
|
||||
using StructureHelper.Windows.ViewModels.Calculations.Calculators;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
@@ -22,7 +21,6 @@ using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.Geometry;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
||||
{
|
||||
public class TraceDocumentVM : ViewModelBase
|
||||
{
|
||||
const int tabFactor = 500;
|
||||
const double tabFactor = 500d;
|
||||
private readonly IEnumerable<ITraceLoggerEntry> loggerEntries;
|
||||
private IEnumerable<ITraceLoggerEntry> selectedLoggerEntries;
|
||||
private FlowDocument document;
|
||||
@@ -110,13 +110,13 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(traceEntry));
|
||||
}
|
||||
block.Margin = new Thickness(traceEntry.Priority / tabFactor * tabGap, 7, 0, 7);
|
||||
return block;
|
||||
}
|
||||
|
||||
private Block GetBlockByStringEntry(StringLogEntry stringEntry)
|
||||
{
|
||||
var paragraph = new Paragraph(new Run(stringEntry.Message));
|
||||
paragraph.Margin = new Thickness(stringEntry.Priority / tabFactor * tabGap, 7, 0, 7);
|
||||
if (stringEntry.Priority <= LoggerService.GetPriorityByStatus(TraceLogStatuses.Fatal))
|
||||
{
|
||||
paragraph.FontSize = 14;
|
||||
|
||||
Reference in New Issue
Block a user