Interpolation View for calculation result was added

This commit is contained in:
Evgeny Redikultsev
2023-01-08 14:11:16 +05:00
parent 2d7c8648ab
commit 401e3dd02b
52 changed files with 1428 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
using StructureHelper.Infrastructure;
using StructureHelper.Models.Materials;
using StructureHelper.Services.Primitives;
using StructureHelper.Windows.AddMaterialWindow;
using StructureHelper.Windows.MainWindow;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Settings;
@@ -56,6 +57,29 @@ namespace StructureHelper.Windows.ViewModels.Materials
public ICommand DeleteMaterialCommand { get; set; }
public ICommand EditHeadMaterial;
private RelayCommand showSafetyfactors;
public RelayCommand ShowSafetyFactors
{
get
{
return showSafetyfactors ??
(
showSafetyfactors = new RelayCommand(o =>
{
if (selectedMaterial.HelperMaterial is ILibMaterial)
{
var material = selectedMaterial.HelperMaterial as ILibMaterial;
var wnd = new SafetyFactorsView(material.SafetyFactors);
wnd.ShowDialog();
OnPropertyChanged(nameof(Items));
}
}, o=> SelectedLibMaterial != null
));
}
}
private ICommand addElasticMaterialCommand;
public ObservableCollection<IHeadMaterial> HeadMaterials { get; private set; }
@@ -74,6 +98,19 @@ namespace StructureHelper.Windows.ViewModels.Materials
}
}
public ObservableCollection<IMaterialSafetyFactor> Items
{
get
{
if (selectedMaterial.HelperMaterial is ILibMaterial)
{
var material = selectedMaterial.HelperMaterial as ILibMaterial;
return new ObservableCollection<IMaterialSafetyFactor>(material.SafetyFactors);
}
else return null;
}
}
public string SelectedName
{
get => selectedMaterial.Name;

View File

@@ -0,0 +1,15 @@
using StructureHelper.Infrastructure;
using StructureHelperCommon.Models.Materials.Libraries;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.ViewModels.Materials
{
internal interface ISafetyFactorViewModel<TItem> : ICRUDViewModel<TItem>
{
RelayCommand ShowPartialFactors { get; }
}
}

View File

@@ -0,0 +1,22 @@
using StructureHelperCommon.Models.Materials.Libraries;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.ViewModels.Materials
{
internal class PartialFactorsViewModel : CRUDViewModelBase<IMaterialPartialFactor>
{
public override void AddMethod(object parameter)
{
NewItem = new MaterialPartialFactor();
base.AddMethod(parameter);
}
public PartialFactorsViewModel(List<IMaterialPartialFactor> safetyFactors) : base(safetyFactors)
{
}
}
}

View File

@@ -0,0 +1,41 @@
using StructureHelper.Infrastructure;
using StructureHelper.Windows.MainWindow.Materials;
using StructureHelperCommon.Models.Materials.Libraries;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.ViewModels.Materials
{
internal class SafetyFactorsViewModel : CRUDViewModelBase<IMaterialSafetyFactor>
{
private RelayCommand showPartialCommand;
public RelayCommand ShowPartialFactors
{
get
{
return showPartialCommand ??
(showPartialCommand = new RelayCommand(o =>
{
var wnd = new PartialFactorsView(SelectedItem.PartialFactors);
wnd.ShowDialog();
}, o => SelectedItem != null
));
}
}
public override void AddMethod(object parameter)
{
NewItem = new MaterialSafetyFactor();
base.AddMethod(parameter);
}
public SafetyFactorsViewModel(List<IMaterialSafetyFactor> safetyFactors) : base(safetyFactors)
{
}
}
}