Icons were added

This commit is contained in:
Evgeny Redikultsev
2023-08-12 14:53:38 +05:00
parent ce97586d2b
commit 80302525b3
103 changed files with 1133 additions and 449 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace StructureHelper.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StructureHelper.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -22,6 +22,23 @@
<Page Remove="StructureHelperLogics\**" /> <Page Remove="StructureHelperLogics\**" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Remove="Windows\MainWindow\Add_Circle.png" />
<None Remove="Windows\MainWindow\Add_Rebar.png" />
<None Remove="Windows\MainWindow\Copy.png" />
<None Remove="Windows\MainWindow\Delete.png" />
<None Remove="Windows\MainWindow\Edit.png" />
<None Remove="Windows\MainWindow\Edit_Circle_RC.png" />
<None Remove="Windows\MainWindow\Edit_Concrete beam.png" />
<None Remove="Windows\MainWindow\Edit_Concrete column.png" />
<None Remove="Windows\MainWindow\Edit_Concrete slab.png" />
<None Remove="Windows\MainWindow\Materials.png" />
<None Remove="Windows\MainWindow\Point_Primitive.png" />
<None Remove="Windows\MainWindow\Rectangle_Primitive.png" />
<None Remove="Windows\MainWindow\ToBackground.png" />
<None Remove="Windows\MainWindow\ToForeground.png" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Autofac" Version="6.5.0" /> <PackageReference Include="Autofac" Version="6.5.0" />
<PackageReference Include="LiveCharts.Wpf" Version="0.9.7" /> <PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
@@ -51,6 +68,44 @@
<ItemGroup> <ItemGroup>
<Folder Include="Documentation\Manuals\" /> <Folder Include="Documentation\Manuals\" />
<Folder Include="Infrastructure\UI\DataContexts\Logics\" /> <Folder Include="Infrastructure\UI\DataContexts\Logics\" />
<Folder Include="Infrastructure\UI\Icons\" />
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Windows\MainWindow\Add_Circle.png" />
<Resource Include="Windows\MainWindow\Add_Rebar.png" />
<Resource Include="Windows\MainWindow\Copy.png" />
<Resource Include="Windows\MainWindow\Delete.png" />
<Resource Include="Windows\MainWindow\Edit.png" />
<Resource Include="Windows\MainWindow\Point_Primitive.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Windows\MainWindow\Rectangle_Primitive.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Windows\MainWindow\Edit_Circle_RC.png" />
<Resource Include="Windows\MainWindow\Edit_Concrete beam.png" />
<Resource Include="Windows\MainWindow\Edit_Concrete column.png" />
<Resource Include="Windows\MainWindow\Edit_Concrete slab.png" />
<Resource Include="Windows\MainWindow\Materials.png" />
<Resource Include="Windows\MainWindow\ToBackground.png" />
<Resource Include="Windows\MainWindow\ToForeground.png" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -56,10 +56,7 @@ namespace StructureHelper.Windows.MainWindow
ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm }; ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию) //Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
List<INdm> ndmCollection = new List<INdm>(); return ndmPrimitives.SelectMany(x => x.GetNdms(options));
ndmCollection.AddRange(Triangulation.GetNdms(ndmPrimitives, options));
return ndmCollection;
} }
} }
} }

View File

