Copying of actions was repaired

This commit is contained in:
Evgeny Redikultsev
2023-09-23 21:14:23 +05:00
parent 9884a0919c
commit e355f9e29d
3 changed files with 14 additions and 2 deletions

View File

@@ -52,7 +52,15 @@ namespace StructureHelper.Windows.ViewModels.Forces
} }
} }
public override void CopyMethod(object parameter)
{
NewItem = SelectedItem.Clone() as IForceAction;
NewItem.Name = $"{NewItem.Name} copy";
GlobalRepository.Actions.Create(NewItem);
Collection.Add(NewItem);
Items.Add(NewItem);
SelectedItem = NewItem;
}
public override void EditMethod(object parameter) public override void EditMethod(object parameter)
{ {

View File

@@ -87,6 +87,7 @@ namespace StructureHelper.Windows.ViewModels.Materials
Items.Add(NewItem); Items.Add(NewItem);
SelectedItem = NewItem; SelectedItem = NewItem;
} }
private void AddElastic() private void AddElastic()
{ {
var material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Elastic200); var material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Elastic200);

View File

@@ -1,4 +1,5 @@
using LoaderCalculator.Data.Matrix; using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Logics; using LoaderCalculator.Logics;
using StructureHelperCommon.Infrastructures.Enums; using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions; using StructureHelperCommon.Infrastructures.Exceptions;
@@ -30,7 +31,9 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": main material is incorrect or null"); throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": main material is incorrect or null");
} }
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm }; var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
var ndm = ndmPrimitive.GetNdms(triangulationOptions).Single(); var ndms = ndmPrimitive.GetNdms(triangulationOptions);
var ndm = ndms.Where(x => x is RebarNdm)
.Single();
if (strainMatrix is not null) if (strainMatrix is not null)
{ {
inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm); inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm);