Value points were added

This commit is contained in:
Evgeny Redikultsev
2024-03-02 21:40:13 +05:00
parent 2e8ebccc13
commit 4359b2c49b
41 changed files with 1127 additions and 439 deletions

View File

@@ -1,4 +1,5 @@
using StructureHelper.Windows.Graphs;
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
using StructureHelper.Windows.Graphs;
using StructureHelper.Windows.ViewModels.Errors;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
@@ -64,7 +65,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
var unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
var unitCurvature = CommonOperation.GetUnit(UnitTypes.Curvature, "1/m");
string[] labels = GetCrackLabels(unitForce, unitMoment, unitCurvature);
List<string> labels = GetCrackLabels(unitForce, unitMoment, unitCurvature);
arrayParameter = new ArrayParameter<double>(ValidTupleList.Count(), labels.Count(), labels);
CalculateWithCrack(ValidTupleList, NdmPrimitives, unitForce, unitMoment, unitCurvature);
}
@@ -131,18 +132,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
}
}
private static string[] GetCrackLabels(IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
private static List<string> GetCrackLabels(IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
{
const string crc = "Crc";
const string crcFactor = "CrcSofteningFactor";
return new string[]
var labels = LabelsFactory.GetLabels();
var crclabels = new List<string>
{
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
$"{GeometryNames.MomSndName}, {unitMoment.Name}",
$"{GeometryNames.LongForceName}, {unitForce.Name}",
$"{GeometryNames.CurvFstName}, {unitCurvature.Name}",
$"{GeometryNames.CurvSndName}, {unitCurvature.Name}",
$"{GeometryNames.StrainTrdName}",
$"{crc}{GeometryNames.CurvFstName}, {unitCurvature.Name}",
$"{crc}{GeometryNames.CurvSndName}, {unitCurvature.Name}",
$"{crc}{GeometryNames.StrainTrdName}",
@@ -151,6 +147,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
$"{crcFactor}Az",
$"PsiFactor"
};
labels.AddRange(crclabels);
return labels;
}
}

View File

@@ -90,7 +90,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
private ArrayParameter<double> GetParametersByCurveResult(LimitCurveResult curveResult)
{
string[] labels = GetLabels();
var labels = GetLabels();
var items = curveResult.Points;
var arrayParameter = new ArrayParameter<double>(items.Count(), labels.Count(), labels);
var data = arrayParameter.Data;
@@ -121,11 +121,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
SetProgress?.Invoke(parameterResult.IterationNumber);
}
private string[] GetLabels()
private List<string> GetLabels()
{
string[] strings = new string[2];
strings[0] = GetLabel(InputData.SurroundData.ConvertLogicEntity.XForceType);
strings[1] = GetLabel(InputData.SurroundData.ConvertLogicEntity.YForceType);
List<string> strings = new()
{
GetLabel(InputData.SurroundData.ConvertLogicEntity.XForceType),
GetLabel(InputData.SurroundData.ConvertLogicEntity.YForceType)
};
return strings;
}

View File

@@ -0,0 +1,32 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Services.Units;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
{
public static class LabelsFactory
{
private static IUnit unitForce = CommonOperation.GetUnit(UnitTypes.Force, "kN");
private static IUnit unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
private static IUnit unitCurvature = CommonOperation.GetUnit(UnitTypes.Curvature, "1/m");
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
public static List<string> GetLabels()
{
var labels = new List<string>
{
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
$"{GeometryNames.MomSndName}, {unitMoment.Name}",
$"{GeometryNames.LongForceName}, {unitForce.Name}",
$"{GeometryNames.CurvFstName}, {unitCurvature.Name}",
$"{GeometryNames.CurvSndName}, {unitCurvature.Name}",
$"{GeometryNames.StrainTrdName}",
};
return labels;
}
}
}

View File

@@ -27,12 +27,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
public void Show(IDesignForceTuple finishDesignTuple)
{
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
viewModel.StepCountVisible = false;
viewModel.ForceInterpolationViewModel.StepCountVisible = false;
var wndTuples = new InterpolateTuplesView(viewModel);
wndTuples.ShowDialog();
if (wndTuples.DialogResult != true) return;
var startDesignTuple = viewModel.StartDesignForce.ForceTuple;
var endDesignTuple = viewModel.FinishDesignForce.ForceTuple;
var startDesignTuple = viewModel.ForceInterpolationViewModel.StartDesignForce.ForceTuple;
var endDesignTuple = viewModel.ForceInterpolationViewModel.FinishDesignForce.ForceTuple;
FindCrackFactor(endDesignTuple, startDesignTuple);
}

View File

@@ -22,8 +22,6 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
private IEnumerable<INdmPrimitive> NdmPrimitives;
private List<IForcesTupleResult> ValidTupleList;
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
public int StepCount => ValidTupleList.Count();
public Action<int> SetProgress { get; set; }
@@ -63,7 +61,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
var unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
var unitCurvature = CommonOperation.GetUnit(UnitTypes.Curvature, "1/m");
string[] labels = GetLabels(unitForce, unitMoment, unitCurvature);
var labels = LabelsFactory.GetLabels();
arrayParameter = new ArrayParameter<double>(ValidTupleList.Count(), labels.Count(), labels);
CalculateWithoutCrack(ValidTupleList, unitForce, unitMoment, unitCurvature);
}
@@ -102,18 +100,5 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
resultList[i].LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
};
}
private static string[] GetLabels(IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
{
return new string[]
{
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
$"{GeometryNames.MomSndName}, {unitMoment.Name}",
$"{GeometryNames.LongForceName}, {unitForce.Name}",
$"{GeometryNames.CurvFstName}, {unitCurvature.Name}",
$"{GeometryNames.CurvSndName}, {unitCurvature.Name}",
$"{GeometryNames.StrainTrdName}"
};
}
}
}

