Interactin diagram was added
This commit is contained in:
@@ -13,6 +13,11 @@
|
||||
<Slider x:Name="StrokeSlider" Width="195" Minimum="0" Maximum="{Binding MaxStrokeSize}" Value="{Binding StrokeSize}"/>
|
||||
<TextBox Width="40" Text="{Binding StrokeSize,Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Filling opacity" Margin="0,5,0,5"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Slider x:Name="OpacitySlider" Width="195" Minimum="0" Maximum="1" Value="{Binding Opacity}"/>
|
||||
<TextBox Width="40" Text="{Binding Opacity,Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<Compile Update="Windows\Arrays\ArrayView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\SurroundDataView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\GeometryCalculatorViews\GeometryCalculatorResultView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -39,7 +42,7 @@
|
||||
<Compile Update="Windows\PrimitiveTemplates\RCs\Beams\CircleView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\UserControls\MultiplyTuple.xaml.cs">
|
||||
<Compile Update="Windows\UserControls\MultiplyDouble.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
@@ -59,6 +62,9 @@
|
||||
<Page Update="Windows\Arrays\ArrayView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\SurroundDataView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\GeometryCalculatorViews\GeometryCalculatorResultView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -86,7 +92,7 @@
|
||||
<Page Update="Windows\PrimitiveTemplates\RCs\Beams\CircleView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\UserControls\MultiplyTuple.xaml">
|
||||
<Page Update="Windows\UserControls\MultiplyDouble.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
using StructureHelper.Windows.Graphs;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
@@ -18,20 +20,18 @@ using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
|
||||
{
|
||||
internal class InteractionDiagramLogic : ILongProcessLogic
|
||||
{
|
||||
const double xmax = 0.7e6d;
|
||||
const double xmin = -0.7e6d;
|
||||
const double ymax = 1.5e6d;
|
||||
const double ymin = -9e6d;
|
||||
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private IResult result;
|
||||
|
||||
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
|
||||
public int StepCount { get; }
|
||||
public int StepCount => SurroundData.PointCount;
|
||||
|
||||
public Action<int> SetProgress { get; set; }
|
||||
public bool Result { get; set; }
|
||||
@@ -40,29 +40,40 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
|
||||
private void Show()
|
||||
public SurroundData SurroundData { get; set; }
|
||||
|
||||
public InteractionDiagramLogic(SurroundData surroundData)
|
||||
{
|
||||
var options = new TriangulationOptions() { LimiteState = LimitState, CalcTerm = CalcTerm };
|
||||
var ndmCollection = NdmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
//var ndmCollection = NdmPrimitivesService.GetNdms(NdmPrimitives, LimitState, CalcTerm);
|
||||
SurroundData = surroundData;
|
||||
}
|
||||
|
||||
private void DoCalculations()
|
||||
{
|
||||
var ndmCollection = NdmPrimitivesService.GetNdms(NdmPrimitives, LimitState, CalcTerm);
|
||||
|
||||
var predicateFactory = new PredicateFactory()
|
||||
{
|
||||
My = ForceTuple.My,
|
||||
My = SurroundData.ConstZ,
|
||||
Ndms = ndmCollection
|
||||
};
|
||||
Predicate<IPoint2D> predicate = predicateFactory.GetResult;
|
||||
Predicate<IPoint2D> predicate = predicateFactory.IsSectionFailure;
|
||||
//Predicate<IPoint2D> predicate = predicateFactory.IsSectionCracked;
|
||||
//var logic = new StabLimitCurveLogic();
|
||||
var logic = new LimitCurveLogic(predicate);
|
||||
var calculator = new LimitCurveCalculator(logic);
|
||||
calculator.SurroundData.XMax = xmax;
|
||||
calculator.SurroundData.XMin = xmin;
|
||||
calculator.SurroundData.YMax = ymax;
|
||||
calculator.SurroundData.YMin = ymin;
|
||||
calculator.SurroundData.PointCount = 40;
|
||||
calculator.SurroundData = SurroundData;
|
||||
calculator.ActionToOutputResults = SetProgressByResult;
|
||||
SafetyProcessor.RunSafeProcess(() =>
|
||||
{
|
||||
CalcResult(calculator);
|
||||
}, "Errors appeared during showing a graph, see detailed information");
|
||||
}
|
||||
|
||||
private void CalcResult(LimitCurveCalculator calculator)
|
||||
{
|
||||
calculator.Run();
|
||||
var result = calculator.Result;
|
||||
if (result.IsValid = false) { return; }
|
||||
result = calculator.Result;
|
||||
if (result.IsValid == false) { return; }
|
||||
var interactionResult = result as LimitCurveResult;
|
||||
var unitForce = CommonOperation.GetUnit(UnitTypes.Force, "kN");
|
||||
var unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
|
||||
@@ -73,18 +84,27 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
for (int i = 0; i < items.Count(); i++)
|
||||
{
|
||||
var valueList = new List<double>
|
||||
{
|
||||
items[i].X * unitForce.Multiplyer,
|
||||
items[i].Y * unitMoment.Multiplyer
|
||||
};
|
||||
{
|
||||
items[i].X * unitForce.Multiplyer,
|
||||
items[i].Y * unitMoment.Multiplyer
|
||||
};
|
||||
for (int j = 0; j < valueList.Count; j++)
|
||||
{
|
||||
data[i, j] = valueList[j];
|
||||
}
|
||||
SetProgress?.Invoke(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetProgressByResult(IResult calcResult)
|
||||
{
|
||||
if (calcResult is not LimitCurveResult)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(LimitCurveResult), calcResult));
|
||||
}
|
||||
var parameterResult = calcResult as LimitCurveResult;
|
||||
SetProgress?.Invoke(parameterResult.IterationNumber);
|
||||
}
|
||||
|
||||
private static string[] GetLabels(IUnit unitForce, IUnit unitMoment)
|
||||
{
|
||||
return new string[]
|
||||
@@ -96,19 +116,25 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public void ShowWindow()
|
||||
{
|
||||
Show();
|
||||
Result = true;
|
||||
SafetyProcessor.RunSafeProcess(() =>
|
||||
{
|
||||
var wnd = new GraphView(arrayParameter);
|
||||
wnd.ShowDialog();
|
||||
if (result.IsValid == true)
|
||||
{
|
||||
var wnd = new GraphView(arrayParameter);
|
||||
wnd.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(result.Description);
|
||||
}
|
||||
},
|
||||
"Errors appeared during showing a graph, see detailed information");
|
||||
}
|
||||
|
||||
public void WorkerDoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
Show();
|
||||
DoCalculations();
|
||||
Result = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic.SurroundDataView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic"
|
||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
d:DataContext ="{d:DesignInstance local:SurroundDataViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Diagram properties" Height="250" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="35"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="170"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Maximum axial force"/>
|
||||
<TextBlock Grid.Row="1" Text="Minimum axial force"/>
|
||||
<TextBlock Grid.Row="2" Text="Maximum bending moment Mx"/>
|
||||
<TextBlock Grid.Row="3" Text="Minimum bending moment Mx"/>
|
||||
<TextBlock Grid.Row="4" Text="Minimum bending moment My"/>
|
||||
<TextBlock Grid.Row="5" Text="Point count"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding YMax, Converter={StaticResource ForceConverter}, ValidatesOnDataErrors=True}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding YMin, Converter={StaticResource ForceConverter}, ValidatesOnDataErrors=True}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding XMax, Converter={StaticResource MomentConverter}, ValidatesOnDataErrors=True}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding XMin, Converter={StaticResource MomentConverter}, ValidatesOnDataErrors=True}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding ConstZ, Converter={StaticResource MomentConverter}, ValidatesOnDataErrors=True}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="5" Text="{Binding PointCount, ValidatesOnDataErrors=True}"/>
|
||||
<uc:MultiplyDouble Margin="2" Grid.Column="4" Grid.Row="0" ValueChanged="YmaxChanged"/>
|
||||
<uc:MultiplyDouble Margin="2" Grid.Column="4" Grid.Row="1" ValueChanged="YminChanged"/>
|
||||
<uc:MultiplyDouble Margin="2" Grid.Column="4" Grid.Row="2" ValueChanged="XmaxChanged"/>
|
||||
<uc:MultiplyDouble Margin="2" Grid.Column="4" Grid.Row="3" ValueChanged="XminChanged"/>
|
||||
<uc:MultiplyDouble Margin="2" Grid.Column="4" Grid.Row="4" ValueChanged="ConstZChanged"/>
|
||||
<uc:MultiplyDouble Margin="2" Grid.Column="4" Grid.Row="5" ValueChanged="PointCountChanged"/>
|
||||
</Grid>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,67 @@
|
||||
using StructureHelper.Windows.UserControls;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для SurroundDataView.xaml
|
||||
/// </summary>
|
||||
public partial class SurroundDataView : Window
|
||||
{
|
||||
private SurroundDataViewModel viewModel;
|
||||
public SurroundDataView(SurroundData surroundData) : this(new SurroundDataViewModel(surroundData)) { }
|
||||
public SurroundDataView(SurroundDataViewModel vm)
|
||||
{
|
||||
viewModel = vm;
|
||||
viewModel.ParentWindow = this;
|
||||
DataContext = viewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void XmaxChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.XMax *= ChangeValue(sender);
|
||||
}
|
||||
private void XminChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.XMin *= ChangeValue(sender);
|
||||
}
|
||||
|
||||
private void YmaxChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.YMax *= ChangeValue(sender);
|
||||
}
|
||||
private void YminChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.YMin *= ChangeValue(sender);
|
||||
}
|
||||
private void ConstZChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.ConstZ *= ChangeValue(sender);
|
||||
}
|
||||
private void PointCountChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.PointCount = Convert.ToInt32(viewModel.PointCount * ChangeValue(sender));
|
||||
}
|
||||
|
||||
private double ChangeValue(object sender)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var factor = obj.DoubleFactor;
|
||||
return factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
||||
{
|
||||
public class SurroundDataViewModel : OkCancelViewModelBase, IDataErrorInfo
|
||||
{
|
||||
private readonly SurroundData surroundData;
|
||||
|
||||
public double XMax
|
||||
{
|
||||
get => surroundData.XMax; set
|
||||
{
|
||||
surroundData.XMax = value;
|
||||
OnPropertyChanged(nameof(XMax));
|
||||
}
|
||||
}
|
||||
public double XMin
|
||||
{
|
||||
get => surroundData.XMin; set
|
||||
{
|
||||
surroundData.XMin = value;
|
||||
OnPropertyChanged(nameof(XMin));
|
||||
}
|
||||
}
|
||||
public double YMax
|
||||
{
|
||||
get => surroundData.YMax; set
|
||||
{
|
||||
surroundData.YMax = value;
|
||||
OnPropertyChanged(nameof(YMax));
|
||||
}
|
||||
}
|
||||
public double YMin
|
||||
{
|
||||
get => surroundData.YMin; set
|
||||
{
|
||||
surroundData.YMin = value;
|
||||
OnPropertyChanged(nameof(YMin));
|
||||
}
|
||||
}
|
||||
public double ConstZ
|
||||
{
|
||||
get => surroundData.ConstZ; set
|
||||
{
|
||||
surroundData.ConstZ = value;
|
||||
OnPropertyChanged(nameof(ConstZ));
|
||||
}
|
||||
}
|
||||
public int PointCount
|
||||
{
|
||||
get => surroundData.PointCount; set
|
||||
{
|
||||
try
|
||||
{
|
||||
surroundData.PointCount = value;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
surroundData.PointCount = 40;
|
||||
}
|
||||
OnPropertyChanged(nameof(PointCount));
|
||||
}
|
||||
}
|
||||
|
||||
public string Error => throw new NotImplementedException();
|
||||
|
||||
public string this[string columnName]
|
||||
{
|
||||
get
|
||||
{
|
||||
string error = String.Empty;
|
||||
switch (columnName)
|
||||
{
|
||||
case nameof(PointCount):
|
||||
if (PointCount < 24)
|
||||
{
|
||||
error = "Point count must be greater than 24";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
public SurroundDataViewModel(SurroundData surroundData)
|
||||
{
|
||||
this.surroundData = surroundData;
|
||||
}
|
||||
|
||||
internal void RefreshAll()
|
||||
{
|
||||
OnPropertyChanged(nameof(XMax));
|
||||
OnPropertyChanged(nameof(XMin));
|
||||
OnPropertyChanged(nameof(YMax));
|
||||
OnPropertyChanged(nameof(YMin));
|
||||
OnPropertyChanged(nameof(ConstZ));
|
||||
OnPropertyChanged(nameof(PointCount));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using StructureHelper.Services.Exports;
|
||||
using StructureHelper.Services.Reports;
|
||||
using StructureHelper.Services.Reports.CalculationReports;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.GeometryCalculatorViews;
|
||||
using StructureHelper.Windows.Errors;
|
||||
using StructureHelper.Windows.Forces;
|
||||
@@ -38,7 +39,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private ForceCalculator forceCalculator;
|
||||
private ILongProcessLogic progressLogic;
|
||||
private ShowProgressLogic showProgressLogic;
|
||||
private InteractionDiagramLogic interactionDiagramLogic = new();
|
||||
private InteractionDiagramLogic interactionDiagramLogic;
|
||||
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
|
||||
private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
||||
private IForcesResults forcesResults;
|
||||
@@ -73,11 +74,25 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
return showInteractionDiagramCommand ??
|
||||
(showInteractionDiagramCommand = new RelayCommand(o =>
|
||||
{
|
||||
interactionDiagramLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple.Clone() as ForceTuple;
|
||||
interactionDiagramLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
interactionDiagramLogic.CalcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
interactionDiagramLogic.NdmPrimitives = ndmPrimitives;
|
||||
interactionDiagramLogic.ShowWindow();
|
||||
var tuple = SelectedResult.DesignForceTuple.ForceTuple.Clone() as ForceTuple;
|
||||
var data = new SurroundData();
|
||||
data.ConstZ = tuple.My;
|
||||
var wnd = new SurroundDataView(data);
|
||||
wnd.ShowDialog();
|
||||
if (wnd.DialogResult != true) return;
|
||||
interactionDiagramLogic = new(data)
|
||||
{
|
||||
ForceTuple = tuple,
|
||||
LimitState = SelectedResult.DesignForceTuple.LimitState,
|
||||
CalcTerm = SelectedResult.DesignForceTuple.CalcTerm,
|
||||
NdmPrimitives = ndmPrimitives
|
||||
};
|
||||
showProgressLogic = new(interactionDiagramLogic)
|
||||
{
|
||||
WindowTitle = "Diagram creating...",
|
||||
ShowResult = interactionDiagramLogic.ShowWindow
|
||||
};
|
||||
showProgressLogic.Show();
|
||||
}, o => SelectedResult != null && SelectedResult.IsValid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
d:DataContext="{d:DesignInstance local:InterpolateTuplesViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Interpolate Combinations" Height="200" Width="400" MinHeight="180" MinWidth="400" WindowStartupLocation="CenterScreen">
|
||||
Title="Interpolate Combinations" Height="200" Width="460" MinHeight="180" MinWidth="460" WindowStartupLocation="CenterScreen">
|
||||
<Window.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
<Style TargetType="Button">
|
||||
@@ -40,7 +40,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
||||
@@ -99,8 +99,9 @@
|
||||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<uc:MultiplyTuple Grid.Column="4" Grid.Row="1" ForceTuple="{Binding StartDesignForce.ForceTuple}" ValueChanged="StartValueChanged"/>
|
||||
<uc:MultiplyTuple Grid.Column="4" Grid.Row="3" ForceTuple="{Binding FinishDesignForce.ForceTuple}" ValueChanged="FinishValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using StructureHelper.Windows.ViewModels.Forces;
|
||||
using StructureHelper.Windows.UserControls;
|
||||
using StructureHelper.Windows.ViewModels.Forces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -38,12 +40,28 @@ namespace StructureHelper.Windows.Forces
|
||||
|
||||
private void StartValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(viewModel.StartDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, viewModel.StartDesignForce.ForceTuple, 1d);
|
||||
viewModel.RefreshStartTuple();
|
||||
}
|
||||
|
||||
private void FinishValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(viewModel.FinishDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, viewModel.FinishDesignForce.ForceTuple, 1d);
|
||||
viewModel.RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void StepCountValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var factor = obj.DoubleFactor;
|
||||
if (factor > 0d)
|
||||
{
|
||||
viewModel.StepCount = Convert.ToInt32(viewModel.StepCount * factor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,15 @@ namespace StructureHelper.Windows.Forces
|
||||
private RelayCommand invertForcesCommand;
|
||||
private RelayCommand copyToStartCommand;
|
||||
private RelayCommand copyToFinishCommand;
|
||||
private int stepCount;
|
||||
|
||||
public IDesignForceTuple StartDesignForce { get; set; }
|
||||
public IDesignForceTuple FinishDesignForce { get; set; }
|
||||
|
||||
public double StartFactor { get; set; }
|
||||
public double FinishFactor { get; set; }
|
||||
public double StepCountFactor { get; set; }
|
||||
|
||||
public bool StepCountVisible { get; set; }
|
||||
public double StartMx
|
||||
{
|
||||
@@ -70,23 +75,27 @@ namespace StructureHelper.Windows.Forces
|
||||
OnPropertyChanged(nameof(FinishNz));
|
||||
}
|
||||
}
|
||||
public int StepCount { get; set; }
|
||||
public int StepCount
|
||||
{
|
||||
get => stepCount; set
|
||||
{
|
||||
stepCount = value;
|
||||
OnPropertyChanged(nameof(StepCount));
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand InvertForcesCommand
|
||||
{
|
||||
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
|
||||
}
|
||||
|
||||
public ICommand CopyToStartCommand
|
||||
{
|
||||
get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
|
||||
}
|
||||
|
||||
public ICommand CopyToFinishCommand
|
||||
{
|
||||
get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
|
||||
}
|
||||
|
||||
public InterpolateTuplesResult Result
|
||||
{
|
||||
get => new()
|
||||
|
||||
23
StructureHelper/Windows/Graphs/GraphService.cs
Normal file
23
StructureHelper/Windows/Graphs/GraphService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using LiveCharts.Wpf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelper.Windows.Graphs
|
||||
{
|
||||
internal static class GraphService
|
||||
{
|
||||
public static void SetVisualProps(LineSeries lineSeries, GraphVisualProps visualProps, Color color)
|
||||
{
|
||||
lineSeries.Stroke = new SolidColorBrush(color);
|
||||
lineSeries.Fill = new SolidColorBrush(color) { Opacity = visualProps.Opacity };
|
||||
lineSeries.LineSmoothness = visualProps.LineSmoothness;
|
||||
lineSeries.PointGeometry = DefaultGeometries.Circle;
|
||||
lineSeries.PointGeometrySize = visualProps.StrokeSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||||
d:DataContext="{d:DesignInstance local:GraphViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Graph" Height="450" Width="800" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
||||
Title="Graph" Height="550" Width="800" MinHeight="500" MinWidth="600" WindowStartupLocation="CenterScreen">
|
||||
<DockPanel>
|
||||
<!--<ToolBarTray DockPanel.Dock="Top">
|
||||
<ToolBar>
|
||||
@@ -30,7 +30,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="70"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="120"/>
|
||||
<RowDefinition Height="170"/>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Grid.Row="0" Header="X-axis values">
|
||||
<StackPanel>
|
||||
|
||||
@@ -165,13 +165,8 @@ namespace StructureHelper.Windows.Graphs
|
||||
.X(point => point.X)
|
||||
.Y(point => point.Y),
|
||||
Title = yParameter.Name,
|
||||
//PointGeometry = null,
|
||||
Stroke = new SolidColorBrush(yParameter.Color),
|
||||
Fill = Brushes.Transparent,
|
||||
LineSmoothness = VisualProps.LineSmoothness,
|
||||
PointGeometry = DefaultGeometries.Circle,
|
||||
PointGeometrySize = VisualProps.StrokeSize
|
||||
};
|
||||
GraphService.SetVisualProps(lineSeries, VisualProps, yParameter.Color);
|
||||
_ = valueList.TryGetValue(xParameter, out double[] xValues);
|
||||
_ = valueList.TryGetValue(yParameter, out double[] yValues);
|
||||
var chartValues = new ChartValues<Point2D>();
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace StructureHelper.Windows.Graphs
|
||||
{
|
||||
private double lineSmoothness;
|
||||
private double strokeSize;
|
||||
private double opacity;
|
||||
|
||||
public double LineSmoothness
|
||||
{
|
||||
@@ -37,6 +38,18 @@ namespace StructureHelper.Windows.Graphs
|
||||
public double MaxLineSmoothness { get; }
|
||||
public double MaxStrokeSize { get; }
|
||||
|
||||
public double Opacity
|
||||
{
|
||||
get => opacity; set
|
||||
{
|
||||
value = Math.Max(value, 0d);
|
||||
value = Math.Min(value, 1d);
|
||||
value = Math.Round(value, 2);
|
||||
opacity = value;
|
||||
OnPropertyChanged(nameof(Opacity));
|
||||
}
|
||||
}
|
||||
|
||||
public GraphVisualProps()
|
||||
{
|
||||
MaxLineSmoothness = 1d;
|
||||
@@ -44,6 +57,7 @@ namespace StructureHelper.Windows.Graphs
|
||||
|
||||
lineSmoothness = 0.3;
|
||||
strokeSize = 0;
|
||||
Opacity = 0d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||||
d:DataContext="{d:DesignInstance local:MaterialDiagramViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Material Diagram" Height="450" Width="800" WindowStartupLocation="CenterScreen">
|
||||
Title="Material Diagram" Height="550" Width="800" MinHeight="550" MinWidth="800" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="250"/>
|
||||
@@ -16,7 +16,7 @@
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="120"/>
|
||||
<RowDefinition Height="170"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
|
||||
@@ -6,6 +6,7 @@ using StructureHelper.Models.Materials;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -212,15 +213,14 @@ namespace StructureHelper.Windows.Graphs
|
||||
var lineSeries = new LineSeries()
|
||||
{
|
||||
Title = $"{material.Name} ({calcTerm.ShortName} {limitState.ShortName})",
|
||||
//Stroke = new SolidColorBrush(material.Color),
|
||||
Fill = Brushes.Transparent,
|
||||
LineSmoothness = VisualProps.LineSmoothness,
|
||||
PointGeometry = DefaultGeometries.Circle,
|
||||
PointGeometrySize = VisualProps.StrokeSize
|
||||
};
|
||||
if (limitStates.Count() == 1 && calcTerms.Count() == 1)
|
||||
{
|
||||
lineSeries.Stroke = new SolidColorBrush(material.Color);
|
||||
GraphService.SetVisualProps(lineSeries, VisualProps, material.Color);
|
||||
}
|
||||
else
|
||||
{
|
||||
GraphService.SetVisualProps(lineSeries, VisualProps, ColorProcessor.GetRandomColor());
|
||||
}
|
||||
var chartValues = new ChartValues<double>();
|
||||
for (double s = minValue; s < maxValue; s += step)
|
||||
|
||||
@@ -16,6 +16,7 @@ using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using StructureHelperLogics.Services;
|
||||
using StructureHelperLogics.Services.NdmCalculations;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -51,12 +52,12 @@ namespace StructureHelper.Windows.MainWindow
|
||||
public IEnumerable<INdm> GetNdms(ICalculationProperty calculationProperty)
|
||||
{
|
||||
var ndmPrimitives = Section.SectionRepository.Primitives;
|
||||
return NdmPrimitivesService.GetNdms(ndmPrimitives, calculationProperty.LimitState, calculationProperty.CalcTerm);
|
||||
////Настройки триангуляции, пока опции могут быть только такие
|
||||
//ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
||||
|
||||
//Настройки триангуляции, пока опции могут быть только такие
|
||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
||||
|
||||
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
|
||||
return ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
////Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
|
||||
//return ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.PrimitivePropertiesWindow"
|
||||
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.PrimitiveProperties"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance vm:SelectPrimitivesViewModel}"
|
||||
d:DataContext="{d:DesignInstance local:SelectPrimitivesViewModel}"
|
||||
Title="Select Primitives" Height="250" Width="250" MinHeight="250" MinWidth="250" MaxHeight="500" MaxWidth="500" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -7,7 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
|
||||
namespace StructureHelper.Windows.PrimitivePropertiesWindow
|
||||
{
|
||||
public class SelectPrimitivesViewModel : OkCancelViewModelBase
|
||||
{
|
||||
@@ -1,18 +1,22 @@
|
||||
<UserControl x:Class="StructureHelper.Windows.UserControls.MultiplyTuple"
|
||||
<UserControl x:Class="StructureHelper.Windows.UserControls.MultiplyDouble"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="25" d:DesignWidth="60">
|
||||
d:DesignHeight="25" d:DesignWidth="120">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="Multy0_5" Grid.Column="0" Content="*0.5" Click="Multy0_5_Click"/>
|
||||
<Button x:Name="Multy2_0" Grid.Column="1" Content="*2.0" Click="Multy2_0_Click"/>
|
||||
<Button x:Name="MultyM1_2" Grid.Column="0" Content="*-1" Click="MultyM1_2_Click"/>
|
||||
<Button x:Name="Multy0_0" Grid.Column="1" Content="*0" Click="Multy0_Click"/>
|
||||
<Button x:Name="Multy0_5" Grid.Column="2" Content="*0.5" Click="Multy0_5_Click"/>
|
||||
<Button x:Name="Multy2_0" Grid.Column="3" Content="*2.0" Click="Multy2_0_Click"/>
|
||||
<!--<Grid.ToolTip>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="MultyM1_2" Grid.Column="1" Content="*(-1)" Click="MultyM1_2_Click"/>
|
||||
@@ -23,11 +23,11 @@ namespace StructureHelper.Windows.UserControls
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для MultiplyTuple.xaml
|
||||
/// </summary>
|
||||
public partial class MultiplyTuple : UserControl
|
||||
public partial class MultiplyDouble : UserControl
|
||||
{
|
||||
public event EventHandler ValueChanged;
|
||||
|
||||
public MultiplyTuple()
|
||||
public MultiplyDouble()
|
||||
{
|
||||
InitializeComponent();
|
||||
//DataContext = this;
|
||||
@@ -51,15 +51,28 @@ namespace StructureHelper.Windows.UserControls
|
||||
}
|
||||
|
||||
|
||||
public static readonly DependencyProperty ForceTupleProperty = DependencyProperty.Register(
|
||||
"ForceTuple", typeof(ForceTuple), typeof(MultiplyTuple), new PropertyMetadata(new ForceTuple()));
|
||||
|
||||
public double DoubleValue
|
||||
{
|
||||
get { return (double)GetValue(DoubleValueProperty); }
|
||||
set { SetValue(DoubleValueProperty, value); }
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for DoubleValue. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty DoubleValueProperty =
|
||||
DependencyProperty.Register("DoubleValue", typeof(double), typeof(MultiplyDouble), new PropertyMetadata(new double()));
|
||||
|
||||
|
||||
|
||||
public static readonly DependencyProperty DoubleFactorProperty = DependencyProperty.Register(
|
||||
"DoubleFactor", typeof(double), typeof(MultiplyDouble), new PropertyMetadata(new double()));
|
||||
|
||||
private RelayCommand muliplyByFactor;
|
||||
|
||||
public ForceTuple ForceTuple
|
||||
public double DoubleFactor
|
||||
{
|
||||
get { return (ForceTuple)GetValue(ForceTupleProperty); }
|
||||
set { SetValue(ForceTupleProperty, value); }
|
||||
get { return (double)GetValue(DoubleFactorProperty); }
|
||||
set { SetValue(DoubleFactorProperty, value); }
|
||||
}
|
||||
|
||||
private void Multy0_5_Click(object sender, RoutedEventArgs e)
|
||||
@@ -73,8 +86,8 @@ namespace StructureHelper.Windows.UserControls
|
||||
|
||||
private void ChangeValue(double factor)
|
||||
{
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(ForceTuple, factor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, ForceTuple, 1d);
|
||||
DoubleValue *= factor;
|
||||
DoubleFactor = factor;
|
||||
ValueChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Calculators
|
||||
{
|
||||
public class FindParameterCalculator : ICalculator
|
||||
public class FindParameterCalculator : ICalculator, IHasActionByResult
|
||||
{
|
||||
FindParameterResult result;
|
||||
public string Name { get; set; }
|
||||
@@ -18,21 +18,20 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
public IAccuracy Accuracy {get;set;}
|
||||
public IResult Result => result;
|
||||
|
||||
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
|
||||
public FindParameterCalculator()
|
||||
{
|
||||
StartValue = 0d;
|
||||
EndValue = 1d;
|
||||
Accuracy = new Accuracy() { IterationAccuracy = 0.001, MaxIterationCount = 1000 };
|
||||
Accuracy = new Accuracy() { IterationAccuracy = 0.001d, MaxIterationCount = 1000 };
|
||||
}
|
||||
public void Run()
|
||||
{
|
||||
result = new() { IsValid = true};
|
||||
result = new();
|
||||
try
|
||||
{
|
||||
result.Parameter = FindMinimumValue(StartValue, EndValue, Predicate);
|
||||
result.Description = "Parameter was found succefully";
|
||||
FindMinimumValue(StartValue, EndValue, Predicate);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
@@ -45,7 +44,7 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private double FindMinimumValue(double start, double end, Predicate<double> predicate)
|
||||
private void FindMinimumValue(double start, double end, Predicate<double> predicate)
|
||||
{
|
||||
if (predicate(end) == false)
|
||||
{
|
||||
@@ -59,7 +58,7 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
int iterationNum = 0;
|
||||
while (step > precision)
|
||||
{
|
||||
if (predicate(current))
|
||||
if (predicate(current) == true)
|
||||
{
|
||||
end = current;
|
||||
}
|
||||
@@ -71,13 +70,23 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
current = (start + end) / 2;
|
||||
step = (end - start) / 2;
|
||||
iterationNum++;
|
||||
|
||||
result.IsValid = false;
|
||||
result.IterationNumber = iterationNum;
|
||||
result.CurrentAccuracy = step;
|
||||
ActionToOutputResults?.Invoke(result);
|
||||
|
||||
if (iterationNum > maxIterationCount)
|
||||
{
|
||||
result.Description = "Parameter was not found succefully: \n";
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": violation of iteration count");
|
||||
}
|
||||
}
|
||||
|
||||
return current;
|
||||
result.Parameter = current;
|
||||
result.Description = "Parameter was found succefully";
|
||||
result.IsValid = true;
|
||||
ActionToOutputResults?.Invoke(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Calculators
|
||||
{
|
||||
public class FindParameterResult : IResult
|
||||
public class FindParameterResult : IResult, IiterationResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string Description { get; set; }
|
||||
public double Parameter { get; set; }
|
||||
public int IterationNumber { get; set; }
|
||||
public double CurrentAccuracy { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,5 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
/// Result of Calculations
|
||||
/// </summary>
|
||||
IResult Result { get; }
|
||||
Action<IResult> ActionToOutputResults { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Calculators
|
||||
{
|
||||
public interface IHasActionByResult
|
||||
{
|
||||
Action<IResult> ActionToOutputResults { get; set; }
|
||||
}
|
||||
}
|
||||
13
StructureHelperCommon/Models/Calculators/IiterationResult.cs
Normal file
13
StructureHelperCommon/Models/Calculators/IiterationResult.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Calculators
|
||||
{
|
||||
public interface IiterationResult
|
||||
{
|
||||
int IterationNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,12 @@ namespace StructureHelperCommon.Services.Forces
|
||||
{
|
||||
public static class ForceTupleService
|
||||
{
|
||||
/// <summary>
|
||||
/// Copy properties from target to source
|
||||
/// </summary>
|
||||
/// <param name="source">Source tuple</param>
|
||||
/// <param name="target">Target tuple</param>
|
||||
/// <param name="factor">factor</param>
|
||||
public static void CopyProperties(IForceTuple source, IForceTuple target, double factor = 1d)
|
||||
{
|
||||
CheckTuples(source, target);
|
||||
|
||||
@@ -12,7 +12,7 @@ using StructureHelperLogics.Services.NdmPrimitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForceCalculator : IForceCalculator
|
||||
public class ForceCalculator : IForceCalculator, IHasActionByResult
|
||||
{
|
||||
static readonly ForceCalculatorUpdateStrategy updateStrategy = new();
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -6,7 +6,7 @@ using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForceTupleCalculator : IForceTupleCalculator
|
||||
public class ForceTupleCalculator : IForceTupleCalculator, IHasActionByResult
|
||||
{
|
||||
public IForceTupleInputData InputData { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface ILimitCurveLogic
|
||||
public interface ILimitCurveLogic : IHasActionByResult
|
||||
{
|
||||
List<IPoint2D> GetPoints(List<IPoint2D> points);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface ILimitCurveParameterLogic
|
||||
public interface ILimitCurveParameterLogic : IHasActionByResult
|
||||
{
|
||||
IPoint2D CurrentPoint { get; set; }
|
||||
double GetParameter();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,7 +10,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class LimitCurveCalculator : ICalculator
|
||||
public class LimitCurveCalculator : ICalculator, IHasActionByResult
|
||||
{
|
||||
private LimitCurveResult result;
|
||||
private List<IPoint2D> surroundList;
|
||||
@@ -50,14 +51,26 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
surroundList = SurroundProcLogic.GetPoints();
|
||||
try
|
||||
{
|
||||
limitCurveLogic.ActionToOutputResults = GetCurrentStepNumber;
|
||||
factoredList = limitCurveLogic.GetPoints(surroundList);
|
||||
result.Points = factoredList;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.IsValid = false;
|
||||
result.Description = ex.Message;
|
||||
result.Description += ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private void GetCurrentStepNumber(IResult calcResult)
|
||||
{
|
||||
if (calcResult is not FindParameterResult)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(FindParameterResult), calcResult));
|
||||
}
|
||||
var parameterResult = calcResult as FindParameterResult;
|
||||
result.IterationNumber = parameterResult.IterationNumber;
|
||||
ActionToOutputResults?.Invoke(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,12 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class LimitCurveLogic : ILimitCurveLogic
|
||||
{
|
||||
private FindParameterResult result;
|
||||
private IPoint2D currentPoint;
|
||||
private ILimitCurveParameterLogic parameterLogic;
|
||||
public Predicate<IPoint2D> LimitPredicate { get; set; }
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
|
||||
public LimitCurveLogic(ILimitCurveParameterLogic parameterLogic)
|
||||
{
|
||||
this.parameterLogic = parameterLogic;
|
||||
@@ -24,6 +27,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
}
|
||||
public List<IPoint2D> GetPoints(List<IPoint2D> points)
|
||||
{
|
||||
result = new();
|
||||
List<IPoint2D> resultList = new();
|
||||
if (LimitPredicate(new Point2D()) == true)
|
||||
{
|
||||
@@ -48,6 +52,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
Y = currentPoint.Y * parameter
|
||||
};
|
||||
resultList.Add(resultPoint);
|
||||
result.IterationNumber = resultList.Count;
|
||||
ActionToOutputResults?.Invoke(result);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,10 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class LimitCurveParameterLogic : ILimitCurveParameterLogic
|
||||
{
|
||||
private FindParameterResult result;
|
||||
private Predicate<Point2D> limitPredicate;
|
||||
public IPoint2D CurrentPoint { get; set; }
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
|
||||
public LimitCurveParameterLogic(Predicate<Point2D> limitPredicate)
|
||||
{
|
||||
@@ -31,8 +33,16 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": predicate for point (x={CurrentPoint.X}, y={CurrentPoint.Y}) is not valid");
|
||||
}
|
||||
var result = parameterCalculator.Result as FindParameterResult;
|
||||
result = parameterCalculator.Result as FindParameterResult;
|
||||
var parameter = result.Parameter;
|
||||
if (parameter < 0.1d)
|
||||
{
|
||||
parameterCalculator.Accuracy.IterationAccuracy = 0.0001d;
|
||||
parameterCalculator.Run();
|
||||
result = parameterCalculator.Result as FindParameterResult;
|
||||
parameter = result.Parameter;
|
||||
}
|
||||
|
||||
return parameter;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class LimitCurveResult : IResult
|
||||
public class LimitCurveResult : IResult, IiterationResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string Description { get; set; }
|
||||
public List<IPoint2D> Points { get; set; }
|
||||
public int IterationNumber { get; set; }
|
||||
|
||||
public LimitCurveResult()
|
||||
{
|
||||
Points = new List<IPoint2D>();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,17 +13,52 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class PredicateFactory
|
||||
{
|
||||
|
||||
private ForceTupleCalculator calculator;
|
||||
private ForceTuple tuple;
|
||||
private ForceTupleInputData inputData;
|
||||
public IEnumerable<INdm> Ndms { get; set; }
|
||||
public double My { get; set; }
|
||||
public bool GetResult(IPoint2D point)
|
||||
public PredicateFactory()
|
||||
{
|
||||
var calculator = new ForceTupleCalculator();
|
||||
var tuple = new ForceTuple() { Nz = point.Y, Mx = point.X, My = My };
|
||||
var inputData = new ForceTupleInputData() { Tuple = tuple, NdmCollection = Ndms };
|
||||
calculator.InputData = inputData;
|
||||
inputData = new();
|
||||
calculator = new() { InputData = inputData };
|
||||
}
|
||||
public bool IsSectionFailure(IPoint2D point)
|
||||
{
|
||||
tuple = new()
|
||||
{
|
||||
Nz = point.Y,
|
||||
Mx = point.X,
|
||||
My = My
|
||||
};
|
||||
inputData.Tuple = tuple;
|
||||
inputData.NdmCollection = Ndms;
|
||||
calculator.Run();
|
||||
var result = calculator.Result;
|
||||
return !result.IsValid;
|
||||
}
|
||||
|
||||
public bool IsSectionCracked(IPoint2D point)
|
||||
{
|
||||
var logic = new HoleSectionCrackedLogic();
|
||||
tuple = new()
|
||||
{
|
||||
Nz = point.Y,
|
||||
Mx = point.X,
|
||||
My = My
|
||||
};
|
||||
logic.Tuple = tuple;
|
||||
logic.NdmCollection = Ndms;
|
||||
try
|
||||
{
|
||||
var result = logic.IsSectionCracked();
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -9,6 +10,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class StabLimitCurveLogic : ILimitCurveLogic
|
||||
{
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
|
||||
public List<IPoint2D> GetPoints(List<IPoint2D> points)
|
||||
{
|
||||
var result = new List<IPoint2D>();
|
||||
|
||||
@@ -12,6 +12,15 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public double XMin { get; set; }
|
||||
public double YMax { get; set; }
|
||||
public double YMin { get; set; }
|
||||
public double ConstZ { get; set; }
|
||||
public int PointCount { get; set; }
|
||||
public SurroundData()
|
||||
{
|
||||
XMax = 1e7d;
|
||||
XMin = -1e7d;
|
||||
YMax = 1e7d;
|
||||
YMin = -1e7d;
|
||||
PointCount = 80;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public Accuracy Accuracy {get;set; }
|
||||
public IResult Result => result;
|
||||
|
||||
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public CrackForceCalculator(IForceTupleCalculator forceTupleCalculator)
|
||||
{
|
||||
StartTuple ??= new ForceTuple();
|
||||
|
||||
@@ -6,6 +6,7 @@ using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
@@ -23,8 +24,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public CrackWidthCalculatorInputData InputData { get; set; }
|
||||
public IResult Result => result;
|
||||
|
||||
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public void Run()
|
||||
{
|
||||
result = new() { IsValid = true, Description = ""};
|
||||
@@ -96,10 +95,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
rebarPrimitives.Add(item as RebarPrimitive);
|
||||
}
|
||||
}
|
||||
//rebarPrimitives = ndmPrimitives
|
||||
// .Select(x => x is RebarPrimitive) as IEnumerable<RebarPrimitive>;
|
||||
var options = new TriangulationOptions() { LimiteState = InputData.LimitState, CalcTerm = InputData.CalcTerm };
|
||||
ndmCollection = ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
ndmCollection = NdmPrimitivesService.GetNdms(ndmPrimitives, InputData.LimitState, InputData.CalcTerm);
|
||||
}
|
||||
|
||||
private void CalcCrackForce()
|
||||
|
||||
@@ -8,20 +8,20 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public static class Triangulation1
|
||||
{
|
||||
public static IEnumerable<INdm> GetNdms(IEnumerable<INdmPrimitive> ndmPrimitives, ITriangulationOptions options)
|
||||
{
|
||||
return ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
//var headMaterials = GetPrimitiveMaterials(ndmPrimitives);
|
||||
//Dictionary<Guid, IMaterial> materials = GetMaterials(headMaterials, options);
|
||||
//foreach (var ndmPrimitive in ndmPrimitives)
|
||||
//{
|
||||
// IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial;
|
||||
// IMaterial material;
|
||||
// if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
|
||||
// IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, options);
|
||||
// ndms.AddRange(localNdms);
|
||||
//}
|
||||
}
|
||||
//public static IEnumerable<INdm> GetNdms(IEnumerable<INdmPrimitive> ndmPrimitives, ITriangulationOptions options)
|
||||
//{
|
||||
// return ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
// var headMaterials = GetPrimitiveMaterials(ndmPrimitives);
|
||||
// Dictionary<Guid, IMaterial> materials = GetMaterials(headMaterials, options);
|
||||
// foreach (var ndmPrimitive in ndmPrimitives)
|
||||
// {
|
||||
// IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial;
|
||||
// IMaterial material;
|
||||
// if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
|
||||
// IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, options);
|
||||
// ndms.AddRange(localNdms);
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// Returns dictionary of unique materials by collection of primitives
|
||||
/// </summary>
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
|
||||
namespace StructureHelperLogics.Services.NdmCalculations
|
||||
{
|
||||
@@ -24,8 +25,7 @@ namespace StructureHelperLogics.Services.NdmCalculations
|
||||
public IStrainMatrix GetPrimitiveStrainMatrix(INdmPrimitive[] ndmPrimitives, double mx, double my, double nz)
|
||||
{
|
||||
var ndmCollection = new List<INdm>();
|
||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
||||
ndmCollection.AddRange(ndmPrimitives.SelectMany(x => x.GetNdms(options)));
|
||||
ndmCollection.AddRange(NdmPrimitivesService.GetNdms(ndmPrimitives, calculationProperty.LimitState, calculationProperty.CalcTerm));
|
||||
var loaderData = new LoaderOptions
|
||||
{
|
||||
Preconditions = new Preconditions
|
||||
|
||||
@@ -16,8 +16,4 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="NdmCalculations\Analyses\Interaction\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -11,6 +11,7 @@ using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
|
||||
namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.CrackCalculatorTests
|
||||
|
||||
@@ -24,8 +25,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.CrackCalculatorT
|
||||
var template = new RectangleBeamTemplate(width, height) { TopDiameter = topDiametr, BottomDiameter = bottomDiametr, WidthCount = widthCount, HeightCount = heightCount };
|
||||
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
|
||||
var ndmPrimitives = newSection.SectionRepository.Primitives;
|
||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = CalcTerms.ShortTerm };
|
||||
var ndms = ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
var ndms = NdmPrimitivesService.GetNdms(ndmPrimitives, LimitStates.SLS, CalcTerms.ShortTerm);
|
||||
var calculator = new CrackForceCalculator();
|
||||
calculator.EndTuple = new ForceTuple() { Mx = -50e3d, My = -50e3d, Nz = 0d };
|
||||
calculator.NdmCollection = ndms;
|
||||
|
||||
@@ -16,6 +16,10 @@ namespace StructureHelperTests.UnitTests.Calcuators
|
||||
var calculator = new LimitCurveCalculator(new StabLimitCurveLogic())
|
||||
{
|
||||
};
|
||||
calculator.SurroundData.XMax = xmax;
|
||||
calculator.SurroundData.XMin = -xmax;
|
||||
calculator.SurroundData.YMax = ymax;
|
||||
calculator.SurroundData.YMin = -ymax;
|
||||
//Act
|
||||
calculator.Run();
|
||||
var result = calculator.Result;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace StructureHelperTests.UnitTests.Calcuators
|
||||
parameterLogicMock.Setup(p => p.GetParameter()).Returns(2.0); // Mocking the GetParameter method
|
||||
|
||||
var limitCurveLogic = new LimitCurveLogic(parameterLogicMock.Object);
|
||||
limitCurveLogic.LimitPredicate = point => point.X <= 0.5d; // Example predicate
|
||||
limitCurveLogic.LimitPredicate = point => point.X >= 0.5d; // Example predicate
|
||||
|
||||
var inputPoints = new List<IPoint2D>
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace StructureHelperTests.UnitTests.Calcuators
|
||||
parameterLogicMock.Setup(p => p.GetParameter()).Returns(2.0);
|
||||
|
||||
var limitCurveLogic = new LimitCurveLogic(parameterLogicMock.Object);
|
||||
limitCurveLogic.LimitPredicate = point => false; // Invalid predicate
|
||||
limitCurveLogic.LimitPredicate = point => true; // Invalid predicate
|
||||
|
||||
var inputPoints = new List<IPoint2D>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user