View of tuple crack result was changed
This commit is contained in:
Binary file not shown.
@@ -34,6 +34,20 @@ namespace StructureHelper.Services.ResultViewers
|
||||
UnitName = unitLength.Name
|
||||
},
|
||||
new()
|
||||
{
|
||||
Name = "Long softening factor",
|
||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.SofteningFactor,
|
||||
UnitFactor = unitLength.Multiplyer,
|
||||
UnitName = unitLength.Name
|
||||
},
|
||||
new()
|
||||
{
|
||||
Name = "Short softening factor",
|
||||
ResultFunction = (RebarCrackResult rebar) => rebar.ShortTermResult.SofteningFactor,
|
||||
UnitFactor = unitLength.Multiplyer,
|
||||
UnitName = unitLength.Name
|
||||
},
|
||||
new()
|
||||
{
|
||||
Name = "Long rebar stress",
|
||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.RebarStressResult.RebarStress,
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace StructureHelper.Services.ResultViewers
|
||||
{
|
||||
List<ForceResultFunc> resultFuncs = new ();
|
||||
resultFuncs.Add(new ForceResultFunc() { Name = "Section Strain", ResultFunction = stressLogic.GetSectionStrain });
|
||||
resultFuncs.Add(new ForceResultFunc() { Name = "Total Strain", ResultFunction = stressLogic.GetTotalStrainWithPrestrain });
|
||||
resultFuncs.Add(new ForceResultFunc() { Name = "Total Strain", ResultFunction = stressLogic.GetTotalStrain });
|
||||
resultFuncs.Add(new ForceResultFunc() { Name = "Prestrain", ResultFunction = stressLogic.GetPrestrain });
|
||||
resultFuncs.Add(new ForceResultFunc() { Name = "Elastic Strain", ResultFunction = stressLogic.GetElasticStrain });
|
||||
resultFuncs.Add(new ForceResultFunc() { Name = "Plastic Strain", ResultFunction = stressLogic.GetPlasticStrain });
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
|
||||
d:DataContext="{d:DesignInstance local:TupleCrackResultViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="TupleCrackResultView" Height="450" Width="800" MinHeight="300" MinWidth="500" MaxHeight="1000" MaxWidth="1200" WindowStartupLocation="CenterScreen">
|
||||
Title="{Binding WindowName}" Height="450" Width="1000" MinHeight="300" MinWidth="500" MaxHeight="1000" MaxWidth="1200" WindowStartupLocation="CenterScreen">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -51,6 +51,20 @@
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Softening factor" Width="120">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="{Binding LongTermResult.SofteningFactor, Converter={StaticResource PlainDouble}}" />
|
||||
<TextBlock Grid.Row="1" Text="{Binding ShortTermResult.SofteningFactor, Converter={StaticResource PlainDouble}}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Rebar stress" Width="120">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
public TupleCrackResult CrackResult => crackResult;
|
||||
public List<RebarCrackResult> RebarResults => crackResult.RebarResults;
|
||||
public RebarCrackResult SelectedResult { get; set; }
|
||||
public string WindowName => "Result of calculation of cracks for action " + crackResult.InputData.TupleName;
|
||||
public ICommand ShowIsoFieldCommand
|
||||
{
|
||||
get
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
private void AddCrackCalculator()
|
||||
{
|
||||
var inputData = new CrackInputData();
|
||||
var calculator = new CrackCalculator(inputData)
|
||||
var calculator = new CrackCalculator(inputData, new CheckCrackCalculatorInputDataLogic(inputData))
|
||||
{
|
||||
Name = "New crack calculator",
|
||||
TraceLogger = new ShiftTraceLogger(),
|
||||
|
||||
@@ -16,7 +16,9 @@ namespace StructureHelperLogics.Models.Templates.CrossSections
|
||||
TraceLogger = new ShiftTraceLogger()
|
||||
};
|
||||
calculators.Add(forceCalculator);
|
||||
var crackCalculator = new CrackCalculator(new CrackInputData())
|
||||
CrackInputData newInputData = new CrackInputData();
|
||||
var checkLogic = new CheckCrackCalculatorInputDataLogic(newInputData);
|
||||
var crackCalculator = new CrackCalculator(newInputData, checkLogic)
|
||||
{
|
||||
Name = "New Crack Calculator",
|
||||
TraceLogger = new ShiftTraceLogger()
|
||||
|
||||
@@ -30,14 +30,17 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public IResult Result => result;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public CrackCalculator(CrackInputData inputData)
|
||||
public CrackCalculator(CrackInputData inputData, ICheckInputDataLogic checkInputDataLogic)
|
||||
{
|
||||
InputData = inputData;
|
||||
this.checkInputDataLogic = checkInputDataLogic;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var newItem = new CrackCalculator(new CrackInputData());
|
||||
CrackInputData crackInputData = new CrackInputData();
|
||||
var checkDataLogic = new CheckCrackCalculatorInputDataLogic(InputData);
|
||||
var newItem = new CrackCalculator(crackInputData, checkDataLogic);
|
||||
updateStrategy.Update(newItem, this);
|
||||
return newItem;
|
||||
}
|
||||
@@ -62,10 +65,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
private void CheckInputData()
|
||||
{
|
||||
checkInputDataLogic = new CheckCrackCalculatorInputDataLogic(InputData)
|
||||
{
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
checkInputDataLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
if (checkInputDataLogic.Check() == false)
|
||||
{
|
||||
result.IsValid = false;
|
||||
|
||||
@@ -49,26 +49,26 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
inputData = InputData as CrackWidthLogicInputDataSP63;
|
||||
if (inputData.Length <=0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks Ls={inputData.Length} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks Lcrc={inputData.Length} must be greater than zero";
|
||||
}
|
||||
if (inputData.TermFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor fi1 {inputData.TermFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor fi1 {inputData.TermFactor} must be greater than zero";
|
||||
|
||||
}
|
||||
if (inputData.BondFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor fi2 {inputData.BondFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor fi2 {inputData.BondFactor} must be greater than zero";
|
||||
|
||||
}
|
||||
if (inputData.StressStateFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Stress factor fi3 factor {inputData.StressStateFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Stress factor fi3 factor {inputData.StressStateFactor} must be greater than zero";
|
||||
|
||||
}
|
||||
if (inputData.PsiSFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greater than zero";
|
||||
}
|
||||
if (errorString != string.Empty)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
CrackWidth = acrc1,
|
||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateLongCrackWidth,
|
||||
RebarStressResult = rebarStressResult
|
||||
RebarStressResult = rebarStressResult,
|
||||
SofteningFactor = crackSofteningLogic.GetSofteningFactor()
|
||||
};
|
||||
TraceLogger?.AddMessage($"Long crack width acrc = acrc,1 = {acrc1}(m)");
|
||||
TraceLogger?.AddMessage($"Ultimate long crack width acrc,ult = {longRebarResult.UltimateCrackWidth}(m)");
|
||||
@@ -69,7 +70,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
CrackWidth = acrcShort,
|
||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateShortCrackWidth,
|
||||
RebarStressResult = rebarStressResult
|
||||
RebarStressResult = rebarStressResult,
|
||||
SofteningFactor = crackSofteningLogic.GetSofteningFactor()
|
||||
};
|
||||
TraceCrackResult(shortRebarResult);
|
||||
result.LongTermResult = longRebarResult;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
TraceLogger?.AddMessage($"Concrete area Ac = {concreteArea}");
|
||||
var concreteTensileArea = concreteCollection
|
||||
.Where(x => stressLogic.GetTotalStrainWithPrestrain(StrainMatrix, x) > 0d)
|
||||
.Where(x => stressLogic.GetTotalStrain(StrainMatrix, x) > 0d)
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
TraceLogger?.AddMessage($"Concrete tensile area Ac,t = {concreteTensileArea}");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using StructureHelperLogics.NdmCalculations.Cracking;
|
||||
|
||||
namespace StructureHelperTests.UnitTests.Ndms.Cracks
|
||||
{
|
||||
public class CrackWidthLogicTest
|
||||
public class CrackWidthLogicSP63Test
|
||||
{
|
||||
[TestCase(1.4d, 0.001d, 0d, 0.3d, 0.00020999999999999998d)]
|
||||
[TestCase(1.4d, 0.001d, 0.001d, 0.3d, 0d)]
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||
|
||||
namespace StructureHelperTests.UnitTests.Ndms.Cracks
|
||||
{
|
||||
public class EquivalentDiameterLogicTest
|
||||
{
|
||||
[TestCase(0.025d, 2, 0.025d, 2, 0.025d)]
|
||||
[TestCase(0.032d, 2, 0.025d, 1, 0.029842055910607741d)]
|
||||
[TestCase(0.032d, 1, 0.025d, 2, 0.027524820186583671d)]
|
||||
public void Run_ShouldPass(double fstDiameter, int fstCount, double sndDiameter, int sndCount, double expectedDiameter)
|
||||
{
|
||||
//Arrange
|
||||
List<RebarNdm> rebar = new();
|
||||
for (int i = 0; i < fstCount; i++)
|
||||
{
|
||||
rebar.Add(new RebarNdm() { Area = 0.785d * fstDiameter * fstDiameter });
|
||||
}
|
||||
for (int i = 0; i < sndCount; i++)
|
||||
{
|
||||
rebar.Add(new RebarNdm() { Area = 0.785d * sndDiameter * sndDiameter });
|
||||
}
|
||||
var logic = new EquivalentDiameterLogic() { Rebars = rebar };
|
||||
//Act
|
||||
var eqDiametr = logic.GetAverageDiameter();
|
||||
//Assert
|
||||
Assert.AreEqual(expectedDiameter, eqDiametr, 0.0001d);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user