Anchoring isofields has been added
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using FieldVisualizer.Entities.Values.Primitives;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelper.Infrastructure.UI.Converters.Units;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.RC;
|
||||
@@ -12,6 +16,7 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -19,53 +24,139 @@ namespace StructureHelper.Services.ResultViewers
|
||||
{
|
||||
public static class ShowAnchorageResult
|
||||
{
|
||||
private static IStressLogic stressLogic => new StressLogic();
|
||||
public static void ShowAnchorageField (IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<PrimitiveBase> primitives)
|
||||
internal static List<IPrimitiveSet> GetPrimitiveSets(IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
foreach (var item in primitives)
|
||||
{
|
||||
if (item is ReinforcementViewPrimitive)
|
||||
{
|
||||
var primitive = item as ReinforcementViewPrimitive;
|
||||
var ndmPrimitive = primitive.GetNdmPrimitive() as ReinforcementPrimitive;
|
||||
var inputData = new AnchorageInputData();
|
||||
inputData.ConcreteStrength = GetConcreteStrength(limitState, calcTerm, ndmPrimitive);
|
||||
inputData.ReinforcementStrength = GetReinforcementStrength(limitState, calcTerm, ndmPrimitive);
|
||||
inputData.CrossSectionArea = ndmPrimitive.Area;
|
||||
var diameter = Math.Sqrt(ndmPrimitive.Area / Math.PI) * 2d;
|
||||
inputData.CrossSectionPerimeter = Math.PI * diameter;
|
||||
var material = ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
var ndm = ndmPrimitive.GetNdms(material).Single();
|
||||
inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm);
|
||||
inputData.LappedCountRate = 0.5d;
|
||||
}
|
||||
}
|
||||
}
|
||||
private static double GetConcreteStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
|
||||
{
|
||||
if (primitive.HostPrimitive is not null)
|
||||
{
|
||||
var host = primitive.HostPrimitive;
|
||||
var hostMaterial = host.HeadMaterial.HelperMaterial;
|
||||
if (hostMaterial is IConcreteLibMaterial)
|
||||
{
|
||||
var concreteMaterial = hostMaterial as IConcreteLibMaterial;
|
||||
var concreteStrength = concreteMaterial.GetStrength(limitState, calcTerm).Tensile;
|
||||
return concreteStrength;
|
||||
}
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host's material is incorrect or null");
|
||||
var primitiveSets = new List<IPrimitiveSet>();
|
||||
PrimitiveSet primitiveSet;
|
||||
primitiveSet = GetBaseDevelopmentLength(strainMatrix, limitState, calcTerm, ndmPrimitives);
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetDevelopmentLength(strainMatrix, limitState, calcTerm, ndmPrimitives, true);
|
||||
primitiveSet.Name = "Development length full strength";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetDevelopmentLength(strainMatrix, limitState, calcTerm, ndmPrimitives,false);
|
||||
primitiveSet.Name = "Development length actual stress";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetFullStrengthLapLength(strainMatrix, limitState, calcTerm, ndmPrimitives, 0.5d, true);
|
||||
primitiveSet.Name = "Lapping length full strength, r=50%";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetFullStrengthLapLength(strainMatrix, limitState, calcTerm, ndmPrimitives, 1d, true);
|
||||
primitiveSet.Name = "Lapping length full strength, r=100%";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetFullStrengthLapLength(strainMatrix, limitState, calcTerm, ndmPrimitives, 0.5d, false);
|
||||
primitiveSet.Name = "Lapping length actual stress, r=50%";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetFullStrengthLapLength(strainMatrix, limitState, calcTerm, ndmPrimitives, 1d, false);
|
||||
primitiveSet.Name = "Lapping length actual stress, r=100%";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetStrength(strainMatrix, limitState, calcTerm, ndmPrimitives, true);
|
||||
primitiveSet.Name = "Full strength";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
primitiveSet = GetStrength(strainMatrix, limitState, calcTerm, ndmPrimitives, false);
|
||||
primitiveSet.Name = "Actual stress";
|
||||
primitiveSets.Add(primitiveSet);
|
||||
return primitiveSets;
|
||||
}
|
||||
|
||||
private static double GetReinforcementStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
|
||||
private static PrimitiveSet GetStrength(IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<INdmPrimitive> ndmPrimitives, bool fullStrength)
|
||||
{
|
||||
if (primitive.HeadMaterial.HelperMaterial is IReinforcementLibMaterial)
|
||||
PrimitiveSet primitiveSet = new PrimitiveSet();
|
||||
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
||||
foreach (var item in ndmPrimitives)
|
||||
{
|
||||
var material = primitive.HeadMaterial.HelperMaterial as IReinforcementLibMaterial;
|
||||
var strength = material.GetStrength(limitState, calcTerm).Tensile;
|
||||
return strength;
|
||||
if (item is ReinforcementPrimitive)
|
||||
{
|
||||
var primitive = item as ReinforcementPrimitive;
|
||||
var inputData = InputDataFactory.GetInputData(primitive, strainMatrix, limitState, calcTerm, 1d);
|
||||
if (fullStrength == true)
|
||||
{
|
||||
inputData.ReinforcementStress = inputData.ReinforcementStrength * Math.Sign(inputData.ReinforcementStress);
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host's material is incorrect or null");
|
||||
var val = inputData.ReinforcementStress * UnitConstatnts.Stress;
|
||||
var valuePrimitive = GetValuePrimitive(primitive, val);
|
||||
primitives.Add(valuePrimitive);
|
||||
}
|
||||
}
|
||||
primitiveSet.ValuePrimitives = primitives;
|
||||
return primitiveSet;
|
||||
}
|
||||
|
||||
private static PrimitiveSet GetBaseDevelopmentLength(IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
PrimitiveSet primitiveSet = new PrimitiveSet() { Name = "Base Development Length"};
|
||||
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
||||
foreach (var item in ndmPrimitives)
|
||||
{
|
||||
if (item is ReinforcementPrimitive)
|
||||
{
|
||||
var primitive = item as ReinforcementPrimitive;
|
||||
var inputData = InputDataFactory.GetInputData(primitive, strainMatrix, limitState, calcTerm, 1d);
|
||||
var calculator = new AnchorageCalculator(inputData);
|
||||
var val = calculator.GetBaseDevLength() * UnitConstatnts.Length;
|
||||
var valuePrimitive = GetValuePrimitive(primitive, val);
|
||||
primitives.Add(valuePrimitive);
|
||||
}
|
||||
}
|
||||
primitiveSet.ValuePrimitives = primitives;
|
||||
return primitiveSet;
|
||||
}
|
||||
private static PrimitiveSet GetDevelopmentLength(IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<INdmPrimitive> ndmPrimitives, bool fullStrength)
|
||||
{
|
||||
PrimitiveSet primitiveSet = new PrimitiveSet();
|
||||
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
||||
foreach (var item in ndmPrimitives)
|
||||
{
|
||||
if (item is ReinforcementPrimitive)
|
||||
{
|
||||
var primitive = item as ReinforcementPrimitive;
|
||||
var inputData = InputDataFactory.GetInputData(primitive, strainMatrix, limitState, calcTerm, 1d);
|
||||
if (fullStrength == true)
|
||||
{
|
||||
inputData.ReinforcementStress = inputData.ReinforcementStrength * Math.Sign(inputData.ReinforcementStress);
|
||||
}
|
||||
var calculator = new AnchorageCalculator(inputData);
|
||||
var val = calculator.GetDevLength() * UnitConstatnts.Length;
|
||||
var valuePrimitive = GetValuePrimitive(primitive, val);
|
||||
primitives.Add(valuePrimitive);
|
||||
}
|
||||
}
|
||||
primitiveSet.ValuePrimitives = primitives;
|
||||
return primitiveSet;
|
||||
}
|
||||
|
||||
private static PrimitiveSet GetFullStrengthLapLength(IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<INdmPrimitive> ndmPrimitives, double lapperdCountRate, bool fullStrength)
|
||||
{
|
||||
PrimitiveSet primitiveSet = new PrimitiveSet();
|
||||
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
||||
foreach (var item in ndmPrimitives)
|
||||
{
|
||||
if (item is ReinforcementPrimitive)
|
||||
{
|
||||
var primitive = item as ReinforcementPrimitive;
|
||||
var inputData = InputDataFactory.GetInputData(primitive, strainMatrix, limitState, calcTerm, lapperdCountRate);
|
||||
if (fullStrength == true)
|
||||
{
|
||||
inputData.ReinforcementStress = inputData.ReinforcementStrength * Math.Sign(inputData.ReinforcementStress);
|
||||
}
|
||||
var calculator = new AnchorageCalculator(inputData);
|
||||
var val = calculator.GetLapLength() * UnitConstatnts.Length;
|
||||
var valuePrimitive = GetValuePrimitive(primitive, val);
|
||||
primitives.Add(valuePrimitive);
|
||||
}
|
||||
}
|
||||
primitiveSet.ValuePrimitives = primitives;
|
||||
return primitiveSet;
|
||||
}
|
||||
|
||||
private static FieldVisualizer.Entities.Values.Primitives.CirclePrimitive GetValuePrimitive(IPointPrimitive primitive, double val)
|
||||
{
|
||||
var valuePrimitive = new FieldVisualizer.Entities.Values.Primitives.CirclePrimitive()
|
||||
{
|
||||
CenterX = primitive.CenterX,
|
||||
CenterY = primitive.CenterY,
|
||||
Diameter = Math.Sqrt(primitive.Area / Math.PI) * 2,
|
||||
Value = val
|
||||
};
|
||||
return valuePrimitive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Windows\Errors\ErrorMessage.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\Forces\ForceCombinationByFactorView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -23,6 +26,9 @@
|
||||
<Page Update="Infrastructure\UI\Resources\ForceTemplates.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\Errors\ErrorMessage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\Forces\ForceCombinationByFactorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
|
||||
37
StructureHelper/Windows/Errors/ErrorMessage.xaml
Normal file
37
StructureHelper/Windows/Errors/ErrorMessage.xaml
Normal file
@@ -0,0 +1,37 @@
|
||||
<Window x:Class="StructureHelper.Windows.Errors.ErrorMessage"
|
||||
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.Errors"
|
||||
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Errors"
|
||||
d:DataContext="{d:DesignInstance vm:ErrorProcessor}"
|
||||
mc:Ignorable="d"
|
||||
Title="Error Message" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Width="500" Height="300">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<Image Source="IconBug128.png"/>-->
|
||||
<TabControl Grid.Column="1" x:Name="tabControl">
|
||||
<TabItem Header="Short information" Margin="0">
|
||||
<Grid Background="#FFE5E5E5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock x:Name="HeaderText" TextWrapping="Wrap" Text="Happened something wrong" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" FontWeight="Bold"/>
|
||||
<TextBlock Grid.Row="1" x:Name="MainText" TextWrapping="Wrap" Text="{Binding ShortText}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Detailed Information">
|
||||
<Grid Background="#FFE5E5E5">
|
||||
<ScrollViewer>
|
||||
<TextBlock x:Name="ExtendedText" TextWrapping="Wrap" Text="{Binding DetailText}"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
31
StructureHelper/Windows/Errors/ErrorMessage.xaml.cs
Normal file
31
StructureHelper/Windows/Errors/ErrorMessage.xaml.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
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.Errors
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для ErrorMessage.xaml
|
||||
/// </summary>
|
||||
public partial class ErrorMessage : Window
|
||||
{
|
||||
ErrorProcessor vm;
|
||||
public ErrorMessage(ErrorProcessor errorProcessor)
|
||||
{
|
||||
vm = errorProcessor;
|
||||
this.DataContext = vm;
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,16 +7,17 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels
|
||||
{
|
||||
public abstract class CRUDViewModelBase<TItem> : ViewModelBase, ICRUDViewModel<TItem> where TItem : class
|
||||
{
|
||||
|
||||
private RelayCommand addCommand;
|
||||
private RelayCommand deleteCommand;
|
||||
private RelayCommand copyCommand;
|
||||
private RelayCommand editCommand;
|
||||
private ICommand addCommand;
|
||||
private ICommand deleteCommand;
|
||||
private ICommand copyCommand;
|
||||
private ICommand editCommand;
|
||||
|
||||
public List<TItem> Collection { get; set; }
|
||||
|
||||
@@ -25,7 +26,7 @@ namespace StructureHelper.Windows.ViewModels
|
||||
|
||||
public ObservableCollection<TItem> Items { get; private set; }
|
||||
|
||||
public RelayCommand Add
|
||||
public ICommand Add
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -43,7 +44,7 @@ namespace StructureHelper.Windows.ViewModels
|
||||
Collection.Add(NewItem);
|
||||
Items.Add(NewItem);
|
||||
}
|
||||
public RelayCommand Delete
|
||||
public ICommand Delete
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -61,7 +62,7 @@ namespace StructureHelper.Windows.ViewModels
|
||||
Collection.Remove(SelectedItem);
|
||||
Items.Remove(SelectedItem);
|
||||
}
|
||||
public RelayCommand Edit
|
||||
public ICommand Edit
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -84,7 +85,7 @@ namespace StructureHelper.Windows.ViewModels
|
||||
OnPropertyChanged(nameof(Items));
|
||||
}
|
||||
|
||||
public RelayCommand Copy
|
||||
public ICommand Copy
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -7,8 +7,10 @@ using StructureHelper.Services.Reports.CalculationReports;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
|
||||
using StructureHelper.Windows.Errors;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Windows.PrimitivePropertiesWindow;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelper.Windows.ViewModels.Forces;
|
||||
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
@@ -74,7 +76,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
}
|
||||
}
|
||||
|
||||
public RelayCommand ExportToCSVCommand
|
||||
public ICommand ExportToCSVCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -105,7 +107,12 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.FileCantBeDeleted + ex + filename);
|
||||
var vm = new ErrorProcessor()
|
||||
{
|
||||
ShortText = ErrorStrings.FileCantBeDeleted + ex + filename,
|
||||
DetailText = $"{ex}"
|
||||
};
|
||||
new ErrorMessage(vm).ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,15 +122,21 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
logic.Export(forcesResults);
|
||||
try
|
||||
{
|
||||
Process filopener = new Process();
|
||||
filopener.StartInfo.FileName = saveFileDialog.FileName;
|
||||
var filopener = new Process();
|
||||
var startInfo = new ProcessStartInfo(saveFileDialog.FileName) { UseShellExecute = true};
|
||||
filopener.StartInfo = startInfo;
|
||||
filopener.Start();
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.FileCantBeSaved + ex + filename);
|
||||
var vm = new ErrorProcessor()
|
||||
{
|
||||
ShortText = ErrorStrings.FileCantBeSaved + ex + filename,
|
||||
DetailText = $"{ex}"
|
||||
};
|
||||
new ErrorMessage(vm).ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +222,24 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
|
||||
private void showAnchorage()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var limitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
|
||||
var primitiveSets = ShowAnchorageResult.GetPrimitiveSets(strainMatrix, limitState, calcTerm, ndmPrimitives);
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
isoFieldReport.Show();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
var vm = new ErrorProcessor()
|
||||
{ ShortText = "Errors apearred during showing isofield, see detailed information",
|
||||
DetailText = $"{ex}"};
|
||||
new ErrorMessage(vm).ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ForcesResultsViewModel(IForceCalculator forceCalculator)
|
||||
@@ -220,12 +250,25 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
}
|
||||
|
||||
private void ShowIsoField()
|
||||
{
|
||||
try
|
||||
{
|
||||
IStrainMatrix strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(strainMatrix, ndms, ResultFuncFactory.GetResultFuncs());
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
isoFieldReport.Show();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var vm = new ErrorProcessor()
|
||||
{
|
||||
ShortText = "Errors apearred during showing isofield, see detailed information",
|
||||
DetailText = $"{ex}"
|
||||
};
|
||||
new ErrorMessage(vm).ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void GetNdms()
|
||||
{
|
||||
|
||||
@@ -12,30 +12,30 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
public class SetPrestrainViewModel : ViewModelBase
|
||||
{
|
||||
IStrainTuple SourceTuple;
|
||||
private double coeffcient;
|
||||
private double coefficient;
|
||||
|
||||
public double Coefficient
|
||||
{
|
||||
get
|
||||
{
|
||||
return coeffcient;
|
||||
return coefficient;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref coeffcient, value);
|
||||
SetProperty(ref coefficient, value);
|
||||
}
|
||||
}
|
||||
|
||||
public SetPrestrainViewModel(IStrainTuple sourceTuple)
|
||||
{
|
||||
SourceTuple = sourceTuple;
|
||||
coeffcient = 1d;
|
||||
coefficient = 1d;
|
||||
}
|
||||
|
||||
public IStrainTuple GetStrainTuple()
|
||||
{
|
||||
var result = new StrainTuple();
|
||||
StrainTupleService.CopyProperties(SourceTuple, result, coeffcient);
|
||||
StrainTupleService.CopyProperties(SourceTuple, result, coefficient);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
14
StructureHelper/Windows/ViewModels/Errors/ErrorProcessor.cs
Normal file
14
StructureHelper/Windows/ViewModels/Errors/ErrorProcessor.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Errors
|
||||
{
|
||||
public class ErrorProcessor
|
||||
{
|
||||
public string? ShortText { get; set; }
|
||||
public string? DetailText { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels
|
||||
{
|
||||
@@ -13,10 +14,10 @@ namespace StructureHelper.Windows.ViewModels
|
||||
{
|
||||
TItem SelectedItem { get; set; }
|
||||
ObservableCollection<TItem> Items { get; }
|
||||
RelayCommand Add { get; }
|
||||
RelayCommand Delete { get; }
|
||||
RelayCommand Edit { get; }
|
||||
RelayCommand Copy { get; }
|
||||
ICommand Add { get; }
|
||||
ICommand Delete { get; }
|
||||
ICommand Edit { get; }
|
||||
ICommand Copy { get; }
|
||||
void AddItems(IEnumerable<TItem> items);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
|
||||
public ObservableCollection<IForceAction> Items { get; private set; }
|
||||
|
||||
private RelayCommand addForceCombinationCommand;
|
||||
public RelayCommand Add
|
||||
private ICommand addForceCombinationCommand;
|
||||
public ICommand Add
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -43,8 +43,8 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
Items.Add(item);
|
||||
repository.ForceActions.Add(item);
|
||||
}
|
||||
private RelayCommand deleteForceCombinationCommand;
|
||||
public RelayCommand Delete
|
||||
private ICommand deleteForceCombinationCommand;
|
||||
public ICommand Delete
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -65,10 +65,10 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
repository.ForceActions.Remove(SelectedItem);
|
||||
}
|
||||
}
|
||||
private RelayCommand editForceCombinationCommand;
|
||||
private RelayCommand copyCommand;
|
||||
private ICommand editForceCombinationCommand;
|
||||
private ICommand copyCommand;
|
||||
|
||||
public RelayCommand Edit
|
||||
public ICommand Edit
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -84,7 +84,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
}
|
||||
}
|
||||
|
||||
public RelayCommand Copy
|
||||
public ICommand Copy
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ using System.Windows.Forms;
|
||||
using System.Windows.Documents;
|
||||
using StructureHelper.Windows.PrimitiveProperiesWindow;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
{
|
||||
@@ -26,12 +27,12 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
{
|
||||
private ICrossSection section;
|
||||
private ICrossSectionRepository repository => section.SectionRepository;
|
||||
private RelayCommand addCommand;
|
||||
private RelayCommand deleteCommand;
|
||||
private RelayCommand editCommand;
|
||||
private RelayCommand copyCommand;
|
||||
private RelayCommand setToFront;
|
||||
private RelayCommand setToBack;
|
||||
private ICommand addCommand;
|
||||
private ICommand deleteCommand;
|
||||
private ICommand editCommand;
|
||||
private ICommand copyCommand;
|
||||
private ICommand setToFront;
|
||||
private ICommand setToBack;
|
||||
|
||||
public double CanvasWidth { get; set; }
|
||||
public double CanvasHeight { get; set; }
|
||||
@@ -40,7 +41,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
|
||||
public ObservableCollection<PrimitiveBase> Items { get; private set; }
|
||||
|
||||
public RelayCommand Add
|
||||
public ICommand Add
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -106,7 +107,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
OnPropertyChanged(nameof(PrimitivesCount));
|
||||
}
|
||||
|
||||
public RelayCommand Delete
|
||||
public ICommand Delete
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -148,7 +149,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
OnPropertyChanged(nameof(PrimitivesCount));
|
||||
}
|
||||
|
||||
public RelayCommand Edit
|
||||
public ICommand Edit
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -166,7 +167,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
wnd.ShowDialog();
|
||||
}
|
||||
|
||||
public RelayCommand Copy
|
||||
public ICommand Copy
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -197,7 +198,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
|
||||
public int PrimitivesCount => repository.Primitives.Count();
|
||||
|
||||
public RelayCommand SetToFront
|
||||
public ICommand SetToFront
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -226,7 +227,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
else return false;
|
||||
}
|
||||
|
||||
public RelayCommand SetToBack
|
||||
public ICommand SetToBack
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -19,6 +20,7 @@ using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Linq;
|
||||
@@ -314,7 +316,33 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
|
||||
foreach (var item in sectionRepository.Primitives)
|
||||
{
|
||||
if (item is RectanglePrimitive || item is CirclePrimitive)
|
||||
{HostPrimitives.Add(PrimitiveOperations.ConvertNdmPrimitiveToPrimitiveBase(item));}
|
||||
{
|
||||
CheckHost(primitive, item);
|
||||
HostPrimitives.Add(PrimitiveOperations.ConvertNdmPrimitiveToPrimitiveBase(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckHost(PrimitiveBase primitive, INdmPrimitive item)
|
||||
{
|
||||
var ndm = primitive.GetNdmPrimitive();
|
||||
if (ndm is ReinforcementPrimitive)
|
||||
{
|
||||
var host = item as IHasDivisionSize;
|
||||
var reinforcement = ndm as ReinforcementPrimitive;
|
||||
if (host.IsPointInside(new Point2D() { X = reinforcement.CenterX, Y = reinforcement.CenterY })
|
||||
&& reinforcement.HostPrimitive is null)
|
||||
{
|
||||
var dialogResult = MessageBox.Show($"Primitive {reinforcement.Name} is inside primitive {item.Name}",
|
||||
"Assign new host?",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Warning);
|
||||
if (dialogResult == DialogResult.Yes)
|
||||
{
|
||||
reinforcement.HostPrimitive = item;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using LCM = LoaderCalculator.Data.Materials;
|
||||
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using LoaderMaterials = LoaderCalculator.Data.Materials;
|
||||
using LoaderMaterialBuilders = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using LCMBML = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
|
||||
using LoaderMaterialLogic = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
@@ -22,13 +22,13 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public bool TensionForSLS { get; set; }
|
||||
|
||||
private IMaterialOptionLogic optionLogic;
|
||||
private LCMBML.ITrueStrengthLogic strengthLogic;
|
||||
private LoaderMaterialLogic.ITrueStrengthLogic strengthLogic;
|
||||
|
||||
public ConcreteLibMaterial()
|
||||
{
|
||||
SafetyFactors = new List<IMaterialSafetyFactor>();
|
||||
SafetyFactors.AddRange(PartialCoefficientFactory.GetDefaultConcreteSafetyFactors(ProgramSetting.CodeType));
|
||||
optionLogic = new MaterialOptionLogic(new LCMB.ConcreteOptions());
|
||||
optionLogic = new MaterialOptionLogic(new LoaderMaterialBuilders.ConcreteOptions());
|
||||
TensionForULS = false;
|
||||
TensionForSLS = true;
|
||||
}
|
||||
@@ -38,9 +38,9 @@ namespace StructureHelperLogics.Models.Materials
|
||||
return new ConcreteLibMaterial() { MaterialEntity = MaterialEntity, TensionForULS = TensionForULS, TensionForSLS = TensionForSLS };
|
||||
}
|
||||
|
||||
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
public LoaderMaterials.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm) as LCMB.ConcreteOptions;
|
||||
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm) as LoaderMaterialBuilders.ConcreteOptions;
|
||||
materialOptions.WorkInTension = false;
|
||||
if (limitState == LimitStates.ULS & TensionForULS == true)
|
||||
{
|
||||
@@ -53,8 +53,8 @@ namespace StructureHelperLogics.Models.Materials
|
||||
var strength = GetStrengthFactors(limitState, calcTerm);
|
||||
materialOptions.ExternalFactor.Compressive = strength.Compressive;
|
||||
materialOptions.ExternalFactor.Tensile = strength.Tensile;
|
||||
LCMB.IMaterialBuilder builder = new LCMB.ConcreteBuilder(materialOptions);
|
||||
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
|
||||
LoaderMaterialBuilders.IMaterialBuilder builder = new LoaderMaterialBuilders.ConcreteBuilder(materialOptions);
|
||||
LoaderMaterialBuilders.IBuilderDirector director = new LoaderMaterialBuilders.BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
}
|
||||
|
||||
@@ -72,9 +72,19 @@ namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
strengthLogic = new LCMBML.TrueStrengthConcreteLogicSP63_2018(MaterialEntity.MainStrength);
|
||||
strengthLogic = new LoaderMaterialLogic.TrueStrengthConcreteLogicSP63_2018(MaterialEntity.MainStrength);
|
||||
var strength = strengthLogic.GetTrueStrength();
|
||||
return (strength.Comressive, strength.Tensile);
|
||||
double compressionFactor = 1d;
|
||||
double tensionFactor = 1d;
|
||||
if (limitState == LimitStates.ULS)
|
||||
{
|
||||
compressionFactor /= 1.3d;
|
||||
tensionFactor /= 1.5d;
|
||||
var factors = GetStrengthFactors(limitState, calcTerm);
|
||||
compressionFactor *= factors.Compressive;
|
||||
tensionFactor *= factors.Tensile;
|
||||
}
|
||||
return (strength.Comressive * compressionFactor, strength.Tensile * tensionFactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
Concrete40,
|
||||
Reinforecement400,
|
||||
Reinforecement500,
|
||||
Elastic200
|
||||
}
|
||||
|
||||
@@ -30,10 +31,21 @@ namespace StructureHelperLogics.Models.Materials
|
||||
codeType = code;
|
||||
if (type == HeadmaterialType.Concrete40) { return GetConcrete40(); }
|
||||
if (type == HeadmaterialType.Reinforecement400) { return GetReinforcement400(); }
|
||||
if (type == HeadmaterialType.Reinforecement500) { return GetReinforcement500(); }
|
||||
if (type == HeadmaterialType.Elastic200) { return GetElastic200(); }
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + nameof(type));
|
||||
}
|
||||
|
||||
private static IHeadMaterial GetReinforcement500()
|
||||
{
|
||||
var material = new HeadMaterial() { Name = "New reinforcement" };
|
||||
var libMaterial = LibReinforcementMaterials.Where(x => x.Name.Contains("500")).First();
|
||||
var libMat = new ReinforcementLibMaterial();
|
||||
libMat.MaterialEntity = libMaterial;
|
||||
material.HelperMaterial = libMat;
|
||||
return material;
|
||||
}
|
||||
|
||||
private static IHeadMaterial GetElastic200()
|
||||
{
|
||||
var material = new HeadMaterial();
|
||||
|
||||
@@ -5,9 +5,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using LCM = LoaderCalculator.Data.Materials;
|
||||
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using LCMBML = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
|
||||
using Loadermaterials = LoaderCalculator.Data.Materials;
|
||||
using LoaderMaterialBuilders = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using LoaderMaterialLogics = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
@@ -17,12 +17,12 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
|
||||
private IMaterialOptionLogic optionLogic;
|
||||
private LCMBML.ITrueStrengthLogic strengthLogic;
|
||||
private LoaderMaterialLogics.ITrueStrengthLogic strengthLogic;
|
||||
|
||||
public ReinforcementLibMaterial()
|
||||
{
|
||||
SafetyFactors = new List<IMaterialSafetyFactor>();
|
||||
optionLogic = new MaterialOptionLogic(new LCMB.ReinforcementOptions());
|
||||
optionLogic = new MaterialOptionLogic(new LoaderMaterialBuilders.ReinforcementOptions());
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
@@ -30,14 +30,14 @@ namespace StructureHelperLogics.Models.Materials
|
||||
return new ReinforcementLibMaterial() { MaterialEntity = MaterialEntity};
|
||||
}
|
||||
|
||||
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
public Loadermaterials.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm);
|
||||
var strength = GetStrengthFactors(limitState, calcTerm);
|
||||
materialOptions.ExternalFactor.Compressive = strength.Compressive;
|
||||
materialOptions.ExternalFactor.Tensile = strength.Tensile;
|
||||
LCMB.IMaterialBuilder builder = new LCMB.ReinforcementBuilder(materialOptions);
|
||||
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
|
||||
LoaderMaterialBuilders.IMaterialBuilder builder = new LoaderMaterialBuilders.ReinforcementBuilder(materialOptions);
|
||||
LoaderMaterialBuilders.IBuilderDirector director = new LoaderMaterialBuilders.BuilderDirector(builder);
|
||||
return director.BuildMaterial();
|
||||
}
|
||||
|
||||
@@ -55,9 +55,32 @@ namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
strengthLogic = new LCMBML.TrueStrengthReinforcementLogic(MaterialEntity.MainStrength);
|
||||
strengthLogic = new LoaderMaterialLogics.TrueStrengthReinforcementLogic(MaterialEntity.MainStrength);
|
||||
var strength = strengthLogic.GetTrueStrength();
|
||||
return (strength.Comressive, strength.Tensile);
|
||||
double compressionFactor = 1d;
|
||||
double tensionFactor = 1d;
|
||||
if (limitState == LimitStates.ULS)
|
||||
{
|
||||
compressionFactor /= 1.15d;
|
||||
tensionFactor /= 1.15d;
|
||||
}
|
||||
var factors = GetStrengthFactors(limitState, calcTerm);
|
||||
compressionFactor *= factors.Compressive;
|
||||
tensionFactor *= factors.Tensile;
|
||||
var compressiveStrength = strength.Comressive * compressionFactor;
|
||||
if (limitState == LimitStates.ULS)
|
||||
{
|
||||
if (calcTerm == CalcTerms.ShortTerm)
|
||||
{
|
||||
compressiveStrength = Math.Min(4e8, compressiveStrength);
|
||||
}
|
||||
else
|
||||
{
|
||||
compressiveStrength = Math.Min(5e8, compressiveStrength);
|
||||
}
|
||||
}
|
||||
var tensileStrength = strength.Tensile * tensionFactor;
|
||||
return (compressiveStrength, tensileStrength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
|
||||
public double GetBaseDevLength()
|
||||
{
|
||||
return anchorage.GetBaseDevLength();
|
||||
var val = anchorage.GetBaseDevLength();
|
||||
return val;
|
||||
}
|
||||
|
||||
public double GetDevLength()
|
||||
@@ -40,6 +41,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
var anchorageOptions = new AnchorageOptionsSP63();
|
||||
anchorageOptions.ConcreteStrength = inputData.ConcreteStrength;
|
||||
anchorageOptions.ReinforcementStrength = inputData.ReinforcementStrength;
|
||||
anchorageOptions.FactorEta1 = inputData.FactorEta1;
|
||||
anchorageOptions.ReinforcementStress = inputData.ReinforcementStress;
|
||||
anchorageOptions.CrossSectionArea = inputData.CrossSectionArea;
|
||||
anchorageOptions.CrossSectionPerimeter = inputData.CrossSectionPerimeter;
|
||||
|
||||
@@ -14,5 +14,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
public double CrossSectionPerimeter { get; set; }
|
||||
public double ReinforcementStress { get; set; }
|
||||
public double LappedCountRate { get; set; }
|
||||
public double FactorEta1 { get; set; }
|
||||
public bool IsPrestressed { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,12 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
{
|
||||
double ConcreteStrength { get; set; }
|
||||
double ReinforcementStrength { get; set; }
|
||||
double FactorEta1 { get; set; }
|
||||
double CrossSectionArea { get; set; }
|
||||
double CrossSectionPerimeter { get; set; }
|
||||
double ReinforcementStress { get; set; }
|
||||
double LappedCountRate { get; set; }
|
||||
bool IsPrestressed { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
{
|
||||
public static class InputDataFactory
|
||||
{
|
||||
private static IStressLogic stressLogic => new StressLogic();
|
||||
public static IAnchorageInputData GetInputData(ReinforcementPrimitive ndmPrimitive, IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, double lappedCountRate)
|
||||
{
|
||||
var inputData = new AnchorageInputData();
|
||||
inputData.ConcreteStrength = GetConcreteStrength(limitState, calcTerm, ndmPrimitive);
|
||||
inputData.ReinforcementStrength = GetReinforcementStrength(limitState, calcTerm, ndmPrimitive);
|
||||
inputData.FactorEta1 = 2.5d;
|
||||
inputData.CrossSectionArea = ndmPrimitive.Area;
|
||||
var diameter = Math.Sqrt(ndmPrimitive.Area / Math.PI) * 2d;
|
||||
inputData.CrossSectionPerimeter = Math.PI * diameter;
|
||||
if (ndmPrimitive.HeadMaterial is null)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": main material is incorrect or null");
|
||||
}
|
||||
var material = ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
var ndm = ndmPrimitive.GetNdms(material).Single();
|
||||
if (strainMatrix is not null)
|
||||
{
|
||||
inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm);
|
||||
}
|
||||
else
|
||||
{
|
||||
inputData.ReinforcementStress = inputData.ReinforcementStrength;
|
||||
}
|
||||
inputData.IsPrestressed = ndm.Prestrain > 0.0005d ? true : false;
|
||||
inputData.LappedCountRate = lappedCountRate;
|
||||
return inputData;
|
||||
}
|
||||
|
||||
private static double GetConcreteStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
|
||||
{
|
||||
if (primitive.HostPrimitive is not null)
|
||||
{
|
||||
var host = primitive.HostPrimitive;
|
||||
var hostMaterial = host.HeadMaterial.HelperMaterial;
|
||||
if (hostMaterial is IConcreteLibMaterial)
|
||||
{
|
||||
var concreteMaterial = hostMaterial as IConcreteLibMaterial;
|
||||
var concreteStrength = concreteMaterial.GetStrength(limitState, calcTerm).Tensile;
|
||||
return concreteStrength;
|
||||
}
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host material is incorrect or null");
|
||||
}
|
||||
|
||||
private static double GetReinforcementStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
|
||||
{
|
||||
if (primitive.HeadMaterial.HelperMaterial is IReinforcementLibMaterial)
|
||||
{
|
||||
var material = primitive.HeadMaterial.HelperMaterial as IReinforcementLibMaterial;
|
||||
var strength = material.GetStrength(limitState, calcTerm).Tensile;
|
||||
return strength;
|
||||
}
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host's material is incorrect or null");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.RC;
|
||||
|
||||
namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.AnchorageCalculatorTest
|
||||
{
|
||||
public class AnchorageCalculatorTest
|
||||
{
|
||||
[TestCase(0.012d, 0d, 0.416d)]
|
||||
[TestCase(0.025d, 0d, 0.867d)]
|
||||
[TestCase(0.032d, 0d, 1.110d)]
|
||||
[TestCase(0.036d, 0d, 1.388d)]
|
||||
public void Run_ShouldPass(double diameter, double stress, double expectedBaseDevLength)
|
||||
{
|
||||
//Arrange
|
||||
var inputData = new AnchorageInputData();
|
||||
inputData.ConcreteStrength = 1e6; //Pa
|
||||
inputData.ReinforcementStrength = 347e6; //Pa
|
||||
inputData.FactorEta1 = 2.5d;
|
||||
inputData.CrossSectionArea = Math.PI * diameter * diameter / 4d;
|
||||
inputData.CrossSectionPerimeter = Math.PI * diameter;
|
||||
inputData.ReinforcementStress = stress;
|
||||
var calculator = new AnchorageCalculator(inputData);
|
||||
//Act
|
||||
var baseLength = calculator.GetBaseDevLength();
|
||||
//Assert
|
||||
Assert.AreEqual(expectedBaseDevLength, baseLength, 0.001d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using LoaderCalculator.Tests.Infrastructures.Logics;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
||||
using StructureHelperLogics.Models.Templates.RCs;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorTests
|
||||
{
|
||||
@@ -55,5 +57,37 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
Assert.True(calcResult == result.IsValid);
|
||||
Assert.True(firstForceResult == result.ForcesResultList[0].IsValid);
|
||||
}
|
||||
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, 0d, 0d, 0d)]
|
||||
public void Run_ShouldPassPrestrain(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, double expectedKx, double expectedKy, double expectedEpsZ)
|
||||
{
|
||||
//Arrange
|
||||
var template = new RectangleBeamTemplate(width, height) { TopDiameter = topDiametr, BottomDiameter = bottomDiametr, WidthCount = widthCount, HeightCount = heightCount };
|
||||
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
|
||||
var calculator = newSection.SectionRepository.CalculatorsList[0] as IForceCalculator;
|
||||
calculator.CompressedMember.Buckling = false;
|
||||
calculator.Run();
|
||||
var ndmPrimitives = newSection.SectionRepository.Primitives;
|
||||
var result = calculator.Result as IForcesResults;
|
||||
var strainMatrix = result.ForcesResultList[0].LoaderResults.StrainMatrix;
|
||||
var source = StrainTupleService.ConvertToStrainTuple(strainMatrix);
|
||||
//Act
|
||||
foreach (var item in ndmPrimitives)
|
||||
{
|
||||
StrainTupleService.CopyProperties(source, item.AutoPrestrain);
|
||||
}
|
||||
calculator.Run();
|
||||
var result2 = calculator.Result as IForcesResults;
|
||||
//Assert
|
||||
Assert.IsNotNull(result2);
|
||||
Assert.IsTrue(result2.IsValid);
|
||||
var strainMatrix2 = result2.ForcesResultList[0].LoaderResults.StrainMatrix;
|
||||
var kx = strainMatrix2.Kx;
|
||||
var ky = strainMatrix2.Ky;
|
||||
var epsz = strainMatrix2.EpsZ;
|
||||
Assert.AreEqual(expectedKx, kx, 1e-10);
|
||||
Assert.AreEqual(expectedKy, ky, 1e-10);
|
||||
Assert.AreEqual(expectedEpsZ, epsz, 1e-10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,8 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="FunctionalTests\RCs\Anchorage\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
namespace StructureHelperTests.UnitTests.MaterialTests
|
||||
{
|
||||
public class MaterialStrengthTest
|
||||
{
|
||||
[TestCase(HeadmaterialType.Reinforecement400, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.ShortTerm, 347826086.95652175d, 347826086.95652175d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement400, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 400000000d, 400000000d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.ShortTerm, 400000000.0d, 434782608.69565225d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.LongTerm, 434782608.69565225d, 434782608.69565225d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 5e8d, 5e8d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 5e8d, 5e8d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.ShortTerm, 22461538.46153846d, 1395297.0017909051d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.LongTerm, 20215384.615384616d, 1255767.3016118146d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 29200000.0d, 2092945.5026863578d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.LongTerm, 29200000.0d, 2092945.5026863578d)]
|
||||
public void Run_ShouldPass(HeadmaterialType headmaterialType, CodeTypes code, LimitStates limitState, CalcTerms calcTerm, double expectedCompressive, double expectedTensile)
|
||||
{
|
||||
//Arrange
|
||||
var material = HeadMaterialFactory.GetHeadMaterial(headmaterialType, code);
|
||||
var libMaterial = material.HelperMaterial as ILibMaterial;
|
||||
//Act
|
||||
var compressive = libMaterial.GetStrength(limitState, calcTerm).Compressive;
|
||||
var tensile = libMaterial.GetStrength(limitState, calcTerm).Tensile;
|
||||
//Assert
|
||||
Assert.AreEqual(expectedCompressive, compressive, 1d);
|
||||
Assert.AreEqual(expectedTensile, tensile, 1d);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user