diff --git a/StructureHelper/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/UserControls/SurroundDataViewModel.cs b/StructureHelper/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/UserControls/SurroundDataViewModel.cs index 4234dda..db1f181 100644 --- a/StructureHelper/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/UserControls/SurroundDataViewModel.cs +++ b/StructureHelper/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/UserControls/SurroundDataViewModel.cs @@ -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)); } } diff --git a/StructureHelper/Windows/MainWindow/CrossSectionViewModel.cs b/StructureHelper/Windows/MainWindow/CrossSectionViewModel.cs index 27c6b40..37c5e69 100644 --- a/StructureHelper/Windows/MainWindow/CrossSectionViewModel.cs +++ b/StructureHelper/Windows/MainWindow/CrossSectionViewModel.cs @@ -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, diff --git a/StructureHelper/Windows/ViewModels/NdmCrossSections/AnalysisVewModelLogic.cs b/StructureHelper/Windows/ViewModels/NdmCrossSections/AnalysisViewModelLogic.cs similarity index 97% rename from StructureHelper/Windows/ViewModels/NdmCrossSections/AnalysisVewModelLogic.cs rename to StructureHelper/Windows/ViewModels/NdmCrossSections/AnalysisViewModelLogic.cs index c11101e..a496c48 100644 --- a/StructureHelper/Windows/ViewModels/NdmCrossSections/AnalysisVewModelLogic.cs +++ b/StructureHelper/Windows/ViewModels/NdmCrossSections/AnalysisViewModelLogic.cs @@ -16,7 +16,7 @@ using MessageBox = System.Windows.Forms.MessageBox; namespace StructureHelper.Windows.ViewModels.NdmCrossSections { - public class AnalysisVewModelLogic : SelectItemVM + public class AnalysisViewModelLogic : SelectItemVM { 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; } diff --git a/StructureHelper/Windows/ViewModels/SelectItemVM.cs b/StructureHelper/Windows/ViewModels/SelectItemVM.cs index c240e4b..c0b0d45 100644 --- a/StructureHelper/Windows/ViewModels/SelectItemVM.cs +++ b/StructureHelper/Windows/ViewModels/SelectItemVM.cs @@ -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); } diff --git a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/Factories/PredicateFactory.cs b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/Factories/PredicateFactory.cs index 39717b8..a0e746b 100644 --- a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/Factories/PredicateFactory.cs +++ b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/Factories/PredicateFactory.cs @@ -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 } diff --git a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/LimitCurvesCalculator.cs b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/LimitCurvesCalculator.cs index f88eff2..83db6dc 100644 --- a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/LimitCurvesCalculator.cs +++ b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/LimitCurve/LimitCurvesCalculator.cs @@ -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; + } + } } diff --git a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/Logics/LimitCurveInputDataUpdateStrategy.cs b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/Logics/LimitCurveInputDataUpdateStrategy.cs index 10055bf..f45bdfd 100644 --- a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/Logics/LimitCurveInputDataUpdateStrategy.cs +++ b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/Logics/LimitCurveInputDataUpdateStrategy.cs @@ -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() + { + Name = item.Name + }; + newItem.Collection.AddRange(item.Collection); + targetObject.PrimitiveSeries.Add(newItem); + } surroundDataUpdateStrategy.Update(targetObject.SurroundData, sourceObject.SurroundData); } }