Window of interpolation tuple was changed

This commit is contained in:
Evgeny Redikultsev
2023-10-29 17:26:05 +05:00
parent e355f9e29d
commit 78ee3a8b13
37 changed files with 559 additions and 93 deletions

View File

@@ -0,0 +1,7 @@
Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,7 @@
Copyright (c) 2023 Редикульцев Евгений, Екатеринбург, Россия
Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации (далее — Программное обеспечение), безвозмездно использовать Программное обеспечение без ограничений, включая неограниченное право на использование, копирование, изменение, слияние, публикацию, распространение, сублицензирование и/или продажу копий Программного обеспечения, а также лицам, которым предоставляется данное Программное обеспечение, при соблюдении следующих условий:
Указанное выше уведомление об авторском праве и данные условия должны быть включены во все копии или значимые части данного Программного обеспечения.
ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ ГАРАНТИИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ, НО НЕ ОГРАНИЧИВАЯСЬ ИМИ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО КАКИМ-ЛИБО ИСКАМ, ЗА УЩЕРБ ИЛИ ПО ИНЫМ ТРЕБОВАНИЯМ, В ТОМ ЧИСЛЕ, ПРИ ДЕЙСТВИИ КОНТРАКТА, ДЕЛИКТЕ ИЛИ ИНОЙ СИТУАЦИИ, ВОЗНИКШИМ ИЗ-ЗА ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.

View File

@@ -50,6 +50,14 @@
</Style.Setters>
</Style>
<Style x:Key="ToolButton" TargetType="Button">
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Background" Value="#FFA19BC3"/>
<Setter Property="BorderBrush" Value="#FF857AB9"/>
</Style>
<Style x:Key="ButtonImage16" TargetType="Image">
<Setter Property="Height" Value="16"/>
<Setter Property="Width" Value="16"/>

View File

@@ -81,6 +81,7 @@
<Folder Include="Documentation\Manuals\" />
<Folder Include="Infrastructure\UI\DataContexts\Logics\" />
<Folder Include="Resources\" />
<Folder Include="Windows\UserControls\MultiplyTuples\" />
</ItemGroup>
<ItemGroup>

View File

@@ -9,9 +9,15 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Compile Update="Windows\Arrays\ArrayView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Windows\CalculationWindows\CalculatorsViews\GeometryCalculatorViews\GeometryCalculatorResultView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Windows\CalculationWindows\ProgressViews\InterpolationProgressView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Windows\Errors\ErrorMessage.xaml.cs">
<SubType>Code</SubType>
</Compile>
@@ -33,6 +39,9 @@
<Compile Update="Windows\PrimitiveTemplates\RCs\Beams\CircleView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Windows\UserControls\MultiplyTuple.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Update="Infrastructure\UI\Resources\ForceTemplates.xaml">
@@ -44,9 +53,15 @@
<Page Update="Infrastructure\UI\Resources\Materials.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Windows\Arrays\ArrayView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Windows\CalculationWindows\CalculatorsViews\GeometryCalculatorViews\GeometryCalculatorResultView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Windows\CalculationWindows\ProgressViews\InterpolationProgressView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Windows\Errors\ErrorMessage.xaml">
<SubType>Designer</SubType>
</Page>
@@ -68,5 +83,8 @@
<Page Update="Windows\PrimitiveTemplates\RCs\Beams\CircleView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Windows\UserControls\MultiplyTuple.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,37 @@
<Window x:Class="StructureHelper.Windows.Arrays.ArrayView"
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.Arrays"
d:DataContext="{d:DesignInstance local:ArrayViewModel}"
mc:Ignorable="d"
Title="Array" Height="450" Width="800" MinHeight="400" MinWidth="700">
<Window.Resources>
<HierarchicalDataTemplate x:Key="ArrayTemplate" ItemsSource="{Binding Children}">
<TextBlock Text="{Binding Name}"/>
</HierarchicalDataTemplate>
</Window.Resources>
<DockPanel>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
</ToolBar>
<ToolBar>
</ToolBar>
</ToolBarTray>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="200"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TreeView Grid.Column="0" Name="ArrayTreeView" SelectedItemChanged="ArrayTreeView_SelectedItemChanged">
</TreeView>
<ListBox Grid.Column="1">
</ListBox>
</Grid>
</DockPanel>
</Window>

