SectionTemlate was added
This commit is contained in:
@@ -18,7 +18,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.CalculationResult
|
||||
public class CalculationResultViewModel
|
||||
{
|
||||
public ICalculationResult SelectedResult { get; set; }
|
||||
public ICommand ShowIsoFieldCommand { get; set; }
|
||||
public ICommand ShowIsoFieldCommand { get;}
|
||||
private ObservableCollection<ICalculationResult> calculationResults;
|
||||
private IEnumerable<INdm> ndms;
|
||||
private IReport isoFieldReport;
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
@@ -47,6 +48,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
public bool LongTerm { get; set; }
|
||||
|
||||
public ISourceToTargetViewModel<IForceCombinationList> CombinationViewModel { get; }
|
||||
//public ISourceToTargetViewModel<PrimitiveBase> PrimitivesViewModel { get; }
|
||||
|
||||
public PrimitiveBase SelectedAllowedPrimitive { get; set; }
|
||||
public PrimitiveBase SelectedPrimitive { get; set; }
|
||||
@@ -148,6 +150,13 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
CombinationViewModel.SetTargetItems(forcesCalculator.ForceCombinationLists);
|
||||
CombinationViewModel.SetSourceItems(allowedForceCombinations);
|
||||
|
||||
//PrimitivesViewModel = new SourceToTargetViewModel<PrimitiveBase>();
|
||||
//var targetItems = forcesCalculator.NdmPrimitives;
|
||||
//var viewPrimitives = ConvertNdmPrimitivesToPrimitiveBase(targetItems);
|
||||
//PrimitivesViewModel.SetTargetItems(viewPrimitives);
|
||||
//var sourceViewPrimitives = ConvertNdmPrimitivesToPrimitiveBase(allowedPrimitives) ;
|
||||
//PrimitivesViewModel.SetSourceItems(sourceViewPrimitives);
|
||||
|
||||
InputRefresh();
|
||||
}
|
||||
|
||||
@@ -187,6 +196,11 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
{
|
||||
forcesCalculator.ForceCombinationLists.Add(item);
|
||||
}
|
||||
//forcesCalculator.NdmPrimitives.Clear();
|
||||
//foreach (var item in PrimitivesViewModel.GetTargetItems())
|
||||
//{
|
||||
// forcesCalculator.NdmPrimitives.Add(item.GetNdmPrimitive());
|
||||
//}
|
||||
forcesCalculator.LimitStatesList.Clear();
|
||||
if (ULS == true) { forcesCalculator.LimitStatesList.Add(LimitStates.ULS); }
|
||||
if (SLS == true) { forcesCalculator.LimitStatesList.Add(LimitStates.SLS); }
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
using FieldVisualizer.Infrastructure.Commands;
|
||||
using FieldVisualizer.ViewModels;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Services.Reports;
|
||||
using StructureHelper.Services.Reports.CalculationReports;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||
{
|
||||
public class ForcesResultsViewModel : ViewModelBase
|
||||
{
|
||||
private IForceCalculator forceCalculator;
|
||||
private IForcesResults forcesResults;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private IEnumerable<INdm> ndms;
|
||||
private IReport isoFieldReport;
|
||||
|
||||
public ForcesResult SelectedResult { get; set; }
|
||||
private ICommand showIsoFieldCommand;
|
||||
|
||||
public IForcesResults ForcesResults
|
||||
{
|
||||
get => forcesResults;
|
||||
}
|
||||
|
||||
public ICommand ShowIsoFieldCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return showIsoFieldCommand ??
|
||||
(
|
||||
showIsoFieldCommand = new RelayCommand(o =>
|
||||
{
|
||||
GetNdms();
|
||||
ShowIsoField();
|
||||
}, o => (SelectedResult != null) && SelectedResult.IsValid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ForcesResultsViewModel(IForceCalculator forceCalculator)
|
||||
{
|
||||
this.forceCalculator = forceCalculator;
|
||||
this.forcesResults = this.forceCalculator.Result as IForcesResults;
|
||||
ndmPrimitives = this.forceCalculator.NdmPrimitives;
|
||||
}
|
||||
|
||||
private void ShowIsoField()
|
||||
{
|
||||
IStrainMatrix strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(strainMatrix, ndms, ResultFuncFactory.GetResultFuncs());
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
isoFieldReport.Show();
|
||||
}
|
||||
|
||||
private void GetNdms()
|
||||
{
|
||||
var limitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
ndms = NdmPrimitivesService.GetNdms(ndmPrimitives, limitState, calcTerm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,40 @@ namespace StructureHelper.Windows.ViewModels.Forces
|
||||
combinationList.Name = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SetInGravityCenter
|
||||
{
|
||||
get => combinationList.SetInGravityCenter;
|
||||
set
|
||||
{
|
||||
combinationList.SetInGravityCenter = value;
|
||||
OnPropertyChanged(nameof(SetInGravityCenter));
|
||||
OnPropertyChanged(nameof(CoordEnable));
|
||||
}
|
||||
}
|
||||
|
||||
public bool CoordEnable => !SetInGravityCenter;
|
||||
|
||||
public double CenterX
|
||||
{
|
||||
get => combinationList.ForcePoint.X;
|
||||
set
|
||||
{
|
||||
combinationList.ForcePoint.X = value;
|
||||
OnPropertyChanged(nameof(CenterX));
|
||||
}
|
||||
}
|
||||
|
||||
public double CenterY
|
||||
{
|
||||
get => combinationList.ForcePoint.Y;
|
||||
set
|
||||
{
|
||||
combinationList.ForcePoint.Y = value;
|
||||
OnPropertyChanged(nameof(CenterY));
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IDesignForceTuple> ForceTuples { get => combinationList.DesignForces; }
|
||||
|
||||
public ForceCombinationViewModel(IForceCombinationList combinationList)
|
||||
|
||||
@@ -98,7 +98,19 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
(
|
||||
runCommand = new RelayCommand(o =>
|
||||
{
|
||||
(SelectedItem as INdmCalculator).Run();
|
||||
SelectedItem.Run();
|
||||
var result = SelectedItem.Result;
|
||||
if (result.IsValid == false)
|
||||
{
|
||||
MessageBox.Show(result.Desctription, "Check data for analisys", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
var calculator = SelectedItem as IForceCalculator;
|
||||
var vm = new ForcesResultsViewModel(calculator);
|
||||
var wnd = new ForceResultsView(vm);
|
||||
wnd.Show();
|
||||
}
|
||||
}, o => SelectedItem != null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,5 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
public interface ICalculatorsViewModelLogic : ICRUDViewModel<INdmCalculator>
|
||||
{
|
||||
RelayCommand Run { get; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user