This commit is contained in:
Evgeny Redikultsev
2023-02-23 21:13:41 +05:00
parent 118639716b
commit 231ff82f8a
6 changed files with 84 additions and 77 deletions

Binary file not shown.

View File

@@ -40,4 +40,10 @@
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="Libraries\NLog.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -63,85 +63,87 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Add Force Combination" Command="{Binding Add}"/>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="Add Force Combination" Command="{Binding Add}"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Materials" MinWidth="20">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Materials" Command="{Binding EditHeadMaterialsCommand}"/>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding HeadMaterials}" ItemTemplate="{StaticResource ColoredItemTemplate}">
</ListBox>
</Expander>
<Expander Header="Geometry" MinWidth="20" DataContext="{Binding PrimitiveLogic}">
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">
<Button Content="Add Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}"/>
<Button Content="Add Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}"/>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Materials" MinWidth="20">
<Expander.ContextMenu>
<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}"/>
<Button Content="Materials" Command="{Binding EditHeadMaterialsCommand}"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Analyses" MinWidth="20" DataContext="{Binding CalculatorsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Add Calculator" Command="{Binding Add}"/>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding HeadMaterials}" ItemTemplate="{StaticResource ColoredItemTemplate}">
</ListBox>
</Expander>
<Expander Header="Geometry" MinWidth="20" DataContext="{Binding PrimitiveLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Run" Command="{Binding Run}"/>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<MenuItem Header="Add">
<Button Content="Add Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}"/>
<Button Content="Add Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}"/>
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
</StackPanel>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
<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>
<Button Content="Add Calculator" Command="{Binding Add}"/>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Run" Command="{Binding Run}"/>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
</StackPanel>
</ScrollViewer>
<Border BorderBrush="Black" Background="White" BorderThickness="1" Margin="5" Grid.Column="1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseDown">

View File

@@ -62,7 +62,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
}
else point2D = combination.ForcePoint;
var newTuple = ForceTupleService.MoveTupleIntoPoint(tuple.ForceTuple, point2D);
var result = GetPrimitiveStrainMatrix(ndms, newTuple);
IForcesTupleResult result = GetPrimitiveStrainMatrix(ndms, newTuple);
if (CompressedMember.Buckling == true)
{
IForceTuple longTuple;
@@ -85,15 +85,14 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
result.Desctription += $"Buckling result:\n{bucklingResult.Desctription}\n";
}
newTuple = CalculateBuckling(newTuple, bucklingResult);
result = GetPrimitiveStrainMatrix(ndms, newTuple);
}
catch (Exception ex)
{
result.IsValid = false;
result.Desctription = $"Buckling error:\n{ex}\n";
}
}
result.DesignForceTuple.LimitState = limitState;
result.DesignForceTuple.CalcTerm = calcTerm;
result.DesignForceTuple.ForceTuple = newTuple;

View File

@@ -16,7 +16,7 @@ namespace StructureHelperTests.UnitTests.Ndms.Triangulations
//Участок с поворотом на 1 радиан
[TestCase(0d, 0d, 1.0d, 1.0d, 1d, 0.02d, 1, 50 * 50, 0.14757265268048089d, -0.67706891243125777d)]
//Участок со смещением и поворотом на 1 радиан
[TestCase(2d, 2d, 1.0d, 1.0d, 1d, 0.02d, 1, 50 * 50, -0.45476470519903267d, 2.0864776689208147d)]
[TestCase(2d, 2d, 1.0d, 1.0d, 1d, 0.02d, 1, 50 * 50, -0.45476470519903262d, 2.0864776689208147d)]
public void Run_ShouldPass (double centerX, double centerY, double width, double height, double angle, double ndmMaxSize, int ndmMinDivision, int expectedCount, double expectedFirstCenterX, double expectedFirstCenterY)
{
//Arrange