Binding function by states and terms done
This commit is contained in:
@@ -111,7 +111,17 @@ namespace StructureHelperLogics.Models.Materials
|
||||
var functionSelectionView = new FunctionSelectionView();
|
||||
functionSelectionView.ShowDialog();
|
||||
var material = new HeadMaterial();
|
||||
material.HelperMaterial = new FunctionMaterial() { Modulus = 2e11d, CompressiveStrength = 4e8d, TensileStrength = 4e8d };
|
||||
material.HelperMaterial = new FunctionMaterial()
|
||||
{
|
||||
Modulus = 2e11d,
|
||||
CompressiveStrength = 4e8d,
|
||||
TensileStrength = 4e8d,
|
||||
FunctionStorage = functionSelectionView.ViewModel.FunctionStorage,
|
||||
};
|
||||
if (functionSelectionView.DialogResult == true)
|
||||
{
|
||||
material.SuccessfullyCreated = true;
|
||||
}
|
||||
return material;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Functions;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials.Logics;
|
||||
using System;
|
||||
@@ -20,6 +21,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public double TensileStrength { get; set; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; } = new();
|
||||
public IOneVariableFunction Function { get; set; }
|
||||
public FunctionStorage FunctionStorage { get; set; }
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
@@ -29,7 +31,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
}
|
||||
public FunctionMaterial() : this(Guid.NewGuid())
|
||||
{
|
||||
Function = ProgramSetting.Functions.First();
|
||||
}
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace StructureHelper.Models.Materials
|
||||
}
|
||||
}
|
||||
public IHelperMaterial HelperMaterial {get; set;}
|
||||
|
||||
public bool SuccessfullyCreated { get; set; } = false;
|
||||
|
||||
public HeadMaterial(Guid id)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Functions;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -14,6 +15,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
double CompressiveStrength { get; set; }
|
||||
double TensileStrength { get; set; }
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public FunctionStorage FunctionStorage { get; set; }
|
||||
public IOneVariableFunction Function { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials.Logics
|
||||
{
|
||||
@@ -17,16 +12,37 @@ namespace StructureHelperLogics.Models.Materials.Logics
|
||||
{
|
||||
IMaterial material = new Material();
|
||||
material.InitModulus = functionMaterial.Modulus;
|
||||
IFactorLogic factorLogic = new FactorLogic(functionMaterial.SafetyFactors);
|
||||
var factors = factorLogic.GetTotalFactor(limitState, calcTerm);
|
||||
this.functionMaterial = functionMaterial;
|
||||
parameters = new List<double>()
|
||||
if (calcTerm == CalcTerms.ShortTerm)
|
||||
{
|
||||
functionMaterial.Modulus,
|
||||
functionMaterial.CompressiveStrength * factors.Compressive * factor,
|
||||
functionMaterial.TensileStrength * factors.Tensile * factor
|
||||
};
|
||||
material.DiagramParameters = parameters;
|
||||
if (limitState == LimitStates.ULS)
|
||||
{
|
||||
functionMaterial.Function = functionMaterial.FunctionStorage.Func_ST_ULS;
|
||||
}
|
||||
else if (limitState == LimitStates.SLS)
|
||||
{
|
||||
functionMaterial.Function = functionMaterial.FunctionStorage.Func_ST_SLS;
|
||||
}
|
||||
else if (limitState == LimitStates.Special)
|
||||
{
|
||||
functionMaterial.Function = functionMaterial.FunctionStorage.Func_ST_Special;
|
||||
}
|
||||
}
|
||||
else if (calcTerm == CalcTerms.LongTerm)
|
||||
{
|
||||
if (limitState == LimitStates.ULS)
|
||||
{
|
||||
functionMaterial.Function = functionMaterial.FunctionStorage.Func_LT_ULS;
|
||||
}
|
||||
else if (limitState == LimitStates.SLS)
|
||||
{
|
||||
functionMaterial.Function = functionMaterial.FunctionStorage.Func_LT_SLS;
|
||||
}
|
||||
else if (limitState == LimitStates.Special)
|
||||
{
|
||||
functionMaterial.Function = functionMaterial.FunctionStorage.Func_LT_Special;
|
||||
}
|
||||
}
|
||||
this.functionMaterial = functionMaterial;
|
||||
material.Diagram = GetStressByStrain;
|
||||
return material;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user