@@ -15,6 +15,14 @@
d:DataContext="{d:DesignInstance local:MainViewModel}" d:DataContext="{d:DesignInstance local:MainViewModel}"
Title="StructureHelper" Height="700" Width="1000" MinHeight="400" MinWidth="600"> Title="StructureHelper" Height="700" Width="1000" MinHeight="400" MinWidth="600">
<Window.Resources> <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}"> <DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
<dataTemplates:RectangleTemplate/> <dataTemplates:RectangleTemplate/>
</DataTemplate> </DataTemplate>
@@ -25,17 +33,55 @@
<dataTemplates:EllipseTemplate/> <dataTemplates:EllipseTemplate/>
</DataTemplate> </DataTemplate>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<ContextMenu x:Key="PrimitivesMenu">
<MenuItem Header="Add" DataContext="{Binding PrimitiveLogic}">
<MenuItem Header="Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Rectangle_Primitive.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Circle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Add_Circle.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Add_Rebar.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Point_primitive.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="Templates">
<MenuItem Header="Add Rectangle RC Column" Command="{Binding AddColumnCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Concrete column.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add Circle RC Column" Command="{Binding AddRCCircleCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Circle_RC.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add RC Beam" Command="{Binding AddBeamCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Concrete beam.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add RC slab" Command="{Binding AddSlabCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Concrete slab.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</ContextMenu>
</Window.Resources> </Window.Resources>
<Grid> <DockPanel>
<Grid.RowDefinitions> <Menu DockPanel.Dock="Top" x:Name="menu">
<RowDefinition Height="20"/>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Menu x:Name="menu">
<MenuItem Header="File"> <MenuItem Header="File">
</MenuItem> </MenuItem>
<MenuItem Header="Edit"> <MenuItem Header="Edit">
@@ -65,211 +111,269 @@
<Button Content="About..." Command="{Binding HelpLogic.ShowAbout}"/> <Button Content="About..." Command="{Binding HelpLogic.ShowAbout}"/>
</MenuItem> </MenuItem>
</Menu> </Menu>
<Grid Grid.Row="1"> <ToolBarTray DockPanel.Dock="Top">
<Grid.ColumnDefinitions> <ToolBar DataContext="{Binding CombinationsLogic}" ToolTip="Actions">
<ColumnDefinition Width="Auto"/> <Button Style="{StaticResource ToolButton}"
<ColumnDefinition Width="*"/> Command="{Binding Add}"
</Grid.ColumnDefinitions> CommandParameter="{x:Static enums:ActionType.ForceCombination}"
<ScrollViewer VerticalScrollBarVisibility="Auto"> Content="Full" ToolTip="Add Full Combination"/>
<StackPanel> <Button Style="{StaticResource ToolButton}"
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}"> Command="{Binding Add}"
<Expander.ContextMenu> CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"
<ContextMenu> Content="Fact" ToolTip="Add Factored Combination"/>
<MenuItem Header="Add"> </ToolBar>
<Button Content="Combination" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombination}"/> <ToolBar DataContext="{Binding MaterialsLogic}" ToolTip="Materials">
<Button Content="Combination By Factors" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"/> <Button Style="{StaticResource ToolButton}"
</MenuItem> Command="{Binding Add}"
</ContextMenu> CommandParameter="{x:Static enums:MaterialType.Concrete}"
</Expander.ContextMenu> Content="Con" ToolTip="Add Concrete Material"/>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}"> <Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}" Content="RF" ToolTip="Add Reinforcement Material"/>
<ListBox.ContextMenu> <Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}" Content="Elast" ToolTip="Add Elastic Material"/>
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}" Content="CFR" ToolTip="Add Carbon Fiber Material"/>
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}" Content="GFR" ToolTip="Add Glass Fiber Material"/>
<Button Command="{Binding EditMaterialsCommand}" ToolTip="Show Materials">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Materials.png"/>
</Button>
</ToolBar>
<ToolBar ToolTip="Base Primitives" DataContext="{Binding PrimitiveLogic}">
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}" ToolTip="Add Rectangle Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Rectangle_Primitive.png"/>
</Button>
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}" ToolTip="Add Circle Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Add_Circle.png"/>
</Button>
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}" ToolTip="Add Rebar Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Add_Rebar.png"/>
</Button>
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}" ToolTip="Add Point Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Point_primitive.png"/>
</Button>
</ToolBar>
<ToolBar ToolTip="RC Templates">
<Button Command="{Binding AddColumnCase}" ToolTip="Add Rectangle RC Column">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Concrete column.png"/>
</Button>
<Button Command="{Binding AddRCCircleCase}" ToolTip="Add Circle RC Column">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Circle_RC.png"/>
</Button>
<Button Command="{Binding AddBeamCase}" ToolTip="Add RC Beam">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Concrete beam.png"/>
</Button>
<Button Command="{Binding AddSlabCase}" ToolTip="Add RC Slab">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Concrete slab.png"/>
</Button>
</ToolBar>
</ToolBarTray>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}">
<Expander.ContextMenu>
<ContextMenu> <ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/> <MenuItem Header="Add">
<Button Content="Copy" Command="{Binding Copy}"/> <Button Content="Combination" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombination}"/>
<Button Content="Delete" Command="{Binding Delete}"/> <Button Content="Combination By Factors" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"/>
</MenuItem>
</ContextMenu> </ContextMenu>
</ListBox.ContextMenu> </Expander.ContextMenu>
<ListBox.ItemTemplate> <ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<DataTemplate> <ListBox.ContextMenu>
<Grid> <ContextMenu>
<TextBlock Text="{Binding Name}"/> <Button Content="Edit" Command="{Binding Edit}"/>
</Grid> <Button Content="Copy" Command="{Binding Copy}"/>
</DataTemplate> <Button Content="Delete" Command="{Binding Delete}"/>
</ListBox.ItemTemplate> </ContextMenu>
</ListBox> </ListBox.ContextMenu>
</Expander> <ListBox.ItemTemplate>
<Expander Header="Materials" MinWidth="20" DataContext="{Binding MaterialsLogic}"> <DataTemplate>
<Expander.ContextMenu> <Grid>
<ContextMenu> <TextBlock Text="{Binding Name}"/>
<Button Content="Materials" Command="{Binding EditMaterialsCommand}"/> </Grid>
<MenuItem Header="Add"> </DataTemplate>
<Button Content="Concrete" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}"/> </ListBox.ItemTemplate>
<Button Content="Reinforcement" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}"/> </ListBox>
<Button Content="Elastic" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}"/> </Expander>
<Button Content="CarbonFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}"/> <Expander Header="Materials" MinWidth="20" DataContext="{Binding MaterialsLogic}">
<Button Content="GlassFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}"/> <Expander.ContextMenu>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
<ContextMenu> <ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/> <Button Content="Materials" Command="{Binding EditMaterialsCommand}"/>
<Button Content="Copy" Command="{Binding Copy}"/> <MenuItem Header="Add">
<Button Content="Delete" Command="{Binding Delete}"/> <Button Content="Concrete" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}"/>
<Button Content="Reinforcement" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}"/>
<Button Content="Elastic" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}"/>
<Button Content="CarbonFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}"/>
<Button Content="GlassFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}"/>
</MenuItem>
</ContextMenu> </ContextMenu>
</ListBox.ContextMenu> </Expander.ContextMenu>
</ListBox> <ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
</Expander> <ListBox.ContextMenu>
<Expander Header="Geometry" MinWidth="20" DataContext="{Binding PrimitiveLogic}"> <ContextMenu>
<Expander.ContextMenu> <Button Content="Edit" Command="{Binding Edit}"/>
<ContextMenu> <Button Content="Copy" Command="{Binding Copy}"/>
<MenuItem Header="Add"> <Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}"/> </ContextMenu>
<Button Content="Circle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}"/> </ListBox.ContextMenu>
<Button Content="Rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}"/> </ListBox>
<Button Content="Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}"/> </Expander>
</MenuItem> <Expander Header="Geometry" MinWidth="20" ContextMenu="{StaticResource PrimitivesMenu}">
</ContextMenu> <ListBox DataContext="{Binding PrimitiveLogic}" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
</Expander.ContextMenu> <ListBox.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}"> <ContextMenu>
<ListBox.ContextMenu> <Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="To Foreground" Command="{Binding SetToFront}"/>
<Button Content="To Background" Command="{Binding SetToBack}"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Analyses" MinWidth="20" DataContext="{Binding CalculatorsLogic}">
<Expander.ContextMenu>
<ContextMenu> <ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/> <Button Content="Add Calculator" Command="{Binding Add}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="To Foreground" Command="{Binding SetToFront}"/>
<Button Content="To Background" Command="{Binding SetToBack}"/>
</ContextMenu> </ContextMenu>
</ListBox.ContextMenu> </Expander.ContextMenu>
</ListBox> <ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
</Expander> <ListBox.ContextMenu>
<Expander Header="Analyses" MinWidth="20" DataContext="{Binding CalculatorsLogic}"> <ContextMenu>
<Expander.ContextMenu> <Button Content="Run" Command="{Binding Run}"/>
<ContextMenu> <Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Add Calculator" Command="{Binding Add}"/> <Button Content="Copy" Command="{Binding Copy}"/>
</ContextMenu> <Button Content="Delete" Command="{Binding Delete}"/>
</Expander.ContextMenu> </ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}"> </ListBox.ContextMenu>
<ListBox.ContextMenu> <ListBox.ItemTemplate>
<ContextMenu> <DataTemplate>
<Button Content="Run" Command="{Binding Run}"/> <Grid>
<Button Content="Edit" Command="{Binding Edit}"/> <TextBlock Text="{Binding Name}"/>
<Button Content="Copy" Command="{Binding Copy}"/> </Grid>
<Button Content="Delete" Command="{Binding Delete}"/> </DataTemplate>
</ContextMenu> </ListBox.ItemTemplate>
</ListBox.ContextMenu> </ListBox>
<ListBox.ItemTemplate> </Expander>
<DataTemplate> </StackPanel>
<Grid> </ScrollViewer>
<TextBlock Text="{Binding Name}"/> <Border BorderBrush="Black" Background="White" BorderThickness="1" Margin="5" Grid.Column="1">
</Grid> <i:Interaction.Triggers>
</DataTemplate> <i:EventTrigger EventName="PreviewMouseDown">
</ListBox.ItemTemplate> <i:InvokeCommandAction Command="{Binding ClearSelection}" CommandParameter="{Binding}"/>
</ListBox> </i:EventTrigger>
</Expander> </i:Interaction.Triggers>
</StackPanel> <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
</ScrollViewer> <Canvas Name="WorkPlane" ClipToBounds="True" Width="{Binding CanvasWidth}" Height="{Binding CanvasHeight}" ContextMenu="{StaticResource PrimitivesMenu}">
<Border BorderBrush="Black" Background="White" BorderThickness="1" Margin="5" Grid.Column="1"> <i:Interaction.Behaviors>
<i:Interaction.Triggers> <infrastructure:MouseBehaviour MouseX="{Binding PanelX, Mode=OneWayToSource}" MouseY="{Binding PanelY, Mode=OneWayToSource}"/>
<i:EventTrigger EventName="PreviewMouseDown"> </i:Interaction.Behaviors>
<i:InvokeCommandAction Command="{Binding ClearSelection}" CommandParameter="{Binding}"/> <i:Interaction.Triggers>
</i:EventTrigger> <mouseEventTriggers:MouseWheelDownEventTrigger EventName="PreviewMouseWheel">
</i:Interaction.Triggers> <i:InvokeCommandAction Command="{Binding ScaleCanvasDown}"/>
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible"> </mouseEventTriggers:MouseWheelDownEventTrigger>
<Canvas Name="WorkPlane" ClipToBounds="True" Width="{Binding CanvasWidth}" Height="{Binding CanvasHeight}"> <mouseEventTriggers:MouseWheelUpEventTrigger EventName="PreviewMouseWheel">
<Canvas.ContextMenu> <i:InvokeCommandAction Command="{Binding ScaleCanvasUp}"/>
<ContextMenu> </mouseEventTriggers:MouseWheelUpEventTrigger>
<MenuItem Header="Add"> </i:Interaction.Triggers>
<Button Content="Rectangle" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}"/> <Canvas.LayoutTransform>
<Button Content="Circle" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}"/> <TransformGroup>
<Button Content="Rebar" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}"/> <ScaleTransform ScaleX="{Binding ScaleValue}" ScaleY="{Binding ScaleValue}"
<Button Content="Point" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}"/>
</MenuItem>
<MenuItem Header="Templates">
<Button Content="Concrete beam" Command="{Binding AddBeamCase}"/>
<Button Content="Concrete column" Command="{Binding AddColumnCase}"/>
<Button Content="Concrete slab" Command="{Binding AddSlabCase}"/>
<Button Content="Concrete circle" Command="{Binding AddRCCircleCase}"/>
</MenuItem>
</ContextMenu>
</Canvas.ContextMenu>
<i:Interaction.Behaviors>
<infrastructure:MouseBehaviour MouseX="{Binding PanelX, Mode=OneWayToSource}" MouseY="{Binding PanelY, Mode=OneWayToSource}"/>
</i:Interaction.Behaviors>
<i:Interaction.Triggers>
<mouseEventTriggers:MouseWheelDownEventTrigger EventName="PreviewMouseWheel">
<i:InvokeCommandAction Command="{Binding ScaleCanvasDown}"/>
</mouseEventTriggers:MouseWheelDownEventTrigger>
<mouseEventTriggers:MouseWheelUpEventTrigger EventName="PreviewMouseWheel">
<i:InvokeCommandAction Command="{Binding ScaleCanvasUp}"/>
</mouseEventTriggers:MouseWheelUpEventTrigger>
</i:Interaction.Triggers>
<Canvas.LayoutTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding ScaleValue}" ScaleY="{Binding ScaleValue}"
CenterX="{Binding ScrollPanelX}" CenterY="{Binding ScrollPanelY}"/> CenterX="{Binding ScrollPanelX}" CenterY="{Binding ScrollPanelY}"/>
</TransformGroup> </TransformGroup>
</Canvas.LayoutTransform> </Canvas.LayoutTransform>
<Canvas.Background> <Canvas.Background>
<VisualBrush TileMode="Tile" <VisualBrush TileMode="Tile"
Viewport="{Binding CanvasViewportSize}" ViewportUnits="Absolute" Viewport="{Binding CanvasViewportSize}" ViewportUnits="Absolute"
Viewbox="{Binding CanvasViewportSize}" ViewboxUnits="Absolute"> Viewbox="{Binding CanvasViewportSize}" ViewboxUnits="Absolute">
<VisualBrush.Visual> <VisualBrush.Visual>
<Rectangle StrokeThickness="{Binding GridLineThickness}" Height="{Binding GridSize}" Width="{Binding GridSize}" Stroke="Darkgray"/> <Rectangle StrokeThickness="{Binding GridLineThickness}" Height="{Binding GridSize}" Width="{Binding GridSize}" Stroke="Darkgray"/>
</VisualBrush.Visual> </VisualBrush.Visual>
</VisualBrush> </VisualBrush>
</Canvas.Background> </Canvas.Background>
<Line X1="0" X2="{Binding XX2}" Y1="{Binding XY1}" Y2="{Binding XY1}" Stroke="Red" StrokeThickness="{Binding AxisLineThickness}"/> <Line X1="0" X2="{Binding XX2}" Y1="{Binding XY1}" Y2="{Binding XY1}" Stroke="Red" StrokeThickness="{Binding AxisLineThickness}"/>
<Line X1="{Binding YX1}" X2="{Binding YX1}" Y1="0" Y2="{Binding YY2}" Stroke="ForestGreen" StrokeThickness="{Binding AxisLineThickness}"/> <Line X1="{Binding YX1}" X2="{Binding YX1}" Y1="0" Y2="{Binding YY2}" Stroke="ForestGreen" StrokeThickness="{Binding AxisLineThickness}"/>
<ItemsControl ItemsSource="{Binding PrimitiveLogic.Items}" d:DataContext="{d:DesignInstance vm:MainViewModel}"> <ItemsControl ItemsSource="{Binding PrimitiveLogic.Items}" d:DataContext="{d:DesignInstance vm:MainViewModel}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<Canvas/> <Canvas/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle> <ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter"> <Style TargetType="ContentPresenter">
<Setter Property="Canvas.ZIndex" Value="{Binding ZIndex}"/> <Setter Property="Canvas.ZIndex" Value="{Binding ZIndex}"/>
<Setter Property="Canvas.Left" Value="{Binding PrimitiveLeft}"/> <Setter Property="Canvas.Left" Value="{Binding PrimitiveLeft}"/>
<Setter Property="Canvas.Top" Value="{Binding PrimitiveTop}"/> <Setter Property="Canvas.Top" Value="{Binding PrimitiveTop}"/>
<Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/> <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<EventSetter Event="MouseDown" Handler="ContentPresenter_MouseLeftButtonDown"/> <EventSetter Event="MouseDown" Handler="ContentPresenter_MouseLeftButtonDown"/>
</Style> </Style>
</ItemsControl.ItemContainerStyle> </ItemsControl.ItemContainerStyle>
<ItemsControl.ContextMenu> <ItemsControl.ContextMenu>
<ContextMenu> <ContextMenu>
<Button Content="Edit primitive" Command="{Binding PrimitiveLogic.Edit}"/> <MenuItem Header="Edit" Command="{Binding PrimitiveLogic.Edit}">
<Button Content="Copy" Command="{Binding PrimitiveLogic.Copy}"/> <MenuItem.Icon>
<Button Content="Delete" Command="{Binding PrimitiveLogic.Delete}"/> <Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
<Button Content="To Foreground" Command="{Binding PrimitiveLogic.SetToFront}"/> </MenuItem.Icon>
<Button Content="To Background" Command="{Binding PrimitiveLogic.SetToBack}"/> </MenuItem>
</ContextMenu> <MenuItem Header="Copy" Command="{Binding PrimitiveLogic.Copy}">
</ItemsControl.ContextMenu> <MenuItem.Icon>
</ItemsControl> <Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
</Canvas> </MenuItem.Icon>
</ScrollViewer> </MenuItem>
</Border> <MenuItem Header="Delete" Command="{Binding PrimitiveLogic.Delete}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="To Foreground" Command="{Binding PrimitiveLogic.SetToFront}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToForeground.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="To Background" Command="{Binding PrimitiveLogic.SetToBack}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToBackground.png" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</ItemsControl.ContextMenu>
</ItemsControl>
</Canvas>
</ScrollViewer>
</Border>
</Grid>
<StatusBar Grid.Row="1">
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Zoom: "/>
<TextBlock Text="{Binding ScaleValue}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Number of primitives: "/>
<TextBlock Text="{Binding PrimitiveLogic.PrimitivesCount}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Grid size: "/>
<TextBlock Text="{Binding GridSize, Converter={StaticResource LengthConverter}}"/>
</StackPanel>
</StatusBarItem>
</StatusBar>
</Grid> </Grid>
<StatusBar Grid.Row="2">
<StatusBarItem>
<StackPanel Orientation="Horizontal"> </DockPanel>
<TextBlock Text="Zoom: "/>
<TextBlock Text="{Binding ScaleValue}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Number of primitives: "/>
<TextBlock Text="{Binding PrimitiveLogic.PrimitivesCount}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Grid size: "/>
<TextBlock Text="{Binding GridSize, Converter={StaticResource LengthConverter}}"/>
</StackPanel>
</StatusBarItem>
</StatusBar>
</Grid>
</Window> </Window>