View File

@@ -0,0 +1,38 @@
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.Arrays
{
/// <summary>
/// Логика взаимодействия для ArrayView.xaml
/// </summary>
public partial class ArrayView : Window
{
private ArrayViewModel viewModel;
public ArrayView(ArrayViewModel vm)
{
InitializeComponent();
viewModel = vm;
DataContext = viewModel;
}
private void ArrayTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
//if (e.NewValue is selectedItem)
//{
// viewModel.SelectedItem = selectedItem;
//}
}
}
}

View File

@@ -0,0 +1,14 @@
using StructureHelper.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.Arrays
{
public class ArrayViewModel : ViewModelBase
{
}
}

View File

@@ -8,47 +8,57 @@
d:DataContext="{d:DesignInstance vm:ForcesResultsViewModel}"
mc:Ignorable="d"
Title="Calculation Results" Height="350" Width="850" MinHeight="300" MinWidth="400" WindowStartupLocation="CenterScreen">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="90"/>
</Grid.ColumnDefinitions>
<DataGrid x:Name="ResultGrid" IsReadOnly="True" 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>
<StackPanel Grid.Column="1">
<Button Margin="3" Content="Graphic" ToolTip="Show graphic results" Command="{Binding ShowIsoFieldCommand}"/>
<Button Margin="3" Content="Diagrams" ToolTip="Show diagrams" Command="{Binding ShowGraphsCommand}"/>
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
<Button Margin="3" Content="Interpolate" ToolTip="Create analysis by substep" Command="{Binding InterpolateCommand}"/>
<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="Anchorage" ToolTip="Set strains as auto prestrain" Command="{Binding ShowAnchorageCommand}"/>
<Button Margin="3" Content="Geometry" ToolTip="Show Geometry Properties" Command="{Binding ShowGeometryResultCommand}"/>
<Button Margin="3" Content="Fcrc" ToolTip="Show crack force" Command="{Binding ShowCrackResultCommand}"/>
<Button Margin="3" Content="Acrc" ToolTip="Show crack width" Command="{Binding ShowCrackWidthResultCommand}"/>
</StackPanel>
</Grid>
<DockPanel>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Style="{StaticResource ToolButton}"
Command="{Binding ShowCrackResultCommand}"
Content="Fcrc" ToolTip="Calc crack forces"/>
</ToolBar>
</ToolBarTray>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="90"/>
</Grid.ColumnDefinitions>
<DataGrid x:Name="ResultGrid" IsReadOnly="True" 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>
<StackPanel Grid.Column="1">
<Button Margin="3" Content="Graphic" ToolTip="Show graphic results" Command="{Binding ShowIsoFieldCommand}"/>
<Button Margin="3" Content="Diagrams" ToolTip="Show diagrams" Command="{Binding ShowGraphsCommand}"/>
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
<Button Margin="3" Content="Interpolate" ToolTip="Create analysis by substep" Command="{Binding InterpolateCommand}"/>
<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="Anchorage" ToolTip="Set strains as auto prestrain" Command="{Binding ShowAnchorageCommand}"/>
<Button Margin="3" Content="Geometry" ToolTip="Show Geometry Properties" Command="{Binding ShowGeometryResultCommand}"/>
<Button Margin="3" Content="Fcrc" ToolTip="Show crack force" Command="{Binding ShowCrackResultCommand}"/>
<Button Margin="3" Content="Acrc" ToolTip="Show crack width" Command="{Binding ShowCrackWidthResultCommand}"/>
</StackPanel>
</Grid>
</DockPanel>
</Window>

View File

