diff --git a/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs b/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs index a4a5efe..78bb55d 100644 --- a/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs +++ b/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs @@ -198,7 +198,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels double sizeX = PrimitiveOperations.GetSizeX(PrimitiveSet.ValuePrimitives); double sizeY = PrimitiveOperations.GetSizeY(PrimitiveSet.ValuePrimitives); dX = PrimitiveOperations.GetMinMaxX(PrimitiveSet.ValuePrimitives)[0]; - dY = PrimitiveOperations.GetMinMaxY(PrimitiveSet.ValuePrimitives)[0]; + dY = PrimitiveOperations.GetMinMaxY(PrimitiveSet.ValuePrimitives)[1]; WorkPlaneCanvas.Width = Math.Abs(sizeX); WorkPlaneCanvas.Height = Math.Abs(sizeY); WorkPlaneBox.Width = ScrolWidth - 50; @@ -260,7 +260,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels shape.Tag = valuePrimitive; shape.Fill = brush; Canvas.SetLeft(shape, valuePrimitive.CenterX - addX - dX); - Canvas.SetTop(shape, -valuePrimitive.CenterY - addY - dY); + Canvas.SetTop(shape, -valuePrimitive.CenterY - addY + dY); } private void Zoom(double coefficient) { diff --git a/Infrastructure/Strings/ErrorStrings.cs b/Infrastructure/Strings/ErrorStrings.cs deleted file mode 100644 index b864870..0000000 --- a/Infrastructure/Strings/ErrorStrings.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StructureHelper.Infrastructure.Strings -{ - internal static class ErrorStrings - { - public static string ObjectTypeIsUnknown => "#0001: Object type is unknown"; - public static string MaterialTypeIsUnknown => "#0002: Material type is unknown"; - } -} diff --git a/Infrastructure/UI/DataContexts/Point.cs b/Infrastructure/UI/DataContexts/Point.cs index 7b0ab3b..5acd966 100644 --- a/Infrastructure/UI/DataContexts/Point.cs +++ b/Infrastructure/UI/DataContexts/Point.cs @@ -44,8 +44,13 @@ namespace StructureHelper.Infrastructure.UI.DataContexts string materialName = MaterialName; ICenter center = new Center { X = CenterX, Y = CenterY }; IShape shape = new StructureHelperCommon.Models.Shapes.Point { Area = this.Area }; - IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = Material.DesignCompressiveStrength }; - INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial }; + IPrimitiveMaterial primitiveMaterial = GetPrimitiveMaterial(); + //IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = Material.DesignCompressiveStrength }; + INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial, + PrestrainKx = PrestrainKx, + PrestrainKy = PrestrainKy, + PrestrainEpsZ = PrestrainEpsZ + }; return ndmPrimitive; } } diff --git a/Infrastructure/UI/DataContexts/PrimitiveBase.cs b/Infrastructure/UI/DataContexts/PrimitiveBase.cs index 03bb9c5..9cf271d 100644 --- a/Infrastructure/UI/DataContexts/PrimitiveBase.cs +++ b/Infrastructure/UI/DataContexts/PrimitiveBase.cs @@ -5,21 +5,24 @@ using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using StructureHelper.Infrastructure.Enums; -using StructureHelper.Infrastructure.Exceptions; -using StructureHelper.Infrastructure.Strings; using StructureHelper.Infrastructure.UI.Converters.Units; using StructureHelper.Models.Materials; +using StructureHelper.Services.Primitives; using StructureHelper.UnitSystem.Systems; using StructureHelper.Windows.MainWindow; +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Infrastructures.Strings; using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Materials; +using StructureHelperCommon.Services.ColorServices; namespace StructureHelper.Infrastructure.UI.DataContexts { public abstract class PrimitiveBase : ViewModelBase { #region Поля - + private IPrimitiveRepository primitiveRepository; private readonly PrimitiveType type; private string name; private double centerX, centerY; @@ -31,7 +34,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts private Color color; private IHeadMaterial headMaterial; private MaterialDefinitionBase material; - private double prestrain_kx, prestrain_ky, prestrain_epsz; + private double prestrainKx, prestrainKy, prestrainEpsZ; private double opacity = 1, showedOpacity = 0, x, y, xY1, yX1, primitiveWidth, primitiveHeight, showedX, showedY; protected double delta = 0.5; private int showedZIndex = 1, zIndex; @@ -52,6 +55,8 @@ namespace StructureHelper.Infrastructure.UI.DataContexts } } + public IPrimitiveRepository PrimitiveRepository => primitiveRepository; + public string Name { get => name; @@ -96,6 +101,9 @@ namespace StructureHelper.Infrastructure.UI.DataContexts OnPropertyChanged(value, ref centerY); } } + public double PrestrainKx { get; set; } + public double PrestrainKy { get; set; } + public double PrestrainEpsZ { get; set; } public IHeadMaterial HeadMaterial { @@ -103,6 +111,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts set { OnPropertyChanged(value, ref headMaterial); + OnPropertyChanged(nameof(Color)); } } @@ -113,7 +122,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts } public Color Color { - get => setMaterialColor? headMaterial.Color :color; + get => ((setMaterialColor == true) & (headMaterial !=null))? headMaterial.Color :color; set { SetMaterialColor = false; @@ -285,10 +294,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts this.type = type; X = ownerVM.YX1 + x; Y = ownerVM.XY1 + y; - var randomR = new Random(new Random((int)DateTime.Now.Ticks % 1000).Next(50)).Next(0, 255); - var randomG = new Random(new Random((int)DateTime.Now.Ticks % 200).Next(100, 200)).Next(0, 255); - var randomB = new Random(new Random((int)DateTime.Now.Ticks % 50).Next(500, 1000)).Next(0, 255); - color = Color.FromRgb((byte)randomR, (byte)randomG, (byte)randomB); + color = ColorProcessor.GetRandomColor(); PrimitiveLeftButtonUp = new RelayCommand(o => Captured = false); PrimitiveLeftButtonDown = new RelayCommand(o => Captured = true); @@ -302,6 +308,9 @@ namespace StructureHelper.Infrastructure.UI.DataContexts }); OwnerVm = ownerVM; SetMaterialColor = true; + PrestrainKx = 0; + PrestrainKy = 0; + PrestrainEpsZ = 0; } protected readonly MainViewModel OwnerVm; @@ -342,5 +351,9 @@ namespace StructureHelper.Infrastructure.UI.DataContexts else { throw new StructureHelperException(ErrorStrings.MaterialTypeIsUnknown); } return materialTypes; } + public IPrimitiveMaterial GetPrimitiveMaterial() + { + return HeadMaterial.HelperMaterial.GetPrimitiveMaterial(); + } } } diff --git a/Infrastructure/UI/DataContexts/Rectangle.cs b/Infrastructure/UI/DataContexts/Rectangle.cs index c10a57b..aa95efd 100644 --- a/Infrastructure/UI/DataContexts/Rectangle.cs +++ b/Infrastructure/UI/DataContexts/Rectangle.cs @@ -47,11 +47,16 @@ namespace StructureHelper.Infrastructure.UI.DataContexts var height = PrimitiveHeight; double centerX = CenterX; double centerY = CenterY; - 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.DesignCompressiveStrength }; - INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial, NdmMaxSize = MaxElementSize, NdmMinDivision = MinElementDivision }; + IPrimitiveMaterial primitiveMaterial = GetPrimitiveMaterial(); + //IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = Material.DesignCompressiveStrength }; + INdmPrimitive ndmPrimitive = new NdmPrimitive + { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial, + NdmMaxSize = MaxElementSize, NdmMinDivision = MinElementDivision, + PrestrainKx = PrestrainKx, + PrestrainKy = PrestrainKy, + PrestrainEpsZ = PrestrainEpsZ }; return ndmPrimitive; } } diff --git a/Models/Materials/HeadMaterial.cs b/Models/Materials/HeadMaterial.cs deleted file mode 100644 index 672d532..0000000 --- a/Models/Materials/HeadMaterial.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media; - -namespace StructureHelper.Models.Materials -{ - public class HeadMaterial : IHeadMaterial - { - public string Name { get; set; } - public Color Color { get; set; } - public MaterialDefinitionBase Material { get; set; } - - public HeadMaterial() - { - Thread.Sleep(100); - var randomR = new Random(new Random((int)DateTime.Now.Ticks % 1000).Next(50)).Next(0, 255); - var randomG = new Random(new Random((int)DateTime.Now.Ticks % 200).Next(100, 200)).Next(0, 255); - var randomB = new Random(new Random((int)DateTime.Now.Ticks % 50).Next(500, 1000)).Next(0, 255); - Color = Color.FromRgb((byte)randomR, (byte)randomG, (byte)randomB); - } - } -} diff --git a/StructureHelper.csproj b/StructureHelper.csproj index 62157ed..16ba3d4 100644 --- a/StructureHelper.csproj +++ b/StructureHelper.csproj @@ -93,6 +93,7 @@ packages\System.Diagnostics.DiagnosticSource.6.0.0\lib\net461\System.Diagnostics.DiagnosticSource.dll True + packages\System.Memory.4.5.5\lib\net461\System.Memory.dll True @@ -132,8 +133,6 @@ Designer - - @@ -142,8 +141,6 @@ PrimitivePopup.xaml - - @@ -276,7 +273,7 @@ - + diff --git a/StructureHelper.sln b/StructureHelper.sln index 9096489..dd8c1da 100644 --- a/StructureHelper.sln +++ b/StructureHelper.sln @@ -11,6 +11,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureHelperTests", "Str EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructureHelperLogics", "StructureHelperLogics\StructureHelperLogics.csproj", "{330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}" + ProjectSection(ProjectDependencies) = postProject + {5DFEC3FD-9677-47BB-9E88-EB71828B5913} = {5DFEC3FD-9677-47BB-9E88-EB71828B5913} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureHelperCommon", "StructureHelperCommon\StructureHelperCommon.csproj", "{5DFEC3FD-9677-47BB-9E88-EB71828B5913}" EndProject diff --git a/StructureHelperCommon/Infrastructures/Enums/CodeTypes.cs b/StructureHelperCommon/Infrastructures/Enums/CodeTypes.cs new file mode 100644 index 0000000..66213b9 --- /dev/null +++ b/StructureHelperCommon/Infrastructures/Enums/CodeTypes.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StructureHelperCommon.Infrastructures.Enums +{ + public enum CodeTypes + { + SP63_13330_2018, + EuroCode_2_1990 + } +} diff --git a/StructureHelperCommon/Models/Materials/MaterialTypes.cs b/StructureHelperCommon/Infrastructures/Enums/MaterialTypes.cs similarity index 68% rename from StructureHelperCommon/Models/Materials/MaterialTypes.cs rename to StructureHelperCommon/Infrastructures/Enums/MaterialTypes.cs index b53a479..ff4c2ce 100644 --- a/StructureHelperCommon/Models/Materials/MaterialTypes.cs +++ b/StructureHelperCommon/Infrastructures/Enums/MaterialTypes.cs @@ -1,4 +1,5 @@ -namespace StructureHelperCommon.Models.Materials +namespace StructureHelperCommon.Infrastructures.Enums + { public enum MaterialTypes { diff --git a/Infrastructure/Exceptions/StructureHelperException.cs b/StructureHelperCommon/Infrastructures/Exceptions/StructureHelperException.cs similarity index 67% rename from Infrastructure/Exceptions/StructureHelperException.cs rename to StructureHelperCommon/Infrastructures/Exceptions/StructureHelperException.cs index 01d5cd8..9c96b5e 100644 --- a/Infrastructure/Exceptions/StructureHelperException.cs +++ b/StructureHelperCommon/Infrastructures/Exceptions/StructureHelperException.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace StructureHelper.Infrastructure.Exceptions +namespace StructureHelperCommon.Infrastructures.Exceptions { - internal class StructureHelperException : Exception + public class StructureHelperException : Exception { public StructureHelperException(string errorString) : base(errorString) { diff --git a/StructureHelperCommon/Infrastructures/Interfaces/IHasParent.cs b/StructureHelperCommon/Infrastructures/Interfaces/IHasParent.cs new file mode 100644 index 0000000..99f6895 --- /dev/null +++ b/StructureHelperCommon/Infrastructures/Interfaces/IHasParent.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelperCommon.Infrastructures.Interfaces +{ + public interface IHasParent + { + object Parent { get; } + void RegisterParent(); + } +} diff --git a/StructureHelperCommon/Infrastructures/Strings/ErrorString.cs b/StructureHelperCommon/Infrastructures/Strings/ErrorString.cs new file mode 100644 index 0000000..9684acd --- /dev/null +++ b/StructureHelperCommon/Infrastructures/Strings/ErrorString.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelperCommon.Infrastructures.Strings +{ + public static class ErrorStrings + { + public static string UnknownError => "#0000: Unknown error"; + public static string ObjectTypeIsUnknown => "#0001: Object type is unknown"; + public static string MaterialTypeIsUnknown => "#0002: Material type is unknown"; + public static string DataIsInCorrect => "#0003: Data is not correct"; + public static string ShapeIsNotCorrect => "#0004: Shape is not valid"; + public static string LimitStatesIsNotValid => "#0005: Type of limite state is not valid"; + public static string LoadTermIsNotValid => "#0006: Load term is not valid"; + } +} diff --git a/StructureHelperCommon/Models/Entities/INdmPrimitive.cs b/StructureHelperCommon/Models/Entities/INdmPrimitive.cs index 34e29fe..1ddc65a 100644 --- a/StructureHelperCommon/Models/Entities/INdmPrimitive.cs +++ b/StructureHelperCommon/Models/Entities/INdmPrimitive.cs @@ -10,5 +10,8 @@ namespace StructureHelperCommon.Models.Entities IPrimitiveMaterial PrimitiveMaterial {get;set;} double NdmMaxSize { get; set; } int NdmMinDivision { get; set; } + double PrestrainKx { get; set; } + double PrestrainKy { get; set; } + double PrestrainEpsZ { get; set; } } } diff --git a/StructureHelperCommon/Models/Entities/NdmPrimitive.cs b/StructureHelperCommon/Models/Entities/NdmPrimitive.cs index 627c5f7..a837b67 100644 --- a/StructureHelperCommon/Models/Entities/NdmPrimitive.cs +++ b/StructureHelperCommon/Models/Entities/NdmPrimitive.cs @@ -10,5 +10,8 @@ namespace StructureHelperCommon.Models.Entities public IPrimitiveMaterial PrimitiveMaterial { get; set; } public double NdmMaxSize { get; set; } public int NdmMinDivision { get; set; } + public double PrestrainKx { get; set; } + public double PrestrainKy { get; set; } + public double PrestrainEpsZ { get; set; } } } diff --git a/StructureHelperCommon/Models/Materials/IPrimitiveMaterial.cs b/StructureHelperCommon/Models/Materials/IPrimitiveMaterial.cs index 881c4c9..9289b2b 100644 --- a/StructureHelperCommon/Models/Materials/IPrimitiveMaterial.cs +++ b/StructureHelperCommon/Models/Materials/IPrimitiveMaterial.cs @@ -1,9 +1,12 @@ -namespace StructureHelperCommon.Models.Materials +using StructureHelperCommon.Infrastructures.Enums; + +namespace StructureHelperCommon.Models.Materials { public interface IPrimitiveMaterial { string Id { get;} MaterialTypes MaterialType { get; } + CodeTypes CodeType { get; set; } string ClassName { get; } double Strength { get; } } diff --git a/StructureHelperCommon/Models/Materials/PrimitiveMaterial.cs b/StructureHelperCommon/Models/Materials/PrimitiveMaterial.cs index c39a763..4a05055 100644 --- a/StructureHelperCommon/Models/Materials/PrimitiveMaterial.cs +++ b/StructureHelperCommon/Models/Materials/PrimitiveMaterial.cs @@ -1,4 +1,5 @@ -using System; +using StructureHelperCommon.Infrastructures.Enums; +using System; namespace StructureHelperCommon.Models.Materials { @@ -6,9 +7,11 @@ namespace StructureHelperCommon.Models.Materials { public string Id { get; } public MaterialTypes MaterialType { get; set; } + public CodeTypes CodeType { get; set; } public string ClassName { get; set; } public double Strength { get; set; } + public PrimitiveMaterial() { Id = Convert.ToString(Guid.NewGuid()); diff --git a/StructureHelperCommon/Models/NdmPrimitives/PointPrimitive.cs b/StructureHelperCommon/Models/NdmPrimitives/PointPrimitive.cs index 1b7f8ac..d098f2a 100644 --- a/StructureHelperCommon/Models/NdmPrimitives/PointPrimitive.cs +++ b/StructureHelperCommon/Models/NdmPrimitives/PointPrimitive.cs @@ -1,4 +1,5 @@ -using StructureHelperCommon.Models.Entities; +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Materials; using StructureHelperCommon.Models.Shapes; diff --git a/StructureHelperCommon/Models/NdmPrimitives/RectanglePrimitive.cs b/StructureHelperCommon/Models/NdmPrimitives/RectanglePrimitive.cs index 01f72ca..6fb5ea4 100644 --- a/StructureHelperCommon/Models/NdmPrimitives/RectanglePrimitive.cs +++ b/StructureHelperCommon/Models/NdmPrimitives/RectanglePrimitive.cs @@ -1,4 +1,5 @@ -using StructureHelperCommon.Models.Entities; +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Materials; using StructureHelperCommon.Models.Shapes; diff --git a/StructureHelperCommon/Services/ColorServices/ColorProcessor.cs b/StructureHelperCommon/Services/ColorServices/ColorProcessor.cs new file mode 100644 index 0000000..67f7980 --- /dev/null +++ b/StructureHelperCommon/Services/ColorServices/ColorProcessor.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Windows.Media; +using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; + +namespace StructureHelperCommon.Services.ColorServices +{ + public static class ColorProcessor + { + public static Color GetRandomColor() + { + Thread.Sleep(100); + var randomR = new Random(new Random((int)DateTime.Now.Ticks % 1000).Next(50)).Next(0, 255); + var randomG = new Random(new Random((int)DateTime.Now.Ticks % 200).Next(100, 200)).Next(0, 255); + var randomB = new Random(new Random((int)DateTime.Now.Ticks % 50).Next(500, 1000)).Next(0, 255); + return Color.FromRgb((byte)randomR, (byte)randomG, (byte)randomB); + } + public static void EditColor(ref Color wpfColor) + { + var winformsColor = System.Drawing.Color.FromArgb(wpfColor.A, wpfColor.R, wpfColor.G, wpfColor.B); + ColorDialog dialog = new ColorDialog(); + dialog.FullOpen = true; + dialog.Color = winformsColor; + if (dialog.ShowDialog() == DialogResult.OK) + { + wpfColor = Color.FromArgb(dialog.Color.A, dialog.Color.R, dialog.Color.G, dialog.Color.B); + } + } + } +} diff --git a/StructureHelperCommon/StructureHelperCommon.csproj b/StructureHelperCommon/StructureHelperCommon.csproj index fcc0973..af6a756 100644 --- a/StructureHelperCommon/StructureHelperCommon.csproj +++ b/StructureHelperCommon/StructureHelperCommon.csproj @@ -32,8 +32,12 @@ 4 + + + + @@ -42,10 +46,14 @@ + + + + - + @@ -61,6 +69,7 @@ + \ No newline at end of file diff --git a/StructureHelperCommon/StructureHelperCommon.csproj.bak b/StructureHelperCommon/StructureHelperCommon.csproj.bak new file mode 100644 index 0000000..6311dda --- /dev/null +++ b/StructureHelperCommon/StructureHelperCommon.csproj.bak @@ -0,0 +1,69 @@ + + + + + Debug + AnyCPU + {5DFEC3FD-9677-47BB-9E88-EB71828B5913} + Library + Properties + StructureHelperCommon + StructureHelperCommon + v4.7.2 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/StructureHelperLogics/Models/Materials/ElasticMaterial.cs b/StructureHelperLogics/Models/Materials/ElasticMaterial.cs new file mode 100644 index 0000000..500212d --- /dev/null +++ b/StructureHelperLogics/Models/Materials/ElasticMaterial.cs @@ -0,0 +1,24 @@ +using StructureHelperCommon.Models.Materials; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelperLogics.Models.Materials +{ + public class ElasticMaterial : IElasticMaterial + { + public double Modulus { get; set; } + + public object Clone() + { + return new ElasticMaterial() { Modulus = Modulus }; + } + + public IPrimitiveMaterial GetPrimitiveMaterial() + { + throw new NotImplementedException(); + } + } +} diff --git a/StructureHelperLogics/Models/Materials/Factories/LibMaterialFactory.cs b/StructureHelperLogics/Models/Materials/Factories/LibMaterialFactory.cs new file mode 100644 index 0000000..a437eef --- /dev/null +++ b/StructureHelperLogics/Models/Materials/Factories/LibMaterialFactory.cs @@ -0,0 +1,105 @@ +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Infrastructures.Strings; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelperLogics.Models.Materials.Factories +{ + public static class LibMaterialFactory + { + public static List GetLibMaterials(CodeTypes code) + { + List libMaterials = new List(); + libMaterials.AddRange(GetConcrete(code)); + libMaterials.AddRange(GetReinforcement(code)); + return libMaterials; + } + + private static IEnumerable GetReinforcement(CodeTypes code) + { + if (code == CodeTypes.EuroCode_2_1990) + { + return GetReinforcementEurocode(); + } + else if (code == CodeTypes.SP63_13330_2018) + { + return GetReinforcementSP63(); + } + else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown); } + } + + private static IEnumerable GetConcrete(CodeTypes code) + { + if (code == CodeTypes.EuroCode_2_1990) + { + return GetConcreteEurocode(); + } + else if (code == CodeTypes.SP63_13330_2018) + { + return GetConcreteSP63(); + } + else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown); } + } + + private static IEnumerable GetConcreteEurocode() + { + var code = CodeTypes.EuroCode_2_1990; + var material = MaterialTypes.Concrete; + List libMaterials = new List(); + libMaterials.Add(new LibMaterial(material, code, "C12", 12e6)); + libMaterials.Add(new LibMaterial(material, code, "C20", 20e6)); + libMaterials.Add(new LibMaterial(material, code, "C30", 30e6)); + libMaterials.Add(new LibMaterial(material, code, "C40", 40e6)); + libMaterials.Add(new LibMaterial(material, code, "C50", 50e6)); + libMaterials.Add(new LibMaterial(material, code, "C60", 60e6)); + libMaterials.Add(new LibMaterial(material, code, "C70", 70e6)); + libMaterials.Add(new LibMaterial(material, code, "C80", 80e6)); + return libMaterials; + } + + private static IEnumerable GetReinforcementEurocode() + { + var code = CodeTypes.EuroCode_2_1990; + var material = MaterialTypes.Reinforcement; + List libMaterials = new List(); + libMaterials.Add(new LibMaterial(material, code, "S240", 240e6)); + libMaterials.Add(new LibMaterial(material, code, "S400", 400e6)); + libMaterials.Add(new LibMaterial(material, code, "S500", 500e6)); + return libMaterials; + } + + private static IEnumerable GetConcreteSP63() + { + var code = CodeTypes.SP63_13330_2018; + var material = MaterialTypes.Concrete; + List libMaterials = new List(); + libMaterials.Add(new LibMaterial(material, code, "B5", 5e6)); + libMaterials.Add(new LibMaterial(material, code, "B7,5", 7.5e6)); + libMaterials.Add(new LibMaterial(material, code, "B10", 10e6)); + libMaterials.Add(new LibMaterial(material, code, "B15", 15e6)); + libMaterials.Add(new LibMaterial(material, code, "B20", 20e6)); + libMaterials.Add(new LibMaterial(material, code, "B25", 25e6)); + libMaterials.Add(new LibMaterial(material, code, "B30", 30e6)); + libMaterials.Add(new LibMaterial(material, code, "B35", 35e6)); + libMaterials.Add(new LibMaterial(material, code, "B40", 40e6)); + libMaterials.Add(new LibMaterial(material, code, "B50", 50e6)); + libMaterials.Add(new LibMaterial(material, code, "B60", 60e6)); + return libMaterials; + } + + private static IEnumerable GetReinforcementSP63() + { + var code = CodeTypes.EuroCode_2_1990; + var material = MaterialTypes.Reinforcement; + List libMaterials = new List(); + libMaterials.Add(new LibMaterial(material, code, "A240", 240e6)); + libMaterials.Add(new LibMaterial(material, code, "A400", 400e6)); + libMaterials.Add(new LibMaterial(material, code, "A500", 500e6)); + return libMaterials; + } + } +} diff --git a/StructureHelperLogics/Models/Materials/HeadMaterial.cs b/StructureHelperLogics/Models/Materials/HeadMaterial.cs new file mode 100644 index 0000000..4a4b349 --- /dev/null +++ b/StructureHelperLogics/Models/Materials/HeadMaterial.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; +using StructureHelperCommon.Services.ColorServices; +using StructureHelperLogics.Models.Materials; + +namespace StructureHelper.Models.Materials +{ + public class HeadMaterial : IHeadMaterial + { + public string Name { get; set; } + public Color Color { get; set; } + public IHelperMaterial HelperMaterial {get; set;} + + //public MaterialDefinitionBase Material { get; set; } + + public HeadMaterial() + { + Color = ColorProcessor.GetRandomColor(); + } + + public object Clone() + { + IHeadMaterial material = new HeadMaterial + { + Name = Name, + Color = Color, + HelperMaterial = HelperMaterial.Clone() as IHelperMaterial + }; + return material; + } + } +} diff --git a/StructureHelperLogics/Models/Materials/HeadMaterialRepository.cs b/StructureHelperLogics/Models/Materials/HeadMaterialRepository.cs new file mode 100644 index 0000000..fa52826 --- /dev/null +++ b/StructureHelperLogics/Models/Materials/HeadMaterialRepository.cs @@ -0,0 +1,35 @@ +using StructureHelper.Models.Materials; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelperLogics.Models.Materials +{ + public class HeadMaterialRepository : IHeadMaterialRepository + { + public object Parent { get; private set; } + + public List HeadMaterials { get; set; } + public List LibMaterials { get; set; } + + public HeadMaterialRepository() + { + HeadMaterials = new List(); + LibMaterials = new List(); + } + + public HeadMaterialRepository(object parent) + { + Parent = parent; + HeadMaterials = new List(); + LibMaterials = new List(); + } + + public void RegisterParent(object obj) + { + Parent = obj; + } + } +} diff --git a/StructureHelperLogics/Models/Materials/IElasticMaterial.cs b/StructureHelperLogics/Models/Materials/IElasticMaterial.cs new file mode 100644 index 0000000..d9e34be --- /dev/null +++ b/StructureHelperLogics/Models/Materials/IElasticMaterial.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelperLogics.Models.Materials +{ + public interface IElasticMaterial : IHelperMaterial + { + double Modulus { get; set; } + } +} diff --git a/Models/Materials/IHeadMaterial.cs b/StructureHelperLogics/Models/Materials/IHeadMaterial.cs similarity index 53% rename from Models/Materials/IHeadMaterial.cs rename to StructureHelperLogics/Models/Materials/IHeadMaterial.cs index 0b55d40..830996f 100644 --- a/Models/Materials/IHeadMaterial.cs +++ b/StructureHelperLogics/Models/Materials/IHeadMaterial.cs @@ -1,4 +1,5 @@ -using System; +using StructureHelperLogics.Models.Materials; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,10 +8,11 @@ using System.Windows.Media; namespace StructureHelper.Models.Materials { - public interface IHeadMaterial + public interface IHeadMaterial : ICloneable { string Name { get; set; } Color Color { get; set; } - MaterialDefinitionBase Material { get; set; } + IHelperMaterial HelperMaterial { get; set; } + //MaterialDefinitionBase Material { get; set; } } } diff --git a/StructureHelperLogics/Models/Materials/IHeadMaterialRepository.cs b/StructureHelperLogics/Models/Materials/IHeadMaterialRepository.cs new file mode 100644 index 0000000..a11e7bd --- /dev/null +++ b/StructureHelperLogics/Models/Materials/IHeadMaterialRepository.cs @@ -0,0 +1,19 @@ +using StructureHelper.Models.Materials; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace StructureHelperLogics.Models.Materials +{ + public interface IHeadMaterialRepository + { + object Parent { get; } + List HeadMaterials { get; set; } + List LibMaterials { get; set; } + void RegisterParent(object obj); + + } +} diff --git a/StructureHelperLogics/Models/Materials/IHelperMaterial.cs b/StructureHelperLogics/Models/Materials/IHelperMaterial.cs new file mode 100644 index 0000000..df10795 --- /dev/null +++ b/StructureHelperLogics/Models/Materials/IHelperMaterial.cs @@ -0,0 +1,13 @@ +using LoaderCalculator.Data.Materials; +using StructureHelperCommon.Models.Materials; +using System; +using System.Collections.Generic; +using System.Text; + +namespace StructureHelperLogics.Models.Materials +{ + public interface IHelperMaterial : ICloneable + { + IPrimitiveMaterial GetPrimitiveMaterial(); + } +} diff --git a/StructureHelperLogics/Models/Materials/ILibMaterial.cs b/StructureHelperLogics/Models/Materials/ILibMaterial.cs new file mode 100644 index 0000000..667f110 --- /dev/null +++ b/StructureHelperLogics/Models/Materials/ILibMaterial.cs @@ -0,0 +1,17 @@ +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Models.Materials; +using StructureHelperLogics.Infrastructures.CommonEnums; +using System; +using System.Collections.Generic; +using System.Text; + +namespace StructureHelperLogics.Models.Materials +{ + public interface ILibMaterial : IHelperMaterial + { + MaterialTypes MaterialType { get; set; } + CodeTypes CodeType { get; set; } + string Name { get; set; } + double MainStrength { get; set; } + } +} diff --git a/StructureHelperLogics/Models/Materials/LibMaterial.cs b/StructureHelperLogics/Models/Materials/LibMaterial.cs new file mode 100644 index 0000000..4ff2199 --- /dev/null +++ b/StructureHelperLogics/Models/Materials/LibMaterial.cs @@ -0,0 +1,73 @@ +using LoaderCalculator.Data.Materials; +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Infrastructures.Strings; +using StructureHelperCommon.Models.Materials; +using System; +using System.Collections.Generic; +using System.Text; + +namespace StructureHelperLogics.Models.Materials +{ + public class LibMaterial : ILibMaterial + { + public MaterialTypes MaterialType { get; set; } + public CodeTypes CodeType { get; set; } + public string Name { get; set; } + public double MainStrength { get; set; } + + public LibMaterial(MaterialTypes materialType, CodeTypes codeType, string name, double mainStrength) + { + MaterialType = materialType; + CodeType = codeType; + Name = name; + MainStrength = mainStrength; + } + + public IPrimitiveMaterial GetPrimitiveMaterial() + { + if (MaterialType == MaterialTypes.Concrete & CodeType == CodeTypes.EuroCode_2_1990) + { return GetConcreteEurocode();} + else if (MaterialType == MaterialTypes.Reinforcement & CodeType == CodeTypes.EuroCode_2_1990) + { return GetReinfrocementeEurocode();} + if (MaterialType == MaterialTypes.Concrete & CodeType == CodeTypes.SP63_13330_2018) + { return GetConcreteSP63(); } + else if (MaterialType == MaterialTypes.Reinforcement & CodeType == CodeTypes.SP63_13330_2018) + { return GetReinfrocementeSP63(); } + else throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown}: material type = {MaterialType}, code type = {CodeType}"); + } + + private IPrimitiveMaterial GetReinfrocementeSP63() + { + IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial + { MaterialType = MaterialType, CodeType = CodeTypes.SP63_13330_2018, ClassName = $"Reinforcement {Name}", Strength = MainStrength }; + return primitiveMaterial; + } + + private IPrimitiveMaterial GetConcreteSP63() + { + IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial + { MaterialType = MaterialType, CodeType = CodeTypes.SP63_13330_2018, ClassName = $"Concrete {Name}", Strength = MainStrength }; + return primitiveMaterial; + } + + private IPrimitiveMaterial GetReinfrocementeEurocode() + { + IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial + { MaterialType = MaterialType, CodeType = CodeTypes.EuroCode_2_1990, ClassName = $"Reinforcement {Name}", Strength = MainStrength }; + return primitiveMaterial; + } + + private IPrimitiveMaterial GetConcreteEurocode() + { + IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial + { MaterialType = MaterialType, CodeType = CodeTypes.EuroCode_2_1990, ClassName = $"Concrete {Name}", Strength = MainStrength }; + return primitiveMaterial; + } + + public object Clone() + { + return new LibMaterial(this.MaterialType, this.CodeType, this.Name, this.MainStrength); + } + } +} diff --git a/StructureHelperLogics/NdmCalculations/Triangulations/ITriangulationLogicOptions.cs b/StructureHelperLogics/NdmCalculations/Triangulations/ITriangulationLogicOptions.cs index 9abe4ec..513a185 100644 --- a/StructureHelperLogics/NdmCalculations/Triangulations/ITriangulationLogicOptions.cs +++ b/StructureHelperLogics/NdmCalculations/Triangulations/ITriangulationLogicOptions.cs @@ -2,5 +2,8 @@ { public interface ITriangulationLogicOptions { + double PrestrainKx { get;} + double PrestrainKy { get;} + double PrestrainEpsZ { get;} } } diff --git a/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogic.cs b/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogic.cs index a324533..20afe30 100644 --- a/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogic.cs +++ b/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogic.cs @@ -3,6 +3,8 @@ using LoaderCalculator.Data.Ndms; using System; using System.Collections.Generic; using StructureHelperCommon.Models.Shapes; +using LoaderCalculator.Data.Matrix; +using LoaderCalculator.Data.Ndms.Transformations; namespace StructureHelperLogics.NdmCalculations.Triangulations { @@ -23,6 +25,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations List ndmCollection = new List(); INdm ndm = new Ndm { CenterX = center.X, CenterY = center.Y, Area = area, Material = material }; ndmCollection.Add(ndm); + NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = Options.PrestrainKx, Ky = Options.PrestrainKy, EpsZ = Options.PrestrainEpsZ }); return ndmCollection; } diff --git a/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogicOptions.cs b/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogicOptions.cs index 3f8b36c..faede61 100644 --- a/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogicOptions.cs +++ b/StructureHelperLogics/NdmCalculations/Triangulations/PointTriangulationLogicOptions.cs @@ -1,4 +1,8 @@ -using StructureHelperCommon.Models.Shapes; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Infrastructures.Strings; +using StructureHelperCommon.Models.Entities; +using StructureHelperCommon.Models.NdmPrimitives; +using StructureHelperCommon.Models.Shapes; namespace StructureHelperLogics.NdmCalculations.Triangulations { @@ -11,13 +15,31 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations /// /// public ICenter Center { get; } - + /// public double Area { get; } + /// + public double PrestrainKx { get; } + /// + public double PrestrainKy { get; } + /// + public double PrestrainEpsZ { get; } public PointTriangulationLogicOptions(ICenter center, double area) { Center = center; Area = area; } + + public PointTriangulationLogicOptions(INdmPrimitive primitive) + { + if (!(primitive.Shape is IPoint)) { throw new StructureHelperException(ErrorStrings.ShapeIsNotCorrect); } + Center = primitive.Center; + IPoint point = primitive.Shape as IPoint; + Center = primitive.Center; + Area = point.Area; + PrestrainKx = primitive.PrestrainKx; + PrestrainKy = primitive.PrestrainKy; + PrestrainEpsZ = primitive.PrestrainEpsZ; + } } } diff --git a/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogic.cs b/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogic.cs index 7297316..a11e435 100644 --- a/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogic.cs +++ b/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogic.cs @@ -3,6 +3,7 @@ using LoaderCalculator.Data.Ndms; using System; using System.Collections.Generic; using LoaderCalculator.Data.Ndms.Transformations; +using LoaderCalculator.Data.Matrix; namespace StructureHelperLogics.NdmCalculations.Triangulations { @@ -25,6 +26,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations NdmTransform.Move(ndmCollection, dX, dY); double angle = rectangleOptions.Rectangle.Angle; NdmTransform.Rotate(ndmCollection, angle); + NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = Options.PrestrainKx, Ky = Options.PrestrainKy, EpsZ = Options.PrestrainEpsZ }); return ndmCollection; } diff --git a/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogicOptions.cs b/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogicOptions.cs index b941871..aa70138 100644 --- a/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogicOptions.cs +++ b/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogicOptions.cs @@ -1,4 +1,6 @@ using System; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Infrastructures.Strings; using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Shapes; @@ -15,6 +17,12 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations public double NdmMaxSize { get; } /// public int NdmMinDivision { get; } + /// + public double PrestrainKx { get;} + /// + public double PrestrainKy { get; } + /// + public double PrestrainEpsZ { get;} public RectangleTriangulationLogicOptions(ICenter center, IRectangle rectangle, double ndmMaxSize, int ndmMinDivision) { @@ -26,11 +34,14 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations public RectangleTriangulationLogicOptions(INdmPrimitive primitive) { - if (! (primitive.Shape is IRectangle)) { throw new Exception("Shape type is not valid"); } + if (! (primitive.Shape is IRectangle)) { throw new StructureHelperException(ErrorStrings.ShapeIsNotCorrect); } Center = primitive.Center; Rectangle = primitive.Shape as IRectangle; NdmMaxSize = primitive.NdmMaxSize; NdmMinDivision = primitive.NdmMinDivision; + PrestrainKx = primitive.PrestrainKx; + PrestrainKy = primitive.PrestrainKy; + PrestrainEpsZ = primitive.PrestrainEpsZ; } } } diff --git a/StructureHelperLogics/NdmCalculations/Triangulations/Triangulation.cs b/StructureHelperLogics/NdmCalculations/Triangulations/Triangulation.cs index 4c810fe..07a8718 100644 --- a/StructureHelperLogics/NdmCalculations/Triangulations/Triangulation.cs +++ b/StructureHelperLogics/NdmCalculations/Triangulations/Triangulation.cs @@ -3,6 +3,9 @@ using System.Collections.Generic; using LoaderCalculator.Data.Materials; using LoaderCalculator.Data.Materials.MaterialBuilders; using LoaderCalculator.Data.Ndms; +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Infrastructures.Strings; using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Materials; using StructureHelperCommon.Models.Shapes; @@ -67,12 +70,11 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations } else if (shape is IPoint) { - IPoint point = shape as IPoint; - options = new PointTriangulationLogicOptions(primitive.Center, point.Area); + options = new PointTriangulationLogicOptions(primitive); IPointTriangulationLogic logic = new PointTriangulationLogic(options); ndms.AddRange(logic.GetNdmCollection(material)); } - else { throw new Exception("Primitive type is not valid"); } + else { throw new StructureHelperException($"{ErrorStrings.ShapeIsNotCorrect} :{nameof(primitive.Shape)}"); } return ndms; } @@ -81,7 +83,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations IMaterial material; if (primitiveMaterial.MaterialType == MaterialTypes.Concrete) { material = GetConcreteMaterial(primitiveMaterial, options); } else if (primitiveMaterial.MaterialType == MaterialTypes.Reinforcement) { material = GetReinforcementMaterial(primitiveMaterial, options); } - else { throw new Exception("Material type is invalid"); } + else { throw new StructureHelperException(ErrorStrings.MaterialTypeIsUnknown); } return material; } @@ -106,14 +108,22 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations private static void SetMaterialOptions(IMaterialOptions materialOptions, IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options) { materialOptions.Strength = primitiveMaterial.Strength; - materialOptions.CodesType = CodesType.EC2_1990; + if (primitiveMaterial.CodeType == CodeTypes.EuroCode_2_1990) + { + materialOptions.CodesType = CodesType.EC2_1990; + } + else if (primitiveMaterial.CodeType == CodeTypes.SP63_13330_2018) + { + materialOptions.CodesType = CodesType.SP63_2018; + } + else { throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown} : {primitiveMaterial.CodeType}"); } if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Collapse) { materialOptions.LimitState = LimitStates.Collapse; } else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.ServiceAbility) { materialOptions.LimitState = LimitStates.ServiceAbility; } else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Special) { materialOptions.LimitState = LimitStates.Special; } - else { throw new Exception("LimitStateType is not valid"); } + else { throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid); } if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.ShortTerm) { materialOptions.IsShortTerm = true; } else if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.LongTerm) { materialOptions.IsShortTerm = false; } - else { throw new Exception("Calculation term is not valid"); } + else { throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid); } } } } diff --git a/StructureHelperLogics/StructureHelperLogics.csproj b/StructureHelperLogics/StructureHelperLogics.csproj index 8fc4ebc..df78d7b 100644 --- a/StructureHelperLogics/StructureHelperLogics.csproj +++ b/StructureHelperLogics/StructureHelperLogics.csproj @@ -1,21 +1,20 @@ - + - netstandard2.0 + net472 + Library - - - - - ..\..\StructureHelper\Libraries\LoaderCalculator.dll + ..\Libraries\LoaderCalculator.dll + + - + \ No newline at end of file diff --git a/StructureHelperLogics/StructureHelperLogics.csproj.bak b/StructureHelperLogics/StructureHelperLogics.csproj.bak new file mode 100644 index 0000000..1b7c1f1 --- /dev/null +++ b/StructureHelperLogics/StructureHelperLogics.csproj.bak @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/StructureHelperLogics/StructureHelperLogics1.csproj b/StructureHelperLogics/StructureHelperLogics1.csproj new file mode 100644 index 0000000..439819a --- /dev/null +++ b/StructureHelperLogics/StructureHelperLogics1.csproj @@ -0,0 +1,42 @@ + + + + + + Debug + AnyCPU + v4.7.2 + Library + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + ..\..\StructureHelper\Libraries\LoaderCalculator.dll + + + + diff --git a/StructureHelperTests/FunctionalTests/Ndms/RCSections/RCSectionTest.cs b/StructureHelperTests/FunctionalTests/Ndms/RCSections/RCSectionTest.cs index 8daf761..91a88a9 100644 --- a/StructureHelperTests/FunctionalTests/Ndms/RCSections/RCSectionTest.cs +++ b/StructureHelperTests/FunctionalTests/Ndms/RCSections/RCSectionTest.cs @@ -10,6 +10,7 @@ using System.Threading; using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Materials; using StructureHelperCommon.Models.Shapes; +using StructureHelperCommon.Infrastructures.Enums; namespace StructureHelperTests.FunctionalTests.Ndms.RCSections { diff --git a/StructureHelperTests/FunctionalTests/Ndms/SteelSections/ReinforcementTest.cs b/StructureHelperTests/FunctionalTests/Ndms/SteelSections/ReinforcementTest.cs index ac40fa8..6d19bb4 100644 --- a/StructureHelperTests/FunctionalTests/Ndms/SteelSections/ReinforcementTest.cs +++ b/StructureHelperTests/FunctionalTests/Ndms/SteelSections/ReinforcementTest.cs @@ -9,6 +9,7 @@ using System.Threading; using StructureHelperCommon.Models.Entities; using StructureHelperCommon.Models.Materials; using StructureHelperCommon.Models.Shapes; +using StructureHelperCommon.Infrastructures.Enums; namespace StructureHelperTests.FunctionalTests.Ndms.SteelSections { diff --git a/Windows/MainWindow/MainModel.cs b/Windows/MainWindow/MainModel.cs index 6a93263..7c4b43c 100644 --- a/Windows/MainWindow/MainModel.cs +++ b/Windows/MainWindow/MainModel.cs @@ -8,8 +8,11 @@ using StructureHelper.Services; using StructureHelper.Services.Primitives; using StructureHelper.UnitSystem; using StructureHelper.UnitSystem.Systems; +using StructureHelperCommon.Infrastructures.Enums; using StructureHelperLogics.Infrastructures.CommonEnums; using StructureHelperLogics.Models.Calculations.CalculationProperties; +using StructureHelperLogics.Models.Materials; +using StructureHelperLogics.Models.Materials.Factories; using StructureHelperLogics.NdmCalculations.Triangulations; using StructureHelperLogics.Services; using System.Collections; @@ -21,11 +24,17 @@ namespace StructureHelper.Windows.MainWindow { public class MainModel { + //const CodeTypes code = CodeTypes.EuroCode_2_1990; + const CodeTypes code = CodeTypes.SP63_13330_2018; + private IPrimitiveRepository primitiveRepository; + public IHeadMaterialRepository HeadMaterialRepository { get; } public List HeadMaterials { get; } private CalculationService calculationService; private UnitSystemService unitSystemService; + public IPrimitiveRepository PrimitiveRepository => primitiveRepository; + public ICalculationProperty CalculationProperty { get; private set; } public MainModel(IPrimitiveRepository primitiveRepository, CalculationService calculationService, UnitSystemService unitSystemService) @@ -36,6 +45,8 @@ namespace StructureHelper.Windows.MainWindow CalculationProperty = new CalculationProperty(); HeadMaterials = new List(); + HeadMaterialRepository = new HeadMaterialRepository(this); + HeadMaterialRepository.LibMaterials = LibMaterialFactory.GetLibMaterials(code); } public IStrainMatrix Calculate(double mx, double my, double nz) diff --git a/Windows/MainWindow/MainView.xaml b/Windows/MainWindow/MainView.xaml index a12649b..3b7544f 100644 --- a/Windows/MainWindow/MainView.xaml +++ b/Windows/MainWindow/MainView.xaml @@ -29,8 +29,7 @@ - - + @@ -49,6 +48,9 @@ @@ -102,11 +119,10 @@