View File

@@ -306,8 +306,8 @@ namespace StructureHelper.Windows.MainWindow
var center = GeometryOperations.GetGravityCenter(ndms); var center = GeometryOperations.GetGravityCenter(ndms);
foreach (var item in PrimitiveLogic.Items) foreach (var item in PrimitiveLogic.Items)
{ {
item.CenterX -= center.CenterX; item.CenterX -= center.Cx;
item.CenterY -= center.CenterY; item.CenterY -= center.Cy;
} }
}, },
o => repository.Primitives.Count() > 0 o => repository.Primitives.Count() > 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -19,11 +19,11 @@ namespace StructureHelper.Windows.ViewModels.Calculations.CalculationProperies
{ {
get get
{ {
return calculationProperty.IterationProperty.Accuracy; return calculationProperty.Accuracy.IterationAccuracy;
} }
set set
{ {
calculationProperty.IterationProperty.Accuracy = value; calculationProperty.Accuracy.IterationAccuracy = value;
OnPropertyChanged(nameof(IterationAccuracy)); OnPropertyChanged(nameof(IterationAccuracy));
} }
} }
@@ -31,11 +31,11 @@ namespace StructureHelper.Windows.ViewModels.Calculations.CalculationProperies
{ {
get get
{ {
return calculationProperty.IterationProperty.MaxIterationCount; return calculationProperty.Accuracy.MaxIterationCount;
} }
set set
{ {
calculationProperty.IterationProperty.MaxIterationCount = value; calculationProperty.Accuracy.MaxIterationCount = value;
OnPropertyChanged(nameof(MaxIterationCount)); OnPropertyChanged(nameof(MaxIterationCount));
} }
} }

View File

@@ -29,6 +29,7 @@ using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Analyses.Geometry; using StructureHelperLogics.NdmCalculations.Analyses.Geometry;
using StructureHelperLogics.NdmCalculations.Cracking; using StructureHelperLogics.NdmCalculations.Cracking;
using StructureHelperLogics.NdmCalculations.Primitives; using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmCalculations; using StructureHelperLogics.Services.NdmCalculations;
using StructureHelperLogics.Services.NdmPrimitives; using StructureHelperLogics.Services.NdmPrimitives;
using System; using System;
@@ -264,6 +265,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
{ {
var limitState = SelectedResult.DesignForceTuple.LimitState; var limitState = SelectedResult.DesignForceTuple.LimitState;
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm; var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
var orderedNdmPrimitives = ndmPrimitives.OrderBy(x => x.VisualProperty.ZIndex); var orderedNdmPrimitives = ndmPrimitives.OrderBy(x => x.VisualProperty.ZIndex);
var ndmRange = new List<INdm>(); var ndmRange = new List<INdm>();
foreach (var item in orderedNdmPrimitives) foreach (var item in orderedNdmPrimitives)
@@ -278,7 +280,8 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
} }
if (selectedNdmPrimitives.Contains(item) & item.Triangulate == true) if (selectedNdmPrimitives.Contains(item) & item.Triangulate == true)
{ {
ndmRange.AddRange(NdmPrimitivesService.GetNdms(item, limitState, calcTerm));
ndmRange.AddRange(item.GetNdms(triangulationOptions));
} }
} }
ndms = ndmRange; ndms = ndmRange;

