Change ObsCollection to List in Common, write FunctionMaterialCreationVM, remove old UI, binding enums and functions to new UI.
This commit is contained in:
@@ -116,7 +116,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
Modulus = functionMaterialCreationView.ViewModel.Modulus,
|
||||
CompressiveStrength = 4e8d,
|
||||
TensileStrength = 4e8d,
|
||||
//FunctionStorage = functionMaterialCreationView.ViewModel.FunctionStorage,
|
||||
MaterialSettings = functionMaterialCreationView.ViewModel.MaterialSettingsList.ToList(),
|
||||
};
|
||||
if (functionMaterialCreationView.DialogResult == true)
|
||||
|
||||
@@ -22,7 +22,6 @@ 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 List<MaterialSettings> MaterialSettings { get; set; }
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Functions;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -15,7 +16,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
double CompressiveStrength { get; set; }
|
||||
double TensileStrength { get; set; }
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public FunctionStorage FunctionStorage { get; set; }
|
||||
public List<MaterialSettings> MaterialSettings { get; set; }
|
||||
public IOneVariableFunction Function { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -12,36 +12,14 @@ namespace StructureHelperLogics.Models.Materials.Logics
|
||||
{
|
||||
IMaterial material = new Material();
|
||||
material.InitModulus = functionMaterial.Modulus;
|
||||
if (calcTerm == CalcTerms.ShortTerm)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
functionMaterial.Function = functionMaterial.MaterialSettings
|
||||
.Where(
|
||||
x => x.LimitState.Equals(limitState)
|
||||
&&
|
||||
x.CalcTerm.Equals(calcTerm)
|
||||
)
|
||||
.Select(x => x.Function)
|
||||
.First();
|
||||
this.functionMaterial = functionMaterial;
|
||||
material.Diagram = GetStressByStrain;
|
||||
return material;
|
||||
|
||||
Reference in New Issue
Block a user