View File

@@ -0,0 +1,21 @@
using StructureHelper.Windows.Forces;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
{
public class ShowValuePointDiagramLogic
{
public ForceCalculator Calculator { get; set; }
public PointPrimitiveLogic PrimitiveLogic { get; set; }
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
public void ShowGraph()
{
}
}
}

View File

@@ -19,6 +19,9 @@
<Button Command="{Binding ShowGraphsCommand}" ToolTip="Show diagram moment-curvature">
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
</Button>
<Button Command="{Binding GraphValuePointsCommand}" ToolTip="Show diagram by value points">
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
</Button>
<Button Command="{Binding ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
</Button>

View File

@@ -1,6 +1,7 @@
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using StructureHelper.Infrastructure;
using StructureHelper.Infrastructure.UI.DataContexts;
using StructureHelper.Services.Exports;
using StructureHelper.Services.Reports;
using StructureHelper.Services.Reports.CalculationReports;
@@ -52,17 +53,18 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
public ForcesTupleResult SelectedResult { get; set; }
private ICommand showIsoFieldCommand;
private ICommand exportToCSVCommand;
private ICommand interpolateCommand;
private ICommand setPrestrainCommand;
private ICommand showAnchorageCommand;
private ICommand showGeometryResultCommand;
private ICommand showGraphsCommand;
private ICommand showCrackResult;
private ICommand showCrackGraphsCommand;
private RelayCommand showCrackWidthResult;
private ICommand showInteractionDiagramCommand;
private ICommand? showIsoFieldCommand;
private ICommand? exportToCSVCommand;
private ICommand? interpolateCommand;
private ICommand? setPrestrainCommand;
private ICommand? showAnchorageCommand;
private ICommand? showGeometryResultCommand;
private ICommand? showGraphsCommand;
private ICommand? showCrackResult;
private ICommand? showCrackGraphsCommand;
private ICommand? showCrackWidthResult;
private ICommand? showInteractionDiagramCommand;
private ICommand? graphValuepointsCommand;
public IForcesResults ForcesResults
{
@@ -155,7 +157,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
if (wndTuples.DialogResult != true) return;
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.Result);
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
showProgressLogic = new(interpolationLogic)
{
WindowTitle = "Interpolate forces"
@@ -186,7 +188,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
if (wndTuples.DialogResult != true) return;
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.Result);
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
showProgressLogic = new(interpolationLogic)
{
WindowTitle = "Interpolate forces"
@@ -259,13 +261,53 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
if (wndTuples.DialogResult != true) return;
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.Result);
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
progressLogic = interpolationLogic;
showProgressLogic = new(interpolationLogic);
showProgressLogic.ShowResult = ShowInterpolationProgressDialog;
showProgressLogic.Show();
}
public ICommand GraphValuePointsCommand
{
get
{
return graphValuepointsCommand ??
(graphValuepointsCommand = new RelayCommand(o =>
{
InterpolateValuePoints();
}, o => SelectedResult != null));
}
}
private void InterpolateValuePoints()
{
var inputData = new ValuePointsInterpolationInputData()
{
FinishDesignForce = SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple,
LimitState = SelectedResult.DesignForceTuple.LimitState,
CalcTerm = SelectedResult.DesignForceTuple.CalcTerm,
};
inputData.PrimitiveBases.AddRange(PrimitiveOperations.ConvertNdmPrimitivesToPrimitiveBase(ndmPrimitives));
var viewModel = new ValuePointsInterpolateViewModel(inputData);
var wnd = new ValuePointsInterpolateView(viewModel);
wnd.ShowDialog();
if (wnd.DialogResult != true) { return; }
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, viewModel.ForceInterpolationViewModel.Result);
ShowValuePointDiagramLogic pointGraphLogic = new()
{
Calculator = interpolationLogic.InterpolateCalculator,
PrimitiveLogic = viewModel.PrimitiveLogic,
ValueDelegatesLogic = viewModel.ValueDelegatesLogic
};
progressLogic = interpolationLogic;
showProgressLogic = new(interpolationLogic)
{
ShowResult = pointGraphLogic.ShowGraph
};
showProgressLogic.Show();
}
private void ShowInterpolationWindow(out InterpolateTuplesViewModel interploateTuplesViewModel, out InterpolateTuplesView wndTuples)
{
IDesignForceTuple finishDesignTuple = SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple;