Add beam shear window
This commit is contained in:
@@ -3,6 +3,7 @@ using StructureHelper.Models.Materials;
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace DataAccess.DTOs
|
namespace DataAccess.DTOs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using StructureHelper.Models.Materials;
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.CodeDom;
|
using System.CodeDom;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using StructureHelperCommon.Infrastructures.Exceptions;
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials.Logics;
|
using StructureHelperLogics.Models.Materials.Logics;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using System;
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
using System.Collections.Generic;
|
//All rights reserved.
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace DataAccess.DTOs
|
namespace DataAccess.DTOs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,13 +2,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace DataAccess.DTOs
|
namespace DataAccess.DTOs
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/CommonEnums.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Resources/CommonEnums.xaml"/>
|
||||||
|
<ResourceDictionary Source="Infrastructure/UI/Resources/ContextMenus.xaml"/>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Styles.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Styles.xaml"/>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/DataGridStyles.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Resources/DataGridStyles.xaml"/>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/ButtonStyles.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Resources/ButtonStyles.xaml"/>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace StructureHelper.Infrastructure.Enums
|
|||||||
ForceCalculator,
|
ForceCalculator,
|
||||||
LimitCurveCalculator,
|
LimitCurveCalculator,
|
||||||
CrackCalculator,
|
CrackCalculator,
|
||||||
FireCalculator
|
FireCalculator,
|
||||||
|
BeamShearCalculator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
StructureHelper/Infrastructure/Enums/StirrupTypes.cs
Normal file
14
StructureHelper/Infrastructure/Enums/StirrupTypes.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Infrastructure.Enums
|
||||||
|
{
|
||||||
|
public enum StirrupTypes
|
||||||
|
{
|
||||||
|
Density,
|
||||||
|
UniformRebar
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -269,6 +269,20 @@
|
|||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="DistributedLoad">
|
||||||
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
|
<Canvas.Children>
|
||||||
|
<Line X1="4" Y1="10" X2="28" Y2="10" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="4" Y1="10" X2="4" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="28" Y1="10" X2="28" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="2" Y1="16" X2="4" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="6" Y1="16" X2="4" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="26" Y1="16" X2="28" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="30" Y1="16" X2="28" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="2" Y1="20" X2="30" Y2="20" Stroke="Black" StrokeThickness="2"/>
|
||||||
|
</Canvas.Children>
|
||||||
|
</Canvas>
|
||||||
|
</DataTemplate>
|
||||||
<DataTemplate x:Key="Document">
|
<DataTemplate x:Key="Document">
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<Canvas.Children>
|
<Canvas.Children>
|
||||||
@@ -601,6 +615,25 @@
|
|||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="ShearRectangleSection">
|
||||||
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
|
<Canvas.Children>
|
||||||
|
<Rectangle Canvas.Left="5" Canvas.Top="3" Width="22" Height="26" Fill="LightGray" Stroke ="Black"/>
|
||||||
|
<Ellipse Canvas.Left="10" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
|
||||||
|
<Ellipse Canvas.Left="18" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
|
||||||
|
</Canvas.Children>
|
||||||
|
</Canvas>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="ShearSectionTemplate">
|
||||||
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
|
<Canvas.Children>
|
||||||
|
<Rectangle Canvas.Left="5" Canvas.Top="3" Width="22" Height="26" Fill="LightGray" Stroke ="Black"/>
|
||||||
|
<Rectangle Canvas.Left="8" Canvas.Top="6" Width="16" Height="20" Fill="LightGray" Stroke ="Black" RadiusX="2" RadiusY="2"/>
|
||||||
|
<Ellipse Canvas.Left="10" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
|
||||||
|
<Ellipse Canvas.Left="18" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
|
||||||
|
</Canvas.Children>
|
||||||
|
</Canvas>
|
||||||
|
</DataTemplate>
|
||||||
<DataTemplate x:Key="ShowRebarsResult">
|
<DataTemplate x:Key="ShowRebarsResult">
|
||||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
<Canvas.Children>
|
<Canvas.Children>
|
||||||
@@ -627,6 +660,30 @@
|
|||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="StirrupDensity">
|
||||||
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
|
<Canvas.Children>
|
||||||
|
<Line X1="2" Y1="8" X2="30" Y2="8" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="2" Y1="24" X2="30" Y2="24" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="4" Y1="6" X2="4" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
<TextBlock Margin="7,9" Text="Den" FontWeight="Bold" FontSize="10" Background="White"/>
|
||||||
|
<Line X1="28" Y1="6" X2="28" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
</Canvas.Children>
|
||||||
|
</Canvas>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="StirrupRebars">
|
||||||
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
|
<Canvas.Children>
|
||||||
|
<Line X1="2" Y1="8" X2="30" Y2="8" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="2" Y1="24" X2="30" Y2="24" Stroke="Black" StrokeThickness="1"/>
|
||||||
|
<Line X1="4" Y1="6" X2="4" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
<Line X1="10" Y1="6" X2="10" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
<Line X1="16" Y1="6" X2="16" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
<Line X1="22" Y1="6" X2="22" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
<Line X1="28" Y1="6" X2="28" Y2="26" Stroke="Black" StrokeThickness="0.6"/>
|
||||||
|
</Canvas.Children>
|
||||||
|
</Canvas>
|
||||||
|
</DataTemplate>
|
||||||
<DataTemplate x:Key="StraightArrow">
|
<DataTemplate x:Key="StraightArrow">
|
||||||
<Path Margin="4" Data="M 5 13 l 0 -4 l 10 0 l 0 -3 l 5 5 l -5 5 l 0 -3 z" Fill="White" Stroke="Black"/>
|
<Path Margin="4" Data="M 5 13 l 0 -4 l 10 0 l 0 -3 l 5 5 l -5 5 l 0 -3 z" Fill="White" Stroke="Black"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<ContextMenu x:Key="EditCopyDelete">
|
||||||
|
<MenuItem Header="Edit" Command="{Binding Edit}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="Copy" Command="{Binding Copy}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="Delete" Command="{Binding Delete}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</ContextMenu>
|
||||||
|
<ContextMenu x:Key="AnalisesCRUD">
|
||||||
|
<MenuItem Header="Run" Command="{Binding Run}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Viewbox Width="16" Height="16">
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource CalculatorRun}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<Separator/>
|
||||||
|
<MenuItem Header="Edit" Command="{Binding Edit}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="Copy" Command="{Binding Copy}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="Delete" Command="{Binding Delete}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</ContextMenu>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -12,6 +12,9 @@
|
|||||||
<Compile Update="Windows\Arrays\ArrayView.xaml.cs">
|
<Compile Update="Windows\Arrays\ArrayView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="Windows\BeamShears\BeamShearView.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml.cs">
|
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -107,6 +110,9 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Page Update="Infrastructure\UI\Resources\ContextMenus.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="Infrastructure\UI\Resources\Cracks.xaml">
|
<Page Update="Infrastructure\UI\Resources\Cracks.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -134,6 +140,9 @@
|
|||||||
<Page Update="Windows\Arrays\ArrayView.xaml">
|
<Page Update="Windows\Arrays\ArrayView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="Windows\BeamShears\BeamShearView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml">
|
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearActionsViewModel : SelectItemVM<IBeamShearAction>
|
||||||
|
{
|
||||||
|
private readonly IBeamShearRepository shearRepository;
|
||||||
|
|
||||||
|
public BeamShearActionsViewModel(IBeamShearRepository shearRepository) : base(shearRepository.BeamShearActions)
|
||||||
|
{
|
||||||
|
this.shearRepository = shearRepository;
|
||||||
|
}
|
||||||
|
public override void DeleteMethod(object parameter)
|
||||||
|
{
|
||||||
|
shearRepository.DeleteAction(SelectedItem);
|
||||||
|
base.DeleteMethod(parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearCalculatorViewModel : OkCancelViewModelBase
|
||||||
|
{
|
||||||
|
private IBeamShearCalculator calculator;
|
||||||
|
public BeamShearCalculatorViewModel(IBeamShearCalculator calculator)
|
||||||
|
{
|
||||||
|
this.calculator = calculator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using StructureHelper.Infrastructure.Enums;
|
||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelper.Windows.ViewModels.Errors;
|
||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearCalculatorsViewModel : SelectItemVM<ICalculator>
|
||||||
|
{
|
||||||
|
private object parameter;
|
||||||
|
private readonly IBeamShearRepository shearRepository;
|
||||||
|
private RelayCommand runCommand;
|
||||||
|
|
||||||
|
public ICommand Run
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return runCommand ??
|
||||||
|
(
|
||||||
|
runCommand = new RelayCommand(param =>
|
||||||
|
{
|
||||||
|
RunMethod(param);
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddMethod(object parameter)
|
||||||
|
{
|
||||||
|
this.parameter = parameter;
|
||||||
|
SafetyProcessor.RunSafeProcess(AddCalculator, "Error of creating calculator");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override void EditMethod(object parameter)
|
||||||
|
{
|
||||||
|
SafetyProcessor.RunSafeProcess(EditCalculator, $"Error of calculator {SelectedItem.Name}");
|
||||||
|
base.EditMethod(parameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeamShearCalculatorsViewModel(IBeamShearRepository shearRepository) : base(shearRepository.Calculators)
|
||||||
|
{
|
||||||
|
this.shearRepository = shearRepository;
|
||||||
|
}
|
||||||
|
private void AddCalculator()
|
||||||
|
{
|
||||||
|
if (parameter is CalculatorTypes.BeamShearCalculator)
|
||||||
|
{
|
||||||
|
NewItem = new BeamShearCalculator(Guid.NewGuid())
|
||||||
|
{
|
||||||
|
Name = "New shear calculator",
|
||||||
|
TraceLogger = new ShiftTraceLogger()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(parameter));
|
||||||
|
}
|
||||||
|
base.AddMethod(parameter);
|
||||||
|
}
|
||||||
|
private void EditCalculator()
|
||||||
|
{
|
||||||
|
if (SelectedItem is IBeamShearCalculator beamShearCalculator)
|
||||||
|
{
|
||||||
|
//to do
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(SelectedItem));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void RunMethod(object param)
|
||||||
|
{
|
||||||
|
SafetyProcessor.RunSafeProcess(RunCalculator, $"Error of calculator {SelectedItem.Name}");
|
||||||
|
}
|
||||||
|
private void RunCalculator()
|
||||||
|
{
|
||||||
|
if (SelectedItem is IBeamShearCalculator beamShearCalculator)
|
||||||
|
{
|
||||||
|
beamShearCalculator.Run();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(SelectedItem));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearSectionsViewModel : SelectItemVM<IBeamShearSection>
|
||||||
|
{
|
||||||
|
IBeamShearRepository shearRepository;
|
||||||
|
public BeamShearSectionsViewModel(IBeamShearRepository shearRepository) : base(shearRepository.ShearSections)
|
||||||
|
{
|
||||||
|
this.shearRepository = shearRepository;
|
||||||
|
}
|
||||||
|
public override void DeleteMethod(object parameter)
|
||||||
|
{
|
||||||
|
shearRepository.DeleteSection(SelectedItem);
|
||||||
|
base.DeleteMethod(parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
169
StructureHelper/Windows/BeamShears/BeamShearView.xaml
Normal file
169
StructureHelper/Windows/BeamShears/BeamShearView.xaml
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.BeamShears.BeamShearView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||||
|
xmlns:local="clr-namespace:StructureHelper.Windows.BeamShears"
|
||||||
|
xmlns:enums="clr-namespace:StructureHelper.Infrastructure.Enums"
|
||||||
|
d:DataContext="{d:DesignInstance local:BeamShearViewModel}"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Beam Shear Analysis" Height="450" Width="800" MinHeight="250" MinWidth="400" MaxHeight="1000" MaxWidth="1500" WindowStartupLocation="CenterScreen">
|
||||||
|
<DockPanel>
|
||||||
|
<ToolBarTray DockPanel.Dock="Top">
|
||||||
|
<ToolBar ToolTip="Actions">
|
||||||
|
<Button Style="{StaticResource ToolButton}"
|
||||||
|
Command="{Binding FileOpen}">
|
||||||
|
<Button.ToolTip>
|
||||||
|
<uc:ButtonToolTipEh HeaderText="Shear action"
|
||||||
|
IconContent="{StaticResource DistributedLoad}"
|
||||||
|
DescriptionText="Add beam shear action"/>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource DistributedLoad}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
<ToolBar ToolTip="Sections">
|
||||||
|
<Button Style="{StaticResource ToolButton}"
|
||||||
|
Command="{Binding FileOpen}">
|
||||||
|
<Button.ToolTip>
|
||||||
|
<uc:ButtonToolTipEh HeaderText="Rectangle section"
|
||||||
|
IconContent="{StaticResource ShearRectangleSection}"
|
||||||
|
DescriptionText="Add rectangle shear section (height, width, strength)"/>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource ShearRectangleSection}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
<ToolBar ToolTip="Stirrups" DataContext="{Binding Stirrups}">
|
||||||
|
<Button Style="{StaticResource ToolButton}"
|
||||||
|
Command="{Binding Add}"
|
||||||
|
CommandParameter="{x:Static enums:StirrupTypes.Density}">
|
||||||
|
<Button.ToolTip>
|
||||||
|
<uc:ButtonToolTipEh HeaderText="Add stirrups by density"
|
||||||
|
IconContent="{StaticResource StirrupDensity}"
|
||||||
|
DescriptionText="Add uniformly distributed stirrups by value of density"/>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource StirrupDensity}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
<Button Style="{StaticResource ToolButton}"
|
||||||
|
Command="{Binding Add}"
|
||||||
|
CommandParameter="{x:Static enums:StirrupTypes.UniformRebar}">
|
||||||
|
<Button.ToolTip>
|
||||||
|
<uc:ButtonToolTipEh HeaderText="Open file"
|
||||||
|
IconContent="{StaticResource StirrupRebars}"
|
||||||
|
DescriptionText="Add uniformly distributed stirrups by rebars (step, diameter, strength)"/>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource StirrupRebars}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
<ToolBar ToolTip="Calculators">
|
||||||
|
<Button Style="{StaticResource ToolButton}"
|
||||||
|
Command="{Binding FileOpen}">
|
||||||
|
<Button.ToolTip>
|
||||||
|
<uc:ButtonToolTipEh HeaderText="Open file"
|
||||||
|
IconContent="{StaticResource FileOpen}"
|
||||||
|
DescriptionText="Open exsisting project from file"/>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource FileOpen}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
<ToolBar ToolTip="Templates">
|
||||||
|
<Button Style="{StaticResource ToolButton}"
|
||||||
|
Command="{Binding AddTemplate}">
|
||||||
|
<Button.ToolTip>
|
||||||
|
<uc:ButtonToolTipEh HeaderText="Open file"
|
||||||
|
IconContent="{StaticResource ShearSectionTemplate}"
|
||||||
|
DescriptionText="Create rectangle section by template"/>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource ShearSectionTemplate}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
</ToolBarTray>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="0"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel>
|
||||||
|
<Expander Header="Actions" DataContext="{Binding Actions}">
|
||||||
|
|
||||||
|
</Expander>
|
||||||
|
<Expander Header="Cross-Sections" DataContext="{Binding Sections}">
|
||||||
|
|
||||||
|
</Expander>
|
||||||
|
<Expander Header="Stirrups" DataContext="{Binding Stirrups}">
|
||||||
|
<Expander.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="Add">
|
||||||
|
<MenuItem Header="Uniformly distributed density" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.Density}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Viewbox Height="24" Width="24">
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource StirrupDensity}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="Uniformly distributed rebars" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.UniformRebar}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Viewbox Height="24" Width="24">
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource StirrupRebars}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</MenuItem>
|
||||||
|
</ContextMenu>
|
||||||
|
</Expander.ContextMenu>
|
||||||
|
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ContextMenu="{StaticResource EditCopyDelete}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Text="{Binding Name}"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
</Expander>
|
||||||
|
<Expander Header="Calculators" DataContext="{Binding Calculators}">
|
||||||
|
<Expander.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="Add">
|
||||||
|
<MenuItem Header="Beam Shear Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.BeamShearCalculator}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</MenuItem>
|
||||||
|
</ContextMenu>
|
||||||
|
</Expander.ContextMenu>
|
||||||
|
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ContextMenu="{StaticResource AnalisesCRUD}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Text="{Binding Name}"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
</Expander>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
||||||
31
StructureHelper/Windows/BeamShears/BeamShearView.xaml.cs
Normal file
31
StructureHelper/Windows/BeamShears/BeamShearView.xaml.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using StructureHelperLogics.Models.Analyses;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for BeamShearView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class BeamShearView : Window
|
||||||
|
{
|
||||||
|
private BeamShearViewModel viewModel;
|
||||||
|
public BeamShearView(BeamShearViewModel viewModel)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.viewModel = viewModel;
|
||||||
|
this.DataContext = this.viewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
70
StructureHelper/Windows/BeamShears/BeamShearViewModel.cs
Normal file
70
StructureHelper/Windows/BeamShears/BeamShearViewModel.cs
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using StructureHelperLogics.Models.Analyses;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private IBeamShear beamShear;
|
||||||
|
private IBeamShearRepository repository;
|
||||||
|
private RelayCommand addTemplateCommand;
|
||||||
|
|
||||||
|
public BeamShearActionsViewModel Actions {get; private set;}
|
||||||
|
public BeamShearSectionsViewModel Sections { get; private set; }
|
||||||
|
public BeamStirrupsViewModel Stirrups { get; private set; }
|
||||||
|
public BeamShearCalculatorsViewModel Calculators { get; private set; }
|
||||||
|
|
||||||
|
public ICommand AddTemplate
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return addTemplateCommand ??
|
||||||
|
(
|
||||||
|
addTemplateCommand = new RelayCommand(param =>
|
||||||
|
{
|
||||||
|
AddTemplateMethod(param);
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddTemplateMethod(object param)
|
||||||
|
{
|
||||||
|
var templateRepository = BeamShearTemplatesFactory.GetTemplateRepository(ShearSectionTemplateTypes.Rectangle);
|
||||||
|
var updateStrategy = new BeamShearRepositoryAddUpdateStrategy();
|
||||||
|
updateStrategy.Update(repository, templateRepository);
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Refresh()
|
||||||
|
{
|
||||||
|
Actions.Refresh();
|
||||||
|
Sections.Refresh();
|
||||||
|
Stirrups.Refresh();
|
||||||
|
Calculators.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeamShearViewModel(IBeamShear beamShear)
|
||||||
|
{
|
||||||
|
this.beamShear = beamShear;
|
||||||
|
repository = beamShear.Repository;
|
||||||
|
InitializeSubModels();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeSubModels()
|
||||||
|
{
|
||||||
|
Actions = new (repository);
|
||||||
|
Sections = new (repository);
|
||||||
|
Stirrups = new (repository);
|
||||||
|
Calculators = new (repository);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
StructureHelper/Windows/BeamShears/BeamStirrupsViewModel.cs
Normal file
25
StructureHelper/Windows/BeamShears/BeamStirrupsViewModel.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamStirrupsViewModel : SelectItemVM<IStirrup>
|
||||||
|
{
|
||||||
|
private readonly IBeamShearRepository shearRepository;
|
||||||
|
|
||||||
|
public BeamStirrupsViewModel(IBeamShearRepository shearRepository) : base(shearRepository.Stirrups)
|
||||||
|
{
|
||||||
|
this.shearRepository = shearRepository;
|
||||||
|
}
|
||||||
|
public override void DeleteMethod(object parameter)
|
||||||
|
{
|
||||||
|
shearRepository.DeleteStirrup(SelectedItem);
|
||||||
|
base.DeleteMethod(parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
|
using StructureHelper.Windows.BeamShears;
|
||||||
using StructureHelper.Windows.MainWindow.Analyses;
|
using StructureHelper.Windows.MainWindow.Analyses;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
@@ -7,6 +8,7 @@ using StructureHelperCommon.Infrastructures.Settings;
|
|||||||
using StructureHelperCommon.Models.Analyses;
|
using StructureHelperCommon.Models.Analyses;
|
||||||
using StructureHelperLogic.Models.Analyses;
|
using StructureHelperLogic.Models.Analyses;
|
||||||
using StructureHelperLogics.Models.Analyses;
|
using StructureHelperLogics.Models.Analyses;
|
||||||
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -220,12 +222,23 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
ProcessCrossSection(crossSection);
|
ProcessCrossSection(crossSection);
|
||||||
}
|
}
|
||||||
|
else if (version.AnalysisVersion is IBeamShear beamShear)
|
||||||
|
{
|
||||||
|
ProcessBeamShear(beamShear);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(version));
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(version));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ProcessBeamShear(IBeamShear beamShear)
|
||||||
|
{
|
||||||
|
BeamShearViewModel viewModel = new BeamShearViewModel(beamShear);
|
||||||
|
var window = new BeamShearView(viewModel);
|
||||||
|
window.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
private void ProcessCrossSection(ICrossSection crossSection)
|
private void ProcessCrossSection(ICrossSection crossSection)
|
||||||
{
|
{
|
||||||
var window = new CrossSectionView(crossSection);
|
var window = new CrossSectionView(crossSection);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance local:CrossSectionViewModel}"
|
d:DataContext="{d:DesignInstance local:CrossSectionViewModel}"
|
||||||
Title="StructureHelper" Height="700" Width="1000" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
Title="Cross-Section NDM Analysis" Height="700" Width="1000" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
|
<DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
|
||||||
<dataTemplates:RectangleTemplate/>
|
<dataTemplates:RectangleTemplate/>
|
||||||
@@ -27,48 +27,6 @@
|
|||||||
<dataTemplates:EllipseTemplate/>
|
<dataTemplates:EllipseTemplate/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
<ContextMenu x:Key="EditCopyDelete">
|
|
||||||
<MenuItem Header="Edit" Command="{Binding Edit}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem Header="Copy" Command="{Binding Copy}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem Header="Delete" Command="{Binding Delete}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
</ContextMenu>
|
|
||||||
<ContextMenu x:Key="AnalisesCRUD">
|
|
||||||
<MenuItem Header="Run" Command="{Binding Run}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Viewbox Width="16" Height="16">
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource CalculatorRun}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
<Separator/>
|
|
||||||
<MenuItem Header="Edit" Command="{Binding Edit}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem Header="Copy" Command="{Binding Copy}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem Header="Delete" Command="{Binding Delete}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
</ContextMenu>
|
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<ToolBarTray DockPanel.Dock="Top">
|
<ToolBarTray DockPanel.Dock="Top">
|
||||||
@@ -287,7 +245,7 @@
|
|||||||
</Expander.Header>
|
</Expander.Header>
|
||||||
<Expander.ContextMenu>
|
<Expander.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="Add" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
<MenuItem Header="Add">
|
||||||
<MenuItem Header="Add Force Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
<MenuItem Header="Add Force Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.ViewModels.Materials;
|
using StructureHelper.Windows.ViewModels.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using StructureHelper.Infrastructure;
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.AddMaterialWindow;
|
using StructureHelper.Windows.AddMaterialWindow;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using StructureHelper.Windows.MainWindow;
|
|||||||
using StructureHelper.Windows.MainWindow.Materials;
|
using StructureHelper.Windows.MainWindow.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Models.Codes;
|
using StructureHelperCommon.Models.Codes;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
|
|||||||
public interface IHasBeamShearActions
|
public interface IHasBeamShearActions
|
||||||
{
|
{
|
||||||
List<IBeamShearAction> BeamShearActions { get; }
|
List<IBeamShearAction> BeamShearActions { get; }
|
||||||
|
void DeleteAction(IBeamShearAction action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials
|
||||||
|
{
|
||||||
|
public interface IDirectMaterialStrength
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperCommon.Models.Materials
|
||||||
{
|
{
|
||||||
public interface IHasSafetyFactors
|
public interface IHasSafetyFactors
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using LoaderCalculator.Data.Materials;
|
using LoaderCalculator.Data.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperCommon.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
using LoaderCalculator.Data.Materials;
|
using LoaderCalculator.Data.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperCommon.Models.Materials
|
||||||
{
|
{
|
||||||
public interface IHelperMaterial : ISaveable, ICloneable, IHasSafetyFactors
|
public interface IHelperMaterial : ISaveable, ICloneable, IHasSafetyFactors
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
|
//All rights reserved.
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials
|
||||||
{
|
{
|
||||||
public interface ILibMaterial : IHelperMaterial
|
/// <summary>
|
||||||
|
/// Implements logic for library material
|
||||||
|
/// </summary>
|
||||||
|
public interface ILibMaterial : IHelperMaterial, IMaterialStrength
|
||||||
{
|
{
|
||||||
ILibMaterialEntity MaterialEntity { get; set; }
|
ILibMaterialEntity MaterialEntity { get; set; }
|
||||||
IMaterialLogic MaterialLogic { get; set; }
|
IMaterialLogic MaterialLogic { get; set; }
|
||||||
List<IMaterialLogic> MaterialLogics { get; }
|
List<IMaterialLogic> MaterialLogics { get; }
|
||||||
(double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials
|
||||||
|
{
|
||||||
|
public interface IMaterialStrength
|
||||||
|
{
|
||||||
|
(double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials
|
||||||
|
{
|
||||||
|
public interface IMaterialStrengthByLibMaterial : ISaveable, ICloneable, IMaterialStrength
|
||||||
|
{
|
||||||
|
ILibMaterial LibMaterial { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials
|
||||||
|
{
|
||||||
|
public class MaterialStrengthByLibMaterial : IMaterialStrengthByLibMaterial
|
||||||
|
{
|
||||||
|
public Guid Id { get; }
|
||||||
|
public ILibMaterial LibMaterial { get; }
|
||||||
|
|
||||||
|
public MaterialStrengthByLibMaterial(Guid id, ILibMaterial libMaterial)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
LibMaterial = libMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
|
||||||
|
{
|
||||||
|
return LibMaterial.GetStrength(limitState, calcTerm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,4 +20,8 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Models\BeamShears\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
internal class BeamShearCalculator : IBeamShearCalculator
|
public class BeamShearCalculator : IBeamShearCalculator
|
||||||
{
|
{
|
||||||
private ICheckInputDataLogic<IBeamShearCalculatorInputData> checkInputDataLogic;
|
private ICheckInputDataLogic<IBeamShearCalculatorInputData> checkInputDataLogic;
|
||||||
IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> calculationLogic;
|
private IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> calculationLogic;
|
||||||
private IBeamShearCalculatorResult result;
|
private IBeamShearCalculatorResult result;
|
||||||
|
|
||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
@@ -23,6 +23,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
|
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
public BeamShearCalculator(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,5 +26,19 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
Id = id;
|
Id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteAction(IBeamShearAction action)
|
||||||
|
{
|
||||||
|
//nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteSection(IBeamShearSection section)
|
||||||
|
{
|
||||||
|
//nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteStirrup(IStirrup stirrup)
|
||||||
|
{
|
||||||
|
//nothing to do
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -13,7 +14,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
|
|
||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
|
|
||||||
public List<IBeamShearAction> BeamShearActions {get;}
|
public List<IBeamShearAction> BeamShearActions { get; } = new();
|
||||||
|
|
||||||
public List<ICalculator> Calculators { get; } = new();
|
public List<ICalculator> Calculators { get; } = new();
|
||||||
|
|
||||||
@@ -44,5 +45,48 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteSection(IBeamShearSection section)
|
||||||
|
{
|
||||||
|
foreach (var calculator in Calculators)
|
||||||
|
{
|
||||||
|
if (calculator is IBeamShearCalculator beamShearCalculator)
|
||||||
|
{
|
||||||
|
if (beamShearCalculator.InputData.ShearSections.Contains(section))
|
||||||
|
{
|
||||||
|
beamShearCalculator.InputData.DeleteSection(section);
|
||||||
|
beamShearCalculator.InputData.ShearSections.Remove(section);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void DeleteAction(IBeamShearAction action)
|
||||||
|
{
|
||||||
|
foreach (var calculator in Calculators)
|
||||||
|
{
|
||||||
|
if (calculator is IBeamShearCalculator beamShearCalculator)
|
||||||
|
{
|
||||||
|
if (beamShearCalculator.InputData.BeamShearActions.Contains(action))
|
||||||
|
{
|
||||||
|
beamShearCalculator.InputData.DeleteAction(action);
|
||||||
|
beamShearCalculator.InputData.BeamShearActions.Remove(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void DeleteStirrup(IStirrup stirrup)
|
||||||
|
{
|
||||||
|
foreach (var calculator in Calculators)
|
||||||
|
{
|
||||||
|
if (calculator is IBeamShearCalculator beamShearCalculator)
|
||||||
|
{
|
||||||
|
if (beamShearCalculator.InputData.Stirrups.Contains(stirrup))
|
||||||
|
{
|
||||||
|
beamShearCalculator.InputData.DeleteStirrup(stirrup);
|
||||||
|
beamShearCalculator.InputData.Stirrups.Remove(stirrup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Materials;
|
||||||
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
@@ -12,16 +8,17 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public IConcreteLibMaterial Material { get; set; }
|
/// <inheritdoc/>
|
||||||
|
public IMaterialStrength MaterialStrength { get; } = new MaterialStrengthByLibMaterial(Guid.NewGuid(), new ConcreteLibMaterial(Guid.NewGuid()));
|
||||||
public IShape Shape { get; }
|
/// <inheritdoc/>
|
||||||
|
public IShape Shape { get; } = new RectangleShape(Guid.NewGuid()) { Height = 0.6, Width = 0.4};
|
||||||
|
|
||||||
public double CenterCover { get; set; }
|
public double CenterCover { get; set; }
|
||||||
|
|
||||||
public BeamShearSection(Guid id, IShape shape)
|
|
||||||
|
public BeamShearSection(Guid id)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Shape = shape;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public enum ShearSectionTemplateTypes
|
||||||
|
{
|
||||||
|
Rectangle,
|
||||||
|
}
|
||||||
|
public static class BeamShearTemplatesFactory
|
||||||
|
{
|
||||||
|
public static IBeamShearRepository GetTemplateRepository(ShearSectionTemplateTypes templateType)
|
||||||
|
{
|
||||||
|
if (templateType is ShearSectionTemplateTypes.Rectangle)
|
||||||
|
{
|
||||||
|
return GetRectangleSection();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(templateType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IBeamShearRepository GetRectangleSection()
|
||||||
|
{
|
||||||
|
BeamShearRepository shearRepository = new(Guid.Empty);
|
||||||
|
BeamShearSection section = new(Guid.Empty) { Name = "New shear section"};
|
||||||
|
shearRepository.ShearSections.Add(section);
|
||||||
|
StirrupByUniformRebar stirrupByUniformRebar = new(Guid.Empty) { Name = "New uniform stirrup"};
|
||||||
|
shearRepository.Stirrups.Add(stirrupByUniformRebar);
|
||||||
|
BeamShearCalculator beamShearCalculator = new(Guid.Empty) { Name = "New shear calculator"};
|
||||||
|
beamShearCalculator.InputData.ShearSections.Add(section);
|
||||||
|
beamShearCalculator.InputData.Stirrups.Add(stirrupByUniformRebar);
|
||||||
|
shearRepository.Calculators.Add(beamShearCalculator);
|
||||||
|
return shearRepository;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
@@ -18,11 +19,11 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Concrete of cross-section
|
/// Concrete of cross-section
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IConcreteLibMaterial Material { get; set; }
|
IMaterialStrength MaterialStrength { get;}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shape of cross-section
|
/// Shape of cross-section
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IShape Shape {get;}
|
IShape Shape { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Distance from edge of tension zone to center of the nearest reinforcement bar
|
/// Distance from edge of tension zone to center of the nearest reinforcement bar
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
public interface IHasBeamShearSections
|
public interface IHasBeamShearSections
|
||||||
{
|
{
|
||||||
List<IBeamShearSection> ShearSections { get; }
|
List<IBeamShearSection> ShearSections { get; }
|
||||||
|
void DeleteSection(IBeamShearSection section);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
public interface IHasStirrups
|
public interface IHasStirrups
|
||||||
{
|
{
|
||||||
List<IStirrup> Stirrups { get; }
|
List<IStirrup> Stirrups { get; }
|
||||||
|
void DeleteStirrup(IStirrup stirrup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearRepositoryAddUpdateStrategy : IUpdateStrategy<IBeamShearRepository>
|
||||||
|
{
|
||||||
|
public void Update(IBeamShearRepository targetObject, IBeamShearRepository sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||||
|
targetObject.BeamShearActions.AddRange(sourceObject.BeamShearActions);
|
||||||
|
targetObject.ShearSections.AddRange(sourceObject.ShearSections);
|
||||||
|
targetObject.Stirrups.AddRange(sourceObject.Stirrups);
|
||||||
|
targetObject.Calculators.AddRange(sourceObject.Calculators);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
|
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IReinforcementLibMaterial Material { get; set; }
|
public IReinforcementLibMaterial Material { get; set; }
|
||||||
@@ -24,6 +25,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public double CompressedGap { get; set; } = 0;
|
public double CompressedGap { get; set; } = 0;
|
||||||
|
|
||||||
|
public StirrupByUniformRebar(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
using System;
|
using LoaderCalculator.Data.Materials;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using LoaderCalculator.Data.Materials;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace StructureHelper.Models.Materials
|
namespace StructureHelper.Models.Materials
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,8 +6,16 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
|
||||||
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
|
//All rights reserved.
|
||||||
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Implements logic for library concrete material
|
||||||
|
/// </summary>
|
||||||
public interface IConcreteLibMaterial : ILibMaterial, ICrackedMaterial
|
public interface IConcreteLibMaterial : ILibMaterial, ICrackedMaterial
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials;
|
||||||
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using StructureHelperCommon.Models.Materials;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using StructureHelperLogics.Models.Materials.Logics;
|
using StructureHelperLogics.Models.Materials.Logics;
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
using System.Linq;
|
//All rights reserved.
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
using System.Linq;
|
//All rights reserved.
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
using LoaderCalculator.Data.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Models.Materials;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Models.Tables;
|
using StructureHelperCommon.Models.Tables;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
using System.Collections.Generic;
|
//All rights reserved.
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
|
||||||
namespace StructureHelperTests.UnitTests.MaterialTests
|
namespace StructureHelperTests.UnitTests.MaterialTests
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using StructureHelper.Models.Materials;
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
Reference in New Issue
Block a user