UnitSystem inplementation started, Calculation started
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user