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); var factor = GetFactor(SurroundData.ConvertLogicEntity.ZForceType);
SurroundData.ConstZ = value / factor; SurroundData.ConstZ = value / factor;
SurroundData.ConvertLogicEntity.ConstDirectionValue = SurroundData.ConstZ;
OnPropertyChanged(nameof(ConstZ)); OnPropertyChanged(nameof(ConstZ));
} }
} }

View File

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

View File

@@ -16,7 +16,7 @@ using MessageBox = System.Windows.Forms.MessageBox;
namespace StructureHelper.Windows.ViewModels.NdmCrossSections namespace StructureHelper.Windows.ViewModels.NdmCrossSections
{ {
public class AnalysisVewModelLogic : SelectItemVM<ICalculator> public class AnalysisViewModelLogic : SelectItemVM<ICalculator>
{ {
private ICrossSectionRepository repository; private ICrossSectionRepository repository;
private RelayCommand runCommand; private RelayCommand runCommand;
@@ -88,7 +88,6 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
var calculatorCopy = (ICalculator)calculator.Clone(); var calculatorCopy = (ICalculator)calculator.Clone();
var vm = new ForceCalculatorViewModel(repository.Primitives, repository.ForceActions, calculator); var vm = new ForceCalculatorViewModel(repository.Primitives, repository.ForceActions, calculator);
var wnd = new ForceCalculatorView(vm); var wnd = new ForceCalculatorView(vm);
ShowWindow(calculator, calculatorCopy, wnd); 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; 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@@ -98,6 +101,13 @@ namespace StructureHelper.Windows.ViewModels
{ {
NewItem = (SelectedItem as ICloneable).Clone() as TItem; 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); Collection.Add(NewItem);
Items.Add(NewItem); Items.Add(NewItem);
} }

View File

@@ -37,7 +37,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{ {
if (TraceLogger is not null) 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 //calculator.TraceLogger = logger; // too much results
//ConvertLogic.TraceLogger = logger; //wrong work in different threads //ConvertLogic.TraceLogger = logger; //wrong work in different threads
} }

View File

@@ -135,5 +135,22 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
ActionToOutputResults?.Invoke(result); 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 StructureHelperCommon.Infrastructures.Interfaces; using StructureHelperCommon.Models.Parameters;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
{ {
@@ -22,6 +16,16 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
targetObject.PredicateEntries.Clear(); targetObject.PredicateEntries.Clear();
targetObject.PredicateEntries.AddRange(sourceObject.PredicateEntries); targetObject.PredicateEntries.AddRange(sourceObject.PredicateEntries);
targetObject.PointCount = sourceObject.PointCount; 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); surroundDataUpdateStrategy.Update(targetObject.SurroundData, sourceObject.SurroundData);
} }
} }