Add extended force tuple result
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance local:CrossSectionViewModel}"
|
d:DataContext="{d:DesignInstance local:CrossSectionViewModel}"
|
||||||
Title="Cross-Section NDM Analysis" Height="700" Width="1000" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
Title="Cross-Section NDM Analysis" Height="700" Width="1100" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
|
<DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
|
||||||
<dataTemplates:RectangleTemplate/>
|
<dataTemplates:RectangleTemplate/>
|
||||||
|
|||||||
15
StructureHelperCommon/Models/Shapes/IPoint2DRange.cs
Normal file
15
StructureHelperCommon/Models/Shapes/IPoint2DRange.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Shapes
|
||||||
|
{
|
||||||
|
public interface IPoint2DRange : ISaveable
|
||||||
|
{
|
||||||
|
IPoint2D StartPoint { get; set; }
|
||||||
|
IPoint2D EndPoint { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,7 +74,7 @@ namespace StructureHelperCommon.Models.Shapes
|
|||||||
// compute angle from each criterion
|
// compute angle from each criterion
|
||||||
double byAngle = options.AngleStepRadians;
|
double byAngle = options.AngleStepRadians;
|
||||||
double byCount = arcAngle / options.SegmentCount;
|
double byCount = arcAngle / options.SegmentCount;
|
||||||
double byLength = 2 * Math.Asin(options.MaxSegmentLength / (2 * radius));
|
double byLength = 2 * Math.Asin(options.MaxSegmentLength * metresToMillimeters / (2 * radius));
|
||||||
|
|
||||||
return options.Mode switch
|
return options.Mode switch
|
||||||
{
|
{
|
||||||
|
|||||||
20
StructureHelperCommon/Models/Shapes/Point2DRange.cs
Normal file
20
StructureHelperCommon/Models/Shapes/Point2DRange.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Shapes
|
||||||
|
{
|
||||||
|
public class Point2DRange : IPoint2DRange
|
||||||
|
{
|
||||||
|
public Guid Id { get; }
|
||||||
|
public IPoint2D StartPoint { get; set; } = new Point2D();
|
||||||
|
public IPoint2D EndPoint { get; set; } = new Point2D();
|
||||||
|
|
||||||
|
public Point2DRange(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
StructureHelperCommon/Models/States/IStateCalcTermPair.cs
Normal file
13
StructureHelperCommon/Models/States/IStateCalcTermPair.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.States
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Implements pair of limit state and calculeation term
|
||||||
|
/// </summary>
|
||||||
|
public interface IStateCalcTermPair
|
||||||
|
{
|
||||||
|
LimitStates LimitState { get; set; }
|
||||||
|
CalcTerms CalcTerm { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
13
StructureHelperCommon/Models/States/StateCalcTermPair.cs
Normal file
13
StructureHelperCommon/Models/States/StateCalcTermPair.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.States
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public class StateCalcTermPair : IStateCalcTermPair
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public LimitStates LimitState { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public CalcTerms CalcTerm { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.States
|
||||||
|
{
|
||||||
|
public class StateCalcTermPairUpdateStrategy : IUpdateStrategy<IStateCalcTermPair>
|
||||||
|
{
|
||||||
|
public void Update(IStateCalcTermPair targetObject, IStateCalcTermPair sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(targetObject);
|
||||||
|
CheckObject.IsNull(sourceObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
targetObject.LimitState = sourceObject.LimitState;
|
||||||
|
targetObject.CalcTerm = sourceObject.CalcTerm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using StructureHelperCommon.Models.States;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||||
|
{
|
||||||
|
public class ExtendedForceTupleResult : IExtendedForceTupleResult
|
||||||
|
{
|
||||||
|
public IStateCalcTermPair StateCalcTermPair { get; set; } = new StateCalcTermPair();
|
||||||
|
public IForcesTupleResult ForcesTupleResut { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,6 +60,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
{
|
{
|
||||||
IsValid = true,
|
IsValid = true,
|
||||||
Description = string.Empty,
|
Description = string.Empty,
|
||||||
|
InputData = InputData,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ILoaderResults LoaderResults { get; set; }
|
public ILoaderResults LoaderResults { get; set; }
|
||||||
|
|
||||||
|
public IForceTupleInputData InputData { get; set; }
|
||||||
|
|
||||||
public ForcesTupleResult()
|
public ForcesTupleResult()
|
||||||
{
|
{
|
||||||
DesignForceTuple = new DesignForceTuple();
|
DesignForceTuple = new DesignForceTuple();
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using StructureHelperCommon.Models.States;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||||
|
{
|
||||||
|
public interface IExtendedForceTupleResult
|
||||||
|
{
|
||||||
|
IStateCalcTermPair StateCalcTermPair { get; set; }
|
||||||
|
IForcesTupleResult ForcesTupleResut { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
{
|
{
|
||||||
public interface IForcesTupleResult : IResult
|
public interface IForcesTupleResult : IResult
|
||||||
{
|
{
|
||||||
|
IForceTupleInputData InputData { get; set; }
|
||||||
IDesignForceTuple DesignForceTuple { get; set; }
|
IDesignForceTuple DesignForceTuple { get; set; }
|
||||||
ILoaderResults LoaderResults { get; set; }
|
ILoaderResults LoaderResults { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
{
|
{
|
||||||
IsValid = true,
|
IsValid = true,
|
||||||
Description = string.Empty,
|
Description = string.Empty,
|
||||||
|
InputData = InputData,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public interface IValueDiagramCalculator : ICalculator
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.States;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Implements input data for Value diagram calculator
|
||||||
|
/// </summary>
|
||||||
|
public interface IValueDiagramCalculatorInputData : ISaveable, IHasForceActions, IHasPrimitives
|
||||||
|
{
|
||||||
|
IStateCalcTermPair StateTermPair { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Collection of diagram for calculation
|
||||||
|
/// </summary>
|
||||||
|
List<IValueDigram> Digrams { get; }
|
||||||
|
bool CheckStrainLimit { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public interface IValueDiagramCalculatorResult : IResult
|
||||||
|
{
|
||||||
|
IValueDiagramCalculatorInputData? InputData { get; set; }
|
||||||
|
List<IPoint2D> Points { get; set; }
|
||||||
|
List<IForcesTupleResult> ForceTupleResults { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public interface IValueDigram : ISaveable
|
||||||
|
{
|
||||||
|
IPoint2DRange Point2DRange { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public interface IValueDiagramCalculatorLogic : ILogic
|
||||||
|
{
|
||||||
|
IValueDiagramCalculatorInputData InputData { get; set; }
|
||||||
|
IValueDiagramCalculatorResult GetResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
using StructureHelperLogics.Services.NdmPrimitives;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public class ValueDiagramCalculatorLogic : IValueDiagramCalculatorLogic
|
||||||
|
{
|
||||||
|
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||||
|
|
||||||
|
private IValueDiagramCalculatorResult result;
|
||||||
|
public IValueDiagramCalculatorInputData InputData { get; set; }
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
public IValueDiagramCalculatorResult GetResult()
|
||||||
|
{
|
||||||
|
PrepareResult();
|
||||||
|
GetPoints();
|
||||||
|
CalculateTupleResults();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CalculateTupleResults()
|
||||||
|
{
|
||||||
|
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||||
|
{
|
||||||
|
Primitives = InputData.Primitives,
|
||||||
|
LimitState = InputData.StateTermPair.LimitState,
|
||||||
|
CalcTerm = InputData.StateTermPair.CalcTerm,
|
||||||
|
TraceLogger = TraceLogger
|
||||||
|
};
|
||||||
|
var ndms = triangulateLogic.GetNdms();
|
||||||
|
foreach (var forceAction in InputData.ForceActions)
|
||||||
|
{
|
||||||
|
var combination = forceAction.GetCombinations();
|
||||||
|
List<IForceTuple> forceTuples = [];
|
||||||
|
foreach (var action in combination)
|
||||||
|
{
|
||||||
|
var actionCombination = action
|
||||||
|
.DesignForces
|
||||||
|
.Where(x => x.LimitState == InputData.StateTermPair.LimitState && x.CalcTerm == InputData.StateTermPair.CalcTerm);
|
||||||
|
}
|
||||||
|
ForceTupleInputData forceTupleInputData = new()
|
||||||
|
{
|
||||||
|
NdmCollection = ndms,
|
||||||
|
Accuracy = new Accuracy(),
|
||||||
|
CheckStrainLimit = true,
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetPoints()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PrepareResult()
|
||||||
|
{
|
||||||
|
result = new ValueDiagramCalculatorResult()
|
||||||
|
{
|
||||||
|
InputData = InputData,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public class ValueDiagramCalculator : IValueDiagramCalculator
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public bool ShowTraceData { get; set; }
|
||||||
|
|
||||||
|
public IResult Result => throw new NotImplementedException();
|
||||||
|
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
public Guid Id { get; }
|
||||||
|
|
||||||
|
public ValueDiagramCalculator(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperCommon.Models.States;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public class ValueDiagramCalculatorInputData : IValueDiagramCalculatorInputData
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public Guid Id { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public List<IValueDigram> Digrams { get; } = [];
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public List<IForceAction> ForceActions { get; } = [];
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public List<INdmPrimitive> Primitives { get; } = [];
|
||||||
|
public IStateCalcTermPair StateTermPair { get; set; } = new StateCalcTermPair() { LimitState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm};
|
||||||
|
public bool CheckStrainLimit { get; set; } = true;
|
||||||
|
|
||||||
|
public ValueDiagramCalculatorInputData(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||||
|
{
|
||||||
|
public class ValueDiagramCalculatorResult : IValueDiagramCalculatorResult
|
||||||
|
{
|
||||||
|
public IValueDiagramCalculatorInputData? InputData { get; set; }
|
||||||
|
|
||||||
|
public List<IPoint2D> Points { get; set; } = [];
|
||||||
|
|
||||||
|
public List<IForcesTupleResult> ForceTupleResults { get; set; } = [];
|
||||||
|
|
||||||
|
public bool IsValid { get; set; } = true;
|
||||||
|
public string? Description { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ using StructureHelperCommon.Infrastructures.Exceptions;
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Services.Exports;
|
using StructureHelperCommon.Services.Exports;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||||
{
|
{
|
||||||
@@ -35,7 +36,8 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(dxfEntity));
|
// just skip all types of primitives
|
||||||
|
// throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(dxfEntity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user