Limit curve vindow was changed

This commit is contained in:
Evgeny Redikultsev
2023-12-24 20:43:45 +05:00
parent 0a6d29bcfc
commit d0f3ead51f
19 changed files with 370 additions and 86 deletions

View File

@@ -8,28 +8,47 @@
xmlns:fc="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews"
d:DataContext ="{d:DesignInstance local:LimitCurveDataViewModel}"
mc:Ignorable="d"
Title="Diagram properties" Height="320" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
Title="Diagram properties" Height="360" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<fc:SurroundDataControl x:Name="SurData" SurroundData="{Binding SurroundData}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Point count"/>
<TextBox Grid.Column="1" Text="{Binding PointCount, ValidatesOnDataErrors=True}"/>
<uc:MultiplyDouble Margin="2" Grid.Column="3" ValueChanged="PointCountChanged"/>
</Grid>
<TabControl>
<TabItem Header="Limits">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<fc:SurroundDataControl x:Name="SurData" SurroundData="{Binding SurroundData}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Point count"/>
<TextBox Grid.Column="1" Text="{Binding PointCount, ValidatesOnDataErrors=True}"/>
<uc:MultiplyDouble Margin="2" Grid.Column="3" ValueChanged="PointCountChanged"/>
</Grid>
</Grid>
</TabItem>
<TabItem Header="Predicates">
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding PredicateItems}"/>
</TabItem>
<TabItem Header="States">
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding LimitStateItems}"/>
</TabItem>
<TabItem Header="Terms">
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding CalcTermITems}"/>
</TabItem>
</TabControl>
<!--<ContentControl ContentTemplate="{StaticResource SurroundData}" Content="{Binding SurroundDataViewModel}"/>-->
<ContentControl Grid.Row="2" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
</Grid>
</Window>

View File

@@ -2,6 +2,9 @@
using StructureHelper.Windows.ViewModels;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Parameters;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Units;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
@@ -25,6 +28,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
//public SurroundDataViewModel SurroundDataViewModel { get; private set; }
public SurroundData SurroundData { get; set; }
public List<INdmPrimitive> Primitives { get; set; }
public SelectItemsViewModel<PredicateEntry> PredicateItems { get; private set; }
public SelectItemsViewModel<LimitStateEntity> LimitStateItems { get; private set; }
public SelectItemsViewModel<CalcTermEntity> CalcTermITems { get; private set; }
public int PointCount
{
get => pointCount; set
@@ -45,9 +51,38 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
{
//SurroundDataViewModel = new(surroundData);
SurroundData = surroundData;
GetPredicates();
GetLimitStates();
GetCalcTerms();
pointCount = 80;
}
private void GetCalcTerms()
{
CalcTermITems = new SelectItemsViewModel<CalcTermEntity>(ProgramSetting.CalcTermList.CalcTerms);
CalcTermITems.ShowButtons = true;
}
private void GetLimitStates()
{
LimitStateItems = new SelectItemsViewModel<LimitStateEntity>(ProgramSetting.LimitStatesList.LimitStates);
LimitStateItems.ShowButtons = true;
}
private void GetPredicates()
{
PredicateItems = new SelectItemsViewModel<PredicateEntry>(
new List<PredicateEntry>()
{
new PredicateEntry()
{ Name = "Strength", PredicateType = PredicateTypes.Strength },
new PredicateEntry()
{ Name = "Cracking", PredicateType = PredicateTypes.Cracking },
}
);
PredicateItems.ShowButtons = true;
}
public LimitCurveDataViewModel() : this (new SurroundData())
{
}
@@ -59,16 +94,24 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
SurroundData = SurroundData,
PointCount = pointCount
};
inputData.LimitStates.Add(LimitStates.ULS);
inputData.LimitStates.Add(LimitStates.SLS);
inputData.CalcTerms.Add(CalcTerms.ShortTerm);
inputData.CalcTerms.Add(CalcTerms.LongTerm);
inputData.PredicateEntries.Add(new PredicateEntry() { Name = "Strength", PredicateType = PredicateTypes.Strength });
inputData.PredicateEntries.Add(new PredicateEntry() { Name = "Cracking", PredicateType = PredicateTypes.Cracking });
inputData.LimitStates.AddRange(LimitStateItems.SelectedItems.Select(x => x.LimitState));
inputData.CalcTerms.AddRange(CalcTermITems.SelectedItems.Select(x => x.CalcTerm));
inputData.PredicateEntries.AddRange(PredicateItems.SelectedItems);
inputData.Primitives = Primitives;
return inputData;
}
public bool Check()
{
if (PredicateItems.SelectedCount == 0 ||
LimitStateItems.SelectedCount == 0 ||
CalcTermITems.SelectedCount == 0)
{
return false;
}
return true;
}
public string Error => throw new NotImplementedException();
public string this[string columnName]

View File

@@ -14,6 +14,7 @@ using StructureHelper.Windows.ViewModels.Calculations.Calculators;
using StructureHelper.Windows.ViewModels.Errors;
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Forces;
@@ -30,6 +31,7 @@ using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Input;
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
@@ -75,23 +77,34 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
return showInteractionDiagramCommand ??
(showInteractionDiagramCommand = new RelayCommand(o =>
{
var surroundDdata = new SurroundData();
var vm = new LimitCurveDataViewModel(surroundDdata);
vm.Primitives = ndmPrimitives.ToList();
var wnd = new LimitCurveDataView(vm);
wnd.ShowDialog();
if (wnd.DialogResult != true) return;
var inputData = vm.GetLimitCurveInputData();
interactionDiagramLogic = new(inputData);
showProgressLogic = new(interactionDiagramLogic)
{
WindowTitle = "Diagram creating...",
ShowResult = interactionDiagramLogic.ShowWindow
};
showProgressLogic.Show();
ShowInteractionDiagram();
}));
}
}
private void ShowInteractionDiagram()
{
var surroundDdata = new SurroundData();
var vm = new LimitCurveDataViewModel(surroundDdata);
if (vm.Check() == false)
{
MessageBox.Show(ErrorStrings.DataIsInCorrect + ": nothing selected"); ;
return;
}
vm.Primitives = ndmPrimitives.ToList();
var wnd = new LimitCurveDataView(vm);
wnd.ShowDialog();
if (wnd.DialogResult != true) return;
var inputData = vm.GetLimitCurveInputData();
interactionDiagramLogic = new(inputData);
showProgressLogic = new(interactionDiagramLogic)
{
WindowTitle = "Diagram creating...",
ShowResult = interactionDiagramLogic.ShowWindow
};
showProgressLogic.Show();
}
public ICommand ShowIsoFieldCommand
{
get