Add beam shear action view
This commit is contained in:
15
StructureHelper/Infrastructure/Enums/LoadTypes.cs
Normal file
15
StructureHelper/Infrastructure/Enums/LoadTypes.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Infrastructure.Enums
|
||||
{
|
||||
public enum LoadTypes
|
||||
{
|
||||
ConcentratedForce,
|
||||
DistributetLoad,
|
||||
ConcentratedMoment
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.Converters.Units
|
||||
{
|
||||
internal class DistributedLoad : UnitBase
|
||||
{
|
||||
public override UnitTypes UnitType { get => UnitTypes.DistributedLoad; }
|
||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "kN/m"); }
|
||||
public override string UnitName { get => "DistributedLoad"; }
|
||||
}
|
||||
}
|
||||
@@ -197,6 +197,17 @@
|
||||
</Canvas.Children>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="ConcentratedForce">
|
||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||
<Canvas.Children>
|
||||
<Line X1="16" Y1="4" X2="16" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||
<Line X1="10" Y1="12" X2="16" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||
<Line X1="22" Y1="12" X2="16" Y2="20" Stroke="Black" StrokeThickness="1"/>
|
||||
<Line X1="2" Y1="20" X2="30" Y2="20" Stroke="Black" StrokeThickness="2"/>
|
||||
<Ellipse Canvas.Left="13" Canvas.Top="17" Height="6" Width="6" Stroke="Black" StrokeThickness="1" Fill="White"/>
|
||||
</Canvas.Children>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="CrackCalculator">
|
||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
||||
<Canvas.Children>
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
<convertersUnits:Stress x:Key="StressConverter"/>
|
||||
<convertersUnits:Curvature x:Key="Curvature"/>
|
||||
<convertersUnits:CrackWidth x:Key="CrackWidth"/>
|
||||
<convertersUnits:DistributedLoad x:Key="DistributedLoadConverter"/>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</ResourceDictionary>
|
||||
@@ -21,7 +21,7 @@
|
||||
<Compile Update="Windows\BeamShears\ConcentratedForceView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\BeamShears\UniformDistributedLoadView.xaml.cs">
|
||||
<Compile Update="Windows\BeamShears\DistributedLoadView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml.cs">
|
||||
@@ -158,7 +158,7 @@
|
||||
<Page Update="Windows\BeamShears\ConcentratedForceView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\BeamShears\UniformDistributedLoadView.xaml">
|
||||
<Page Update="Windows\BeamShears\DistributedLoadView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml">
|
||||
|
||||
@@ -4,10 +4,118 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.BeamShears"
|
||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
xmlns:enums="clr-namespace:StructureHelper.Infrastructure.Enums"
|
||||
d:DataContext="{d:DesignInstance local:BeamShearActionViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="BeamShearActionView" Height="450" Width="800" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||
Title="Shear Action" Height="300" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Name"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding Name}"/>
|
||||
</Grid>
|
||||
<TabControl Grid.Row="1" DataContext="{Binding YAxisAction}">
|
||||
<TabItem Header="Support">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Shear force at support"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding SupportShearForce, Converter={StaticResource ForceConverter}}"/>
|
||||
</Grid>
|
||||
<uc:FactoredCombination Grid.Row="1" DataContext="{Binding CombinationProperty}"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem DataContext="{Binding ShearLoads}" Header="Span loads">
|
||||
<DockPanel>
|
||||
<ToolBarTray DockPanel.Dock="Top">
|
||||
<ToolBar>
|
||||
<Button Style="{StaticResource ToolButton24}"
|
||||
Command="{Binding Add}" CommandParameter="{x:Static enums:LoadTypes.DistributetLoad}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Add distributed load"
|
||||
IconContent="{StaticResource DistributedLoad}"
|
||||
DescriptionText="Add new uniformly distributed load as span load"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox Height="24" Width="24">
|
||||
<ContentControl ContentTemplate="{DynamicResource DistributedLoad}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton24}"
|
||||
Command="{Binding Add}" CommandParameter="{x:Static enums:LoadTypes.ConcentratedForce}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Add concentrated force"
|
||||
IconContent="{StaticResource ConcentratedForce}"
|
||||
DescriptionText="Add concentrated force as span load"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox Height="24" Width="24">
|
||||
<ContentControl ContentTemplate="{DynamicResource ConcentratedForce}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton24}" Command="{Binding Delete}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Delete span load"
|
||||
IconContent="{StaticResource DeleteEntity }"
|
||||
DescriptionText="Deletes selected span load"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox Height="24" Width="24">
|
||||
<ContentControl ContentTemplate="{DynamicResource DeleteEntity}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton24}"
|
||||
Command="{Binding Edit}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Edit"
|
||||
IconContent="{StaticResource Settings}"
|
||||
DescriptionText="Edit selected span load"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox Height="24" Width="24">
|
||||
<ContentControl ContentTemplate="{DynamicResource Settings}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
</ToolBarTray>
|
||||
<ListBox
|
||||
ItemsSource="{Binding Items}"
|
||||
SelectedItem="{Binding SelectedItem}"
|
||||
ContextMenu="{StaticResource EditCopyDelete}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
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
|
||||
{
|
||||
@@ -19,9 +8,17 @@ namespace StructureHelper.Windows.BeamShears
|
||||
/// </summary>
|
||||
public partial class BeamShearActionView : Window
|
||||
{
|
||||
public BeamShearActionView()
|
||||
private readonly BeamShearActionViewModel viewModel;
|
||||
public BeamShearActionView(BeamShearActionViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.viewModel = viewModel;
|
||||
this.DataContext = this.viewModel;
|
||||
this.viewModel.ParentWindow = this;
|
||||
}
|
||||
public BeamShearActionView(IBeamShearAction beamShearAction) : this(new BeamShearActionViewModel(beamShearAction))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,22 @@ namespace StructureHelper.Windows.BeamShears
|
||||
public class BeamShearActionViewModel : OkCancelViewModelBase
|
||||
{
|
||||
private readonly IBeamShearAction shearAction;
|
||||
public BeamShearLoadsViewModel ShearLoads { get; private set; }
|
||||
private string name;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => shearAction.Name;
|
||||
set
|
||||
{
|
||||
shearAction.Name = value;
|
||||
}
|
||||
}
|
||||
public BeamShearAxisActionViewModel YAxisAction { get; private set; }
|
||||
|
||||
public BeamShearActionViewModel(IBeamShearAction shearAction)
|
||||
{
|
||||
this.shearAction = shearAction;
|
||||
ShearLoads = new(this.shearAction.YAxisShearAction.ShearLoads);
|
||||
YAxisAction = new(this.shearAction.YAxisShearAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -8,11 +10,30 @@ namespace StructureHelper.Windows.BeamShears
|
||||
public class BeamShearActionsViewModel : SelectItemVM<IBeamShearAction>
|
||||
{
|
||||
private readonly IBeamShearRepository shearRepository;
|
||||
private IUpdateStrategy<IBeamShearAction> updateStrategy;
|
||||
|
||||
public BeamShearActionsViewModel(IBeamShearRepository shearRepository) : base(shearRepository.BeamShearActions)
|
||||
{
|
||||
this.shearRepository = shearRepository;
|
||||
}
|
||||
public override void AddMethod(object parameter)
|
||||
{
|
||||
NewItem = BeamShearActionFactory.GetBeamShearAction(ShearActionTypes.DistributedLoad);
|
||||
base.AddMethod(parameter);
|
||||
}
|
||||
public override void EditMethod(object parameter)
|
||||
{
|
||||
if (SelectedItem is null) { return; }
|
||||
IBeamShearAction temporaryShearAction = SelectedItem.Clone() as IBeamShearAction;
|
||||
var window = new BeamShearActionView(SelectedItem);
|
||||
window.ShowDialog();
|
||||
if (window.DialogResult != true)
|
||||
{
|
||||
updateStrategy ??= new BeamShearActionUpdateStrategy();
|
||||
updateStrategy.Update(SelectedItem, temporaryShearAction);
|
||||
}
|
||||
base.EditMethod(parameter);
|
||||
}
|
||||
public override void DeleteMethod(object parameter)
|
||||
{
|
||||
shearRepository.DeleteAction(SelectedItem);
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.BeamShears
|
||||
{
|
||||
public class BeamShearAxisActionViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IBeamShearAxisAction beamShearAxisAction;
|
||||
|
||||
public double SupportShearForce
|
||||
{
|
||||
get => beamShearAxisAction.SupportShearForce;
|
||||
set
|
||||
{
|
||||
beamShearAxisAction.SupportShearForce = value;
|
||||
}
|
||||
}
|
||||
public FactoredCombinationPropertyVM CombinationProperty { get; }
|
||||
public BeamShearLoadsViewModel ShearLoads { get; }
|
||||
|
||||
public BeamShearAxisActionViewModel(IBeamShearAxisAction beamShearAxisAction)
|
||||
{
|
||||
this.beamShearAxisAction = beamShearAxisAction;
|
||||
CombinationProperty = new(this.beamShearAxisAction.FactoredCombinationProperty);
|
||||
ShearLoads = new(this.beamShearAxisAction.ShearLoads);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,65 @@
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelper.Infrastructure.Enums;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace StructureHelper.Windows.BeamShears
|
||||
{
|
||||
public class BeamShearLoadsViewModel : SelectItemVM<IBeamShearLoad>
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearLoad> updateStrategy;
|
||||
public BeamShearLoadsViewModel(List<IBeamShearLoad> collection) : base(collection)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddMethod(object parameter)
|
||||
{
|
||||
LoadTypes typedParameter = (LoadTypes)parameter;
|
||||
if (typedParameter == LoadTypes.DistributetLoad)
|
||||
{
|
||||
NewItem = BeamShearLoadFactory.GetBeamShearLoad(ShearLoadTypes.DistributedLoad);
|
||||
}
|
||||
else if (typedParameter == LoadTypes.ConcentratedForce)
|
||||
{
|
||||
NewItem = BeamShearLoadFactory.GetBeamShearLoad(ShearLoadTypes.ConcentratedForce);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(parameter));
|
||||
}
|
||||
base.AddMethod(parameter);
|
||||
}
|
||||
public override void EditMethod(object parameter)
|
||||
{
|
||||
if (SelectedItem is null) { return; }
|
||||
Window window;
|
||||
IBeamShearLoad temporaryShearLoad = SelectedItem.Clone() as IBeamShearLoad;
|
||||
if (SelectedItem is IDistributedLoad distributedLoad)
|
||||
{
|
||||
|
||||
window = new DistributedLoadView(distributedLoad);
|
||||
}
|
||||
else if (SelectedItem is IConcentratedForce concentrated)
|
||||
{
|
||||
window = new ConcentratedForceView(concentrated);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(SelectedItem));
|
||||
}
|
||||
window.ShowDialog();
|
||||
if (window.DialogResult != true)
|
||||
{
|
||||
updateStrategy ??= new BeamShearLoadUpdateStrategy();
|
||||
updateStrategy.Update(SelectedItem, temporaryShearLoad);
|
||||
}
|
||||
base.EditMethod(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,10 +103,31 @@
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<Expander Header="Actions" DataContext="{Binding Actions}">
|
||||
|
||||
<Expander.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Add" Command="{Binding Add}"/>
|
||||
</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="Cross-Sections" DataContext="{Binding Sections}">
|
||||
|
||||
<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="Stirrups" DataContext="{Binding Stirrups}">
|
||||
<Expander.ContextMenu>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.BeamShears"
|
||||
d:DataContext="{d:DesignInstance local:ConcentratedForceViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="ConcentratedForceView" Height="200" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
|
||||
Title="ConcentratedForceView" Height="200" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
@@ -22,16 +22,19 @@
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Load value"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding ForceValue}"/>
|
||||
<TextBlock Grid.Row="1" Text="Substract ratio"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding LoadRatio, Converter={StaticResource PlainDouble}}"/>
|
||||
<TextBlock Grid.Row="2" Text="Relative applying level"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding RelativeLevel, Converter={StaticResource LengthConverter}}"/>
|
||||
<TextBlock Grid.Row="3" Text="Force point"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding ForceCoordinate, Converter={StaticResource LengthConverter}}"/>
|
||||
<TextBlock Text="Name"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding Name}"/>
|
||||
<TextBlock Grid.Row="1" Text="Load value"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ForceValue, Converter={StaticResource ForceConverter}}"/>
|
||||
<TextBlock Grid.Row="2" Text="Substract ratio"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding LoadRatio, Converter={StaticResource PlainDouble}}"/>
|
||||
<TextBlock Grid.Row="3" Text="Relative applying level"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding RelativeLevel, Converter={StaticResource PlainDouble}}"/>
|
||||
<TextBlock Grid.Row="4" Text="Force point"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding ForceCoordinate, Converter={StaticResource LengthConverter}}"/>
|
||||
</Grid>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||
</Grid>
|
||||
|
||||
@@ -6,7 +6,14 @@ namespace StructureHelper.Windows.BeamShears
|
||||
public class ConcentratedForceViewModel : OkCancelViewModelBase
|
||||
{
|
||||
private readonly IConcentratedForce concenratedForce;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => concenratedForce.Name;
|
||||
set
|
||||
{
|
||||
concenratedForce.Name = value;
|
||||
}
|
||||
}
|
||||
public double ForceCoordinate
|
||||
{
|
||||
get => concenratedForce.ForceCoordinate;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<Window x:Class="StructureHelper.Windows.BeamShears.UniformDistributedLoadView"
|
||||
<Window x:Class="StructureHelper.Windows.BeamShears.DistributedLoadView"
|
||||
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:local="clr-namespace:StructureHelper.Windows.BeamShears"
|
||||
d:DataContext="{d:DesignInstance local:UniformDistributedLoadViewModel}"
|
||||
d:DataContext="{d:DesignInstance local:DistributedLoadViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Uniformly Distributed Load" Height="200" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
|
||||
Title="Uniformly Distributed Load" Height="250" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
@@ -23,18 +23,21 @@
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Load value"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding LoadValue}"/>
|
||||
<TextBlock Grid.Row="1" Text="Substract ratio"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding LoadRatio, Converter={StaticResource PlainDouble}}"/>
|
||||
<TextBlock Grid.Row="2" Text="Relative applying level"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding RelativeLevel, Converter={StaticResource LengthConverter}}"/>
|
||||
<TextBlock Grid.Row="3" Text="Start point"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter}}"/>
|
||||
<TextBlock Grid.Row="4" Text="End point"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding EndCoordinate, Converter={StaticResource LengthConverter}}"/>
|
||||
<TextBlock Text="Name"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding Name}"/>
|
||||
<TextBlock Grid.Row="1" Text="Load value"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding LoadValue, Converter={StaticResource DistributedLoadConverter}}"/>
|
||||
<TextBlock Grid.Row="2" Text="Substract ratio"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding LoadRatio, Converter={StaticResource PlainDouble}}"/>
|
||||
<TextBlock Grid.Row="3" Text="Relative applying level"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding RelativeLevel, Converter={StaticResource PlainDouble}}"/>
|
||||
<TextBlock Grid.Row="4" Text="Start point"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter}}"/>
|
||||
<TextBlock Grid.Row="5" Text="End point"/>
|
||||
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding EndCoordinate, Converter={StaticResource LengthConverter}}"/>
|
||||
</Grid>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||
</Grid>
|
||||
@@ -0,0 +1,25 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System.Windows;
|
||||
|
||||
namespace StructureHelper.Windows.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for UniformDistributedLoadView.xaml
|
||||
/// </summary>
|
||||
public partial class DistributedLoadView : Window
|
||||
{
|
||||
private readonly DistributedLoadViewModel viewModel;
|
||||
public DistributedLoadView(DistributedLoadViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.viewModel = viewModel;
|
||||
this.DataContext = this.viewModel;
|
||||
this.viewModel.ParentWindow = this;
|
||||
}
|
||||
|
||||
public DistributedLoadView(IDistributedLoad distributedLoad) : this(new DistributedLoadViewModel(distributedLoad))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,18 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.BeamShears
|
||||
{
|
||||
public class UniformDistributedLoadViewModel : OkCancelViewModelBase
|
||||
public class DistributedLoadViewModel : OkCancelViewModelBase
|
||||
{
|
||||
private readonly IDistributedLoad distributedLoad;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => distributedLoad.Name;
|
||||
set
|
||||
{
|
||||
distributedLoad.Name = value;
|
||||
}
|
||||
}
|
||||
public double LoadRatio
|
||||
{
|
||||
get => distributedLoad.LoadRatio;
|
||||
@@ -22,10 +30,10 @@ namespace StructureHelper.Windows.BeamShears
|
||||
}
|
||||
public double LoadValue
|
||||
{
|
||||
get => distributedLoad.LoadValue * -1;
|
||||
get => distributedLoad.LoadValue;
|
||||
set
|
||||
{
|
||||
distributedLoad.LoadValue = value * -1;
|
||||
distributedLoad.LoadValue = value;
|
||||
}
|
||||
}
|
||||
public double RelativeLevel
|
||||
@@ -63,7 +71,7 @@ namespace StructureHelper.Windows.BeamShears
|
||||
}
|
||||
}
|
||||
|
||||
public UniformDistributedLoadViewModel(IDistributedLoad distributedLoad)
|
||||
public DistributedLoadViewModel(IDistributedLoad distributedLoad)
|
||||
{
|
||||
this.distributedLoad = distributedLoad;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
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 UniformDistributedLoadView.xaml
|
||||
/// </summary>
|
||||
public partial class UniformDistributedLoadView : Window
|
||||
{
|
||||
private readonly UniformDistributedLoadViewModel viewModel;
|
||||
public UniformDistributedLoadView(UniformDistributedLoadViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.viewModel = viewModel;
|
||||
this.DataContext = this.viewModel;
|
||||
this.viewModel.ParentWindow = this;
|
||||
}
|
||||
|
||||
public UniformDistributedLoadView(IDistributedLoad distributedLoad) : this(new UniformDistributedLoadViewModel(distributedLoad))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
Stress,
|
||||
Force,
|
||||
Moment,
|
||||
Curvature
|
||||
Curvature,
|
||||
DistributedLoad
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
///<inheritdoc/>
|
||||
public IFactoredCombinationProperty FactoredCombinationProperty { get; } = new FactoredCombinationProperty(Guid.NewGuid());
|
||||
///<inheritdoc/>
|
||||
public List<IBeamShearLoad> ShearLoads { get; }
|
||||
public List<IBeamShearLoad> ShearLoads { get; } = new();
|
||||
|
||||
|
||||
public BeamShearAxisAction(Guid id)
|
||||
@@ -31,6 +31,8 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
public object Clone()
|
||||
{
|
||||
BeamShearAxisAction beamShearAxisAction = new(Guid.NewGuid());
|
||||
updateStrategy ??= new BeamShearAxisActionUpdateStrategy();
|
||||
updateStrategy.Update(beamShearAxisAction, this);
|
||||
return beamShearAxisAction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public enum ShearActionTypes
|
||||
{
|
||||
DistributedLoad
|
||||
}
|
||||
/// <summary>
|
||||
/// Generates beam shear action with default settings
|
||||
/// </summary>
|
||||
public static class BeamShearActionFactory
|
||||
{
|
||||
public static IBeamShearAction GetBeamShearAction(ShearActionTypes actionType)
|
||||
{
|
||||
if (actionType == ShearActionTypes.DistributedLoad)
|
||||
{
|
||||
return GetDistributedLoad();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(actionType));
|
||||
}
|
||||
}
|
||||
|
||||
private static IBeamShearAction GetDistributedLoad()
|
||||
{
|
||||
BeamShearAction beamShearAction = new(Guid.NewGuid())
|
||||
{
|
||||
Name = "Beam shear action"
|
||||
};
|
||||
SetAction(beamShearAction.XAxisShearAction, 0);
|
||||
SetFactors(beamShearAction.XAxisShearAction);
|
||||
beamShearAction.XAxisShearAction.ShearLoads.Clear();
|
||||
|
||||
SetAction(beamShearAction.YAxisShearAction, 1e5);
|
||||
SetFactors(beamShearAction.YAxisShearAction);
|
||||
return beamShearAction;
|
||||
}
|
||||
|
||||
private static void SetAction(IBeamShearAxisAction beamShearAxisAction, double supportForce)
|
||||
{
|
||||
beamShearAxisAction.SupportShearForce = 1e5;
|
||||
IBeamShearLoad distributedLoad = BeamShearLoadFactory.GetBeamShearLoad(ShearLoadTypes.DistributedLoad);
|
||||
beamShearAxisAction.ShearLoads.Add(distributedLoad);
|
||||
}
|
||||
|
||||
private static void SetFactors(IBeamShearAxisAction beamShearAxisAction)
|
||||
{
|
||||
beamShearAxisAction.FactoredCombinationProperty.LimitState = Infrastructures.Enums.LimitStates.ULS;
|
||||
beamShearAxisAction.FactoredCombinationProperty.CalcTerm = Infrastructures.Enums.CalcTerms.ShortTerm;
|
||||
beamShearAxisAction.FactoredCombinationProperty.LongTermFactor = 0.95;
|
||||
beamShearAxisAction.FactoredCombinationProperty.ULSFactor = 1.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public enum ShearLoadTypes
|
||||
{
|
||||
DistributedLoad,
|
||||
ConcentratedForce
|
||||
}
|
||||
public static class BeamShearLoadFactory
|
||||
{
|
||||
public static IBeamShearLoad GetBeamShearLoad(ShearLoadTypes loadType)
|
||||
{
|
||||
if (loadType == ShearLoadTypes.DistributedLoad)
|
||||
{
|
||||
return GetDistributedLoad();
|
||||
}
|
||||
else if (loadType == ShearLoadTypes.ConcentratedForce)
|
||||
{
|
||||
return GetConcentratedForce();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(loadType));
|
||||
}
|
||||
}
|
||||
|
||||
private static ConcentratedForce GetConcentratedForce()
|
||||
{
|
||||
ConcentratedForce concentratedForce = new(Guid.NewGuid())
|
||||
{
|
||||
Name = "Concentrated force",
|
||||
ForceValue = -5e4,
|
||||
LoadRatio = 1,
|
||||
RelativeLoadLevel = 0.5,
|
||||
ForceCoordinate = 1
|
||||
};
|
||||
return concentratedForce;
|
||||
}
|
||||
|
||||
private static DistributedLoad GetDistributedLoad()
|
||||
{
|
||||
DistributedLoad distributedLoad = new(Guid.NewGuid())
|
||||
{
|
||||
Name = "Distributed load",
|
||||
LoadValue = -5e3,
|
||||
LoadRatio = 1,
|
||||
RelativeLoadLevel = 0.5,
|
||||
StartCoordinate = 0,
|
||||
EndCoordinate = 100
|
||||
};
|
||||
return distributedLoad;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ namespace StructureHelperCommon.Services.Units
|
||||
{ UnitTypes.Moment, "kNm"},
|
||||
{ UnitTypes.Stress, "MPa"},
|
||||
{ UnitTypes.Curvature, "1/m"},
|
||||
{ UnitTypes.DistributedLoad, "kN/m" },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,10 @@ namespace StructureHelperCommon.Services.Units
|
||||
units.Add(new Unit() { UnitType = type, Name = "1/m", Multiplyer = 1d });
|
||||
units.Add(new Unit() { UnitType = type, Name = "1/mm", Multiplyer = 1e-3d });
|
||||
units.Add(new Unit() { UnitType = type, Name = "1/cm", Multiplyer = 1e-2d });
|
||||
type = UnitTypes.DistributedLoad;
|
||||
units.Add(new Unit() { UnitType = type, Name = "N/m", Multiplyer = 1d });
|
||||
units.Add(new Unit() { UnitType = type, Name = "kN/m", Multiplyer = 1e-3d });
|
||||
units.Add(new Unit() { UnitType = type, Name = "MN/m", Multiplyer = 1e-6d });
|
||||
return units;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -29,6 +30,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private static IBeamShearRepository GetRectangleSection()
|
||||
{
|
||||
BeamShearRepository shearRepository = new(Guid.Empty);
|
||||
IBeamShearAction shearAction = BeamShearActionFactory.GetBeamShearAction(ShearActionTypes.DistributedLoad);
|
||||
shearAction.Name = "New shear action";
|
||||
shearRepository.BeamShearActions.Add(shearAction);
|
||||
BeamShearSection section = new(Guid.Empty) { Name = "New shear section"};
|
||||
shearRepository.ShearSections.Add(section);
|
||||
StirrupByUniformRebar stirrupByUniformRebar = new(Guid.Empty) { Name = "New uniform stirrup"};
|
||||
|
||||
Reference in New Issue
Block a user