@@ -0,0 +1,23 @@
<Window x:Class="StructureHelper.Windows.CalculationWindows.ProgressViews.InterpolationProgressView"
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.ProgressViews"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:InterpolationProgressViewModel}"
Title="InterpolationProgressView" Height="150" Width="200" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="IterationCount"/>
<ProgressBar Grid.Column="1" Grid.Row="0" Minimum="{Binding MinValue}" Maximum="{Binding MaxValue}" Value="{Binding Value}"/>
</Grid>
</Window>

View File

@@ -0,0 +1,31 @@
using StructureHelper.Properties;
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.ProgressViews
{
/// <summary>
/// Логика взаимодействия для InterpolationProgressView.xaml
/// </summary>
public partial class InterpolationProgressView : Window
{
InterpolationProgressViewModel viewModel;
public InterpolationProgressView(InterpolationProgressViewModel viewModel)
{
InitializeComponent();
this.viewModel = viewModel;
this.DataContext = this.viewModel;
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.CalculationWindows.ProgressViews
{
public class InterpolationProgressViewModel
{
public double MinValue { get; set; }
public double MaxValue { get; set; }
public double Value { get; set; }
}
}

View File

@@ -5,9 +5,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Forces"
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
d:DataContext="{d:DesignInstance vm:InterpolateTuplesViewModel}"
mc:Ignorable="d"
Title="Interpolate Combinations" Height="200" Width="440" MinHeight="180" MinWidth="440" WindowStartupLocation="CenterScreen">
Title="Interpolate Combinations" Height="200" Width="500" MinHeight="180" MinWidth="500" WindowStartupLocation="CenterScreen">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
@@ -32,6 +36,7 @@
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
@@ -44,12 +49,15 @@
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
<TextBlock Grid.Row="3" Text="Step count"/>
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}"/>
<TextBlock Grid.Row="3" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<uc:MultiplyTuple Grid.Column="4" Grid.Row="1" ForceTuple="{Binding StartDesignForce.ForceTuple}" ValueChanged="StartValueChanged"/>
<uc:MultiplyTuple Grid.Column="4" Grid.Row="2" ForceTuple="{Binding FinishDesignForce.ForceTuple}" ValueChanged="FinishValueChanged"/>
</Grid>
<StackPanel Grid.Column="1">
<Button Content="Invert comb's" Command="{Binding InvertForcesCommand}" />
<Button Content="Copy To Finish" Command="{Binding CopyToFinishCommand}" />
<Button Content="Copy To Start" Command="{Binding CopyToStartCommand}" />
</StackPanel>
</Grid>

View File

@@ -22,10 +22,12 @@ namespace StructureHelper.Windows.Forces
/// </summary>
public partial class InterpolateTuplesView : Window
{
InterpolateTuplesViewModel viewModel;
public InterpolateTuplesView(InterpolateTuplesViewModel viewModel)
{
InitializeComponent();
DataContext = viewModel;
this.viewModel = viewModel;
DataContext = this.viewModel;
}
private void Button_Click(object sender, RoutedEventArgs e)
@@ -33,5 +35,15 @@ namespace StructureHelper.Windows.Forces
DialogResult = true;
Close();
}
private void StartValueChanged(object sender, EventArgs e)
{
viewModel.RefreshStartTuple();
}
private void FinishValueChanged(object sender, EventArgs e)
{
viewModel.RefreshFinishTuple();
}
}
}

View File

@@ -16,13 +16,6 @@
d:DataContext="{d:DesignInstance local:MainViewModel}"
Title="StructureHelper" Height="700" Width="1000" MinHeight="400" MinWidth="600">
<Window.Resources>
<Style x:Key="ToolButton" TargetType="Button">
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Background" Value="#FFA19BC3"/>
<Setter Property="BorderBrush" Value="#FF857AB9"/>
</Style>
<DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
<dataTemplates:RectangleTemplate/>
</DataTemplate>

View File

