Logic for interaction diagram was added

This commit is contained in:
Evgeny Redikultsev
2023-12-09 22:05:02 +05:00
parent f46c0dd814
commit e6a9322a36
30 changed files with 643 additions and 106 deletions

View File

@@ -0,0 +1,64 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Shapes;
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve
{
public enum ForceCurveLogic
{
N_Mx,
N_My,
Mx_My
}
public static class ConvertLogicFactory
{
public static ConstOneDirectionConverter GetLogic(ForceCurveLogic logic)
{
var strings = ProgramSetting.GeometryNames;
if (logic == ForceCurveLogic.N_Mx)
{
return new ConstOneDirectionConverter(Directions.Y, Guid.Parse("4d8637b6-98bc-4e7f-8006-01fc679c21ee"))
{
Name = "N-Mx",
XAxisName = strings.FullMomFstName,
YAxisName = strings.FullLongForceName,
ConstAxisName = strings.FullMomSndName,
XForceType = ForceTypes.MomentMx,
YForceType = ForceTypes.Force,
ZForceType = ForceTypes.MomentMy,
};
}
else if (logic == ForceCurveLogic.N_My)
{
return new ConstOneDirectionConverter(Directions.X, Guid.Parse("119ff666-7121-4a34-b76c-5ada3bd490f3"))
{
Name = "N-My",
XAxisName = strings.FullMomSndName,
YAxisName = strings.FullLongForceName,
ConstAxisName = strings.FullMomFstName,
XForceType = ForceTypes.MomentMy,
YForceType = ForceTypes.Force,
ZForceType = ForceTypes.MomentMx,
};
}
else if (logic == ForceCurveLogic.Mx_My)
{
return new ConstOneDirectionConverter(Directions.Z, Guid.Parse("58020401-bedf-4b79-9131-86f7078d6c49"))
{
Name = "Mx-My",
XAxisName = strings.FullMomFstName,
YAxisName = strings.FullMomSndName,
ConstAxisName = strings.FullLongForceName,
XForceType = ForceTypes.MomentMx,
YForceType = ForceTypes.MomentMy,
ZForceType = ForceTypes.Force,
};
}
else
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(logic));
}
}
}
}

View File

@@ -0,0 +1,21 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve
{
public static class ConvertLogics
{
private static readonly List<ConstOneDirectionConverter> converterLogics;
public static List<ConstOneDirectionConverter> ConverterLogics => converterLogics ??
new List<ConstOneDirectionConverter>()
{
ConvertLogicFactory.GetLogic(ForceCurveLogic.N_Mx),
ConvertLogicFactory.GetLogic(ForceCurveLogic.N_My),
ConvertLogicFactory.GetLogic(ForceCurveLogic.Mx_My),
};
}
}

View File

@@ -18,19 +18,20 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
private ForceTuple tuple;
private ForceTupleInputData inputData;
public IEnumerable<INdm> Ndms { get; set; }
public double My { get; set; }
public IConvert2DPointTo3DPointLogic ConvertLogic { get; set; }
public PredicateFactory()
{
inputData = new();
calculator = new() { InputData = inputData };
}
public bool IsSectionFailure(IPoint2D point)
public bool IsSectionFailure(IPoint2D point2D)
{
var point3D = ConvertLogic.GetPoint3D(point2D);
tuple = new()
{
Nz = point.Y,
Mx = point.X,
My = My
Nz = point3D.Z,
Mx = point3D.X,
My = point3D.Y
};
inputData.Tuple = tuple;
inputData.NdmCollection = Ndms;
@@ -39,14 +40,15 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
return !result.IsValid;
}
public bool IsSectionCracked(IPoint2D point)
public bool IsSectionCracked(IPoint2D point2D)
{
var logic = new HoleSectionCrackedLogic();
var point3D = ConvertLogic.GetPoint3D(point2D);
tuple = new()
{
Nz = point.Y,
Mx = point.X,
My = My
Nz = point3D.Z,
Mx = point3D.X,
My = point2D.Y
};
logic.Tuple = tuple;
logic.NdmCollection = Ndms;

View File

@@ -1,4 +1,6 @@
using System;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.LimitCurve;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -13,6 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public double YMax { get; set; }
public double YMin { get; set; }
public double ConstZ { get; set; }
public ConstOneDirectionConverter ConvertLogicEntity { get; set; }
public int PointCount { get; set; }
public SurroundData()
{
@@ -21,6 +24,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
YMax = 1e7d;
YMin = -1e7d;
PointCount = 80;
ConvertLogicEntity = ConvertLogics.ConverterLogics[0];
}
}
}