Library material was added

This commit is contained in:
Evgeny Redikultsev
2022-11-06 18:55:01 +05:00
parent 1cf54603bc
commit 5d19958fd7
52 changed files with 1018 additions and 171 deletions

View File

@@ -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
}
}

View File

@@ -1,4 +1,5 @@
namespace StructureHelperCommon.Models.Materials
namespace StructureHelperCommon.Infrastructures.Enums
{
public enum MaterialTypes
{

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Infrastructures.Exceptions
{
public class StructureHelperException : Exception
{
public StructureHelperException(string errorString) : base(errorString)
{
}
}
}

View File

@@ -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();
}
}

View File

@@ -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";
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}

View File

@@ -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());

View File

@@ -1,4 +1,5 @@
using StructureHelperCommon.Models.Entities;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Entities;
using StructureHelperCommon.Models.Materials;
using StructureHelperCommon.Models.Shapes;

View File

@@ -1,4 +1,5 @@
using StructureHelperCommon.Models.Entities;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Entities;
using StructureHelperCommon.Models.Materials;
using StructureHelperCommon.Models.Shapes;

View File

@@ -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);
}
}
}
}

View File

@@ -32,8 +32,12 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -42,10 +46,14 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Infrastructures\Enums\CodeTypes.cs" />
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
<Compile Include="Infrastructures\Interfaces\IHasParent.cs" />
<Compile Include="Infrastructures\Strings\ErrorString.cs" />
<Compile Include="Models\Entities\INdmPrimitive.cs" />
<Compile Include="Models\Entities\NdmPrimitive.cs" />
<Compile Include="Models\Materials\IPrimitiveMaterial.cs" />
<Compile Include="Models\Materials\MaterialTypes.cs" />
<Compile Include="Infrastructures\Enums\MaterialTypes.cs" />
<Compile Include="Models\Materials\PrimitiveMaterial.cs" />
<Compile Include="Models\NdmPrimitives\IPrimitive.cs" />
<Compile Include="Models\NdmPrimitives\PointPrimitive.cs" />
@@ -61,6 +69,7 @@
<Compile Include="Models\Shapes\Point.cs" />
<Compile Include="Models\Shapes\Rectangle.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\ColorServices\ColorProcessor.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5DFEC3FD-9677-47BB-9E88-EB71828B5913}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>StructureHelperCommon</RootNamespace>
<AssemblyName>StructureHelperCommon</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
<Compile Include="Infrastructures\Strings\ErrorStrings.cs" />
<Compile Include="Models\Entities\INdmPrimitive.cs" />
<Compile Include="Models\Entities\NdmPrimitive.cs" />
<Compile Include="Models\Materials\IPrimitiveMaterial.cs" />
<Compile Include="Models\Materials\MaterialTypes.cs" />
<Compile Include="Models\Materials\PrimitiveMaterial.cs" />
<Compile Include="Models\NdmPrimitives\IPrimitive.cs" />
<Compile Include="Models\NdmPrimitives\PointPrimitive.cs" />
<Compile Include="Models\NdmPrimitives\PrimitiveBase.cs" />
<Compile Include="Models\NdmPrimitives\RectanglePrimitive.cs" />
<Compile Include="Models\Shapes\Center.cs" />
<Compile Include="Models\Shapes\ICenter.cs" />
<Compile Include="Models\Shapes\ICenterShape.cs" />
<Compile Include="Models\Shapes\ICircle.cs" />
<Compile Include="Models\Shapes\IPoint.cs" />
<Compile Include="Models\Shapes\IRectangle.cs" />
<Compile Include="Models\Shapes\IShape.cs" />
<Compile Include="Models\Shapes\Point.cs" />
<Compile Include="Models\Shapes\Rectangle.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>