Add beam shear window
This commit is contained in:
@@ -9,10 +9,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class BeamShearCalculator : IBeamShearCalculator
|
||||
public class BeamShearCalculator : IBeamShearCalculator
|
||||
{
|
||||
private ICheckInputDataLogic<IBeamShearCalculatorInputData> checkInputDataLogic;
|
||||
IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> calculationLogic;
|
||||
private IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> calculationLogic;
|
||||
private IBeamShearCalculatorResult result;
|
||||
|
||||
public Guid Id { get; }
|
||||
@@ -23,6 +23,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public BeamShearCalculator(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
|
||||
@@ -26,5 +26,19 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public void DeleteAction(IBeamShearAction action)
|
||||
{
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
public void DeleteSection(IBeamShearSection section)
|
||||
{
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
public void DeleteStirrup(IStirrup stirrup)
|
||||
{
|
||||
//nothing to do
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,7 +14,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
public List<IBeamShearAction> BeamShearActions {get;}
|
||||
public List<IBeamShearAction> BeamShearActions { get; } = new();
|
||||
|
||||
public List<ICalculator> Calculators { get; } = new();
|
||||
|
||||
@@ -44,5 +45,48 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteSection(IBeamShearSection section)
|
||||
{
|
||||
foreach (var calculator in Calculators)
|
||||
{
|
||||
if (calculator is IBeamShearCalculator beamShearCalculator)
|
||||
{
|
||||
if (beamShearCalculator.InputData.ShearSections.Contains(section))
|
||||
{
|
||||
beamShearCalculator.InputData.DeleteSection(section);
|
||||
beamShearCalculator.InputData.ShearSections.Remove(section);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void DeleteAction(IBeamShearAction action)
|
||||
{
|
||||
foreach (var calculator in Calculators)
|
||||
{
|
||||
if (calculator is IBeamShearCalculator beamShearCalculator)
|
||||
{
|
||||
if (beamShearCalculator.InputData.BeamShearActions.Contains(action))
|
||||
{
|
||||
beamShearCalculator.InputData.DeleteAction(action);
|
||||
beamShearCalculator.InputData.BeamShearActions.Remove(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void DeleteStirrup(IStirrup stirrup)
|
||||
{
|
||||
foreach (var calculator in Calculators)
|
||||
{
|
||||
if (calculator is IBeamShearCalculator beamShearCalculator)
|
||||
{
|
||||
if (beamShearCalculator.InputData.Stirrups.Contains(stirrup))
|
||||
{
|
||||
beamShearCalculator.InputData.DeleteStirrup(stirrup);
|
||||
beamShearCalculator.InputData.Stirrups.Remove(stirrup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -12,16 +8,17 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public Guid Id { get; }
|
||||
public string? Name { get; set; }
|
||||
public IConcreteLibMaterial Material { get; set; }
|
||||
|
||||
public IShape Shape { get; }
|
||||
/// <inheritdoc/>
|
||||
public IMaterialStrength MaterialStrength { get; } = new MaterialStrengthByLibMaterial(Guid.NewGuid(), new ConcreteLibMaterial(Guid.NewGuid()));
|
||||
/// <inheritdoc/>
|
||||
public IShape Shape { get; } = new RectangleShape(Guid.NewGuid()) { Height = 0.6, Width = 0.4};
|
||||
|
||||
public double CenterCover { get; set; }
|
||||
|
||||
public BeamShearSection(Guid id, IShape shape)
|
||||
|
||||
public BeamShearSection(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
Shape = shape;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public enum ShearSectionTemplateTypes
|
||||
{
|
||||
Rectangle,
|
||||
}
|
||||
public static class BeamShearTemplatesFactory
|
||||
{
|
||||
public static IBeamShearRepository GetTemplateRepository(ShearSectionTemplateTypes templateType)
|
||||
{
|
||||
if (templateType is ShearSectionTemplateTypes.Rectangle)
|
||||
{
|
||||
return GetRectangleSection();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(templateType));
|
||||
}
|
||||
}
|
||||
|
||||
private static IBeamShearRepository GetRectangleSection()
|
||||
{
|
||||
BeamShearRepository shearRepository = new(Guid.Empty);
|
||||
BeamShearSection section = new(Guid.Empty) { Name = "New shear section"};
|
||||
shearRepository.ShearSections.Add(section);
|
||||
StirrupByUniformRebar stirrupByUniformRebar = new(Guid.Empty) { Name = "New uniform stirrup"};
|
||||
shearRepository.Stirrups.Add(stirrupByUniformRebar);
|
||||
BeamShearCalculator beamShearCalculator = new(Guid.Empty) { Name = "New shear calculator"};
|
||||
beamShearCalculator.InputData.ShearSections.Add(section);
|
||||
beamShearCalculator.InputData.Stirrups.Add(stirrupByUniformRebar);
|
||||
shearRepository.Calculators.Add(beamShearCalculator);
|
||||
return shearRepository;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
@@ -18,11 +19,11 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <summary>
|
||||
/// Concrete of cross-section
|
||||
/// </summary>
|
||||
IConcreteLibMaterial Material { get; set; }
|
||||
IMaterialStrength MaterialStrength { get;}
|
||||
/// <summary>
|
||||
/// Shape of cross-section
|
||||
/// </summary>
|
||||
IShape Shape {get;}
|
||||
IShape Shape { get; }
|
||||
/// <summary>
|
||||
/// Distance from edge of tension zone to center of the nearest reinforcement bar
|
||||
/// </summary>
|
||||
|
||||
@@ -9,5 +9,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public interface IHasBeamShearSections
|
||||
{
|
||||
List<IBeamShearSection> ShearSections { get; }
|
||||
void DeleteSection(IBeamShearSection section);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public interface IHasStirrups
|
||||
{
|
||||
List<IStirrup> Stirrups { get; }
|
||||
void DeleteStirrup(IStirrup stirrup);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearRepositoryAddUpdateStrategy : IUpdateStrategy<IBeamShearRepository>
|
||||
{
|
||||
public void Update(IBeamShearRepository targetObject, IBeamShearRepository sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||
targetObject.BeamShearActions.AddRange(sourceObject.BeamShearActions);
|
||||
targetObject.ShearSections.AddRange(sourceObject.ShearSections);
|
||||
targetObject.Stirrups.AddRange(sourceObject.Stirrups);
|
||||
targetObject.Calculators.AddRange(sourceObject.Calculators);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Guid Id { get; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IReinforcementLibMaterial Material { get; set; }
|
||||
@@ -24,6 +25,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <inheritdoc/>
|
||||
public double CompressedGap { get; set; } = 0;
|
||||
|
||||
public StirrupByUniformRebar(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelper.Models.Materials
|
||||
{
|
||||
|
||||
@@ -6,8 +6,16 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements logic for library concrete material
|
||||
/// </summary>
|
||||
public interface IConcreteLibMaterial : ILibMaterial, ICrackedMaterial
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.Materials.Logics;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Models.Tables;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user