@@ -0,0 +1,27 @@
<UserControl x:Class="StructureHelper.Windows.UserControls.MultiplyTuple"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StructureHelper.Windows.UserControls"
mc:Ignorable="d"
d:DesignHeight="25" d:DesignWidth="60">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button x:Name="Multy0_5" Grid.Column="0" Content="*0.5" Click="Multy0_5_Click"/>
<Button x:Name="Multy2_0" Grid.Column="1" Content="*2.0" Click="Multy2_0_Click"/>
<!--<Grid.ToolTip>
<StackPanel Orientation="Horizontal">
<Button x:Name="MultyM1_2" Grid.Column="1" Content="*(-1)" Click="MultyM1_2_Click"/>
<Button x:Name="Multy02" Grid.Column="1" Content="*0" Click="Multy0_Click"/>
<Button x:Name="Multy0_12" Grid.Column="1" Content="*0.1" Click="Multy0_12_Click"/>
<Button x:Name="Multy0_52" Grid.Column="0" Content="*0.5" Click="Multy0_5_Click"/>
<Button x:Name="Multy2_02" Grid.Column="1" Content="*2.0" Click="Multy2_0_Click"/>
<Button x:Name="Multy10_02" Grid.Column="1" Content="*10.0" Click="Multy10_02_Click"/>
</StackPanel>
</Grid.ToolTip>-->
</Grid>
</UserControl>

View File

@@ -0,0 +1,101 @@
using StructureHelper.Infrastructure;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Services.Forces;
using StructureHelperCommon.Services.Units;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
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.Navigation;
using System.Windows.Shapes;
namespace StructureHelper.Windows.UserControls
{
/// <summary>
/// Логика взаимодействия для MultiplyTuple.xaml
/// </summary>
public partial class MultiplyTuple : UserControl
{
public event EventHandler ValueChanged;
public MultiplyTuple()
{
InitializeComponent();
//DataContext = this;
}
public ICommand MultiplyByFactor
{
get => muliplyByFactor ??= new RelayCommand(o =>
{
try
{
string s = (string)o;
double factor = CommonOperation.ConvertToDoubleChangeComma(s);
ChangeValue(factor);
}
catch(Exception ex)
{
}
});
}
public static readonly DependencyProperty ForceTupleProperty = DependencyProperty.Register(
"ForceTuple", typeof(ForceTuple), typeof(MultiplyTuple), new PropertyMetadata(new ForceTuple()));
private RelayCommand muliplyByFactor;
public ForceTuple ForceTuple
{
get { return (ForceTuple)GetValue(ForceTupleProperty); }
set { SetValue(ForceTupleProperty, value); }
}
private void Multy0_5_Click(object sender, RoutedEventArgs e)
{
ChangeValue(0.5d);
}
private void Multy2_0_Click(object sender, RoutedEventArgs e)
{
ChangeValue(2d);
}
private void ChangeValue(double factor)
{
var tmpTuple = ForceTupleService.MultiplyTuples(ForceTuple, factor);
ForceTupleService.CopyProperties(tmpTuple, ForceTuple, 1d);
ValueChanged?.Invoke(this, EventArgs.Empty);
}
private void Multy0_Click(object sender, RoutedEventArgs e)
{
ChangeValue(0d);
}
private void Multy0_12_Click(object sender, RoutedEventArgs e)
{
ChangeValue(0.1d);
}
private void MultyM1_2_Click(object sender, RoutedEventArgs e)
{
ChangeValue(-1d);
}
private void Multy10_02_Click(object sender, RoutedEventArgs e)
{
ChangeValue(10d);
}
}
}

View File

@@ -18,7 +18,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
public void Show(IDesignForceTuple finishDesignTuple, IForceCalculator forceCalculator)
{
IDesignForceTuple startDesignTuple;
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null, 100);
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
var wndTuples = new InterpolateTuplesView(viewModel);
wndTuples.ShowDialog();
if (wndTuples.DialogResult != true) return;

View File

