UnitSystem inplementation started, Calculation started

This commit is contained in:
NickAppLab
2022-08-26 01:49:22 +05:00
parent e73702d133
commit 51748407e8
29 changed files with 252 additions and 290 deletions

View File

@@ -1,4 +1,5 @@
using StructureHelper.Infrastructure.Enums;
using StructureHelper.UnitSystem.Systems;
using StructureHelper.Windows.MainWindow;
using StructureHelperCommon.Models.Entities;
using StructureHelperCommon.Models.Materials;
@@ -17,18 +18,17 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
ShowedY = 0;
}
public override INdmPrimitive GetNdmPrimitive()
public override INdmPrimitive GetNdmPrimitive(IUnitSystem unitSystem)
{
double strength = 0;
double centerX = 0;
double centerY = 0;
string materialName = "C20";
ICenter center = new Center() { X = centerX, Y = centerY };
double height = 0;
double width = 0;
IShape shape = new StructureHelperCommon.Models.Shapes.Rectangle() { Height = height, Width = width, Angle = 0 };
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial() { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = strength }; ;
INdmPrimitive ndmPrimitive = new NdmPrimitive() { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial };
var width = unitSystem.ConvertLength(PrimitiveWidth);
var height = unitSystem.ConvertLength(PrimitiveHeight);
double centerX = unitSystem.ConvertLength(ShowedX) + width / 2;
double centerY = unitSystem.ConvertLength(ShowedY) + height / 2;
string materialName = MaterialName;
ICenter center = new Center { X = centerX, Y = centerY };
IShape shape = new StructureHelperCommon.Models.Shapes.Rectangle { Height = height, Width = width, Angle = 0 };
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = Material.DesingTensileStrength };
INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial };
return ndmPrimitive;
}
}