View File

@@ -20,5 +20,6 @@
public static string ParameterIsNull => "#0015: Parameter is null"; public static string ParameterIsNull => "#0015: Parameter is null";
public static string ResultIsNotValid => "#0016: Result is not valid"; public static string ResultIsNotValid => "#0016: Result is not valid";
public static string ErrorOfExuting => "#0017: Error of executing"; public static string ErrorOfExuting => "#0017: Error of executing";
public static string ExpectedWas(System.Type expected, System.Type was) => $"{DataIsInCorrect}: Expected {expected}, but was {was}";
} }
} }

View File

@@ -1,4 +1,5 @@
using StructureHelperCommon.Infrastructures.Enums; using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Calculators;
using System.Collections.Generic; using System.Collections.Generic;
namespace StructureHelperLogics.Models.Calculations.CalculationProperties namespace StructureHelperLogics.Models.Calculations.CalculationProperties
@@ -8,7 +9,7 @@ namespace StructureHelperLogics.Models.Calculations.CalculationProperties
public List<IForceCombination> ForceCombinations { get; set; } public List<IForceCombination> ForceCombinations { get; set; }
public LimitStates LimitState { get; set; } public LimitStates LimitState { get; set; }
public CalcTerms CalcTerm { get; set; } public CalcTerms CalcTerm { get; set; }
public IIterationProperty IterationProperty { get; } public IAccuracy Accuracy { get; }
public CalculationProperty() public CalculationProperty()
{ {
@@ -18,7 +19,7 @@ namespace StructureHelperLogics.Models.Calculations.CalculationProperties
}; };
LimitState = LimitStates.ULS; LimitState = LimitStates.ULS;
CalcTerm = CalcTerms.ShortTerm; CalcTerm = CalcTerms.ShortTerm;
IterationProperty = new IterationProperty() { Accuracy = 0.001d, MaxIterationCount = 100}; Accuracy = new Accuracy () { IterationAccuracy = 0.001d, MaxIterationCount = 100};
} }
} }
} }

View File

@@ -1,4 +1,5 @@
using StructureHelperCommon.Infrastructures.Enums; using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Calculators;
using System.Collections.Generic; using System.Collections.Generic;
namespace StructureHelperLogics.Models.Calculations.CalculationProperties namespace StructureHelperLogics.Models.Calculations.CalculationProperties
@@ -8,6 +9,6 @@ namespace StructureHelperLogics.Models.Calculations.CalculationProperties
List<IForceCombination> ForceCombinations { get; set; } List<IForceCombination> ForceCombinations { get; set; }
LimitStates LimitState { get; set; } LimitStates LimitState { get; set; }
CalcTerms CalcTerm { get; set; } CalcTerms CalcTerm { get; set; }
IIterationProperty IterationProperty {get;} IAccuracy Accuracy {get;}
} }
} }

View File

@@ -55,7 +55,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
if (combination.SetInGravityCenter == true) if (combination.SetInGravityCenter == true)
{ {
var loaderPoint = LoaderCalculator.Logics.Geometry.GeometryOperations.GetGravityCenter(ndms); var loaderPoint = LoaderCalculator.Logics.Geometry.GeometryOperations.GetGravityCenter(ndms);
point2D = new Point2D() { X = loaderPoint.CenterX, Y = loaderPoint.CenterY }; point2D = new Point2D() { X = loaderPoint.Cx, Y = loaderPoint.Cy };
} }
else point2D = combination.ForcePoint; else point2D = combination.ForcePoint;
var newTuple = ForceTupleService.MoveTupleIntoPoint(tuple.ForceTuple, point2D) as ForceTuple; var newTuple = ForceTupleService.MoveTupleIntoPoint(tuple.ForceTuple, point2D) as ForceTuple;

View File

@@ -4,6 +4,7 @@ using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions; using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperLogics.Models.Materials; using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.NdmCalculations.Primitives; using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -28,8 +29,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{ {
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": main material is incorrect or null"); throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": main material is incorrect or null");
} }
var material = ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm); var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
var ndm = ndmPrimitive.GetNdms(material).Single(); var ndm = ndmPrimitive.GetNdms(triangulationOptions).Single();
if (strainMatrix is not null) if (strainMatrix is not null)
{ {
inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm); inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm);

View File

@@ -81,10 +81,10 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
var otherInertia = GeometryOperations.GetReducedMomentsOfInertia(otherNdms, gravityCenter); var otherInertia = GeometryOperations.GetReducedMomentsOfInertia(otherNdms, gravityCenter);
var stiffnessX = stiffnessLogicX.GetStiffnessCoeffitients(); var stiffnessX = stiffnessLogicX.GetStiffnessCoeffitients();
var dX = stiffnessX.Kc * concreteInertia.MomentX + stiffnessX.Ks * otherInertia.MomentX; var dX = stiffnessX.Kc * concreteInertia.EIx + stiffnessX.Ks * otherInertia.EIx;
var stiffnessY = stiffnessLogicY.GetStiffnessCoeffitients(); var stiffnessY = stiffnessLogicY.GetStiffnessCoeffitients();
var dY = stiffnessY.Kc * concreteInertia.MomentY + stiffnessY.Ks * otherInertia.MomentY; var dY = stiffnessY.Kc * concreteInertia.EIy + stiffnessY.Ks * otherInertia.EIy;
return (dX, dY); return (dX, dY);
} }

View File

@@ -0,0 +1,33 @@
using LoaderCalculator.Data.Ndms;
using StructureHelperCommon.Infrastructures.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public class AverageDiameterLogic : IAverageDiameterLogic
{
public IEnumerable<RebarNdm> Rebars { get; set; }
public double GetAverageDiameter()
{
Check();
var rebarArea = Rebars
.Sum(x => x.Area);
var rebarCount = Rebars.Count();
var averageArea = rebarArea / rebarCount;
var diameter = Math.Sqrt(averageArea / Math.PI);
return diameter;
}
private void Check()
{
if (!Rebars.Any())
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": rebars count must be greater then zero");
}
}
}
}

View File

@@ -0,0 +1,53 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public class CrackWidthLogicSP63 : ICrackWidthLogic
{
public double RebarStrain { get; set; }
public double ConcreteStrain { get; set; }
public double Length { get; set; }
public double TermFactor { get; set; }
public double BondFactor { get; set; }
public double StressStateFactor { get; set; }
public double PsiSFactor { get; set; }
public double GetCrackWidth()
{
CheckOptions();
//check if strain of concrete greater than strain of rebar
if (ConcreteStrain > RebarStrain) { return 0d; }
double width = (RebarStrain - ConcreteStrain) * Length;
width *= TermFactor * BondFactor * StressStateFactor * PsiSFactor;
return width;
}
private void CheckOptions()
{
if (Length <=0d)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": length between cracks L={Length} must be greate than zero");
}
if (TermFactor <= 0d)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Term factor {TermFactor} must be greate than zero");
}
if (BondFactor <= 0d)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {BondFactor} must be greate than zero");
}
if (StressStateFactor <= 0d)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {StressStateFactor} must be greate than zero");
}
if (PsiSFactor <= 0d)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": PsiS factor {PsiSFactor} must be greate than zero");
}
}
}
}

View File

@@ -0,0 +1,15 @@
using LoaderCalculator.Data.Ndms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public interface IAverageDiameterLogic
{
IEnumerable<RebarNdm> Rebars { get; set; }
double GetAverageDiameter();
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
/// <summary>
/// Logic for calculating width of crack
/// </summary>
public interface ICrackWidthLogic
{
/// <summary>
/// strain of rebar, dimensionless
/// </summary>
double RebarStrain { get; set; }
/// <summary>
/// strain of concrete, dimensionless
/// </summary>
double ConcreteStrain { get; set; }
/// <summary>
/// Length between cracks in meters
/// </summary>
double Length { get; set; }
/// <summary>
/// return width of crack in meters
/// </summary>
double GetCrackWidth();
}
}

View File

@@ -0,0 +1,17 @@
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public interface ILengthBetweenCracksLogic
{
IEnumerable<INdm> NdmCollection { get; set; }
IStrainMatrix StrainMatrix { get; set; }
double GetLength();
}
}

View File

@@ -0,0 +1,21 @@
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using StructureHelperCommon.Models.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
/// <summary>
/// Logic fo calculating of tensile area of RC crosssection
/// </summary>
public interface ITensileAreaLogic
{
IEnumerable<INdm> NdmCollection { get; set; }
IStrainMatrix StrainMatrix { get; set; }
double GetTensileArea();
}
}

View File

@@ -0,0 +1,49 @@
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public class LengthBetweenCracksLogicSP63 : ILengthBetweenCracksLogic
{
const double minDiameterFactor = 10d;
const double maxDiameterFactor = 40d;
const double minLength = 0.1d;
const double maxLength = 0.4d;
readonly IAverageDiameterLogic diameterLogic;
readonly ITensileAreaLogic tensileAreaLogic;
public IEnumerable<INdm> NdmCollection { get; set; }
public IStrainMatrix StrainMatrix { get; set; }
public LengthBetweenCracksLogicSP63(IAverageDiameterLogic diameterLogic, ITensileAreaLogic tensileAreaLogic)
{
this.diameterLogic = diameterLogic;
this.tensileAreaLogic = tensileAreaLogic;
}
public LengthBetweenCracksLogicSP63() :
this
( new AverageDiameterLogic(),
new TensileAreaLogicSP63())
{ }
public double GetLength()
{
var rebars = NdmCollection
.Where(x => x is RebarNdm)
.Select(x => x as RebarNdm);
var rebarArea = rebars.Sum(x => x.Area * x.StressScale);
diameterLogic.Rebars = rebars;
var rebarDiameter = diameterLogic.GetAverageDiameter();
tensileAreaLogic.NdmCollection = NdmCollection;
tensileAreaLogic.StrainMatrix = StrainMatrix;
var concreteArea = tensileAreaLogic.GetTensileArea();
var length = concreteArea / rebarArea * rebarDiameter;
length = new List<double> { length, minDiameterFactor * rebarDiameter, minLength }.Max();
length = new List<double> { length, maxDiameterFactor * rebarDiameter, maxLength }.Min();
return length;
}
}
}

View File

@@ -0,0 +1,45 @@
using LoaderCalculator.Data.Materials;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Logics;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Services.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public class TensileAreaLogicSP63 : ITensileAreaLogic
{
const double maxConcreteFactor = 0.5d;
const double minConcreteFactor = 0.1d;
const double minRebarFactor = 3d;
private static IStressLogic stressLogic => new StressLogic();
public IEnumerable<INdm> NdmCollection { get; set; }
public IStrainMatrix StrainMatrix { get; set; }
public double GetTensileArea()
{
var rebarCollection = NdmCollection
.Where(x => x is RebarNdm);
var rebarArea = rebarCollection.
Sum(x => x.Area * x.StressScale);
var concreteCollection = NdmCollection
.Where(x => x.Material is ConcreteMaterial);
var concreteArea = concreteCollection
.Sum(x => x.Area * x.StressScale);
var concreteTensileArea = concreteCollection
.Where(x => stressLogic.GetTotalStrainWithPresrain(StrainMatrix, x) > 0d)
.Sum(x => x.Area * x.StressScale);
concreteTensileArea = Math.Max(concreteTensileArea, rebarArea * minRebarFactor);
concreteTensileArea = Math.Max(concreteTensileArea, concreteArea * minConcreteFactor);
concreteTensileArea = Math.Min(concreteTensileArea, concreteArea * maxConcreteFactor);
return concreteTensileArea;
}
}
}

View File

@@ -52,12 +52,15 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
return primitive; return primitive;
} }
/// <inheritdoc/> /// <inheritdoc/>
public IEnumerable<INdm> GetNdms(IMaterial material) public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{ {
var ndms = new List<INdm>(); var ndms = new List<INdm>();
var options = new CircleTriangulationLogicOptions(this); var options = new CircleTriangulationLogicOptions(this)
{
triangulationOptions = triangulationOptions
};
var logic = new CircleTriangulationLogic(options); var logic = new CircleTriangulationLogic(options);
ndms.AddRange(logic.GetNdmCollection(material)); ndms.AddRange(logic.GetNdmCollection());
return ndms; return ndms;
} }
/// <inheritdoc/> /// <inheritdoc/>

View File

@@ -9,6 +9,7 @@ using StructureHelperCommon.Infrastructures.Interfaces;
using System; using System;
using StructureHelperCommon.Models.Forces; using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections; using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Triangulations;
namespace StructureHelperLogics.NdmCalculations.Primitives namespace StructureHelperLogics.NdmCalculations.Primitives
{ {
@@ -26,6 +27,6 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
StrainTuple AutoPrestrain { get; } StrainTuple AutoPrestrain { get; }
IVisualProperty VisualProperty {get; } IVisualProperty VisualProperty {get; }
IEnumerable<INdm> GetNdms(IMaterial material); IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions);
} }
} }

View File

@@ -1,16 +1,10 @@
using StructureHelperLogics.Models.Materials; using LoaderCalculator.Data.Ndms;
using StructureHelperCommon.Models.Shapes;
using StructureHelper.Models.Materials; using StructureHelper.Models.Materials;
using System.Collections.Generic; using StructureHelperCommon.Models.Forces;
using LoaderCalculator.Data.Ndms; using StructureHelperCommon.Models.Shapes;
using LoaderCalculator.Data.Materials; using StructureHelperLogics.Models.CrossSections;
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using StructureHelperLogics.NdmCalculations.Primitives; using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations; using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections;
namespace StructureHelperLogics.Models.Primitives namespace StructureHelperLogics.Models.Primitives
{ {
@@ -47,18 +41,18 @@ namespace StructureHelperLogics.Models.Primitives
{} {}
public PointPrimitive(IHeadMaterial material) : this() { HeadMaterial = material; } public PointPrimitive(IHeadMaterial material) : this() { HeadMaterial = material; }
public IEnumerable<INdm> GetNdms(IMaterial material)
{
var options = new PointTriangulationLogicOptions(this);
IPointTriangulationLogic logic = new PointTriangulationLogic(options);
return logic.GetNdmCollection(material);
}
public object Clone() public object Clone()
{ {
var primitive = new PointPrimitive(); var primitive = new PointPrimitive();
updateStrategy.Update(primitive, this); updateStrategy.Update(primitive, this);
return primitive; return primitive;
} }
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{
var options = new PointTriangulationLogicOptions(this) { triangulationOptions = triangulationOptions};
var logic = new PointTriangulationLogic(options);
return logic.GetNdmCollection();
}
} }
} }

View File

@@ -22,7 +22,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public class RebarPrimitive : IPointPrimitive, IHasHostPrimitive public class RebarPrimitive : IPointPrimitive, IHasHostPrimitive
{ {
static readonly RebarUpdateStrategy updateStrategy = new(); static readonly RebarUpdateStrategy updateStrategy = new();
IDataRepository<RebarPrimitive> repository;
/// <inheritdoc/> /// <inheritdoc/>
public string Name { get; set; } public string Name { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
@@ -66,16 +66,14 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
return primitive; return primitive;
} }
public IEnumerable<INdm> GetNdms(IMaterial material) public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{ {
var options = new PointTriangulationLogicOptions(this); var options = new RebarTriangulationLogicOptions(this)
IPointTriangulationLogic logic = new PointTriangulationLogic(options); {
return logic.GetNdmCollection(material); triangulationOptions = triangulationOptions
} };
var logic = new RebarTriangulationLogic(options);
public void Save() return logic.GetNdmCollection();
{
repository.Create(this);
} }
} }
} }

View File

@@ -55,12 +55,15 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
return primitive; return primitive;
} }
public IEnumerable<INdm> GetNdms(IMaterial material) public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{ {
var ndms = new List<INdm>(); var ndms = new List<INdm>();
var options = new RectangleTriangulationLogicOptions(this); var options = new RectangleTriangulationLogicOptions(this)
{
triangulationOptions = triangulationOptions
};
var logic = new RectangleTriangulationLogic(options); var logic = new RectangleTriangulationLogic(options);
ndms.AddRange(logic.GetNdmCollection(material)); ndms.AddRange(logic.GetNdmCollection());
return ndms; return ndms;
} }

View File

