Refactoring: add some button icons
This commit is contained in:
@@ -22,7 +22,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public List<INdmPrimitive> Primitives { get; private set; } = new();
|
||||
public ICompressedMember CompressedMember { get; set; } = new CompressedMember() { Buckling = false};
|
||||
public IAccuracy Accuracy { get; set; } = new Accuracy() {IterationAccuracy = 0.001d, MaxIterationCount = 1000};
|
||||
public List<IForceCombinationList> ForceCombinationLists { get; set; }
|
||||
//public List<IForceCombinationList> ForceCombinationLists { get; set; }
|
||||
|
||||
public ForceCalculatorInputData(Guid id)
|
||||
{
|
||||
|
||||
@@ -12,12 +12,15 @@ using StructureHelperLogics.Services.NdmPrimitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class ForceCalculatorLogic : IForceCalculatorLogic
|
||||
{
|
||||
private ForcesResults result;
|
||||
private IProcessorLogic<IForceTuple> eccentricityLogic;
|
||||
private ForceTupleBucklingLogic bucklingLogic;
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
private List<IForceCombinationList> combinationLists;
|
||||
|
||||
public IForceCalculatorInputData InputData { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
@@ -37,7 +40,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
IsValid = true
|
||||
};
|
||||
foreach (var combination in InputData.ForceCombinationLists)
|
||||
foreach (var combination in combinationLists)
|
||||
{
|
||||
foreach (var tuple in combination.DesignForces)
|
||||
{
|
||||
@@ -176,10 +179,10 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
private void GetCombinations()
|
||||
{
|
||||
InputData.ForceCombinationLists = new List<IForceCombinationList>();
|
||||
combinationLists = new List<IForceCombinationList>();
|
||||
foreach (var item in InputData.ForceActions)
|
||||
{
|
||||
InputData.ForceCombinationLists.Add(item.GetCombinations());
|
||||
combinationLists.AddRange(item.GetCombinations());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ using StructureHelperLogics.Services;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class ForceTupleCalculator : IForceTupleCalculator
|
||||
{
|
||||
IForceTupleTraceResultLogic forceTupleTraceResultLogic;
|
||||
IForcesTupleResult result;
|
||||
private ICheckInputDataLogic<IForceTupleInputData> checkInputDataLogic;
|
||||
private IForceTupleCalcLogic calcLogic;
|
||||
|
||||
@@ -7,12 +7,26 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data fo roce tuple calculator
|
||||
/// </summary>
|
||||
public interface IForceCalculatorInputData : IInputData, ISaveable, IHasPrimitives, IHasForceActions
|
||||
{
|
||||
/// <summary>
|
||||
/// Accuracy of calculating
|
||||
/// </summary>
|
||||
IAccuracy Accuracy { get; set; }
|
||||
List<CalcTerms> CalcTermsList { get; }
|
||||
ICompressedMember CompressedMember { get; set; }
|
||||
List<IForceCombinationList> ForceCombinationLists { get; set; }
|
||||
/// <summary>
|
||||
/// List of limit states, available for calculating
|
||||
/// </summary>
|
||||
List<LimitStates> LimitStatesList { get; }
|
||||
/// <summary>
|
||||
/// List of type of duration, available for calculation
|
||||
/// </summary>
|
||||
List<CalcTerms> CalcTermsList { get; }
|
||||
/// <summary>
|
||||
/// Settings for calculating of stability fo compressed members
|
||||
/// </summary>
|
||||
ICompressedMember CompressedMember { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic for processing of calculation for ForceTuplaCalculator
|
||||
/// </summary>
|
||||
public interface IForceCalculatorLogic : ILogic, IHasActionByResult
|
||||
{
|
||||
IForceCalculatorInputData InputData { get; set; }
|
||||
|
||||
@@ -7,8 +7,14 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
/// <summary>
|
||||
/// Calculator for obtaining solution from loader calculator
|
||||
/// </summary>
|
||||
public interface IForceTupleCalculator : ICalculator, IHasActionByResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data for analysis
|
||||
/// </summary>
|
||||
IForceTupleInputData InputData {get;set;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public interface IForceTupleInputData : IInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of ndma-parts for calculation
|
||||
/// Collection of ndm-parts for calculation
|
||||
/// </summary>
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
|
||||
{
|
||||
public class GeometryCalculator : IGeometryCalculator
|
||||
{
|
||||
TextParametersLogic parametersLogic;
|
||||
IParametersLogic parametersLogic;
|
||||
IGeometryResult geometryResult;
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -19,12 +19,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
|
||||
|
||||
public Guid Id => throw new NotImplementedException();
|
||||
|
||||
public GeometryCalculator(IEnumerable<INdm> ndms, IStrainMatrix strainMatrix)
|
||||
{
|
||||
parametersLogic = new TextParametersLogic(ndms, strainMatrix);
|
||||
}
|
||||
|
||||
public GeometryCalculator(TextParametersLogic parametersLogic)
|
||||
public GeometryCalculator(IParametersLogic parametersLogic)
|
||||
{
|
||||
this.parametersLogic = parametersLogic;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
|
||||
public class GetTupleInputDatasLogic : IGetTupleInputDatasLogic
|
||||
{
|
||||
public List<IForceAction> ForceActions { get; set; }
|
||||
@@ -24,7 +25,9 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public CalcTerms ShortTerm { get; set; }
|
||||
public IUserCrackInputData UserCrackInputData { get; set; }
|
||||
|
||||
public GetTupleInputDatasLogic(List<INdmPrimitive> primitives, List<IForceAction> forceActions, IUserCrackInputData userCrackInputData)
|
||||
public GetTupleInputDatasLogic(List<INdmPrimitive> primitives,
|
||||
List<IForceAction> forceActions,
|
||||
IUserCrackInputData userCrackInputData)
|
||||
{
|
||||
Primitives = primitives;
|
||||
ForceActions = forceActions;
|
||||
@@ -39,31 +42,42 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
CheckInputData();
|
||||
foreach (var action in ForceActions)
|
||||
{
|
||||
var tuple = GetTuplesByActions(action);
|
||||
if (tuple.isValid == false)
|
||||
var tuples = GetCrackTupleByActions(action);
|
||||
foreach (var tuple in tuples)
|
||||
{
|
||||
resultList.Add(new TupleCrackInputData()
|
||||
{
|
||||
IsValid = false,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
resultList.Add(new TupleCrackInputData()
|
||||
{
|
||||
IsValid = true,
|
||||
TupleName = action.Name,
|
||||
LongTermTuple = tuple.LongTuple,
|
||||
ShortTermTuple = tuple.ShortTuple,
|
||||
Primitives = Primitives,
|
||||
UserCrackInputData = UserCrackInputData
|
||||
});
|
||||
var tupleCrackInputDatas = GetTupleCrackInputDatas(action, tuple);
|
||||
resultList.AddRange(tupleCrackInputDatas);
|
||||
}
|
||||
}
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationHasDone);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
private List<TupleCrackInputData> GetTupleCrackInputDatas(IForceAction action, CrackTuple tuple)
|
||||
{
|
||||
List<TupleCrackInputData> resultList = new();
|
||||
if (tuple.IsValid == false)
|
||||
{
|
||||
resultList.Add(new TupleCrackInputData()
|
||||
{
|
||||
IsValid = false,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
resultList.Add(new TupleCrackInputData()
|
||||
{
|
||||
IsValid = true,
|
||||
TupleName = action.Name,
|
||||
LongTermTuple = tuple.LongTuple,
|
||||
ShortTermTuple = tuple.ShortTuple,
|
||||
Primitives = Primitives,
|
||||
UserCrackInputData = UserCrackInputData
|
||||
});
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
private void CheckInputData()
|
||||
{
|
||||
if (ForceActions is null)
|
||||
@@ -73,25 +87,47 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
}
|
||||
}
|
||||
|
||||
private (bool isValid, IForceTuple? LongTuple, IForceTuple? ShortTuple) GetTuplesByActions(IForceAction action)
|
||||
private List<CrackTuple> GetCrackTupleByActions(IForceAction action)
|
||||
{
|
||||
var combinations = action.GetCombinations();
|
||||
List<CrackTuple> crackTuples = new();
|
||||
foreach (var item in combinations)
|
||||
{
|
||||
var crackTuple = GetCrackTupleByCombination(item.DesignForces);
|
||||
crackTuples.Add(crackTuple);
|
||||
}
|
||||
|
||||
return crackTuples;
|
||||
}
|
||||
|
||||
private CrackTuple GetCrackTupleByCombination(List<IDesignForceTuple> combination)
|
||||
{
|
||||
IForceTuple longTuple, shortTuple;
|
||||
var combinations = action.GetCombinations().DesignForces;
|
||||
try
|
||||
{
|
||||
longTuple = GetTupleByCombination(combinations, LimitState, LongTerm);
|
||||
longTuple = GetTupleByCombination(combination, LimitState, LongTerm);
|
||||
TraceLogger?.AddMessage("Long term force combination");
|
||||
TraceLogger?.AddEntry(new TraceTablesFactory().GetByForceTuple(longTuple));
|
||||
shortTuple = GetTupleByCombination(combinations, LimitState, ShortTerm);
|
||||
shortTuple = GetTupleByCombination(combination, LimitState, ShortTerm);
|
||||
TraceLogger?.AddMessage("Short term force combination");
|
||||
TraceLogger?.AddEntry(new TraceTablesFactory().GetByForceTuple(shortTuple));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TraceLogger?.AddMessage("Force combination is not obtained: \n" + ex, TraceLogStatuses.Error);
|
||||
return (false, null, null);
|
||||
return new CrackTuple()
|
||||
{
|
||||
IsValid = false
|
||||
};
|
||||
}
|
||||
return (true, longTuple, shortTuple);
|
||||
|
||||
var result = new CrackTuple()
|
||||
{
|
||||
IsValid = true,
|
||||
LongTuple = longTuple,
|
||||
ShortTuple = shortTuple
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
private static IForceTuple GetTupleByCombination(List<IDesignForceTuple> combinations, LimitStates limitState, CalcTerms calcTerm)
|
||||
@@ -101,5 +137,12 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
.Single()
|
||||
.ForceTuple;
|
||||
}
|
||||
|
||||
private class CrackTuple
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public IForceTuple? LongTuple { get; set; }
|
||||
public IForceTuple? ShortTuple { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,19 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic for preparing tuple data for crack calculator
|
||||
/// </summary>
|
||||
public interface IGetTupleInputDatasLogic : ILogic, IHasPrimitives, IHasForceActions
|
||||
{
|
||||
LimitStates LimitState { get; set; }
|
||||
CalcTerms LongTerm { get; set; }
|
||||
CalcTerms ShortTerm { get; set; }
|
||||
List<TupleCrackInputData> GetTupleInputDatas();
|
||||
IUserCrackInputData UserCrackInputData { get; set; }
|
||||
/// <summary>
|
||||
/// Returns collection of tuples for crack calculations
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<TupleCrackInputData> GetTupleInputDatas();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user