@@ -1,10 +1,15 @@
using StructureHelper.Windows.Errors;
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
using StructureHelper.Windows.Errors;
using StructureHelper.Windows.Forces;
using StructureHelper.Windows.ViewModels.Errors;
using StructureHelper.Windows.ViewModels.Forces;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Cracking;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.Services.NdmCalculations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
@@ -23,44 +28,66 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators.ForceResul
public CalcTerms CalcTerm { get; set; }
public ForceTuple ForceTuple { get; set; }
public IEnumerable<INdmPrimitive> ndmPrimitives { get; set; }
public void Show()
public void Show(IDesignForceTuple finishDesignTuple)
{
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
viewModel.StepCountVisible = false;
var wndTuples = new InterpolateTuplesView(viewModel);
wndTuples.ShowDialog();
if (wndTuples.DialogResult != true) return;
var startDesignTuple = viewModel.StartDesignForce.ForceTuple;
var endDesignTuple = viewModel.FinishDesignForce.ForceTuple;
FindCrackFactor(endDesignTuple, startDesignTuple);
}
private void FindCrackFactor(ForceTuple finishDesignTuple, ForceTuple startDesignTuple)
{
var calculator = new CrackForceCalculator();
calculator.EndTuple = ForceTuple;
calculator.StartTuple = startDesignTuple;
calculator.EndTuple = finishDesignTuple;
calculator.NdmCollection = NdmPrimitivesService.GetNdms(ndmPrimitives, LimitState, CalcTerm);
calculator.Run();
var result = (CrackForceResult)calculator.Result;
if (result.IsValid)
{
//var softLogic = new ExponentialSofteningLogic() { ForceRatio = result.ActualFactor };
string message = string.Empty;
if (result.IsSectionCracked)
{
message += $"Actual crack factor {result.FactorOfCrackAppearance}\n";
message += $"Softening crack factor PsiS={result.PsiS}\n";
message += $"{GeometryNames.MomFstName}={result.TupleOfCrackAppearance.Mx},\n {GeometryNames.MomSndName}={result.TupleOfCrackAppearance.My},\n {GeometryNames.LongForceName}={result.TupleOfCrackAppearance.Nz}";
}
else
{
message += "Cracks are not apeared";
}
MessageBox.Show(
message,
"Crack results",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
ShowResult(result);
}
else
{
var errorVM = new ErrorProcessor()
{
ShortText = "Error apeared while crack calculate",
DetailText = result.Description
};
var wnd = new ErrorMessage(errorVM);
wnd.ShowDialog();
ShowError(result);
}
}
private static void ShowError(CrackForceResult result)
{
var errorVM = new ErrorProcessor()
{
ShortText = "Error apeared while crack calculate",
DetailText = result.Description
};
var wnd = new ErrorMessage(errorVM);
wnd.ShowDialog();
}
private static void ShowResult(CrackForceResult result)
{
//var softLogic = new ExponentialSofteningLogic() { ForceRatio = result.ActualFactor };
string message = string.Empty;
if (result.IsSectionCracked)
{
message += $"Actual crack factor {result.FactorOfCrackAppearance}\n";
message += $"Softening crack factor PsiS={result.PsiS}\n";
message += $"{GeometryNames.MomFstName}={result.TupleOfCrackAppearance.Mx},\n {GeometryNames.MomSndName}={result.TupleOfCrackAppearance.My},\n {GeometryNames.LongForceName}={result.TupleOfCrackAppearance.Nz}";
}
else
{
message += "Cracks are not apeared";
}
MessageBox.Show(
message,
"Crack results",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}
}

View File

@@ -39,7 +39,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
string[] labels = GetLabels(unitForce, unitMoment, unitCurvature);
arrayParameter = new ArrayParameter<double>(resultList.Count(), labels.Count(), labels);
CalculateWithoutCrack(resultList, unitForce, unitMoment, unitCurvature);
SafetyProcessor.RunSafeProcess(ShowWindow, "Errors apearred during showing graph, see detailed information");
SafetyProcessor.RunSafeProcess(ShowWindow, "Errors appeared during showing a graph, see detail information");
}
public void ShowCracks(List<IForcesTupleResult> results, IEnumerable<INdmPrimitive> ndmPrimitives)
{
@@ -51,7 +51,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
string[] labels = GetCrackLabels(unitForce, unitMoment, unitCurvature);
arrayParameter = new ArrayParameter<double>(resultList.Count(), labels.Count(), labels);
CalculateWithCrack(resultList, ndmPrimitives, unitForce, unitMoment, unitCurvature);
SafetyProcessor.RunSafeProcess(ShowWindow, "Errors apearred during showing graph, see detailed information");
SafetyProcessor.RunSafeProcess(ShowWindow, "Errors appeared during showing a graph, see detailed information");
}
private void CalculateWithCrack(List<IForcesTupleResult> resultList, IEnumerable<INdmPrimitive> ndmPrimitives, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)

