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);
}