Value points were added
This commit is contained in:
@@ -33,10 +33,10 @@
|
||||
<DataTemplate x:Key="SelectItems">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding ShowButtons, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<StackPanel Height="25" Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding ShowButtons, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Button Content="Select All" Command="{Binding SelectAllCommand}"/>
|
||||
<Button Content="Unselect All" Command="{Binding UnSelectAllCommand}"/>
|
||||
<Button Content="Invert Selection" Command="{Binding InvertSelectionCommand}"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelper.Infrastructure.UI.Converters.Units;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,19 +9,63 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Services.ResultViewers
|
||||
{
|
||||
public enum FuncsTypes
|
||||
{
|
||||
Strain,
|
||||
Stress,
|
||||
Forces,
|
||||
Full,
|
||||
}
|
||||
public static class ResultFuncFactory
|
||||
{
|
||||
public static IEnumerable<IResultFunc> GetResultFuncs()
|
||||
static readonly IStressLogic stressLogic = new StressLogic();
|
||||
public static List<IResultFunc> GetResultFuncs(FuncsTypes funcsType = FuncsTypes.Full)
|
||||
{
|
||||
List<IResultFunc> results = new();
|
||||
if (funcsType == FuncsTypes.Strain)
|
||||
{
|
||||
results.AddRange(GetStrainResultFuncs());
|
||||
}
|
||||
else if (funcsType == FuncsTypes.Stress)
|
||||
{
|
||||
results.AddRange(GetStressResultFuncs());
|
||||
}
|
||||
else if (funcsType == FuncsTypes.Forces)
|
||||
{
|
||||
results.AddRange(GetForcesResultFuncs());
|
||||
}
|
||||
else if (funcsType == FuncsTypes.Full)
|
||||
{
|
||||
results.AddRange(GetStrainResultFuncs());
|
||||
results.AddRange(GetStressResultFuncs());
|
||||
results.AddRange(GetForcesResultFuncs());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(funcsType));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
private static List<IResultFunc> GetStrainResultFuncs()
|
||||
{
|
||||
List<IResultFunc> resultFuncs = new List<IResultFunc>();
|
||||
IStressLogic stressLogic = new StressLogic();
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Total Strain", ResultFunction = stressLogic.GetTotalStrain });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Total Strain with prestrain", ResultFunction = stressLogic.GetTotalStrainWithPresrain });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Elastic Strain", ResultFunction = stressLogic.GetElasticStrain });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Plastic Strain", ResultFunction = stressLogic.GetPlasticStrain });
|
||||
return resultFuncs;
|
||||
}
|
||||
private static List<IResultFunc> GetStressResultFuncs()
|
||||
{
|
||||
List<IResultFunc> resultFuncs = new List<IResultFunc>();
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Stress", ResultFunction = stressLogic.GetStress, UnitFactor = UnitConstants.Stress });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Secant modulus", ResultFunction = stressLogic.GetSecantModulus, UnitFactor = UnitConstants.Stress });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Modulus degradation", ResultFunction = stressLogic.GetModulusDegradation });
|
||||
return resultFuncs;
|
||||
}
|
||||
private static List<IResultFunc> GetForcesResultFuncs()
|
||||
{
|
||||
List<IResultFunc> resultFuncs = new List<IResultFunc>();
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Force", ResultFunction = stressLogic.GetForce, UnitFactor = UnitConstants.Force });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Moment X", ResultFunction = stressLogic.GetMomentX, UnitFactor = UnitConstants.Force });
|
||||
resultFuncs.Add(new ResultFunc() { Name = "Moment Y", ResultFunction = stressLogic.GetMomentY, UnitFactor = UnitConstants.Force });
|
||||
|
||||
@@ -36,6 +36,15 @@
|
||||
<Compile Update="Windows\Forces\ForceCombinationByFactorView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\Forces\ForceInterpolationControl.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\Forces\ForceTupleInterpolationControl.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\Forces\ValuePointsInterpolateView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Windows\Graphs\GraphView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -101,6 +110,15 @@
|
||||
<Page Update="Windows\Forces\ForceCombinationByFactorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\Forces\ForceInterpolationControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\Forces\ForceTupleInterpolationControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\Forces\ValuePointsInterpolateView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Windows\Graphs\GraphView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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}"
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
<UserControl x:Class="StructureHelper.Windows.Forces.ForceInterpolationControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="200" d:DesignWidth="460">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="3" Text="Force Nz" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="1" Text="Start Combination"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding StartMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding StartNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<Button Grid.Row="2" Grid.Column="1" Command="{Binding CopyToStartCommand}">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="2" Command="{Binding InvertForcesCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||
<Viewbox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</Viewbox.RenderTransform>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="3" Command="{Binding CopyToFinishCommand}">
|
||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||
<Viewbox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</Viewbox.RenderTransform>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<TextBlock Grid.Row="3" Text="Finish Combination"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,67 @@
|
||||
using StructureHelper.Windows.UserControls;
|
||||
using StructureHelper.Windows.ViewModels.Materials;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для ForceInterpolationControl.xaml
|
||||
/// </summary>
|
||||
public partial class ForceInterpolationControl : UserControl
|
||||
{
|
||||
private ForceTupleInterpolationViewModel? properties;
|
||||
|
||||
public ForceTupleInterpolationViewModel? Properties
|
||||
{
|
||||
get => properties; set
|
||||
{
|
||||
properties = value;
|
||||
DataContext = Properties;
|
||||
}
|
||||
}
|
||||
public ForceInterpolationControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void StartValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(Properties.StartDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, Properties.StartDesignForce.ForceTuple, 1d);
|
||||
Properties.RefreshStartTuple();
|
||||
}
|
||||
|
||||
private void FinishValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(Properties.FinishDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, Properties.FinishDesignForce.ForceTuple, 1d);
|
||||
Properties.RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void StepCountValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var factor = obj.DoubleFactor;
|
||||
if (factor > 0d)
|
||||
{
|
||||
Properties.StepCount = Convert.ToInt32(Properties.StepCount * factor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<UserControl x:Class="StructureHelper.Windows.Forces.ForceTupleControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" MinWidth="70"/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="70"/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="70"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" MinHeight="20"/>
|
||||
<RowDefinition Height="Auto" MinHeight="20"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock HorizontalAlignment="Center" Text="Mx"/>
|
||||
<TextBlock HorizontalAlignment="Center" Grid.Column="1" Text="My"/>
|
||||
<TextBlock HorizontalAlignment="Center" Grid.Column="2" Text="Nz"/>
|
||||
<TextBox Grid.Row="1" Text=""/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text=""/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2" Text=""/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,89 @@
|
||||
<UserControl x:Class="StructureHelper.Windows.Forces.ForceTupleInterpolationControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="200" d:DesignWidth="460">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="3" Text="Force Nz" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="1" Text="Start Combination"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding StartMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding StartNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<Button Grid.Row="2" Grid.Column="1" Command="{Binding CopyToStartCommand}">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="2" Command="{Binding InvertForcesCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||
<Viewbox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</Viewbox.RenderTransform>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="3" Command="{Binding CopyToFinishCommand}">
|
||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||
<Viewbox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</Viewbox.RenderTransform>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<TextBlock Grid.Row="3" Text="Finish Combination"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -18,9 +18,10 @@ namespace StructureHelper.Windows.Forces
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для ForceTupleControl.xaml
|
||||
/// </summary>
|
||||
public partial class ForceTupleControl : UserControl
|
||||
public partial class ForceTupleInterpolationControl : UserControl
|
||||
{
|
||||
public ForceTupleControl()
|
||||
public ForceTupleInterpolationViewModel? Properties { get; set; }
|
||||
public ForceTupleInterpolationControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class ForceTupleInterpolationViewModel : ViewModelBase
|
||||
{
|
||||
private RelayCommand invertForcesCommand;
|
||||
private RelayCommand copyToStartCommand;
|
||||
private RelayCommand copyToFinishCommand;
|
||||
private int stepCount;
|
||||
private IDesignForceTuple startDesignForce;
|
||||
private IDesignForceTuple finishDesignForce;
|
||||
|
||||
public IDesignForceTuple StartDesignForce
|
||||
{
|
||||
get => startDesignForce; set
|
||||
{
|
||||
startDesignForce = value;
|
||||
}
|
||||
}
|
||||
public IDesignForceTuple FinishDesignForce
|
||||
{
|
||||
get => finishDesignForce; set
|
||||
{
|
||||
finishDesignForce = value;
|
||||
}
|
||||
}
|
||||
|
||||
public double StartFactor { get; set; }
|
||||
public double FinishFactor { get; set; }
|
||||
public double StepCountFactor { get; set; }
|
||||
|
||||
public bool StepCountVisible { get; set; }
|
||||
public double StartMx
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.Mx;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.Mx = value;
|
||||
OnPropertyChanged(nameof(StartMx));
|
||||
}
|
||||
}
|
||||
public double StartMy
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.My;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.My = value;
|
||||
OnPropertyChanged(nameof(StartMy));
|
||||
}
|
||||
}
|
||||
public double StartNz
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.Nz;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.Nz = value;
|
||||
OnPropertyChanged(nameof(StartNz));
|
||||
}
|
||||
}
|
||||
public double FinishMx
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.Mx;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.Mx = value;
|
||||
OnPropertyChanged(nameof(FinishMx));
|
||||
}
|
||||
}
|
||||
public double FinishMy
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.My;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.My = value;
|
||||
OnPropertyChanged(nameof(FinishMy));
|
||||
}
|
||||
}
|
||||
public double FinishNz
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.Nz;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.Nz = value;
|
||||
OnPropertyChanged(nameof(FinishNz));
|
||||
}
|
||||
}
|
||||
public int StepCount
|
||||
{
|
||||
get => stepCount; set
|
||||
{
|
||||
stepCount = value;
|
||||
OnPropertyChanged(nameof(StepCount));
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand InvertForcesCommand
|
||||
{
|
||||
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
|
||||
}
|
||||
public ICommand CopyToStartCommand
|
||||
{
|
||||
get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
|
||||
}
|
||||
public ICommand CopyToFinishCommand
|
||||
{
|
||||
get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
|
||||
}
|
||||
public InterpolateTuplesResult Result
|
||||
{
|
||||
get => new()
|
||||
{
|
||||
StartTuple = StartDesignForce,
|
||||
FinishTuple = FinishDesignForce,
|
||||
StepCount = StepCount
|
||||
};
|
||||
}
|
||||
|
||||
private void InvertForces()
|
||||
{
|
||||
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||
StartDesignForce = FinishDesignForce;
|
||||
FinishDesignForce = tmpForce;
|
||||
StepCountVisible = true;
|
||||
RefreshStartTuple();
|
||||
RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void CopyStartToFinish()
|
||||
{
|
||||
FinishDesignForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||
RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void CopyFinishToStart()
|
||||
{
|
||||
StartDesignForce = FinishDesignForce.Clone() as IDesignForceTuple;
|
||||
RefreshStartTuple();
|
||||
}
|
||||
|
||||
public void RefreshFinishTuple()
|
||||
{
|
||||
OnPropertyChanged(nameof(FinishDesignForce));
|
||||
OnPropertyChanged(nameof(FinishMx));
|
||||
OnPropertyChanged(nameof(FinishMy));
|
||||
OnPropertyChanged(nameof(FinishNz));
|
||||
}
|
||||
|
||||
public void RefreshStartTuple()
|
||||
{
|
||||
OnPropertyChanged(nameof(StartDesignForce));
|
||||
OnPropertyChanged(nameof(StartMx));
|
||||
OnPropertyChanged(nameof(StartMy));
|
||||
OnPropertyChanged(nameof(StartNz));
|
||||
}
|
||||
|
||||
public ForceTupleInterpolationViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce = null, int stepCount = 100)
|
||||
{
|
||||
if (startDesignForce != null)
|
||||
{
|
||||
CheckDesignForces(finishDesignForce, startDesignForce);
|
||||
StartDesignForce = startDesignForce;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetNewDesignForce(finishDesignForce);
|
||||
}
|
||||
FinishDesignForce = finishDesignForce;
|
||||
StepCount = stepCount;
|
||||
StepCountVisible = true;
|
||||
}
|
||||
public ForceTupleInterpolationViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static void CheckDesignForces(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce)
|
||||
{
|
||||
if (startDesignForce.LimitState != finishDesignForce.LimitState)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||
}
|
||||
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
||||
}
|
||||
}
|
||||
|
||||
private void GetNewDesignForce(IDesignForceTuple finishDesignForce)
|
||||
{
|
||||
StartDesignForce = new DesignForceTuple()
|
||||
{
|
||||
CalcTerm = finishDesignForce.CalcTerm,
|
||||
LimitState = finishDesignForce.LimitState,
|
||||
ForceTuple = new ForceTuple()
|
||||
{
|
||||
Mx = 0,
|
||||
My = 0,
|
||||
Nz = 0
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
d:DataContext="{d:DesignInstance local:InterpolateTuplesViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Interpolate Combinations" Height="200" Width="460" MinHeight="180" MinWidth="460" WindowStartupLocation="CenterScreen">
|
||||
Title="Interpolate Combinations" Height="250" Width="460" MinHeight="250" MinWidth="460" WindowStartupLocation="CenterScreen">
|
||||
<Window.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
<Style TargetType="Button">
|
||||
@@ -20,94 +20,7 @@
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="3" Text="Force Nz" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="1" Text="Start Combination"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding StartMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding StartNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<Button Grid.Row="2" Grid.Column="1" Command="{Binding CopyToStartCommand}">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="2" Command="{Binding InvertForcesCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||
<Viewbox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</Viewbox.RenderTransform>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="3" Command="{Binding CopyToFinishCommand}">
|
||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||
<Viewbox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</Viewbox.RenderTransform>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<TextBlock Grid.Row="3" Text="Finish Combination"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource CancelButton}"/>
|
||||
<Button Style="{StaticResource OkButton}" Click="Button_Click"/>
|
||||
</StackPanel>
|
||||
<local:ForceInterpolationControl x:Name="InterpolationControl"/>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -27,9 +27,11 @@ namespace StructureHelper.Windows.Forces
|
||||
InterpolateTuplesViewModel viewModel;
|
||||
public InterpolateTuplesView(InterpolateTuplesViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.viewModel = viewModel;
|
||||
this.viewModel.ParentWindow = this;
|
||||
DataContext = this.viewModel;
|
||||
InitializeComponent();
|
||||
InterpolationControl.Properties = viewModel.ForceInterpolationViewModel;
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
@@ -37,31 +39,5 @@ namespace StructureHelper.Windows.Forces
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void StartValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(viewModel.StartDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, viewModel.StartDesignForce.ForceTuple, 1d);
|
||||
viewModel.RefreshStartTuple();
|
||||
}
|
||||
|
||||
private void FinishValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTuples(viewModel.FinishDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, viewModel.FinishDesignForce.ForceTuple, 1d);
|
||||
viewModel.RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void StepCountValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var factor = obj.DoubleFactor;
|
||||
if (factor > 0d)
|
||||
{
|
||||
viewModel.StepCount = Convert.ToInt32(viewModel.StepCount * factor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,162 +8,11 @@ namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class InterpolateTuplesViewModel : OkCancelViewModelBase
|
||||
{
|
||||
private RelayCommand invertForcesCommand;
|
||||
private RelayCommand copyToStartCommand;
|
||||
private RelayCommand copyToFinishCommand;
|
||||
private int stepCount;
|
||||
|
||||
public IDesignForceTuple StartDesignForce { get; set; }
|
||||
public IDesignForceTuple FinishDesignForce { get; set; }
|
||||
|
||||
public double StartFactor { get; set; }
|
||||
public double FinishFactor { get; set; }
|
||||
public double StepCountFactor { get; set; }
|
||||
|
||||
public bool StepCountVisible { get; set; }
|
||||
public double StartMx
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.Mx;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.Mx = value;
|
||||
OnPropertyChanged(nameof(StartMx));
|
||||
}
|
||||
}
|
||||
public double StartMy
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.My;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.My = value;
|
||||
OnPropertyChanged(nameof(StartMy));
|
||||
}
|
||||
}
|
||||
public double StartNz
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.Nz;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.Nz = value;
|
||||
OnPropertyChanged(nameof(StartNz));
|
||||
}
|
||||
}
|
||||
public double FinishMx
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.Mx;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.Mx = value;
|
||||
OnPropertyChanged(nameof(FinishMx));
|
||||
}
|
||||
}
|
||||
public double FinishMy
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.My;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.My = value;
|
||||
OnPropertyChanged(nameof(FinishMy));
|
||||
}
|
||||
}
|
||||
public double FinishNz
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.Nz;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.Nz = value;
|
||||
OnPropertyChanged(nameof(FinishNz));
|
||||
}
|
||||
}
|
||||
public int StepCount
|
||||
{
|
||||
get => stepCount; set
|
||||
{
|
||||
stepCount = value;
|
||||
OnPropertyChanged(nameof(StepCount));
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand InvertForcesCommand
|
||||
{
|
||||
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
|
||||
}
|
||||
public ICommand CopyToStartCommand
|
||||
{
|
||||
get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
|
||||
}
|
||||
public ICommand CopyToFinishCommand
|
||||
{
|
||||
get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
|
||||
}
|
||||
public InterpolateTuplesResult Result
|
||||
{
|
||||
get => new()
|
||||
{
|
||||
StartTuple = StartDesignForce,
|
||||
FinishTuple = FinishDesignForce,
|
||||
StepCount = StepCount
|
||||
};
|
||||
}
|
||||
|
||||
private void InvertForces()
|
||||
{
|
||||
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||
StartDesignForce = FinishDesignForce;
|
||||
FinishDesignForce = tmpForce;
|
||||
StepCountVisible = true;
|
||||
RefreshStartTuple();
|
||||
RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void CopyStartToFinish()
|
||||
{
|
||||
FinishDesignForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||
RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void CopyFinishToStart()
|
||||
{
|
||||
StartDesignForce = FinishDesignForce.Clone() as IDesignForceTuple;
|
||||
RefreshStartTuple();
|
||||
}
|
||||
|
||||
public void RefreshFinishTuple()
|
||||
{
|
||||
OnPropertyChanged(nameof(FinishDesignForce));
|
||||
OnPropertyChanged(nameof(FinishMx));
|
||||
OnPropertyChanged(nameof(FinishMy));
|
||||
OnPropertyChanged(nameof(FinishNz));
|
||||
}
|
||||
|
||||
public void RefreshStartTuple()
|
||||
{
|
||||
OnPropertyChanged(nameof(StartDesignForce));
|
||||
OnPropertyChanged(nameof(StartMx));
|
||||
OnPropertyChanged(nameof(StartMy));
|
||||
OnPropertyChanged(nameof(StartNz));
|
||||
}
|
||||
public ForceTupleInterpolationViewModel ForceInterpolationViewModel { get; set; }
|
||||
|
||||
public InterpolateTuplesViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce=null, int stepCount = 100)
|
||||
{
|
||||
if (startDesignForce !=null)
|
||||
{
|
||||
if (startDesignForce.LimitState != finishDesignForce.LimitState) throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm) throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
||||
StartDesignForce = startDesignForce;
|
||||
}
|
||||
else
|
||||
{
|
||||
StartDesignForce = new DesignForceTuple()
|
||||
{
|
||||
CalcTerm = finishDesignForce.CalcTerm,
|
||||
LimitState = finishDesignForce.LimitState,
|
||||
ForceTuple = new ForceTuple() { Mx = 0, My = 0, Nz = 0 },
|
||||
};
|
||||
}
|
||||
FinishDesignForce = finishDesignForce;
|
||||
StepCount = stepCount;
|
||||
StepCountVisible = true;
|
||||
ForceInterpolationViewModel = new(finishDesignForce, startDesignForce, stepCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
StructureHelper/Windows/Forces/PointPrimitiveLogic.cs
Normal file
31
StructureHelper/Windows/Forces/PointPrimitiveLogic.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class PointPrimitiveLogic : ViewModelBase
|
||||
{
|
||||
public SelectItemsVM<PrimitiveValuePoints> Collection { get; private set; }
|
||||
public PointPrimitiveLogic(IEnumerable<PrimitiveBase> primitiveBases)
|
||||
{
|
||||
List<PrimitiveValuePoints> collection = new();
|
||||
foreach (var item in primitiveBases)
|
||||
{
|
||||
var primitiveValuePoint = new PrimitiveValuePoints(item)
|
||||
{
|
||||
PrimitiveBase = item
|
||||
};
|
||||
collection.Add(primitiveValuePoint);
|
||||
}
|
||||
Collection = new SelectItemsVM<PrimitiveValuePoints>(collection);
|
||||
Collection.InvertSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
StructureHelper/Windows/Forces/PrimitiveValuePoints.cs
Normal file
28
StructureHelper/Windows/Forces/PrimitiveValuePoints.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class PrimitiveValuePoints
|
||||
{
|
||||
public PrimitiveBase PrimitiveBase {get;set;}
|
||||
public SelectItemsVM<NamedValue<IPoint2D>> ValuePoints { get; set; }
|
||||
|
||||
public PrimitiveValuePoints(PrimitiveBase primitiveBase)
|
||||
{
|
||||
var ndmPrimitive = primitiveBase.GetNdmPrimitive();
|
||||
var pointCollection = ndmPrimitive.GetValuePoints();
|
||||
ValuePoints = new SelectItemsVM<NamedValue<IPoint2D>>(pointCollection)
|
||||
{
|
||||
ShowButtons = false
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
28
StructureHelper/Windows/Forces/ValueDelegatesLogic.cs
Normal file
28
StructureHelper/Windows/Forces/ValueDelegatesLogic.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class ValueDelegatesLogic : ViewModelBase
|
||||
{
|
||||
private readonly List<IResultFunc> resultFuncs;
|
||||
public SelectItemsVM<IResultFunc> ResultFuncs { get; }
|
||||
public ValueDelegatesLogic()
|
||||
{
|
||||
resultFuncs = new List<IResultFunc>();
|
||||
resultFuncs.AddRange(ResultFuncFactory.GetResultFuncs(FuncsTypes.Strain));
|
||||
resultFuncs.AddRange(ResultFuncFactory.GetResultFuncs(FuncsTypes.Stress));
|
||||
ResultFuncs = new SelectItemsVM<IResultFunc>(resultFuncs)
|
||||
{
|
||||
ShowButtons = true
|
||||
};
|
||||
ResultFuncs.InvertSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<Window x:Class="StructureHelper.Windows.Forces.ValuePointsInterpolateView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:ValuePointsInterpolateViewModel}"
|
||||
Title="Value Poits Interpolation" Height="250" Width="460" MinHeight="250" MinWidth="460" MaxHeight="450" MaxWidth="460" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl>
|
||||
<TabItem Header="Forces">
|
||||
<local:ForceInterpolationControl x:Name="InterpolationControl"/>
|
||||
</TabItem>
|
||||
<TabItem Header="Points" DataContext="{Binding PrimitiveLogic}">
|
||||
<ListBox DataContext="{Binding Collection}" ItemsSource="{Binding CollectionItems}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Header>
|
||||
<ContentControl ContentTemplate="{StaticResource ResourceKey=ColoredItemTemplate}" Content="{Binding Item.PrimitiveBase}"/>
|
||||
</Expander.Header>
|
||||
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding Item.ValuePoints}"/>
|
||||
</Expander>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</TabItem>
|
||||
<TabItem DataContext="{Binding ValueDelegatesLogic}" Header="Values">
|
||||
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding ResultFuncs}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для ValuePoitsInterpolateView.xaml
|
||||
/// </summary>
|
||||
public partial class ValuePointsInterpolateView : Window
|
||||
{
|
||||
private ValuePointsInterpolateViewModel viewModel;
|
||||
public ValuePointsInterpolateView(ValuePointsInterpolateViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.viewModel = viewModel;
|
||||
this.viewModel.ParentWindow = this;
|
||||
this.DataContext = this.viewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class ValuePointsInterpolateViewModel : OkCancelViewModelBase
|
||||
{
|
||||
private readonly ValuePointsInterpolationInputData inputData;
|
||||
|
||||
public ForceTupleInterpolationViewModel ForceInterpolationViewModel { get; private set; }
|
||||
public PointPrimitiveLogic PrimitiveLogic { get; private set; }
|
||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
public ValuePointsInterpolateViewModel(ValuePointsInterpolationInputData inputData)
|
||||
{
|
||||
this.inputData = inputData;
|
||||
ForceInterpolationViewModel = new(this.inputData.FinishDesignForce, this.inputData.StartDesignForce, this.inputData.StepCount);
|
||||
PrimitiveLogic = new PointPrimitiveLogic(inputData.PrimitiveBases);
|
||||
ValueDelegatesLogic = new();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class ValuePointsInterpolationInputData
|
||||
{
|
||||
public IDesignForceTuple FinishDesignForce { get; set; }
|
||||
public IDesignForceTuple StartDesignForce { get; set; }
|
||||
public int StepCount { get; set; }
|
||||
public List<PrimitiveBase> PrimitiveBases { get; private set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
|
||||
public ValuePointsInterpolationInputData()
|
||||
{
|
||||
PrimitiveBases = new List<PrimitiveBase>();
|
||||
StepCount = 100;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user