View File

@@ -126,7 +126,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
showCrackResultLogic.CalcTerm = CalcTerms.ShortTerm; //= SelectedResult.DesignForceTuple.CalcTerm;
showCrackResultLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
showCrackResultLogic.ndmPrimitives = ndmPrimitives;
showCrackResultLogic.Show();
showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
}
public ICommand ShowCrackWidthResultCommand

View File

@@ -13,9 +13,13 @@ namespace StructureHelper.Windows.ViewModels.Forces
public class InterpolateTuplesViewModel : OkCancelViewModelBase
{
private RelayCommand invertForcesCommand;
private RelayCommand copyToStartCommand;
private RelayCommand copyToFinishCommand;
public IDesignForceTuple StartDesignForce { get; private set; }
public IDesignForceTuple FinishDesignForce { get; private set; }
public bool StepCountVisible { get; set; }
public double StartMx
{
get => StartDesignForce.ForceTuple.Mx;
@@ -77,19 +81,52 @@ namespace StructureHelper.Windows.ViewModels.Forces
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
}
public ICommand CopyToStartCommand
{
get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
}
public ICommand CopyToFinishCommand
{
get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
}
private void InvertForces()
{
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
StartDesignForce = FinishDesignForce;
FinishDesignForce = tmpForce;
OnPropertyChanged(nameof(StartMx));
OnPropertyChanged(nameof(StartMy));
OnPropertyChanged(nameof(StartNz));
StepCountVisible = true;
RefreshStartTuple();
RefreshFinishTuple();
}
private void CopyStartToFinish()
{
FinishDesignForce = StartDesignForce.Clone() as IDesignForceTuple;
RefreshFinishTuple();
}
private void CopyFinishToStart()
{
StartDesignForce = FinishDesignForce.Clone() as IDesignForceTuple;
RefreshStartTuple();
}
public void RefreshFinishTuple()
{
OnPropertyChanged(nameof(FinishMx));
OnPropertyChanged(nameof(FinishMy));
OnPropertyChanged(nameof(FinishNz));
}
public void RefreshStartTuple()
{
OnPropertyChanged(nameof(StartMx));
OnPropertyChanged(nameof(StartMy));
OnPropertyChanged(nameof(StartNz));
}
public InterpolateTuplesViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce=null, int stepCount = 100)
{
if (startDesignForce !=null)

View File

@@ -18,6 +18,8 @@ namespace StructureHelperCommon.Models.Calculators
public IAccuracy Accuracy {get;set;}
public IResult Result => result;
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public FindParameterCalculator()
{
StartValue = 0d;

View File

@@ -1,4 +1,5 @@
using System;
using LoaderCalculator.Data.ResultData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,5 +20,6 @@ namespace StructureHelperCommon.Models.Calculators
/// Result of Calculations
/// </summary>
IResult Result { get; }
Action<IResult> ActionToOutputResults { get; set; }
}
}

View File

@@ -21,6 +21,16 @@ namespace StructureHelperCommon.Models.Forces
/// <inheritdoc/>
public double Mz { get; set; }
public void Clear()
{
Mx = 0d;
My = 0d;
Nz = 0d;
Qx = 0d;
Qy = 0d;
Mz = 0d;
}
/// <inheritdoc/>
public object Clone()
{

View File

@@ -31,5 +31,6 @@ namespace StructureHelperCommon.Models.Forces
/// Twisting moment round about z-axis
/// </summary>
double Mz { get; set; }
void Clear();
}
}