@@ -12,16 +12,14 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
internal class CircleTriangulationLogic : ITriangulationLogic internal class CircleTriangulationLogic : ITriangulationLogic
{ {
CircleTriangulationLogicOptions options; private readonly CircleTriangulationLogicOptions options;
public ITriangulationLogicOptions Options { get; private set; }
public CircleTriangulationLogic(ITriangulationLogicOptions options) public CircleTriangulationLogic(ITriangulationLogicOptions options)
{ {
ValidateOptions(options); ValidateOptions(options);
this.options = options as CircleTriangulationLogicOptions; this.options = options as CircleTriangulationLogicOptions;
Options = options;
} }
public IEnumerable<INdm> GetNdmCollection(IMaterial material) public IEnumerable<INdm> GetNdmCollection()
{ {
double diameter = options.Circle.Diameter; double diameter = options.Circle.Diameter;
@@ -29,7 +27,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
int ndmMinDivision = options.NdmMinDivision; int ndmMinDivision = options.NdmMinDivision;
var logicOptions = new LoaderCalculator.Triangulations.CircleTriangulationLogicOptions(diameter, ndmMaxSize, ndmMinDivision); var logicOptions = new LoaderCalculator.Triangulations.CircleTriangulationLogicOptions(diameter, ndmMaxSize, ndmMinDivision);
var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions); var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions);
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.CirclePlane { Material = material }); var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.CirclePlane
{
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
});
TriangulationService.CommonTransform(ndmCollection, options); TriangulationService.CommonTransform(ndmCollection, options);
TriangulationService.SetPrestrain(ndmCollection, options.Prestrain); TriangulationService.SetPrestrain(ndmCollection, options.Prestrain);
return ndmCollection; return ndmCollection;
@@ -37,9 +38,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
public void ValidateOptions(ITriangulationLogicOptions options) public void ValidateOptions(ITriangulationLogicOptions options)
{ {
if (options is not ICircleTriangulationLogicOptions ) if (options is not CircleTriangulationLogicOptions )
{ {
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"\n Expected: {nameof(ICircleTriangulationLogicOptions)}, But was: {nameof(options)}"); throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(CircleTriangulationLogicOptions), options.GetType()));
} }
} }
} }

View File

@@ -1,5 +1,7 @@
using StructureHelperCommon.Models.Forces; using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes; using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.NdmCalculations.Primitives; using StructureHelperLogics.NdmCalculations.Primitives;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -9,7 +11,7 @@ using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
public class CircleTriangulationLogicOptions : ICircleTriangulationLogicOptions public class CircleTriangulationLogicOptions : IShapeTriangulationLogicOptions
{ {
public ICircleShape Circle { get; } public ICircleShape Circle { get; }
@@ -20,19 +22,17 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
public int NdmMinDivision { get; } public int NdmMinDivision { get; }
public StrainTuple Prestrain { get; set; } public StrainTuple Prestrain { get; set; }
public ITriangulationOptions triangulationOptions { get; set; }
public IHeadMaterial HeadMaterial { get; set; }
public CircleTriangulationLogicOptions(ICirclePrimitive primitive) public CircleTriangulationLogicOptions(ICirclePrimitive primitive)
{ {
Center = new Point2D() { X = primitive.Center.X, Y = primitive.Center.Y }; Center = primitive.Center.Clone() as Point2D;
Circle = primitive; Circle = primitive;
NdmMaxSize = primitive.NdmMaxSize; NdmMaxSize = primitive.NdmMaxSize;
NdmMinDivision = primitive.NdmMinDivision; NdmMinDivision = primitive.NdmMinDivision;
Prestrain = new StrainTuple HeadMaterial = primitive.HeadMaterial;
{ Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
Mx = primitive.UsersPrestrain.Mx + primitive.AutoPrestrain.Mx,
My = primitive.UsersPrestrain.My + primitive.AutoPrestrain.My,
Nz = primitive.UsersPrestrain.Nz + primitive.AutoPrestrain.Nz
};
} }
} }
} }

View File

@@ -1,18 +0,0 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
internal interface ICircleTriangulationLogicOptions : IShapeTriangulationLogicOptions
{
/// <summary>
/// Shape
/// </summary>
ICircleShape Circle { get; }
}
}

View File

@@ -1,6 +0,0 @@
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
interface IPointTriangulationLogic : ITriangulationLogic
{
}
}

View File

@@ -1,10 +0,0 @@
using StructureHelperCommon.Models.Shapes;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
public interface IPointTriangulationLogicOptions : ITriangulationLogicOptions
{
IPoint2D Center { get; }
double Area { get; }
}
}

View File

@@ -1,6 +0,0 @@
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
public interface IRectangleTriangulationLogic : ITriangulationLogic
{
}
}

View File

@@ -1,16 +0,0 @@
using StructureHelperCommon.Models.Shapes;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
/// <summary>
/// Parameter of triangulation of rectangle part of section
/// Параметры триангуляции прямоугольного участка сечения
/// </summary>
public interface IRectangleTriangulationLogicOptions : IShapeTriangulationLogicOptions
{
/// <summary>
///
/// </summary>
IRectangleShape Rectangle { get; }
}
}

View File

@@ -6,8 +6,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
public interface ITriangulationLogic public interface ITriangulationLogic
{ {
ITriangulationLogicOptions Options { get; } IEnumerable<INdm> GetNdmCollection();
IEnumerable<INdm> GetNdmCollection(IMaterial material);
void ValidateOptions(ITriangulationLogicOptions options); void ValidateOptions(ITriangulationLogicOptions options);
} }
} }

View File

@@ -1,9 +1,13 @@
using StructureHelperCommon.Models.Forces; using StructureHelper.Models.Materials;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Forces;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
public interface ITriangulationLogicOptions public interface ITriangulationLogicOptions
{ {
ITriangulationOptions triangulationOptions { get; set; }
StrainTuple Prestrain { get; set; } StrainTuple Prestrain { get; set; }
IHeadMaterial HeadMaterial { get; set; }
} }
} }

View File

@@ -1,37 +1,40 @@
using LoaderCalculator.Data.Materials; using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Data.Ndms;
using System;
using System.Collections.Generic;
using StructureHelperCommon.Models.Shapes;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms.Transformations; using LoaderCalculator.Data.Ndms.Transformations;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Services.Forces;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
public class PointTriangulationLogic : IPointTriangulationLogic public class PointTriangulationLogic : ITriangulationLogic
{ {
public ITriangulationLogicOptions Options { get; } private readonly PointTriangulationLogicOptions options;
public PointTriangulationLogic(ITriangulationLogicOptions options) public PointTriangulationLogic(ITriangulationLogicOptions options)
{ {
Options = options; ValidateOptions(options);
this.options = options as PointTriangulationLogicOptions;
} }
public IEnumerable<INdm> GetNdmCollection(IMaterial material) public IEnumerable<INdm> GetNdmCollection()
{ {
IPointTriangulationLogicOptions options = Options as IPointTriangulationLogicOptions; var ndm = new Ndm
IPoint2D center = options.Center; {
double area = options.Area; CenterX = options.Center.X,
List<INdm> ndmCollection = new List<INdm>(); CenterY = options.Center.Y,
INdm ndm = new Ndm { CenterX = center.X, CenterY = center.Y, Area = area, Material = material }; Area = options.Area,
ndmCollection.Add(ndm); Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = options.Prestrain.Mx, Ky = options.Prestrain.My, EpsZ = options.Prestrain.Nz }); };
List<INdm> ndmCollection = new () { ndm};
NdmTransform.SetPrestrain(ndmCollection, StrainTupleService.ConvertToLoaderStrainMatrix(options.Prestrain));
return ndmCollection; return ndmCollection;
} }
public void ValidateOptions(ITriangulationLogicOptions options) public void ValidateOptions(ITriangulationLogicOptions options)
{ {
throw new NotImplementedException(); if (options is not PointTriangulationLogicOptions)
{
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(PointTriangulationLogicOptions), options.GetType()));
}
} }
} }
} }

View File

@@ -1,5 +1,8 @@
using StructureHelperCommon.Models.Forces; using LoaderCalculator.Data.Materials;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes; using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.NdmCalculations.Primitives; using StructureHelperLogics.NdmCalculations.Primitives;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
@@ -7,8 +10,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class PointTriangulationLogicOptions : IPointTriangulationLogicOptions public class PointTriangulationLogicOptions : ITriangulationLogicOptions
{ {
public ITriangulationOptions triangulationOptions { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -16,26 +20,16 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
/// <inheritdoc /> /// <inheritdoc />
public double Area { get; } public double Area { get; }
public StrainTuple Prestrain { get; set; } public StrainTuple Prestrain { get; set; }
public IHeadMaterial HeadMaterial { get; set; }
/// <inheritdoc /> /// <inheritdoc />
public PointTriangulationLogicOptions(IPoint2D center, double area)
{
Center = center;
Area = area;
Prestrain = new StrainTuple();
}
public PointTriangulationLogicOptions(IPointPrimitive primitive) public PointTriangulationLogicOptions(IPointPrimitive primitive)
{ {
Center = new Point2D() { X = primitive.Center.X, Y = primitive.Center.Y }; Center = primitive.Center.Clone() as Point2D;
Area = primitive.Area; Area = primitive.Area;
Prestrain = new StrainTuple HeadMaterial = primitive.HeadMaterial;
{ Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
Mx = primitive.UsersPrestrain.Mx + primitive.AutoPrestrain.Mx,
My = primitive.UsersPrestrain.My + primitive.AutoPrestrain.My,
Nz = primitive.UsersPrestrain.Nz + primitive.AutoPrestrain.Nz
};
} }
} }
} }

View File

