Geometry property results have been added

This commit is contained in:
Evgeny Redikultsev
2023-04-29 20:39:05 +05:00
parent fe2adb49ff
commit 749c864edd
35 changed files with 550 additions and 73 deletions

View File

@@ -98,13 +98,25 @@
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Materials" MinWidth="20">
<Expander Header="Materials" MinWidth="20" DataContext="{Binding MaterialsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Materials" Command="{Binding EditHeadMaterialsCommand}"/>
<Button Content="Materials" Command="{Binding EditMaterialsCommand}"/>
<MenuItem Header="Add">
<Button Content="Concrete" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}"/>
<Button Content="Reinforcement" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}"/>
<Button Content="Elastic" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}"/>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding HeadMaterials}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Geometry" MinWidth="20" DataContext="{Binding PrimitiveLogic}">

View File

@@ -6,7 +6,9 @@ using StructureHelper.Windows.ColorPickerWindow;
using StructureHelper.Windows.MainWindow.Materials;
using StructureHelper.Windows.PrimitiveTemplates.RCs.Beams;
using StructureHelper.Windows.PrimitiveTemplates.RCs.RectangleBeam;
using StructureHelper.Windows.ViewModels;
using StructureHelper.Windows.ViewModels.Forces;
using StructureHelper.Windows.ViewModels.Materials;
using StructureHelper.Windows.ViewModels.NdmCrossSections;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
@@ -40,6 +42,7 @@ namespace StructureHelper.Windows.MainWindow
private readonly AnalysisVewModelLogic calculatorsLogic;
public AnalysisVewModelLogic CalculatorsLogic { get => calculatorsLogic;}
public ActionsViewModel CombinationsLogic { get => combinationsLogic; }
public MaterialsViewModel MaterialsLogic { get => materialsLogic; }
public PrimitiveViewModelLogic PrimitiveLogic => primitiveLogic;
public HelpLogic HelpLogic => new HelpLogic();
@@ -153,11 +156,13 @@ namespace StructureHelper.Windows.MainWindow
public ICommand EditCalculationPropertyCommand { get; }
public ICommand EditHeadMaterialsCommand { get; }
public ICommand AddRCCircleCase
{ get
{
get
{
return new RelayCommand(o =>
{
PrimitiveLogic.AddItems(GetRCCirclePrimitives());
materialsLogic.Refresh();
});
}
}
@@ -215,6 +220,7 @@ namespace StructureHelper.Windows.MainWindow
private PrimitiveViewModelLogic primitiveLogic;
private RelayCommand showVisualProperty;
private RelayCommand selectPrimitive;
private MaterialsViewModel materialsLogic;
public MainViewModel(MainModel model)
{
@@ -222,6 +228,8 @@ namespace StructureHelper.Windows.MainWindow
Model = model;
section = model.Section;
combinationsLogic = new ActionsViewModel(repository);
materialsLogic = new MaterialsViewModel(repository);
materialsLogic.AfterItemsEdit += afterMaterialEdit;
calculatorsLogic = new AnalysisVewModelLogic(repository);
primitiveLogic = new PrimitiveViewModelLogic(section) { CanvasWidth = CanvasWidth, CanvasHeight = CanvasHeight };
XX2 = CanvasWidth;
@@ -253,7 +261,6 @@ namespace StructureHelper.Windows.MainWindow
rect.PrimitiveHeight = PanelY - rect.PrimitiveTop + 10d;
}
});
EditHeadMaterialsCommand = new RelayCommand(o => EditHeadMaterials());
SetColor = new RelayCommand(o =>
{
@@ -279,16 +286,19 @@ namespace StructureHelper.Windows.MainWindow
AddBeamCase = new RelayCommand(o =>
{
PrimitiveLogic.AddItems(GetBeamCasePrimitives());
materialsLogic.Refresh();
});
AddColumnCase = new RelayCommand(o =>
{
PrimitiveLogic.AddItems(GetColumnCasePrimitives());
materialsLogic.Refresh();
});
AddSlabCase = new RelayCommand(o =>
{
PrimitiveLogic.AddItems(GetSlabCasePrimitives());
materialsLogic.Refresh();
});
MovePrimitiveToGravityCenterCommand = new RelayCommand(o =>
@@ -318,11 +328,8 @@ namespace StructureHelper.Windows.MainWindow
});
}
private void EditHeadMaterials()
private void afterMaterialEdit(CRUDViewModelBase<IHeadMaterial> sender, CRUDVMEventArgs e)
{
var wnd = new HeadMaterialsView(repository);
wnd.ShowDialog();
OnPropertyChanged(nameof(HeadMaterials));
foreach (var primitive in primitiveLogic.Items)
{
primitive.RefreshColor();