All Test Was Repaired

This commit is contained in:
Evgeny Redikultsev
2022-12-10 17:44:06 +05:00
parent c766227b19
commit f562cf2bce
72 changed files with 1541 additions and 398 deletions

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
@@ -19,5 +20,12 @@ namespace StructureHelperCommon.Models.Forces
CalcTerm = calcTerm;
ForceTuple = new ForceTuple();
}
public object Clone()
{
var newTuple = new DesignForceTuple(this.LimitState, this.CalcTerm);
newTuple.ForceTuple = this.ForceTuple.Clone() as IForceTuple;
return newTuple;
}
}
}

View File

@@ -14,5 +14,11 @@ namespace StructureHelperCommon.Models.Forces
public double Qx { get; set; }
public double Qy { get; set; }
public double Mz { get; set; }
public object Clone()
{
IForceTuple forceTuple = new ForceTuple() { Mx = Mx, My = My, Nz = Nz, Qx = Qx, Qy = Qy, Mz = Mz};
return forceTuple;
}
}
}

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
public interface IDesignForceTuple
public interface IDesignForceTuple : ICloneable
{
LimitStates LimitState { get; set; }
CalcTerms CalcTerm { get; set; }

View File

@@ -0,0 +1,13 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
internal interface IForceRepository
{
}
}

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
public interface IForceTuple
public interface IForceTuple : ICloneable
{
double Mx { get; set; }
double My { get; set; }
@@ -14,6 +14,5 @@ namespace StructureHelperCommon.Models.Forces
double Qx { get; set; }
double Qy { get; set; }
double Mz { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Materials.Libraries
{
public class ConcreteMaterialEntity : IConcreteMaterialEntity
{
public CodeTypes CodeType { get; set; }
public string Name { get; set; }
public double MainStrength { get; set; }
}
}

View File

@@ -0,0 +1,74 @@
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 StructureHelperCommon.Models.Materials.Libraries
{
public static class LibMaterialFactory
{
public static List<ILibMaterialEntity> GetLibMaterials()
{
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
libMaterials.AddRange(GetConcreteEurocode());
libMaterials.AddRange(GetConcreteSP63());
libMaterials.AddRange(GetReinforcementEurocode());
libMaterials.AddRange(GetReinforcementSP63());
return libMaterials;
}
private static IEnumerable<ILibMaterialEntity> GetConcreteEurocode()
{
var code = CodeTypes.EuroCode_2_1990;
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C12", MainStrength = 12e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C20", MainStrength = 20e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C30", MainStrength = 30e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C40", MainStrength = 40e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C50", MainStrength = 50e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C60", MainStrength = 60e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C70", MainStrength = 70e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C80", MainStrength = 80e6 });
return libMaterials;
}
private static IEnumerable<ILibMaterialEntity> GetReinforcementEurocode()
{
var code = CodeTypes.EuroCode_2_1990;
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "S240", MainStrength = 240e6 });
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "S400", MainStrength = 400e6 });
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "S500", MainStrength = 500e6 });
return libMaterials;
}
private static IEnumerable<ILibMaterialEntity> GetConcreteSP63()
{
var code = CodeTypes.SP63_13330_2018;
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B5", MainStrength = 5e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B7,5", MainStrength = 7.5e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B10", MainStrength = 10e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B15", MainStrength = 15e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B20", MainStrength = 20e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B25", MainStrength = 25e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B30", MainStrength = 30e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B35", MainStrength = 35e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B40", MainStrength = 40e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B50", MainStrength = 50e6 });
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B60", MainStrength = 60e6 });
return libMaterials;
}
private static IEnumerable<ILibMaterialEntity> GetReinforcementSP63()
{
var code = CodeTypes.SP63_13330_2018;
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A240", MainStrength = 240e6 });
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A400", MainStrength = 400e6 });
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A500", MainStrength = 500e6 });
return libMaterials;
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Materials.Libraries
{
public interface IConcreteMaterialEntity : ILibMaterialEntity
{
}
}

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Materials.Libraries
{
public interface ILibMaterialEntity
{
CodeTypes CodeType { get; }
string Name { get; }
double MainStrength { get; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Materials.Libraries
{
public interface IReinforcementMaterialEntity : ILibMaterialEntity
{
}
}

View File

@@ -0,0 +1,30 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Materials.Libraries
{
public static class LibMaterialPepository
{
private static List<ILibMaterialEntity> libMaterials;
public static List<ILibMaterialEntity> GetRepository()
{
if (libMaterials is null) { libMaterials = LibMaterialFactory.GetLibMaterials(); }
return libMaterials;
}
public static IEnumerable<ILibMaterialEntity> GetConcreteRepository(CodeTypes code)
{
return GetRepository().Where(x => x.CodeType == code & x is IConcreteMaterialEntity); ;
}
public static IEnumerable<ILibMaterialEntity> GetReinforcementRepository(CodeTypes code)
{
return GetRepository().Where(x => x.CodeType == code & x is IReinforcementMaterialEntity);
}
}
}

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Materials.Libraries
{
public class ReinforcementMaterialEntity : IReinforcementMaterialEntity
{
public CodeTypes CodeType { get; set; }
public string Name { get; set; }
public double MainStrength { get; set; }
}
}