View File

@@ -20,6 +20,16 @@ namespace StructureHelperCommon.Models.Forces
/// <inheritdoc/>
public double Mz { get; set; }
public void Clear()
{
Mx = 0d;
My = 0d;
Nz = 0d;
Qx = 0d;
Qy = 0d;
Mz = 0d;
}
/// <inheritdoc/>
public object Clone()
{

View File

@@ -11,7 +11,7 @@ namespace StructureHelperCommon.Services.Forces
public static void CopyProperties(IForceTuple source, IForceTuple target, double factor = 1d)
{
CheckTuples(source, target);
SumTupleToTarget(source, target, 0);
target.Clear();
SumTupleToTarget(source, target, factor);
}
public static IForceTuple MoveTupleIntoPoint(IForceTuple forceTuple, IPoint2D point2D)
@@ -66,7 +66,7 @@ namespace StructureHelperCommon.Services.Forces
}
return tuples;
}
private static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
public static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
{
target.Mx += source.Mx * factor;
target.My += source.My * factor;

View File

@@ -28,7 +28,8 @@ namespace StructureHelperCommon.Services.Units
public static IStringDoublePair DivideIntoStringDoublePair(string s)
{
s = s.Replace(" ", "");
string digitPattern = @"^[-]?[+]?\d+(\.?|\,?)\d*";
//string digitPattern = @"^[-]?[+]?\d+(\.?)|(\,?)\d*";
string digitPattern = @"^[-]?[+]?\d*\.?\,?\d*";
string textPattern = @"[0-9]|\.|\,";
string caracterPattern = "[a-z]+$";
string target = "";

View File

@@ -24,6 +24,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public ICompressedMember CompressedMember { get; }
public IAccuracy Accuracy { get; set; }
public List<IForceCombinationList> ForceCombinationLists { get; private set; }
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Run()
{
var checkResult = CheckInputData();

View File

@@ -9,6 +9,8 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using LoaderCalculator.Data.ResultData;
using System.Windows;
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{
@@ -18,6 +20,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public string Name { get; set; }
public IResult Result { get; private set; }
public Action<IResult> ActionToOutputResults { get; set; }
public ForceTupleCalculator(IForceTupleInputData inputData)
{
InputData = inputData;
@@ -51,6 +55,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
MaxIterationCount = accuracy.MaxIterationCount,
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
},
ActionToOutputResults = ShowResultToConsole,
NdmCollection = ndmCollection
};
var calculator = new Calculator();
@@ -79,5 +84,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{
throw new NotImplementedException();
}
private static void ShowResultToConsole(ILoaderResults result)
{
var strain = result.StrainMatrix;
//MessageBox.Show($" Текущие результаты в {result.IterationCounter} итерации:");
}
}
}

View File

@@ -18,6 +18,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
public IResult Result => geometryResult;
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public GeometryCalculator(IEnumerable<INdm> ndms, IStrainMatrix strainMatrix)
{
parametersLogic = new TextParametersLogic(ndms, strainMatrix);

View File

@@ -27,6 +27,7 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
public IResult Result { get; private set; }
public IAccuracy Accuracy { get; set; }
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
private (double EtaAlongX, double EtaAlongY) GetBucklingCoefficients()
{

View File

@@ -29,6 +29,9 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
public IEnumerable<INdm> NdmCollection { get; set; }
public Accuracy Accuracy {get;set; }
public IResult Result => result;
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public CrackForceCalculator(IForceTupleCalculator forceTupleCalculator)
{
StartTuple ??= new ForceTuple();

View File

@@ -23,6 +23,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
public CrackWidthCalculatorInputData InputData { get; set; }
public IResult Result => result;
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Run()
{
result = new() { IsValid = true, Description = ""};

View File

@@ -15,6 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
public ICrackWidthSimpleCalculatorInputData InputData { get; set; }
public IResult Result => result;
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Run()
{

View File

@@ -16,4 +16,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="NdmCalculations\Analyses\Interaction\" />
</ItemGroup>
</Project>