@@ -0,0 +1,55 @@
using LoaderCalculator.Data.Materials;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Data.Ndms.Transformations;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
internal class RebarTriangulationLogic : ITriangulationLogic
{
private readonly RebarTriangulationLogicOptions options;
public RebarTriangulationLogic(ITriangulationLogicOptions options)
{
ValidateOptions(options);
this.options = options as RebarTriangulationLogicOptions;
}
public IEnumerable<INdm> GetNdmCollection()
{
var concreteNdm = new Ndm
{
CenterX = options.Center.X,
CenterY = options.Center.Y,
Area = options.Area,
Material = options.HostMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm),
StressScale = -1d
};
var rebarNdm = new RebarNdm
{
CenterX = options.Center.X,
CenterY = options.Center.Y,
Area = options.Area,
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
};
List<INdm> ndmCollection = new() { concreteNdm, rebarNdm};
//List<INdm> ndmCollection = new() { rebarNdm };
NdmTransform.SetPrestrain(ndmCollection, StrainTupleService.ConvertToLoaderStrainMatrix(options.Prestrain));
return ndmCollection;
}
public void ValidateOptions(ITriangulationLogicOptions options)
{
if (options is not RebarTriangulationLogicOptions)
{
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(RebarTriangulationLogicOptions), options.GetType()));
}
}
}
}

View File

@@ -0,0 +1,37 @@
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
public class RebarTriangulationLogicOptions : ITriangulationLogicOptions
{
public ITriangulationOptions triangulationOptions { get; set; }
/// <summary>
///
/// </summary>
public IPoint2D Center { get; }
/// <inheritdoc />
public double Area { get; }
public StrainTuple Prestrain { get; set; }
public IHeadMaterial HeadMaterial { get; set; }
public IHeadMaterial HostMaterial { get; set; }
/// <inheritdoc />
public RebarTriangulationLogicOptions(RebarPrimitive primitive)
{
Center = primitive.Center.Clone() as Point2D;
Area = primitive.Area;
HeadMaterial = primitive.HeadMaterial;
HostMaterial = primitive.HostPrimitive.HeadMaterial;
Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
}
}
}

View File

@@ -1,19 +1,18 @@
using LoaderCalculator.Data.Materials; using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Data.Ndms;
using System;
using System.Collections.Generic;
using LoaderCalculator.Data.Ndms.Transformations; using LoaderCalculator.Data.Ndms.Transformations;
using LoaderCalculator.Data.Matrix;
using StructureHelperCommon.Infrastructures.Exceptions; using StructureHelperCommon.Infrastructures.Exceptions;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
public class RectangleTriangulationLogic : IRectangleTriangulationLogic public class RectangleTriangulationLogic : ITriangulationLogic
{ {
IRectangleTriangulationLogicOptions options; private readonly RectangleTriangulationLogicOptions options;
public ITriangulationLogicOptions Options { get; } public RectangleTriangulationLogic(ITriangulationLogicOptions options)
{
public IEnumerable<INdm> GetNdmCollection(IMaterial material) ValidateOptions(options);
this.options = options as RectangleTriangulationLogicOptions;
}
public IEnumerable<INdm> GetNdmCollection()
{ {
double width = options.Rectangle.Width; double width = options.Rectangle.Width;
double height = options.Rectangle.Height; double height = options.Rectangle.Height;
@@ -21,7 +20,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
int ndmMinDivision = options.NdmMinDivision; int ndmMinDivision = options.NdmMinDivision;
LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions logicOptions = new LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions(width, height, ndmMaxSize, ndmMinDivision); LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions logicOptions = new LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions(width, height, ndmMaxSize, ndmMinDivision);
var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions); var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions);
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.RectangularPlane { Material = material }); var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.RectangularPlane
{
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
});
TriangulationService.CommonTransform(ndmCollection, options); TriangulationService.CommonTransform(ndmCollection, options);
double angle = options.Rectangle.Angle; double angle = options.Rectangle.Angle;
NdmTransform.Rotate(ndmCollection, angle); NdmTransform.Rotate(ndmCollection, angle);
@@ -31,17 +33,11 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
public void ValidateOptions(ITriangulationLogicOptions options) public void ValidateOptions(ITriangulationLogicOptions options)
{ {
if (options is not IRectangleTriangulationLogicOptions) if (options is not RectangleTriangulationLogicOptions)
{ {
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"\n Expected: {nameof(IRectangleTriangulationLogicOptions)}, But was: {nameof(options)}"); throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(RectangleTriangulationLogicOptions), options.GetType()));
} }
} }
public RectangleTriangulationLogic(ITriangulationLogicOptions options)
{
ValidateOptions(options);
this.options = options as IRectangleTriangulationLogicOptions;
Options = options;
}
} }
} }

View File

@@ -1,11 +1,13 @@
using StructureHelperCommon.Models.Forces; using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes; using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.NdmCalculations.Primitives; using StructureHelperLogics.NdmCalculations.Primitives;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
/// <inheritdoc /> /// <inheritdoc />
public class RectangleTriangulationLogicOptions : IRectangleTriangulationLogicOptions public class RectangleTriangulationLogicOptions : IShapeTriangulationLogicOptions
{ {
/// <inheritdoc /> /// <inheritdoc />
public IPoint2D Center { get; } public IPoint2D Center { get; }
@@ -17,6 +19,8 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
public int NdmMinDivision { get; } public int NdmMinDivision { get; }
/// <inheritdoc /> /// <inheritdoc />
public StrainTuple Prestrain { get; set; } public StrainTuple Prestrain { get; set; }
public ITriangulationOptions triangulationOptions { get; set; }
public IHeadMaterial HeadMaterial { get; set; }
public RectangleTriangulationLogicOptions(IPoint2D center, IRectangleShape rectangle, double ndmMaxSize, int ndmMinDivision) public RectangleTriangulationLogicOptions(IPoint2D center, IRectangleShape rectangle, double ndmMaxSize, int ndmMinDivision)
{ {
@@ -33,12 +37,8 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
Rectangle = primitive; Rectangle = primitive;
NdmMaxSize = primitive.NdmMaxSize; NdmMaxSize = primitive.NdmMaxSize;
NdmMinDivision = primitive.NdmMinDivision; NdmMinDivision = primitive.NdmMinDivision;
Prestrain = new StrainTuple HeadMaterial = primitive.HeadMaterial;
{ Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
Mx = primitive.UsersPrestrain.Mx + primitive.AutoPrestrain.Mx,
My = primitive.UsersPrestrain.My + primitive.AutoPrestrain.My,
Nz = primitive.UsersPrestrain.Nz + primitive.AutoPrestrain.Nz
};
} }
} }
} }

View File

@@ -6,22 +6,21 @@ using StructureHelperLogics.NdmCalculations.Primitives;
namespace StructureHelperLogics.NdmCalculations.Triangulations namespace StructureHelperLogics.NdmCalculations.Triangulations
{ {
public static class Triangulation public static class Triangulation1
{ {
public static IEnumerable<INdm> GetNdms(IEnumerable<INdmPrimitive> ndmPrimitives, ITriangulationOptions options) public static IEnumerable<INdm> GetNdms(IEnumerable<INdmPrimitive> ndmPrimitives, ITriangulationOptions options)
{ {
List<INdm> ndms = new List<INdm>(); return ndmPrimitives.SelectMany(x => x.GetNdms(options));
var headMaterials = GetPrimitiveMaterials(ndmPrimitives); //var headMaterials = GetPrimitiveMaterials(ndmPrimitives);
Dictionary<Guid, IMaterial> materials = GetMaterials(headMaterials, options); //Dictionary<Guid, IMaterial> materials = GetMaterials(headMaterials, options);
foreach (var ndmPrimitive in ndmPrimitives) //foreach (var ndmPrimitive in ndmPrimitives)
{ //{
IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial; // IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial;
IMaterial material; // IMaterial material;
if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); } // if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, material); // IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, options);
ndms.AddRange(localNdms); // ndms.AddRange(localNdms);
} //}
return ndms;
} }
/// <summary> /// <summary>
/// Returns dictionary of unique materials by collection of primitives /// Returns dictionary of unique materials by collection of primitives
@@ -60,10 +59,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
return materials; return materials;
} }
private static IEnumerable<INdm> GetNdmsByPrimitive(INdmPrimitive primitive, IMaterial material) private static IEnumerable<INdm> GetNdmsByPrimitive(INdmPrimitive primitive, ITriangulationOptions options)
{ {
List<INdm> ndms = new List<INdm>(); List<INdm> ndms = new ();
ndms.AddRange(primitive.GetNdms(material)); ndms.AddRange(primitive.GetNdms(options));
return ndms; return ndms;
} }
} }

View File

