Crack edit window was added
This commit is contained in:
@@ -97,8 +97,12 @@
|
|||||||
<Color x:Key="ButtonLight" A="255" B="255" G="255" R="255"/>
|
<Color x:Key="ButtonLight" A="255" B="255" G="255" R="255"/>
|
||||||
<Color x:Key="CalculatorColor" A="255" B="149" G="149" R="211"/>
|
<Color x:Key="CalculatorColor" A="255" B="149" G="149" R="211"/>
|
||||||
<Color x:Key="CalculatorFrameColor" A="255" B="109" G="109" R="166"/>
|
<Color x:Key="CalculatorFrameColor" A="255" B="109" G="109" R="166"/>
|
||||||
|
<Color x:Key="ResultColor" A="255" B="200" G="200" R="200"/>
|
||||||
|
<Color x:Key="ResultFrameColor" A="255" B="100" G="100" R="100"/>
|
||||||
<SolidColorBrush x:Key="CalculatorCanvas" Color="{DynamicResource CalculatorColor}"/>
|
<SolidColorBrush x:Key="CalculatorCanvas" Color="{DynamicResource CalculatorColor}"/>
|
||||||
<SolidColorBrush x:Key="CalculatorFrame" Color="{DynamicResource CalculatorFrameColor}"/>
|
<SolidColorBrush x:Key="CalculatorFrame" Color="{DynamicResource CalculatorFrameColor}"/>
|
||||||
|
<SolidColorBrush x:Key="ResultCanvas" Color="{DynamicResource ResultColor}"/>
|
||||||
|
<SolidColorBrush x:Key="ResultFrame" Color="{DynamicResource ResultFrameColor}"/>
|
||||||
|
|
||||||
<Style x:Key="ButtonCanvas" TargetType="Canvas">
|
<Style x:Key="ButtonCanvas" TargetType="Canvas">
|
||||||
<Setter Property="Width" Value="32"/>
|
<Setter Property="Width" Value="32"/>
|
||||||
@@ -111,6 +115,10 @@
|
|||||||
<Setter Property="Background" Value="{DynamicResource CalculatorCanvas}"/>
|
<Setter Property="Background" Value="{DynamicResource CalculatorCanvas}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonResultCanvas" TargetType="Canvas" BasedOn="{StaticResource ButtonCanvas}">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ResultCanvas}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="ButtonRect" TargetType="Rectangle">
|
<Style x:Key="ButtonRect" TargetType="Rectangle">
|
||||||
<Setter Property="Margin" Value="3"/>
|
<Setter Property="Margin" Value="3"/>
|
||||||
<Setter Property="Width" Value="26"/>
|
<Setter Property="Width" Value="26"/>
|
||||||
@@ -139,6 +147,17 @@
|
|||||||
</Rectangle>
|
</Rectangle>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="ButtonResultRectangle">
|
||||||
|
<Rectangle Style="{DynamicResource ButtonRect}" Stroke="{DynamicResource ResultFrame}">
|
||||||
|
<Rectangle.Fill>
|
||||||
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||||
|
<GradientStop Color="{DynamicResource ButtonLight}" Offset="0.2"/>
|
||||||
|
<GradientStop Color="{DynamicResource ResultColor}" Offset="1"/>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Rectangle.Fill>
|
||||||
|
</Rectangle>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
<DataTemplate x:Key="DiagramCalculator">
|
<DataTemplate x:Key="DiagramCalculator">
|
||||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
||||||
<Canvas.Children>
|
<Canvas.Children>
|
||||||
@@ -176,5 +195,16 @@
|
|||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="IsoFieldResult">
|
||||||
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
|
<Canvas.Children>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource ButtonResultRectangle}"/>
|
||||||
|
<Path Margin="4" Data="M 0 0 h 20 A 20 20 90 0 1 0 24 z" Fill="Gray"/>
|
||||||
|
<Path Margin="4" Data="M 0 0 h 16 A 16 16 90 0 1 0 18 z" Fill="DarkGray"/>
|
||||||
|
<Path Margin="4" Data="M 0 0 h 10 A 10 10 90 0 1 0 10 z" Fill="LightGray"/>
|
||||||
|
</Canvas.Children>
|
||||||
|
</Canvas>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -12,6 +12,15 @@
|
|||||||
<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\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackResultView.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\TupleCrackResultView.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml.cs">
|
<Compile Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -86,6 +95,15 @@
|
|||||||
<Page Update="Windows\Arrays\ArrayView.xaml">
|
<Page Update="Windows\Arrays\ArrayView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackResultView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\TupleCrackResultView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml">
|
<Page Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.CrackCalculatorInputDataView"
|
||||||
|
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.CalculationWindows.CalculatorsViews"
|
||||||
|
d:DataContext="{d:DesignInstance local:CrackCalculatorInputDataViewModel}"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="CrackCalculatorInputDataView" Height="390" Width="400" MinHeight="300" MinWidth="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition Height="35"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="Forces">
|
||||||
|
<ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding CombinationViewModel}"/>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Primitives">
|
||||||
|
<ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding PrimitivesViewModel}"/>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Settings">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<CheckBox x:Name="SetSoftFactorFlag" Grid.ColumnSpan="2" Content="Set user value of softening factor (PsiS)" IsChecked="{Binding SetSofteningFactor}"/>
|
||||||
|
<TextBox Grid.Row="1" Text="{Binding SofteningFactor, Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"
|
||||||
|
IsEnabled="{Binding IsChecked, ElementName=SetSoftFactorFlag}" Margin="0,0,0,3"/>
|
||||||
|
<CheckBox x:Name="SetLengthFlag" Grid.ColumnSpan="2" Grid.Row="2" Content="Set user value of length between cracks (Lcrc)" IsChecked="{Binding SetLengthBetweenCracks}"/>
|
||||||
|
<TextBox Grid.Row="3" Text="{Binding LengthBetweenCracks, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
|
||||||
|
IsEnabled="{Binding IsChecked, ElementName=SetLengthFlag}" Margin="0,0,0,3"/>
|
||||||
|
<TextBlock Grid.Row="4" Text="Ultimate limit crack width"/>
|
||||||
|
<TextBlock Grid.Row="5" Text="Long-term"/>
|
||||||
|
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding UltLongTermCrackWidth, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
|
||||||
|
Margin="3"/>
|
||||||
|
<TextBlock Grid.Row="6" Text="Short-tem"/>
|
||||||
|
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding UltShortTermCrackWidth, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
|
||||||
|
Margin="3"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using StructureHelper.Windows.ViewModels.Calculations.Calculators;
|
||||||
|
using StructureHelper.Windows.ViewModels.Materials;
|
||||||
|
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.CalculationWindows.CalculatorsViews
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Логика взаимодействия для CrackCalculatorInputDataView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class CrackCalculatorInputDataView : Window
|
||||||
|
{
|
||||||
|
private CrackCalculatorInputDataViewModel viewModel;
|
||||||
|
|
||||||
|
public CrackCalculatorInputDataView(CrackCalculatorInputDataViewModel viewModel)
|
||||||
|
{
|
||||||
|
this.viewModel = viewModel;
|
||||||
|
viewModel.ParentWindow = this;
|
||||||
|
DataContext = viewModel;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||||
|
{
|
||||||
|
public class CrackCalculatorInputDataViewModel : OkCancelViewModelBase
|
||||||
|
{
|
||||||
|
CrackInputData crackInputData;
|
||||||
|
private bool setUserValueSofteningFactor;
|
||||||
|
private double softeningFactor;
|
||||||
|
|
||||||
|
public SourceTargetVM<IForceAction> CombinationViewModel { get; }
|
||||||
|
public SourceTargetVM<PrimitiveBase> PrimitivesViewModel { get; private set; }
|
||||||
|
public bool SetSofteningFactor
|
||||||
|
{
|
||||||
|
get => crackInputData.UserCrackInputData.SetSofteningFactor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
crackInputData.UserCrackInputData.SetSofteningFactor = value;
|
||||||
|
OnPropertyChanged(nameof(SetSofteningFactor));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double SofteningFactor
|
||||||
|
{
|
||||||
|
get => crackInputData.UserCrackInputData.SofteningFactor; set
|
||||||
|
{
|
||||||
|
if (value > 1d || value < 0d) { return; }
|
||||||
|
crackInputData.UserCrackInputData.SofteningFactor = value;
|
||||||
|
OnPropertyChanged(nameof(SetSofteningFactor));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool SetLengthBetweenCracks
|
||||||
|
{
|
||||||
|
get => crackInputData.UserCrackInputData.SetLengthBetweenCracks;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
crackInputData.UserCrackInputData.SetLengthBetweenCracks = value;
|
||||||
|
OnPropertyChanged(nameof(SetLengthBetweenCracks));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double LengthBetweenCracks
|
||||||
|
{
|
||||||
|
get => crackInputData.UserCrackInputData.LengthBetweenCracks; set
|
||||||
|
{
|
||||||
|
if (value <= 0d) { return; }
|
||||||
|
crackInputData.UserCrackInputData.LengthBetweenCracks = value;
|
||||||
|
OnPropertyChanged(nameof(SetLengthBetweenCracks));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double UltLongTermCrackWidth
|
||||||
|
{
|
||||||
|
get => crackInputData.UserCrackInputData.UltimateLongCrackWidth; set
|
||||||
|
{
|
||||||
|
if (value <= 0d) { return; }
|
||||||
|
crackInputData.UserCrackInputData.UltimateLongCrackWidth = value;
|
||||||
|
OnPropertyChanged(nameof(UltLongTermCrackWidth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double UltShortTermCrackWidth
|
||||||
|
{
|
||||||
|
get => crackInputData.UserCrackInputData.UltimateShortCrackWidth; set
|
||||||
|
{
|
||||||
|
if (value <= 0d) { return; }
|
||||||
|
crackInputData.UserCrackInputData.UltimateShortCrackWidth = value;
|
||||||
|
OnPropertyChanged(nameof(UltShortTermCrackWidth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CrackCalculatorInputDataViewModel(IEnumerable<INdmPrimitive> allowedPrimitives, IEnumerable<IForceAction> allowedCombinations, CrackCalculator crackCalculator)
|
||||||
|
{
|
||||||
|
crackInputData = crackCalculator.InputData;
|
||||||
|
CombinationViewModel = SourceTargetFactory.GetSourceTargetVM(allowedCombinations, crackInputData.ForceActions);
|
||||||
|
PrimitivesViewModel = SourceTargetFactory.GetSourceTargetVM(allowedPrimitives, crackInputData.Primitives);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Refresh()
|
||||||
|
{
|
||||||
|
var combinations = CombinationViewModel.GetTargetItems();
|
||||||
|
crackInputData.ForceActions.Clear();
|
||||||
|
foreach (var item in combinations)
|
||||||
|
{
|
||||||
|
crackInputData.ForceActions.Add(item);
|
||||||
|
}
|
||||||
|
crackInputData.Primitives.Clear();
|
||||||
|
foreach (var item in PrimitivesViewModel.GetTargetItems())
|
||||||
|
{
|
||||||
|
crackInputData.Primitives.Add(item.GetNdmPrimitive());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.CrackResultView"
|
||||||
|
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.CalculationWindows.CalculatorsViews"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="CrackResultView" Height="450" Width="800">
|
||||||
|
<DockPanel>
|
||||||
|
<ToolBarTray DockPanel.Dock="Top">
|
||||||
|
<ToolBar>
|
||||||
|
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}" ToolTip="Show isofield results">
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource IsoFieldResult}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
</ToolBarTray>
|
||||||
|
<Grid>
|
||||||
|
<DataGrid AutoGenerateColumns="False" ItemsSource="{Binding ForcesResults.ForcesResultList}" SelectedItem="{Binding SelectedResult}">
|
||||||
|
<DataGrid.RowStyle>
|
||||||
|
<Style TargetType="DataGridRow">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding IsValid}" Value="false">
|
||||||
|
<Setter Property="Background" Value="Pink"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.RowStyle>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridCheckBoxColumn Header="Valid" Binding="{Binding Path=IsValid}"/>
|
||||||
|
<DataGridTextColumn Header="LimitState" Width="70" Binding="{Binding DesignForceTuple.LimitState}"/>
|
||||||
|
<DataGridTextColumn Header="Duration" Width="70" Binding="{Binding DesignForceTuple.CalcTerm}"/>
|
||||||
|
<DataGridTextColumn Header="Moment Mx" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.Mx, Converter={StaticResource MomentConverter}}"/>
|
||||||
|
<DataGridTextColumn Header="Moment My" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.My, Converter={StaticResource MomentConverter}}"/>
|
||||||
|
<DataGridTextColumn Header="Force Nz" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.Nz, Converter={StaticResource ForceConverter}}"/>
|
||||||
|
<DataGridTextColumn Header="Kx" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.Kx}"/>
|
||||||
|
<DataGridTextColumn Header="Ky" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.Ky}"/>
|
||||||
|
<DataGridTextColumn Header="EpsZ" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.EpsZ}"/>
|
||||||
|
<DataGridTextColumn Header="Accuracy" Width="90" Binding="{Binding LoaderResults.AccuracyRate}"/>
|
||||||
|
<DataGridTextColumn Header="Max Iteration" Width="90" Binding="{Binding LoaderResults.IterationCounter}"/>
|
||||||
|
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding Description}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.CalculationWindows.CalculatorsViews
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Логика взаимодействия для CrackResultView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class CrackResultView : Window
|
||||||
|
{
|
||||||
|
public CrackResultView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||||
|
{
|
||||||
|
public class CrackResultViewModel
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.TupleCrackResultView"
|
||||||
|
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.CalculationWindows.CalculatorsViews"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="TupleCrackResultView" Height="450" Width="800">
|
||||||
|
<Grid>
|
||||||
|
<DataGrid>
|
||||||
|
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.CalculationWindows.CalculatorsViews
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Логика взаимодействия для TupleCrackResultView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class TupleCrackResultView : Window
|
||||||
|
{
|
||||||
|
public TupleCrackResultView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||||
|
{
|
||||||
|
public class TupleCrackResultViewModel
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,7 +25,11 @@
|
|||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
|
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
|
||||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
|
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}" ToolTip="Show isofield results">
|
||||||
|
<Viewbox>
|
||||||
|
<ContentControl ContentTemplate="{DynamicResource IsoFieldResult}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -59,7 +63,6 @@
|
|||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<StackPanel Grid.Column="1">
|
<StackPanel Grid.Column="1">
|
||||||
<Button Margin="3" Content="Graphic" ToolTip="Show graphic results" Command="{Binding ShowIsoFieldCommand}"/>
|
|
||||||
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
|
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
|
||||||
<Button Margin="3" Content="Export" ToolTip="Export results to *.csv" Command="{Binding ExportToCSVCommand}"/>
|
<Button Margin="3" Content="Export" ToolTip="Export results to *.csv" Command="{Binding ExportToCSVCommand}"/>
|
||||||
<Button Margin="3" Content="Set Prestrain" ToolTip="Set strains as auto prestrain" Command="{Binding SetPrestrainCommand}"/>
|
<Button Margin="3" Content="Set Prestrain" ToolTip="Set strains as auto prestrain" Command="{Binding SetPrestrainCommand}"/>
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.Models.Materials;
|
|
||||||
using StructureHelper.Services.Settings;
|
using StructureHelper.Services.Settings;
|
||||||
using StructureHelper.Windows.Forces;
|
using StructureHelper.Windows.Forces;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
using System;
|
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace StructureHelper.Windows.ViewModels.Forces
|
namespace StructureHelper.Windows.ViewModels.Forces
|
||||||
@@ -98,24 +93,40 @@ namespace StructureHelper.Windows.ViewModels.Forces
|
|||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
var calcRepository = repository.CalculatorsList;
|
var calcRepository = repository.CalculatorsList;
|
||||||
foreach (var item in calcRepository)
|
foreach (var calc in calcRepository)
|
||||||
{
|
{
|
||||||
if (item is IForceCalculator)
|
if (calc is IForceCalculator)
|
||||||
{
|
{
|
||||||
var forceCalculator = item as IForceCalculator;
|
var forceCombinations = calc as IHasForceCombinations;
|
||||||
var containSelected = forceCalculator.ForceActions.Contains(SelectedItem);
|
result = DeleteActionFromHost(result, calc, forceCombinations);
|
||||||
if (containSelected)
|
}
|
||||||
{
|
else if (calc is CrackCalculator calculator)
|
||||||
var dialogResultCalc = MessageBox.Show($"Action is contained in calculator {item.Name}", "Please, confirm deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
{
|
||||||
if (dialogResultCalc == DialogResult.Yes)
|
var forceCombinations = calculator.InputData as IHasForceCombinations;
|
||||||
{
|
result = DeleteActionFromHost(result, calc, forceCombinations);
|
||||||
forceCalculator.ForceActions.Remove(SelectedItem);
|
}
|
||||||
}
|
else
|
||||||
else result = false;
|
{
|
||||||
}
|
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(ICalculator), calc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool DeleteActionFromHost(bool result, ICalculator item, IHasForceCombinations? forceCombinations)
|
||||||
|
{
|
||||||
|
var containSelected = forceCombinations.ForceActions.Contains(SelectedItem);
|
||||||
|
if (containSelected)
|
||||||
|
{
|
||||||
|
var dialogResultCalc = MessageBox.Show($"Action is contained in calculator {item.Name}", "Please, confirm deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||||
|
if (dialogResultCalc == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
forceCombinations.ForceActions.Remove(SelectedItem);
|
||||||
|
}
|
||||||
|
else result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using LoaderCalculator;
|
||||||
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
|
using StructureHelper.Windows.CalculationWindows.CalculatorsViews;
|
||||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
|
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
|
||||||
using StructureHelper.Windows.CalculationWindows.ProgressViews;
|
using StructureHelper.Windows.CalculationWindows.ProgressViews;
|
||||||
using StructureHelper.Windows.Errors;
|
using StructureHelper.Windows.Errors;
|
||||||
@@ -115,9 +117,12 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
|||||||
else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(SelectedItem));}
|
else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(SelectedItem));}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditCrackCalculator(CrackCalculator crackCalculator)
|
private void EditCrackCalculator(CrackCalculator calculator)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
var calculatorCopy = calculator.Clone() as CrackCalculator;
|
||||||
|
var vm = new CrackCalculatorInputDataViewModel(repository.Primitives, repository.ForceActions, calculator);
|
||||||
|
var wnd = new CrackCalculatorInputDataView(vm);
|
||||||
|
ShowWindow(calculator, calculatorCopy, wnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditLimitCurveCalculator(LimitCurvesCalculator calculator)
|
private void EditLimitCurveCalculator(LimitCurvesCalculator calculator)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ using StructureHelper.Windows.PrimitiveTemplates.RCs.Beams;
|
|||||||
using StructureHelper.Windows.PrimitiveTemplates.RCs.RectangleBeam;
|
using StructureHelper.Windows.PrimitiveTemplates.RCs.RectangleBeam;
|
||||||
using StructureHelper.Windows.Services;
|
using StructureHelper.Windows.Services;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperCommon.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
@@ -14,6 +16,7 @@ using StructureHelperLogics.Models.Primitives;
|
|||||||
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
||||||
using StructureHelperLogics.Models.Templates.RCs;
|
using StructureHelperLogics.Models.Templates.RCs;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -135,9 +138,24 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
|||||||
{
|
{
|
||||||
if (calc is IForceCalculator)
|
if (calc is IForceCalculator)
|
||||||
{
|
{
|
||||||
var forceCalc = calc as IForceCalculator;
|
var forceCalc = calc as IHasPrimitives;
|
||||||
forceCalc.Primitives.Remove(ndmPrimitive);
|
forceCalc.Primitives.Remove(ndmPrimitive);
|
||||||
}
|
}
|
||||||
|
else if (calc is LimitCurvesCalculator calculator)
|
||||||
|
{
|
||||||
|
//to do
|
||||||
|
//var forceCalc = calculator.InputData as IHasPrimitives;
|
||||||
|
//forceCalc.Primitives.Remove(ndmPrimitive);
|
||||||
|
}
|
||||||
|
else if (calc is CrackCalculator crackCalculator)
|
||||||
|
{
|
||||||
|
var forceCalc = crackCalculator.InputData as IHasPrimitives;
|
||||||
|
forceCalc.Primitives.Remove(ndmPrimitive);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(ICalculator), calc));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (var primitive in repository.Primitives)
|
foreach (var primitive in repository.Primitives)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using StructureHelperCommon.Services;
|
|||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -28,6 +29,10 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Logics
|
|||||||
{
|
{
|
||||||
new LimitCurvesCalculatorUpdateStrategy().Update(limitCurves, (LimitCurvesCalculator)sourceObject);
|
new LimitCurvesCalculatorUpdateStrategy().Update(limitCurves, (LimitCurvesCalculator)sourceObject);
|
||||||
}
|
}
|
||||||
|
else if (targetObject is CrackCalculator crackCalculator)
|
||||||
|
{
|
||||||
|
new CrackCalculatorUpdateStrategy().Update(crackCalculator, (CrackCalculator)sourceObject);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ErrorCommonProcessor.ObjectTypeIsUnknown(typeof(INdmPrimitive), sourceObject.GetType());
|
ErrorCommonProcessor.ObjectTypeIsUnknown(typeof(INdmPrimitive), sourceObject.GetType());
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
public double CrackWidth { get; set; }
|
public double CrackWidth { get; set; }
|
||||||
public double UltimateCrackWidth { get; set; }
|
public double UltimateCrackWidth { get; set; }
|
||||||
public bool IsCrackLessThanUltimate => CrackWidth <= UltimateCrackWidth;
|
public bool IsCrackLessThanUltimate => CrackWidth <= UltimateCrackWidth;
|
||||||
public double RebarStrain { get; set; }
|
public RebarStressResult RebarStressResult { get; set; }
|
||||||
public double ConcreteStrain { get; set; }
|
public double SofteningFactor { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
readonly IAverageDiameterLogic diameterLogic;
|
readonly IAverageDiameterLogic diameterLogic;
|
||||||
readonly ITensileConcreteAreaLogic concreteAreaLogic;
|
readonly ITensileConcreteAreaLogic concreteAreaLogic;
|
||||||
ITensionRebarAreaLogic rebarAreaLogic;
|
ITensionRebarAreaLogic rebarAreaLogic;
|
||||||
|
private IStressLogic stressLogic => new StressLogic();
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||||
@@ -44,7 +45,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
this
|
this
|
||||||
( new EquivalentDiameterLogic(),
|
( new EquivalentDiameterLogic(),
|
||||||
new TensileConcreteAreaLogicSP63(),
|
new TensileConcreteAreaLogicSP63(),
|
||||||
new TensionRebarAreaSimpleSumLogic())
|
new TensionRebarAreaByStrainLogic())
|
||||||
{ }
|
{ }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public double GetLength()
|
public double GetLength()
|
||||||
@@ -104,8 +105,10 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
|
|
||||||
private double GetAverageDiameter(IEnumerable<RebarNdm?> rebars)
|
private double GetAverageDiameter(IEnumerable<RebarNdm?> rebars)
|
||||||
{
|
{
|
||||||
|
var tesileRebars = rebars
|
||||||
|
.Where(x => stressLogic.GetTotalStrain(StrainMatrix, x) > 0d);
|
||||||
diameterLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
diameterLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||||
diameterLogic.Rebars = rebars;
|
diameterLogic.Rebars = tesileRebars;
|
||||||
var rebarDiameter = diameterLogic.GetAverageDiameter();
|
var rebarDiameter = diameterLogic.GetAverageDiameter();
|
||||||
TraceLogger?.AddMessage($"Average rebar diameter ds = {rebarDiameter}");
|
TraceLogger?.AddMessage($"Average rebar diameter ds = {rebarDiameter}");
|
||||||
return rebarDiameter;
|
return rebarDiameter;
|
||||||
|
|||||||
@@ -47,9 +47,12 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
{
|
{
|
||||||
CrackWidth = acrc1,
|
CrackWidth = acrc1,
|
||||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateLongCrackWidth,
|
UltimateCrackWidth = InputData.UserCrackInputData.UltimateLongCrackWidth,
|
||||||
RebarStrain = rebarStressResult.RebarStrain,
|
RebarStressResult = rebarStressResult
|
||||||
ConcreteStrain = rebarStressResult.ConcreteStrain
|
|
||||||
};
|
};
|
||||||
|
TraceLogger?.AddMessage($"Long crack width acrc = acrc,1 = {acrc1}(m)");
|
||||||
|
TraceLogger?.AddMessage($"Ultimate long crack width acrc,ult = {longRebarResult.UltimateCrackWidth}(m)");
|
||||||
|
TraceCrackResult(longRebarResult);
|
||||||
|
|
||||||
|
|
||||||
GetSofteningLogic(InputData.ShortRebarData);
|
GetSofteningLogic(InputData.ShortRebarData);
|
||||||
rebarStressResult = GetRebarStressResult(InputData.ShortRebarData);
|
rebarStressResult = GetRebarStressResult(InputData.ShortRebarData);
|
||||||
@@ -61,14 +64,16 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
var acrc3 = crackWidthLogic.GetCrackWidth();
|
var acrc3 = crackWidthLogic.GetCrackWidth();
|
||||||
|
|
||||||
double acrcShort = acrc1 - acrc2 + acrc3;
|
double acrcShort = acrc1 - acrc2 + acrc3;
|
||||||
TraceLogger?.AddMessage($"Long crack width acrc = acrc,1 = {acrc1}(m)");
|
|
||||||
TraceLogger?.AddMessage($"Short crack width acrc = acrc,1 - acrc,2 + acrc,3 = {acrc1} - {acrc2} + {acrc3} = {acrcShort}(m)");
|
TraceLogger?.AddMessage($"Short crack width acrc = acrc,1 - acrc,2 + acrc,3 = {acrc1} - {acrc2} + {acrc3} = {acrcShort}(m)");
|
||||||
var shortRebarResult = new CrackWidthTupleResult()
|
var shortRebarResult = new CrackWidthTupleResult()
|
||||||
{
|
{
|
||||||
CrackWidth = acrcShort,
|
CrackWidth = acrcShort,
|
||||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateShortCrackWidth
|
UltimateCrackWidth = InputData.UserCrackInputData.UltimateShortCrackWidth,
|
||||||
|
RebarStressResult = rebarStressResult
|
||||||
};
|
};
|
||||||
|
TraceCrackResult(shortRebarResult);
|
||||||
result.LongTermResult = longRebarResult;
|
result.LongTermResult = longRebarResult;
|
||||||
|
result.ShortTermResult = shortRebarResult;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -78,6 +83,18 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
result.RebarPrimitive = InputData.RebarPrimitive;
|
result.RebarPrimitive = InputData.RebarPrimitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TraceCrackResult(CrackWidthTupleResult rebarResult)
|
||||||
|
{
|
||||||
|
if (rebarResult.IsCrackLessThanUltimate == false)
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Checking crack width is failure, actual crack width acrc = {rebarResult.CrackWidth} > ultimate crack width acrc,ult = {rebarResult.UltimateCrackWidth}", TraceLogStatuses.Warning);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Checking crack width is ok, actual crack width acrc = {rebarResult.CrackWidth} <= ultimate crack width acrc,ult = {rebarResult.UltimateCrackWidth}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void GetSofteningLogic(RebarCrackInputData rebarData)
|
private void GetSofteningLogic(RebarCrackInputData rebarData)
|
||||||
{
|
{
|
||||||
if (InputData.UserCrackInputData.SetSofteningFactor == true)
|
if (InputData.UserCrackInputData.SetSofteningFactor == true)
|
||||||
|
|||||||
@@ -20,27 +20,64 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
{
|
{
|
||||||
public class RebarStressSofteningLogic : ICrackSofteningLogic
|
public class RebarStressSofteningLogic : ICrackSofteningLogic
|
||||||
{
|
{
|
||||||
private IStressLogic stressLogic;
|
/// <summary>
|
||||||
private RebarStressResult afterCrackingRebarResult;
|
/// Rebar result immediately after cracking appearance
|
||||||
|
/// </summary>
|
||||||
|
private RebarStressResult crackRebarResult;
|
||||||
|
/// <summary>
|
||||||
|
/// Rebar resul for actual force combination
|
||||||
|
/// </summary>
|
||||||
private RebarStressResult actualRebarResult;
|
private RebarStressResult actualRebarResult;
|
||||||
|
|
||||||
|
|
||||||
private INdm concreteNdm;
|
private INdm? concreteNdm;
|
||||||
private INdm rebarNdm;
|
private INdm? rebarNdm;
|
||||||
|
|
||||||
private double rebarStrainActual;
|
private double rebarActualStrain;
|
||||||
private double concreteStrainActual;
|
private double concreteStrainActual;
|
||||||
private double rebarStressActual;
|
private double rebarActualStress;
|
||||||
|
private double softeningFactor;
|
||||||
|
private double minValueOfFactor = 0.2d;
|
||||||
|
private RebarPrimitive rebarPrimitive;
|
||||||
|
private RebarCrackInputData inputData;
|
||||||
|
|
||||||
public double MinValueOfFactor { get; set; } = 0.2d;
|
public double MinValueOfFactor
|
||||||
public RebarPrimitive RebarPrimitive { get; set; }
|
{
|
||||||
public RebarCrackInputData InputData { get; set; }
|
get => minValueOfFactor; set
|
||||||
|
{
|
||||||
|
minValueOfFactor = value;
|
||||||
|
IsResultActual = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RebarPrimitive RebarPrimitive
|
||||||
|
{
|
||||||
|
get => rebarPrimitive; set
|
||||||
|
{
|
||||||
|
rebarPrimitive = value;
|
||||||
|
IsResultActual = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RebarCrackInputData InputData
|
||||||
|
{
|
||||||
|
get => inputData; set
|
||||||
|
{
|
||||||
|
inputData = value;
|
||||||
|
IsResultActual = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
public bool IsResultActual { get; private set; } = false;
|
||||||
|
|
||||||
public double GetSofteningFactor()
|
public double GetSofteningFactor()
|
||||||
{
|
{
|
||||||
GetNdms();
|
if (IsResultActual == false)
|
||||||
return GetPsiSFactor(InputData.ForceTuple, InputData.CrackableNdmCollection, InputData.CrackedNdmCollection);
|
{
|
||||||
|
GetNdms();
|
||||||
|
softeningFactor = GetPsiSFactor(InputData.ForceTuple, InputData.CrackableNdmCollection);
|
||||||
|
IsResultActual = true;
|
||||||
|
}
|
||||||
|
return softeningFactor;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetNdms()
|
private void GetNdms()
|
||||||
@@ -55,7 +92,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
rebarNdm = RebarPrimitive.GetRebarNdm(options);
|
rebarNdm = RebarPrimitive.GetRebarNdm(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetPsiSFactor(ForceTuple forceTuple, IEnumerable<INdm> crackableNndms, IEnumerable<INdm> crackedNndms)
|
private double GetPsiSFactor(ForceTuple forceTuple, IEnumerable<INdm> crackableNndms)
|
||||||
{
|
{
|
||||||
|
|
||||||
var crackResult = calculateCrackTuples(forceTuple, crackableNndms);
|
var crackResult = calculateCrackTuples(forceTuple, crackableNndms);
|
||||||
@@ -66,11 +103,10 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
throw new StructureHelperException(errorString);
|
throw new StructureHelperException(errorString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
actualRebarResult = GetRebarStressResult(forceTuple);
|
actualRebarResult = GetRebarStressResult(forceTuple);
|
||||||
rebarStrainActual = actualRebarResult.RebarStrain;
|
rebarActualStrain = actualRebarResult.RebarStrain;
|
||||||
rebarStressActual = actualRebarResult.RebarStress;
|
rebarActualStress = actualRebarResult.RebarStress;
|
||||||
TraceLogger?.AddMessage($"Actual strain of rebar EpsilonS = {rebarStrainActual}(dimensionless)");
|
TraceLogger?.AddMessage($"Actual strain of rebar EpsilonS = {rebarActualStrain}(dimensionless)");
|
||||||
concreteStrainActual = concreteNdm.Prestrain;
|
concreteStrainActual = concreteNdm.Prestrain;
|
||||||
//concreteStrainActual = stressLogic.GetTotalStrain(TupleConverter.ConvertToLoaderStrainMatrix(strainTupleActual), concreteNdm);
|
//concreteStrainActual = stressLogic.GetTotalStrain(TupleConverter.ConvertToLoaderStrainMatrix(strainTupleActual), concreteNdm);
|
||||||
TraceLogger?.AddMessage($"Actual strain of concrete on the axis of rebar EpsilonC = {concreteStrainActual}(dimensionless)");
|
TraceLogger?.AddMessage($"Actual strain of concrete on the axis of rebar EpsilonC = {concreteStrainActual}(dimensionless)");
|
||||||
@@ -84,11 +120,11 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
TraceLogger?.AddMessage($"Section is cracked in start force combination, PsiS = 1.0");
|
TraceLogger?.AddMessage($"Section is cracked in start force combination, PsiS = 1.0");
|
||||||
return 1d;
|
return 1d;
|
||||||
}
|
}
|
||||||
afterCrackingRebarResult = GetRebarStressResult(crackResult.TupleOfCrackAppearance as ForceTuple);
|
crackRebarResult = GetRebarStressResult(crackResult.TupleOfCrackAppearance as ForceTuple);
|
||||||
|
|
||||||
var stressInCracking = afterCrackingRebarResult.RebarStress;
|
var stressInCracking = crackRebarResult.RebarStress;
|
||||||
TraceLogger?.AddMessage($"Stress in rebar immediately after cracking Sigma,scrc = {stressInCracking}(Pa)");
|
TraceLogger?.AddMessage($"Stress in rebar immediately after cracking Sigma,scrc = {stressInCracking}(Pa)");
|
||||||
TraceLogger?.AddMessage($"Actual stress in rebar Sigma,s = {rebarStressActual}(Pa)");
|
TraceLogger?.AddMessage($"Actual stress in rebar Sigma,s = {rebarActualStress}(Pa)");
|
||||||
double psiS = GetExponentialSofteningFactor(stressInCracking);
|
double psiS = GetExponentialSofteningFactor(stressInCracking);
|
||||||
TraceLogger?.AddMessage($"PsiS = {psiS}");
|
TraceLogger?.AddMessage($"PsiS = {psiS}");
|
||||||
//return 0.94d;
|
//return 0.94d;
|
||||||
@@ -97,7 +133,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
|
|
||||||
private double GetExponentialSofteningFactor(double stressInCracking)
|
private double GetExponentialSofteningFactor(double stressInCracking)
|
||||||
{
|
{
|
||||||
var stressRatio = stressInCracking / rebarStressActual;
|
var stressRatio = stressInCracking / rebarActualStress;
|
||||||
var logic = new ExpSofteningLogic()
|
var logic = new ExpSofteningLogic()
|
||||||
{
|
{
|
||||||
ForceRatio = stressRatio,
|
ForceRatio = stressRatio,
|
||||||
@@ -116,13 +152,13 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
{
|
{
|
||||||
NdmCollection = ndms,
|
NdmCollection = ndms,
|
||||||
CheckedNdmCollection = new List<INdm>() { concreteNdm },
|
CheckedNdmCollection = new List<INdm>() { concreteNdm },
|
||||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(100)
|
//TraceLogger = TraceLogger?.GetSimilarTraceLogger(100)
|
||||||
};
|
};
|
||||||
var crackedLogis = new CrackedLogic(sectionCrackedLogic)
|
var crackedLogis = new CrackedLogic(sectionCrackedLogic)
|
||||||
{
|
{
|
||||||
StartTuple = new ForceTuple(),
|
StartTuple = new ForceTuple(),
|
||||||
EndTuple = forceTuple,
|
EndTuple = forceTuple,
|
||||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(100)
|
//TraceLogger = TraceLogger?.GetSimilarTraceLogger(100)
|
||||||
};
|
};
|
||||||
var calculator = new CrackForceCalculator(crackedLogis)
|
var calculator = new CrackForceCalculator(crackedLogis)
|
||||||
{
|
{
|
||||||
@@ -133,7 +169,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
IterationAccuracy = 0.01d,
|
IterationAccuracy = 0.01d,
|
||||||
MaxIterationCount = 1000
|
MaxIterationCount = 1000
|
||||||
},
|
},
|
||||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(150)
|
//TraceLogger = TraceLogger?.GetSimilarTraceLogger(150)
|
||||||
};
|
};
|
||||||
calculator.Run();
|
calculator.Run();
|
||||||
return calculator.Result as CrackForceResult;
|
return calculator.Result as CrackForceResult;
|
||||||
|
|||||||
Reference in New Issue
Block a user