TableCell class was added

This commit is contained in:
Evgeny Redikultsev
2024-01-27 21:19:06 +05:00
parent a9ffd8b903
commit a680e67ab3
13 changed files with 144 additions and 51 deletions

View File

@@ -58,19 +58,19 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
TraceLogger?.AddMessage($"Point count {PointCount}");
surroundList = SurroundProcLogic.GetPoints();
TraceLogger?.AddMessage($"There are {surroundList.Count()} point prepared for calculation");
if (TraceLogger is not null)
{
AddTAbleToTraceLoggerByPoints(surroundList);
}
TraceLogger?.AddEntry(
new TraceTablesFactory(
TraceLoggerStatuses.Info, TraceLogger.ShiftPriority)
.GetTableByPoint2D(surroundList));
try
{
limitCurveLogic.ActionToOutputResults = GetCurrentStepNumber;
factoredList = limitCurveLogic.GetPoints(surroundList);
TraceLogger?.AddMessage($"Solution was successfully obtained for {factoredList.Count()} point");
if (TraceLogger is not null)
{
AddTAbleToTraceLoggerByPoints(factoredList);
}
TraceLogger?.AddEntry(
new TraceTablesFactory(
TraceLoggerStatuses.Info, TraceLogger.ShiftPriority)
.GetTableByPoint2D(factoredList));
result.Points = factoredList;
}
catch (Exception ex)
@@ -81,13 +81,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
}
}
private void AddTAbleToTraceLoggerByPoints(IEnumerable<IPoint2D> pointList)
{
var table = TraceLoggerTableByPointsFactory.GetTableByPoint2D(pointList);
table.Priority = LoggerService.GetPriorityByStatus(TraceLoggerStatuses.Info) + TraceLogger.ShiftPriority;
TraceLogger.AddEntry(table);
}
private void GetCurrentStepNumber(IResult calcResult)
{
if (calcResult is not FindParameterResult)

View File

@@ -2,6 +2,7 @@
using StructureHelperCommon.Models.Loggers;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve.Factories;
using System.Windows.Media.Media3D;
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
@@ -38,9 +39,15 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
TraceLogger?.AddMessage($"Predicate name is {GetPredicateLogic.Name}");
Predicate<IPoint2D> limitPredicate = GetPredicateLogic.GetPredicate();
//if predicate is true for point (0,0), then check other point is pointless
if (limitPredicate(new Point2D()) == true)
var zeroPoint = new Point2D();
if (limitPredicate(zeroPoint) == true)
{
TraceLogger?.AddMessage($"Predicate is true for point (0d, 0d). All point will be skiped", TraceLoggerStatuses.Warning);
TraceLogger?.AddMessage($"Predicate is true for point. All point will be skiped", TraceLoggerStatuses.Warning);
TraceLogger?.AddEntry(
new TraceTablesFactory(
TraceLoggerStatuses.Warning, 0)
.GetTableByPoint2D(zeroPoint));
TraceLogger?.AddMessage($"All point will be skiped", TraceLoggerStatuses.Warning);
var range = points.Select(point => new Point2D { X = 0d, Y = 0d }).ToList();
resultList.AddRange(range);
return resultList;
@@ -113,10 +120,18 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
};
lock (lockObject)
{
TraceLogger?.AddMessage($"Source point (X = {localCurrentPoint.X}, Y = {localCurrentPoint.Y})");
TraceLogger?.AddMessage($"Source point");
TraceLogger?.AddEntry(
new TraceTablesFactory(
TraceLoggerStatuses.Info, TraceLogger.ShiftPriority)
.GetTableByPoint2D(localCurrentPoint));
TraceLogger?.TraceLoggerEntries.AddRange(logic.TraceLogger.TraceLoggerEntries);
TraceLogger?.AddMessage($"Parameter value {parameter} was obtained");
TraceLogger?.AddMessage($"Calculated point (X={localCurrentPoint.X} * {parameter} = {resultPoint.X}, Y={localCurrentPoint.Y} * {parameter} = {resultPoint.Y})");
TraceLogger?.AddMessage($"Calculated point\n(X={localCurrentPoint.X} * {parameter} = {resultPoint.X},\nY={localCurrentPoint.Y} * {parameter} = {resultPoint.Y})");
TraceLogger?.AddEntry(
new TraceTablesFactory(
TraceLoggerStatuses.Info, TraceLogger.ShiftPriority)
.GetTableByPoint2D(resultPoint));
}
return resultPoint;
}

View File

@@ -45,7 +45,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
if (parameter < limitparamValue)
{
var newAccuracy = limitparamValue / 10d;
TraceLogger?.AddMessage($"Since current parameter value {parameter} has a low accuracy (less than {limitparamValue}) new parameter calculatin is started", TraceLoggerStatuses.Warning);
TraceLogger?.AddMessage($"Since current parameter value {parameter} has a low accuracy (value less than {limitparamValue}) new parameter calculating is started", TraceLoggerStatuses.Warning);
parameterCalculator.Accuracy.IterationAccuracy = 0.0001d;
parameterCalculator.Run();
result = parameterCalculator.Result as FindParameterResult;

View File

@@ -86,6 +86,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
foreach (var calcTerm in InputData.CalcTerms)
{
var ndms = NdmPrimitivesService.GetNdms(primitiveSeries.Collection, limitState, calcTerm);
TraceLogger?.AddMessage($"Number of elementary parts N={ndms.Count()} were obtainded succesfully");
TraceLogger?.AddMessage($"Summary area of elementary parts Asum={ndms.Sum(x=>x.Area)}", TraceLoggerStatuses.Debug);
foreach (var predicateEntry in InputData.PredicateEntries)
{
string calcName = $"{primitiveSeries.Name}_{predicateEntry.Name}_{limitState}_{calcTerm}";

View File

@@ -2,18 +2,8 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.Models.Calculations.CalculationProperties;
using StructureHelperLogics.Models.Primitives;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using static System.Collections.Specialized.BitVector32;
namespace StructureHelperLogics.Services.NdmPrimitives
{