@@ -25,13 +25,13 @@ namespace StructureHelperLogics.Services.NdmCalculations
{ {
var ndmCollection = new List<INdm>(); var ndmCollection = new List<INdm>();
ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm }; ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
ndmCollection.AddRange(Triangulation.GetNdms(ndmPrimitives, options)); ndmCollection.AddRange(ndmPrimitives.SelectMany(x => x.GetNdms(options)));
var loaderData = new LoaderOptions var loaderData = new LoaderOptions
{ {
Preconditions = new Preconditions Preconditions = new Preconditions
{ {
ConditionRate = calculationProperty.IterationProperty.Accuracy, ConditionRate = calculationProperty.Accuracy.IterationAccuracy,
MaxIterationCount = calculationProperty.IterationProperty.MaxIterationCount, MaxIterationCount = calculationProperty.Accuracy.MaxIterationCount,
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz } StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
}, },
NdmCollection = ndmCollection NdmCollection = ndmCollection
@@ -47,7 +47,7 @@ namespace StructureHelperLogics.Services.NdmCalculations
foreach (var forceCombinations in calculationProperty.ForceCombinations) foreach (var forceCombinations in calculationProperty.ForceCombinations)
{ {
var forceMatrix = forceCombinations.ForceMatrix; var forceMatrix = forceCombinations.ForceMatrix;
results.Add(GetCalculationResult(forceMatrix, ndms, calculationProperty.IterationProperty.Accuracy, calculationProperty.IterationProperty.MaxIterationCount)); results.Add(GetCalculationResult(forceMatrix, ndms, calculationProperty.Accuracy.IterationAccuracy, calculationProperty.Accuracy.MaxIterationCount));
} }
return results; return results;
} }

View File

@@ -19,18 +19,11 @@ namespace StructureHelperLogics.Services.NdmPrimitives
{ {
public static class NdmPrimitivesService public static class NdmPrimitivesService
{ {
public static List<INdm> GetNdms(INdmPrimitive primitive, LimitStates limitState, CalcTerms calcTerm)
{
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
List<INdm> ndmCollection = new List<INdm>();
var material = primitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
ndmCollection.AddRange(primitive.GetNdms(material));
return ndmCollection;
}
public static List<INdm> GetNdms(IEnumerable<INdmPrimitive> primitives, LimitStates limitState, CalcTerms calcTerm) public static List<INdm> GetNdms(IEnumerable<INdmPrimitive> primitives, LimitStates limitState, CalcTerms calcTerm)
{ {
var orderedNdmPrimitives = primitives.OrderBy(x => x.VisualProperty.ZIndex); var orderedNdmPrimitives = primitives.OrderBy(x => x.VisualProperty.ZIndex);
var ndms = new List<INdm>(); var ndms = new List<INdm>();
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
foreach (var item in orderedNdmPrimitives) foreach (var item in orderedNdmPrimitives)
{ {
if (item is IHasDivisionSize) if (item is IHasDivisionSize)
@@ -43,7 +36,7 @@ namespace StructureHelperLogics.Services.NdmPrimitives
} }
if (item.Triangulate == true) if (item.Triangulate == true)
{ {
ndms.AddRange(GetNdms(item, limitState, calcTerm)); ndms.AddRange(item.GetNdms(triangulationOptions));
} }
} }
return ndms; return ndms;

View File

@@ -94,8 +94,8 @@ namespace StructureHelperLogics.Services.NdmPrimitives
try try
{ {
var gravityCenter = GeometryOperations.GetReducedMomentsOfInertia(locNdms, locStrainMatrix); var gravityCenter = GeometryOperations.GetReducedMomentsOfInertia(locNdms, locStrainMatrix);
firstParameter.Value = (gravityCenter.MomentX * unitMultiPlayer).ToString(); firstParameter.Value = (gravityCenter.EIx * unitMultiPlayer).ToString();
secondParameter.Value = (gravityCenter.MomentY * unitMultiPlayer).ToString(); secondParameter.Value = (gravityCenter.EIy * unitMultiPlayer).ToString();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -134,8 +134,8 @@ namespace StructureHelperLogics.Services.NdmPrimitives
try try
{ {
var actualMoments = GeometryOperations.GetSofteningsFactors(locNdms, locStrainMatrix); var actualMoments = GeometryOperations.GetSofteningsFactors(locNdms, locStrainMatrix);
firstParameter.Value = actualMoments.MxFactor.ToString(); firstParameter.Value = actualMoments.EIxFactor.ToString();
secondParameter.Value = actualMoments.MyFactor.ToString(); secondParameter.Value = actualMoments.EIy.ToString();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -196,7 +196,7 @@ namespace StructureHelperLogics.Services.NdmPrimitives
try try
{ {
var actual = GeometryOperations.GetSofteningsFactors(locNdms, locStrainMatrix); var actual = GeometryOperations.GetSofteningsFactors(locNdms, locStrainMatrix);
firstParameter.Value = actual.NzFactor.ToString(); firstParameter.Value = actual.EAFactor.ToString();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -238,8 +238,8 @@ namespace StructureHelperLogics.Services.NdmPrimitives
try try
{ {
var gravityCenter = GeometryOperations.GetGravityCenter(locNdms, locStrainMatrix); var gravityCenter = GeometryOperations.GetGravityCenter(locNdms, locStrainMatrix);
firstParameter.Value = (gravityCenter.CenterX * unitMultiPlayer).ToString(); firstParameter.Value = (gravityCenter.Cx * unitMultiPlayer).ToString();
secondParameter.Value = (gravityCenter.CenterY * unitMultiPlayer).ToString(); secondParameter.Value = (gravityCenter.Cy * unitMultiPlayer).ToString();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -25,7 +25,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.CrackCalculatorT
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection(); var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
var ndmPrimitives = newSection.SectionRepository.Primitives; var ndmPrimitives = newSection.SectionRepository.Primitives;
ITriangulationOptions options = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = CalcTerms.ShortTerm }; ITriangulationOptions options = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = CalcTerms.ShortTerm };
var ndms = Triangulation.GetNdms(ndmPrimitives, options); var ndms = ndmPrimitives.SelectMany(x => x.GetNdms(options));
var calculator = new CrackForceCalculator(); var calculator = new CrackForceCalculator();
calculator.EndTuple = new ForceTuple() { Mx = -50e3d, My = -50e3d, Nz = 0d }; calculator.EndTuple = new ForceTuple() { Mx = -50e3d, My = -50e3d, Nz = 0d };
calculator.NdmCollection = ndms; calculator.NdmCollection = ndms;

View File

@@ -11,12 +11,12 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
{ {
public class RCSectionsTest public class RCSectionsTest
{ {
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062544561815463693d, -0.0029292919541166911d, 0.00035383082501577246d)] [TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062729176929923703d, -0.0029292919541166911d, 0.00035383082501577246d)]
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046762265275279838d, -0.0025101896869558888d, 0.00027185795017719519d)] [TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046857734823565632d, -0.0025101896869558888d, 0.00027185795017719519d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00080914991212906239d, -0.00080914991212906184d, 0.00011900072665826425d)] [TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00081656737668168479d, -0.00081656737668168414d, 0.00011865117209051567d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.0008126213321004612d, -0.00081262133210046055d, 0.00011963568117586145d)] [TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00081971887286298598d, -0.00081971887286298544d, 0.00011922273439756063d)]
[TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00047720148631058529d, -0.00077269031816753532d, 0.00010610472872420363d)] [TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00048146233319312662d, -0.00077822315770951882d, 0.00010599549196849429d)]
[TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077269031816753478d, -0.00047720148631058437d, 0.00010610472872420363d)] [TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077822315770951947d, -0.00048146233319312478d, 0.00010599549196849413d)]
public void Run_ShouldPass(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, bool isBuckling, double expectedKx, double expectedKy, double expectedEpsZ) public void Run_ShouldPass(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, bool isBuckling, double expectedKx, double expectedKy, double expectedEpsZ)
{ {
//Arrange //Arrange

View File

@@ -37,7 +37,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
var primitives = new List<INdmPrimitive>(); var primitives = new List<INdmPrimitive>();
primitives.AddRange(GetConcreteNdms(width, height)); primitives.AddRange(GetConcreteNdms(width, height));
primitives.AddRange(GetReinforcementNdms(width, height, topArea, bottomArea)); primitives.AddRange(GetReinforcementNdms(width, height, topArea, bottomArea));
ndmCollection.AddRange(Triangulation.GetNdms(primitives, options)); ndmCollection.AddRange(primitives.SelectMany(x => x.GetNdms(options)));
var loaderData = new LoaderOptions var loaderData = new LoaderOptions
{ {
Preconditions = new Preconditions Preconditions = new Preconditions

Some files were not shown because too many files have changed in this diff Show More