Analisys manager window was added
This commit is contained in:
@@ -21,7 +21,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
/// <inheritdoc/>
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public bool TensionForULS { get ; set; }
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
@@ -14,6 +15,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
private IElasticMaterialLogic elasticMaterialLogic => new ElasticMaterialLogic();
|
||||
private MaterialTypes materialType;
|
||||
IUpdateStrategy<IFRMaterial> fRUpdateStrategy = new FRUpdateStrategy();
|
||||
public double Modulus{ get; set; }
|
||||
public double CompressiveStrength { get; set; }
|
||||
public double TensileStrength { get; set; }
|
||||
@@ -49,7 +51,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public object Clone()
|
||||
{
|
||||
var newItem = new FRMaterial(this.materialType);
|
||||
var updateStrategy = new FRUpdateStrategy();
|
||||
var updateStrategy = fRUpdateStrategy;
|
||||
updateStrategy.Update(newItem, this);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public interface ILibMaterial : IHelperMaterial
|
||||
{
|
||||
ILibMaterialEntity MaterialEntity { get; set; }
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; set; }
|
||||
IMaterialLogic MaterialLogic { get; set; }
|
||||
List<IMaterialLogic> MaterialLogics { get; }
|
||||
(double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; }
|
||||
public IMaterialLogic MaterialLogic { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public List<IMaterialLogic> MaterialLogics => throw new NotImplementedException();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,11 +8,20 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal class ConcreteLibUpdateStrategy : IUpdateStrategy<IConcreteLibMaterial>
|
||||
public class ConcreteLibUpdateStrategy : IUpdateStrategy<IConcreteLibMaterial>
|
||||
{
|
||||
LibMaterialUpdateStrategy libUpdateStrategy = new LibMaterialUpdateStrategy();
|
||||
private IUpdateStrategy<ILibMaterial> libUpdateStrategy;
|
||||
public ConcreteLibUpdateStrategy(IUpdateStrategy<ILibMaterial> libUpdateStrategy)
|
||||
{
|
||||
this.libUpdateStrategy = libUpdateStrategy;
|
||||
}
|
||||
public ConcreteLibUpdateStrategy() : this(new LibMaterialUpdateStrategy())
|
||||
{
|
||||
|
||||
}
|
||||
public void Update(IConcreteLibMaterial targetObject, IConcreteLibMaterial sourceObject)
|
||||
{
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
libUpdateStrategy.Update(targetObject, sourceObject);
|
||||
targetObject.TensionForULS = sourceObject.TensionForULS;
|
||||
|
||||
@@ -12,13 +12,15 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal class ElasticMaterialLogic : IElasticMaterialLogic
|
||||
{
|
||||
private List<double> parameters;
|
||||
|
||||
public IMaterial GetLoaderMaterial(IElasticMaterial elasticMaterial, LimitStates limitState, CalcTerms calcTerm, double factor = 1d)
|
||||
{
|
||||
IMaterial material = new Material();
|
||||
material.InitModulus = elasticMaterial.Modulus;
|
||||
IFactorLogic factorLogic = new FactorLogic(elasticMaterial.SafetyFactors);
|
||||
var factors = factorLogic.GetTotalFactor(limitState, calcTerm);
|
||||
IEnumerable<double> parameters = new List<double>()
|
||||
parameters = new List<double>()
|
||||
{
|
||||
elasticMaterial.Modulus,
|
||||
elasticMaterial.CompressiveStrength * factors.Compressive * factor,
|
||||
@@ -29,7 +31,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
return material;
|
||||
}
|
||||
|
||||
private double GetStressByStrain(IEnumerable<double> parameters, double strain)
|
||||
private double GetStressByStrain(IEnumerable<double> parameters1, double strain)
|
||||
{
|
||||
double modulus = parameters.First();
|
||||
double stress = modulus * strain;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,6 +13,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public void Update(IElasticMaterial targetObject, IElasticMaterial sourceObject)
|
||||
{
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.Modulus = sourceObject.Modulus;
|
||||
targetObject.CompressiveStrength = sourceObject.CompressiveStrength;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,12 +13,13 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public void Update(IFRMaterial targetObject, IFRMaterial sourceObject)
|
||||
{
|
||||
CheckObject.ReferenceEquals(targetObject, sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.Modulus = sourceObject.Modulus;
|
||||
targetObject.CompressiveStrength = sourceObject.CompressiveStrength;
|
||||
targetObject.TensileStrength = targetObject.TensileStrength;
|
||||
targetObject.ULSConcreteStrength = targetObject.ULSConcreteStrength;
|
||||
targetObject.SumThickness = targetObject.SumThickness;
|
||||
targetObject.TensileStrength = sourceObject.TensileStrength;
|
||||
targetObject.ULSConcreteStrength = sourceObject.ULSConcreteStrength;
|
||||
targetObject.SumThickness = sourceObject.SumThickness;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,18 +9,23 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal class LibMaterialUpdateStrategy : IUpdateStrategy<ILibMaterial>
|
||||
public class LibMaterialUpdateStrategy : IUpdateStrategy<ILibMaterial>
|
||||
{
|
||||
public void Update(ILibMaterial targetObject, ILibMaterial sourceObject)
|
||||
{
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.MaterialEntity = sourceObject.MaterialEntity;
|
||||
targetObject.SafetyFactors.Clear();
|
||||
targetObject.MaterialLogic = sourceObject.MaterialLogic;
|
||||
foreach (var item in sourceObject.SafetyFactors)
|
||||
if (targetObject.SafetyFactors is not null & sourceObject.SafetyFactors is not null)
|
||||
{
|
||||
targetObject.SafetyFactors.Add(item.Clone() as IMaterialSafetyFactor);
|
||||
targetObject.SafetyFactors.Clear();
|
||||
foreach (var item in sourceObject.SafetyFactors)
|
||||
{
|
||||
targetObject.SafetyFactors.Add(item.Clone() as IMaterialSafetyFactor);
|
||||
}
|
||||
}
|
||||
targetObject.MaterialLogic = sourceObject.MaterialLogic;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,37 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
public class MaterialUpdateStrategy : IUpdateStrategy<IHeadMaterial>
|
||||
{
|
||||
private readonly IUpdateStrategy<IElasticMaterial> elasticStrategy = new ElasticUpdateStrategy();
|
||||
private readonly IUpdateStrategy<IFRMaterial> frStrategy = new FRUpdateStrategy();
|
||||
private readonly IUpdateStrategy<IConcreteLibMaterial> concreteStrategy = new ConcreteLibUpdateStrategy();
|
||||
private readonly IUpdateStrategy<IReinforcementLibMaterial> reinforcementStrategy = new ReinforcementLibUpdateStrategy();
|
||||
private IUpdateStrategy<IElasticMaterial> elasticStrategy;
|
||||
private IUpdateStrategy<IFRMaterial> frStrategy;
|
||||
private IUpdateStrategy<IConcreteLibMaterial> concreteStrategy;
|
||||
private IUpdateStrategy<IReinforcementLibMaterial> reinforcementStrategy;
|
||||
public MaterialUpdateStrategy(IUpdateStrategy<IElasticMaterial> elasticStrategy,
|
||||
IUpdateStrategy<IFRMaterial> frStrategy,
|
||||
IUpdateStrategy<IConcreteLibMaterial> concreteStrategy,
|
||||
IUpdateStrategy<IReinforcementLibMaterial> reinforcementStrategy
|
||||
)
|
||||
{
|
||||
this.elasticStrategy = elasticStrategy;
|
||||
this.frStrategy = frStrategy;
|
||||
this.concreteStrategy = concreteStrategy;
|
||||
this.reinforcementStrategy= reinforcementStrategy;
|
||||
}
|
||||
public MaterialUpdateStrategy() : this(
|
||||
new ElasticUpdateStrategy(),
|
||||
new FRUpdateStrategy(),
|
||||
new ConcreteLibUpdateStrategy(),
|
||||
new ReinforcementLibUpdateStrategy()
|
||||
) { }
|
||||
|
||||
public void Update(IHeadMaterial targetObject, IHeadMaterial sourceObject)
|
||||
{
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.Color = sourceObject.Color;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,11 +8,20 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal class ReinforcementLibUpdateStrategy : IUpdateStrategy<IReinforcementLibMaterial>
|
||||
public class ReinforcementLibUpdateStrategy : IUpdateStrategy<IReinforcementLibMaterial>
|
||||
{
|
||||
LibMaterialUpdateStrategy libUpdateStrategy = new LibMaterialUpdateStrategy();
|
||||
private IUpdateStrategy<ILibMaterial> libUpdateStrategy;
|
||||
public ReinforcementLibUpdateStrategy(IUpdateStrategy<ILibMaterial> libUpdateStrategy)
|
||||
{
|
||||
this.libUpdateStrategy = libUpdateStrategy;
|
||||
}
|
||||
public ReinforcementLibUpdateStrategy() : this(new LibMaterialUpdateStrategy())
|
||||
{
|
||||
|
||||
}
|
||||
public void Update(IReinforcementLibMaterial targetObject, IReinforcementLibMaterial sourceObject)
|
||||
{
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
libUpdateStrategy.Update(targetObject, sourceObject);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
private readonly List<IMaterialLogic> materialLogics;
|
||||
|
||||
public ILibMaterialEntity MaterialEntity { get; set; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; set; }
|
||||
public IMaterialLogic MaterialLogic { get; set; }
|
||||
|
||||
public List<IMaterialLogic> MaterialLogics => materialLogics;
|
||||
|
||||
Reference in New Issue
Block a user