Change force tuple calculator result
This commit is contained in:
@@ -26,9 +26,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
static readonly CrackForceBynarySearchCalculator calculator = new();
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
|
||||
private List<IForcesTupleResult> ValidTupleList { get; set; }
|
||||
private List<IExtendedForceTupleCalculatorResult> ValidTupleList { get; set; }
|
||||
ArrayParameter<double> arrayParameter;
|
||||
private IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
private IEnumerable<IExtendedForceTupleCalculatorResult> TupleList { get; set; }
|
||||
private IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
|
||||
|
||||
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
@@ -40,7 +40,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
public CrackDiagramLogic(IEnumerable<IExtendedForceTupleCalculatorResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
TupleList = tupleList;
|
||||
NdmPrimitives = ndmPrimitives;
|
||||
@@ -92,20 +92,20 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
"Errors appeared during showing a graph, see detailed information");
|
||||
}
|
||||
|
||||
private void CalculateWithCrack(List<IForcesTupleResult> validTupleList, IEnumerable<INdmPrimitive> ndmPrimitives, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||
private void CalculateWithCrack(List<IExtendedForceTupleCalculatorResult> validTupleList, IEnumerable<INdmPrimitive> ndmPrimitives, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||
{
|
||||
var data = arrayParameter.Data;
|
||||
for (int i = 0; i < validTupleList.Count(); i++)
|
||||
{
|
||||
var valueList = new List<double>
|
||||
{
|
||||
validTupleList[i].DesignForceTuple.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
validTupleList[i].DesignForceTuple.ForceTuple.My * unitMoment.Multiplyer,
|
||||
validTupleList[i].DesignForceTuple.ForceTuple.Nz * unitForce.Multiplyer
|
||||
validTupleList[i].ForcesTupleResult.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
validTupleList[i].ForcesTupleResult.ForceTuple.My * unitMoment.Multiplyer,
|
||||
validTupleList[i].ForcesTupleResult.ForceTuple.Nz * unitForce.Multiplyer
|
||||
};
|
||||
calculator.InputData.EndTuple = validTupleList[i].DesignForceTuple.ForceTuple;
|
||||
var limitState = validTupleList[i].DesignForceTuple.LimitState;
|
||||
var calcTerm = validTupleList[i].DesignForceTuple.CalcTerm;
|
||||
calculator.InputData.EndTuple = validTupleList[i].ForcesTupleResult.ForceTuple;
|
||||
var limitState = validTupleList[i].StateCalcTermPair.LimitState;
|
||||
var calcTerm = validTupleList[i].StateCalcTermPair.CalcTerm;
|
||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
{
|
||||
Primitives = ndmPrimitives,
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
/// <summary>
|
||||
/// Collection of force results
|
||||
/// </summary>
|
||||
public List<IForcesTupleResult> TupleList { get; set; }
|
||||
public List<IExtendedForceTupleCalculatorResult> TupleResultList { get; set; }
|
||||
|
||||
//public Action<int> SetProgress { get; set; }
|
||||
|
||||
public ArrayParameter<double> GetCommonArray()
|
||||
{
|
||||
var labels = LabelsFactory.GetCommonLabels();
|
||||
arrayParameter = new ArrayParameter<double>(TupleList.Count(), labels);
|
||||
arrayParameter = new ArrayParameter<double>(TupleResultList.Count(), labels);
|
||||
Calculate();
|
||||
return arrayParameter;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
private void Calculate()
|
||||
{
|
||||
var data = arrayParameter.Data;
|
||||
for (int i = 0; i < TupleList.Count(); i++)
|
||||
for (int i = 0; i < TupleResultList.Count(); i++)
|
||||
{
|
||||
var valueList = ProcessResult(i);
|
||||
for (int j = 0; j < valueList.Count; j++)
|
||||
@@ -56,12 +56,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
return new List<double>
|
||||
{
|
||||
TupleList[i].DesignForceTuple.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
TupleList[i].DesignForceTuple.ForceTuple.My * unitMoment.Multiplyer,
|
||||
TupleList[i].DesignForceTuple.ForceTuple.Nz * unitForce.Multiplyer,
|
||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.Kx * unitCurvature.Multiplyer,
|
||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.Ky * unitCurvature.Multiplyer,
|
||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
|
||||
TupleResultList[i].ForcesTupleResult.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.ForceTuple.My * unitMoment.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.ForceTuple.Nz * unitForce.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Kx * unitCurvature.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Ky * unitCurvature.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
public interface IValuePointDiagramLogic
|
||||
{
|
||||
ForceCalculator Calculator { get; set; }
|
||||
IForceCalculator Calculator { get; set; }
|
||||
PointPrimitiveLogic PrimitiveLogic { get; set; }
|
||||
IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
IEnumerable<IExtendedForceTupleCalculatorResult> TupleList { get; set; }
|
||||
ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
|
||||
GenericResult<ArrayParameter<double>> GetArrayParameter();
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
||||
{
|
||||
@@ -21,9 +18,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private ValuePointsInterpolateViewModel viewModel;
|
||||
private IResult result;
|
||||
private ValuePointsInterpolationInputData inputData;
|
||||
public IForcesTupleResult SelectedResult { get; set; }
|
||||
public IExtendedForceTupleCalculatorResult SelectedResult { get; set; }
|
||||
public IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
|
||||
public ForceCalculator ForceCalculator { get; set; }
|
||||
public IForceCalculator ForceCalculator { get; set; }
|
||||
|
||||
|
||||
public ILongProcessLogic ProgressLogic { get; set; }
|
||||
@@ -31,20 +28,20 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public void InterpolateValuePoints()
|
||||
{
|
||||
var tuple = SelectedResult.DesignForceTuple ?? throw new StructureHelperException(ErrorStrings.NullReference + ": Design force combination");
|
||||
var tuple = SelectedResult.ForcesTupleResult.ForceTuple ?? throw new StructureHelperException(ErrorStrings.NullReference + ": Design force combination");
|
||||
PrepareInputData(tuple);
|
||||
viewModel = new ValuePointsInterpolateViewModel(inputData);
|
||||
if (ShowDialog() == false) { return; };
|
||||
ShowDiagram(result);
|
||||
}
|
||||
|
||||
private void PrepareInputData(IDesignForceTuple tuple)
|
||||
private void PrepareInputData(IForceTuple endTuple)
|
||||
{
|
||||
inputData = new ValuePointsInterpolationInputData()
|
||||
{
|
||||
FinishDesignForce = tuple.Clone() as IDesignForceTuple,
|
||||
LimitState = tuple.LimitState,
|
||||
CalcTerm = tuple.CalcTerm,
|
||||
StartForceTuple = new ForceTuple(),
|
||||
FinishForceTuple = endTuple.Clone() as IForceTuple,
|
||||
StateCalcTermPair = SelectedResult.StateCalcTermPair,
|
||||
};
|
||||
inputData.PrimitiveBases.AddRange(PrimitiveOperations.ConvertNdmPrimitivesToPrimitiveBase(NdmPrimitives));
|
||||
}
|
||||
@@ -54,7 +51,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var wnd = new ValuePointsInterpolateView(viewModel);
|
||||
wnd.ShowDialog();
|
||||
if (wnd.DialogResult != true) { return false; }
|
||||
interpolationLogic = new InterpolationProgressLogic(ForceCalculator, viewModel.ForceInterpolationViewModel.Result);
|
||||
interpolationLogic = new InterpolationProgressLogic(ForceCalculator, SelectedResult.StateCalcTermPair, viewModel.ForceInterpolationViewModel.Result);
|
||||
ProgressLogic = interpolationLogic;
|
||||
ShowProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
@@ -68,17 +65,17 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private void ShowDiagram(IResult result)
|
||||
{
|
||||
if (result.IsValid == false) { return; }
|
||||
if (result is not IForcesResults)
|
||||
if (result is not IForceCalculatorResult)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(IForcesResults), result));
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(IForceCalculatorResult), result));
|
||||
}
|
||||
var tupleResult = result as IForcesResults;
|
||||
var tupleResult = result as IForceCalculatorResult;
|
||||
var pointGraphLogic = new ShowValuePointDiagramLogic()
|
||||
{
|
||||
Calculator = interpolationLogic.InterpolateCalculator,
|
||||
PrimitiveLogic = viewModel.PrimitiveLogic,
|
||||
ValueDelegatesLogic = viewModel.ValueDelegatesLogic,
|
||||
TupleList = tupleResult.ForcesResultList
|
||||
TupleResultList = tupleResult.ForcesResultList
|
||||
};
|
||||
pointGraphLogic.ShowWindow();
|
||||
}
|
||||
|
||||
@@ -25,15 +25,15 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public IForceTuple ForceTuple { get; set; }
|
||||
public IEnumerable<INdmPrimitive> ndmPrimitives { get; set; }
|
||||
public void Show(IDesignForceTuple finishDesignTuple)
|
||||
public void Show(IForceTuple finishDesignTuple)
|
||||
{
|
||||
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
|
||||
var viewModel = new InterpolateTuplesViewModel(new ForceTuple(), finishDesignTuple, 100);
|
||||
viewModel.ForceInterpolationViewModel.StepCountVisible = false;
|
||||
var wndTuples = new InterpolateTuplesView(viewModel);
|
||||
wndTuples.ShowDialog();
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
var startDesignTuple = viewModel.ForceInterpolationViewModel.StartDesignForce.ForceTuple;
|
||||
var endDesignTuple = viewModel.ForceInterpolationViewModel.FinishDesignForce.ForceTuple;
|
||||
var startDesignTuple = viewModel.ForceInterpolationViewModel.StartDesignForce;
|
||||
var endDesignTuple = viewModel.ForceInterpolationViewModel.FinishDesignForce;
|
||||
FindCrackFactor(endDesignTuple, startDesignTuple);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
using StructureHelper.Windows.Graphs;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
@@ -19,9 +16,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
internal class ShowDiagramLogic : ILongProcessLogic
|
||||
{
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private IEnumerable<IForcesTupleResult> tupleList;
|
||||
private IEnumerable<IExtendedForceTupleCalculatorResult> tupleList;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private List<IForcesTupleResult> validTupleList;
|
||||
private List<IExtendedForceTupleCalculatorResult> validTupleList;
|
||||
|
||||
public int StepCount => validTupleList.Count();
|
||||
|
||||
@@ -60,13 +57,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
var factory = new DiagramFactory()
|
||||
{
|
||||
TupleList = validTupleList,
|
||||
TupleResultList = validTupleList,
|
||||
//SetProgress = SetProgress,
|
||||
};
|
||||
arrayParameter = factory.GetCommonArray();
|
||||
}
|
||||
|
||||
public ShowDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
public ShowDiagramLogic(IEnumerable<IExtendedForceTupleCalculatorResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
this.tupleList = tupleList;
|
||||
this.ndmPrimitives = ndmPrimitives;
|
||||
|
||||
@@ -1,27 +1,12 @@
|
||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Windows.Graphs;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -33,8 +18,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private IValuePointDiagramLogic pointDiagramLogic;
|
||||
|
||||
public IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
public ForceCalculator Calculator { get; set; }
|
||||
public IEnumerable<IExtendedForceTupleCalculatorResult> TupleResultList { get; set; }
|
||||
public IForceCalculator Calculator { get; set; }
|
||||
public PointPrimitiveLogic PrimitiveLogic { get; set; }
|
||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
|
||||
@@ -77,7 +62,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
private GenericResult<ArrayParameter<double>> GetResult()
|
||||
{
|
||||
pointDiagramLogic.TupleList = TupleList;
|
||||
pointDiagramLogic.TupleList = TupleResultList;
|
||||
pointDiagramLogic.PrimitiveLogic = PrimitiveLogic;
|
||||
pointDiagramLogic.Calculator = Calculator;
|
||||
pointDiagramLogic.ValueDelegatesLogic = ValueDelegatesLogic;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
@@ -10,9 +9,6 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
||||
{
|
||||
@@ -20,13 +16,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private List<(INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive)> pointCollection;
|
||||
private List<IForcesTupleResult> validTuplesList;
|
||||
private List<IExtendedForceTupleCalculatorResult> validTuplesList;
|
||||
private ArrayParameter<double> arrayOfValuesByPoint;
|
||||
private IEnumerable<ForceResultFunc> selectedDelegates;
|
||||
private string exceptionMessage;
|
||||
|
||||
public IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
public ForceCalculator Calculator { get; set; }
|
||||
public IEnumerable<IExtendedForceTupleCalculatorResult> TupleList { get; set; }
|
||||
public IForceCalculator Calculator { get; set; }
|
||||
public PointPrimitiveLogic PrimitiveLogic { get; set; }
|
||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
|
||||
@@ -106,14 +102,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ProcessPointByTuple(IForcesTupleResult tuple, int i)
|
||||
private void ProcessPointByTuple(IExtendedForceTupleCalculatorResult tupleResult, int i)
|
||||
{
|
||||
var values = new List<double>();
|
||||
var strainMatrix = tuple.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var strainMatrix = tupleResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
|
||||
foreach (var valuePoint in pointCollection)
|
||||
{
|
||||
var ndm = GetMockNdm(valuePoint, tuple);
|
||||
var ndm = GetMockNdm(valuePoint, tupleResult);
|
||||
|
||||
foreach (var valDelegate in selectedDelegates)
|
||||
{
|
||||
@@ -127,7 +123,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
var factory = new DiagramFactory()
|
||||
{
|
||||
TupleList = validTuplesList,
|
||||
TupleResultList = validTuplesList,
|
||||
//SetProgress = SetProgress,
|
||||
};
|
||||
arrayParameter = factory.GetCommonArray();
|
||||
@@ -135,10 +131,10 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var labels = GetValueLabels(selectedDelegates);
|
||||
arrayOfValuesByPoint = new ArrayParameter<double>(validTuplesList.Count(), labels);
|
||||
}
|
||||
private INdm GetMockNdm((INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive) valuePoint, IForcesTupleResult tuple)
|
||||
private INdm GetMockNdm((INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive) valuePoint, IExtendedForceTupleCalculatorResult tupleResult)
|
||||
{
|
||||
var limitState = tuple.DesignForceTuple.LimitState;
|
||||
var calcTerm = tuple.DesignForceTuple.CalcTerm;
|
||||
var limitState = tupleResult.StateCalcTermPair.LimitState;
|
||||
var calcTerm = tupleResult.StateCalcTermPair.CalcTerm;
|
||||
var material = valuePoint.ndmPrimitive.NdmElement.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
var userPrestrain = valuePoint.ndmPrimitive.NdmElement.UsersPrestrain;
|
||||
var autoPrestrain = valuePoint.ndmPrimitive.NdmElement.AutoPrestrain;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<ToolBar Name="CrackResult">
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowCrackResultCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show result step by step"
|
||||
<uc:ButtonToolTipEh HeaderText="Show crack result step by step"
|
||||
IconContent="{StaticResource CrackForces}"
|
||||
DescriptionText="Show proportional combination of forces where cracks are appeared"/>
|
||||
</Button.ToolTip>
|
||||
@@ -164,17 +164,17 @@
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Header="Valid" Binding="{Binding Path=IsValid}"/>
|
||||
<DataGridTextColumn Header="LimitState" Width="70" Binding="{Binding DesignForceTuple.LimitState}"/>
|
||||
<DataGridTextColumn Header="Duration" Width="70" Binding="{Binding DesignForceTuple.CalcTerm}"/>
|
||||
<DataGridTextColumn Header="Moment Mx" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.Mx, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Moment My" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.My, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Force Nz" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.Nz, Converter={StaticResource ForceConverter}}"/>
|
||||
<DataGridTextColumn Header="Kx" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.Kx}"/>
|
||||
<DataGridTextColumn Header="Ky" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.Ky}"/>
|
||||
<DataGridTextColumn Header="EpsZ" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.EpsZ}"/>
|
||||
<DataGridTextColumn Header="Accuracy" Width="90" Binding="{Binding LoaderResults.AccuracyRate}"/>
|
||||
<DataGridTextColumn Header="Max Iteration" Width="90" Binding="{Binding LoaderResults.IterationCounter}"/>
|
||||
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding Description}"/>
|
||||
<DataGridTextColumn Header="LimitState" Width="70" Binding="{Binding StateCalcTermPair.LimitState}"/>
|
||||
<DataGridTextColumn Header="Duration" Width="70" Binding="{Binding StateCalcTermPair.CalcTerm}"/>
|
||||
<DataGridTextColumn Header="Moment Mx" Width="90" Binding="{Binding ForcesTupleResult.InputData.ForceTuple.Mx, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Moment My" Width="90" Binding="{Binding ForcesTupleResult.InputData.ForceTuple.My, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Force Nz" Width="90" Binding="{Binding ForcesTupleResult.InputData.ForceTuple.Nz, Converter={StaticResource ForceConverter}}"/>
|
||||
<DataGridTextColumn Header="Kx" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Kx}"/>
|
||||
<DataGridTextColumn Header="Ky" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Ky}"/>
|
||||
<DataGridTextColumn Header="EpsZ" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.EpsZ}"/>
|
||||
<DataGridTextColumn Header="Accuracy" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.AccuracyRate}"/>
|
||||
<DataGridTextColumn Header="Max Iteration" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.IterationCounter}"/>
|
||||
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding ForcesTupleResult.Description}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource ResultValidness}" Content="{Binding ValidResultCounter}"/>
|
||||
|
||||
@@ -18,7 +18,6 @@ using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Exports;
|
||||
using StructureHelperCommon.Services.Exports.Factories;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses;
|
||||
@@ -42,13 +41,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
public class ForcesResultsViewModel : ViewModelBase
|
||||
{
|
||||
private ShowDiagramLogic showDiagramLogic;
|
||||
private ForceCalculator forceCalculator;
|
||||
private IForceCalculator forceCalculator;
|
||||
private ILongProcessLogic progressLogic;
|
||||
private ShowProgressLogic showProgressLogic;
|
||||
private InteractionDiagramLogic interactionDiagramLogic;
|
||||
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
|
||||
//private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
||||
private IForcesResults resultModel;
|
||||
private IForceCalculatorResult resultModel;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private IEnumerable<INdmPrimitive> selectedNdmPrimitives;
|
||||
private IEnumerable<INdm> ndms;
|
||||
@@ -56,7 +55,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
|
||||
public IForcesTupleResult? SelectedResult { get; set; }
|
||||
public IExtendedForceTupleCalculatorResult? SelectedResult { get; set; }
|
||||
private ICommand? showIsoFieldCommand;
|
||||
private ICommand? exportToCSVCommand;
|
||||
private ICommand? interpolateCommand;
|
||||
@@ -73,7 +72,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public ValidResultCounterVM ValidResultCounter { get; }
|
||||
|
||||
public IForcesResults ForcesResults
|
||||
public IForceCalculatorResult ForcesResults
|
||||
{
|
||||
get => resultModel;
|
||||
}
|
||||
@@ -149,7 +148,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
ShowInterpolationWindow(out interpolateTuplesViewModel, out wndTuples);
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interpolateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, SelectedResult.StateCalcTermPair, interpolateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
WindowTitle = "Interpolate forces"
|
||||
@@ -157,9 +156,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
showProgressLogic.Show();
|
||||
|
||||
var result = interpolationLogic.InterpolateCalculator.Result;
|
||||
if (result is IForcesResults)
|
||||
if (result is IForceCalculatorResult)
|
||||
{
|
||||
var tupleResult = result as IForcesResults;
|
||||
var tupleResult = result as IForceCalculatorResult;
|
||||
var diagramLogic = new ShowDiagramLogic(tupleResult.ForcesResultList, ndmPrimitives);
|
||||
showProgressLogic = new(diagramLogic)
|
||||
{
|
||||
@@ -179,7 +178,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, SelectedResult.StateCalcTermPair, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
WindowTitle = "Interpolate forces"
|
||||
@@ -187,9 +186,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
showProgressLogic.Show();
|
||||
|
||||
var result = interpolationLogic.InterpolateCalculator.Result;
|
||||
if (result is IForcesResults)
|
||||
if (result is IForceCalculatorResult)
|
||||
{
|
||||
var tupleResult = result as IForcesResults;
|
||||
var tupleResult = result as IForceCalculatorResult;
|
||||
var diagramLogic = new CrackDiagramLogic(tupleResult.ForcesResultList, ndmPrimitives);
|
||||
showProgressLogic = new(diagramLogic)
|
||||
{
|
||||
@@ -209,11 +208,11 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
private void ShowCrackResult()
|
||||
{
|
||||
showCrackResultLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
showCrackResultLogic.CalcTerm = CalcTerms.ShortTerm; //= SelectedResult.DesignForceTuple.CalcTerm;
|
||||
showCrackResultLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
|
||||
showCrackResultLogic.LimitState = SelectedResult.StateCalcTermPair.LimitState;
|
||||
showCrackResultLogic.CalcTerm = CalcTerms.ShortTerm;
|
||||
showCrackResultLogic.ForceTuple = SelectedResult.ForcesTupleResult.InputData.ForceTuple;
|
||||
showCrackResultLogic.ndmPrimitives = ndmPrimitives;
|
||||
showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
|
||||
showCrackResultLogic.Show(SelectedResult.ForcesTupleResult.InputData.ForceTuple.Clone() as IForceTuple);
|
||||
}
|
||||
|
||||
public ICommand InterpolateCommand
|
||||
@@ -235,7 +234,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, SelectedResult.StateCalcTermPair, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
progressLogic = interpolationLogic;
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
@@ -276,8 +275,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
private void ShowInterpolationWindow(out InterpolateTuplesViewModel interploateTuplesViewModel, out InterpolateTuplesView wndTuples)
|
||||
{
|
||||
IDesignForceTuple finishDesignTuple = SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple;
|
||||
interploateTuplesViewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
|
||||
ForceTuple startTuple = new();
|
||||
IForceTuple endTuple = SelectedResult.ForcesTupleResult.InputData.ForceTuple.Clone() as IForceTuple;
|
||||
interploateTuplesViewModel = new InterpolateTuplesViewModel(startTuple, endTuple, 100);
|
||||
wndTuples = new InterpolateTuplesView(interploateTuplesViewModel);
|
||||
wndTuples.ShowDialog();
|
||||
}
|
||||
@@ -308,7 +308,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
private void SetPrestrain()
|
||||
{
|
||||
var source = TupleConverter.ConvertToStrainTuple(SelectedResult.LoaderResults.StrainMatrix);
|
||||
var source = TupleConverter.ConvertToStrainTuple(SelectedResult.ForcesTupleResult.LoaderResults.StrainMatrix);
|
||||
var vm = new SetPrestrainViewModel(source);
|
||||
var wnd = new SetPrestrainView(vm);
|
||||
wnd.ShowDialog();
|
||||
@@ -336,9 +336,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var limitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
var strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var limitState = SelectedResult.StateCalcTermPair.LimitState;
|
||||
var calcTerm = SelectedResult.StateCalcTermPair.CalcTerm;
|
||||
|
||||
var primitiveSets = ShowAnchorageResult.GetPrimitiveSets(strainMatrix, limitState, calcTerm, ndmPrimitives);
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
@@ -363,7 +363,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var textParametrsLogic = new GeometryParametersLogic(ndms, strainMatrix);
|
||||
var calculator = new GeometryCalculator(textParametrsLogic);
|
||||
calculator.Run();
|
||||
@@ -392,7 +392,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var textParametrsLogic = new ForcesParametersLogic(ndms, strainMatrix);
|
||||
var calculator = new GeometryCalculator(textParametrsLogic);
|
||||
calculator.Run();
|
||||
@@ -412,10 +412,10 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
}
|
||||
|
||||
public ForcesResultsViewModel(ForceCalculator forceCalculator)
|
||||
public ForcesResultsViewModel(IForceCalculator forceCalculator)
|
||||
{
|
||||
this.forceCalculator = forceCalculator;
|
||||
resultModel = forceCalculator.Result as IForcesResults;
|
||||
resultModel = forceCalculator.Result as IForceCalculatorResult;
|
||||
ValidResultCounter = new(resultModel.ForcesResultList);
|
||||
ndmPrimitives = forceCalculator.InputData.Primitives;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
IStrainMatrix strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
IStrainMatrix strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(strainMatrix, ndms, ForceResultFuncFactory.GetResultFuncs());
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
isoFieldReport.Show();
|
||||
@@ -441,9 +441,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
private void GetNdms()
|
||||
{
|
||||
var limitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
|
||||
var limitState = SelectedResult.StateCalcTermPair.LimitState;
|
||||
var calcTerm = SelectedResult.StateCalcTermPair.CalcTerm;
|
||||
var triangulationOptions = new TriangulationOptions()
|
||||
{
|
||||
LimiteState = limitState,
|
||||
CalcTerm = calcTerm };
|
||||
var orderedNdmPrimitives = ndmPrimitives.OrderBy(x => x.VisualProperty.ZIndex);
|
||||
var ndmRange = new List<INdm>();
|
||||
foreach (var item in orderedNdmPrimitives)
|
||||
|
||||
Reference in New Issue
Block a user