LimitCurveDiagram was repeired (didn't take into account constZ factor)

This commit is contained in:
Evgeny Redikultsev
2024-02-21 21:46:47 +05:00
parent d650924628
commit 8572e1f93d
7 changed files with 50 additions and 15 deletions

View File

@@ -157,6 +157,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
{
var factor = GetFactor(SurroundData.ConvertLogicEntity.ZForceType);
SurroundData.ConstZ = value / factor;
SurroundData.ConvertLogicEntity.ConstDirectionValue = SurroundData.ConstZ;
OnPropertyChanged(nameof(ConstZ));
}
}

View File

@@ -35,7 +35,7 @@ namespace StructureHelper.Windows.MainWindow
public PrimitiveBase SelectedPrimitive { get; set; }
public AnalysisVewModelLogic CalculatorsLogic { get; private set; }
public AnalysisViewModelLogic CalculatorsLogic { get; private set; }
public ActionsViewModel CombinationsLogic { get; }
public MaterialsViewModel MaterialsLogic { get; }
public PrimitiveViewModelLogic PrimitiveLogic { get; }
@@ -135,7 +135,7 @@ namespace StructureHelper.Windows.MainWindow
CombinationsLogic = new ActionsViewModel(repository);
MaterialsLogic = new MaterialsViewModel(repository);
MaterialsLogic.AfterItemsEdit += AfterMaterialEdit;
CalculatorsLogic = new AnalysisVewModelLogic(repository);
CalculatorsLogic = new AnalysisViewModelLogic(repository);
PrimitiveLogic = new PrimitiveViewModelLogic(section)
{
Width = VisualProperty.Width,

View File

@@ -16,7 +16,7 @@ using MessageBox = System.Windows.Forms.MessageBox;
namespace StructureHelper.Windows.ViewModels.NdmCrossSections
{
public class AnalysisVewModelLogic : SelectItemVM<ICalculator>
public class AnalysisViewModelLogic : SelectItemVM<ICalculator>
{
private ICrossSectionRepository repository;
private RelayCommand runCommand;
@@ -88,7 +88,6 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
var calculatorCopy = (ICalculator)calculator.Clone();
var vm = new ForceCalculatorViewModel(repository.Primitives, repository.ForceActions, calculator);
var wnd = new ForceCalculatorView(vm);
ShowWindow(calculator, calculatorCopy, wnd);
}
@@ -183,7 +182,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
}
}
public AnalysisVewModelLogic(ICrossSectionRepository sectionRepository) : base(sectionRepository.CalculatorsList)
public AnalysisViewModelLogic(ICrossSectionRepository sectionRepository) : base(sectionRepository.CalculatorsList)
{
repository = sectionRepository;
}

View File

@@ -1,4 +1,7 @@
using StructureHelper.Infrastructure;
using LoaderCalculator;
using StructureHelper.Infrastructure;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -98,6 +101,13 @@ namespace StructureHelper.Windows.ViewModels
{
NewItem = (SelectedItem as ICloneable).Clone() as TItem;
}
if (SelectedItem is ILogic logic)
{
if (logic.TraceLogger is not null)
{
(NewItem as ILogic).TraceLogger = logic.TraceLogger.GetSimilarTraceLogger();
}
}
Collection.Add(NewItem);
Items.Add(NewItem);
}

View File

@@ -37,7 +37,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{
if (TraceLogger is not null)
{
logger = new ShiftTraceLogger() { ShiftPriority = 500, KeepErrorStatus = false };
logger = new ShiftTraceLogger()
{
ShiftPriority = 500,
KeepErrorStatus = false
};
//calculator.TraceLogger = logger; // too much results
//ConvertLogic.TraceLogger = logger; //wrong work in different threads
}

View File

@@ -135,5 +135,22 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
ActionToOutputResults?.Invoke(result);
}
public override bool Equals(object? obj)
{
if (obj is null)
{
return false;
}
if (obj is LimitCurvesCalculator)
{
var item = obj as LimitCurvesCalculator;
if (item.Id == Id)
{
return true;
}
};
return false;
}
}
}

View File

@@ -1,11 +1,5 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Parameters;
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
{
@@ -22,6 +16,16 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
targetObject.PredicateEntries.Clear();
targetObject.PredicateEntries.AddRange(sourceObject.PredicateEntries);
targetObject.PointCount = sourceObject.PointCount;
targetObject.PrimitiveSeries.Clear();
foreach (var item in sourceObject.PrimitiveSeries)
{
var newItem = new NamedCollection<Primitives.INdmPrimitive>()
{
Name = item.Name
};
newItem.Collection.AddRange(item.Collection);
targetObject.PrimitiveSeries.Add(newItem);
}
surroundDataUpdateStrategy.Update(targetObject.SurroundData, sourceObject.SurroundData);
}
}