Icons for force result were added

This commit is contained in:
Evgeny Redikultsev
2023-11-26 20:33:48 +05:00
parent b4b1720c70
commit 01e6f97429
41 changed files with 678 additions and 273 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -23,6 +23,10 @@
</ItemGroup>
<ItemGroup>
<None Remove="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_crack.png" />
<None Remove="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_graph_1.png" />
<None Remove="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_graph_2.png" />
<None Remove="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_interpolation_1_1.png" />
<None Remove="Windows\MainWindow\Analysis32.png" />
<None Remove="Windows\MainWindow\Beam32.png" />
<None Remove="Windows\MainWindow\Calculator32.png" />
@@ -86,6 +90,10 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_crack.png" />
<Resource Include="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_graph_1.png" />
<Resource Include="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_graph_2.png" />
<Resource Include="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\32px_interpolation_1_1.png" />
<Resource Include="Windows\MainWindow\Analysis32.png" />
<Resource Include="Windows\MainWindow\Beam32.png" />
<Resource Include="Windows\MainWindow\Calculator32.png" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,125 @@
using LoaderCalculator.Data.Ndms;
using StructureHelper.Windows.Graphs;
using StructureHelper.Windows.ViewModels.Errors;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Parameters;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Units;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
{
internal class InteractionDiagramLogic : ILongProcessLogic
{
const double xmax = 0.7e6d;
const double xmin = -0.7e6d;
const double ymax = 1.5e6d;
const double ymin = -9e6d;
private ArrayParameter<double> arrayParameter;
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
public int StepCount { get; }
public Action<int> SetProgress { get; set; }
public bool Result { get; set; }
public IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
public LimitStates LimitState { get; set; }
public CalcTerms CalcTerm { get; set; }
public ForceTuple ForceTuple { get; set; }
private void Show()
{
var options = new TriangulationOptions() { LimiteState = LimitState, CalcTerm = CalcTerm };
var ndmCollection = NdmPrimitives.SelectMany(x => x.GetNdms(options));
//var ndmCollection = NdmPrimitivesService.GetNdms(NdmPrimitives, LimitState, CalcTerm);
var predicateFactory = new PredicateFactory()
{
My = ForceTuple.My,
Ndms = ndmCollection
};
Predicate<IPoint2D> predicate = predicateFactory.GetResult;
//var logic = new StabLimitCurveLogic();
var logic = new LimitCurveLogic(predicate);
var calculator = new LimitCurveCalculator(logic);
calculator.SurroundData.XMax = xmax;
calculator.SurroundData.XMin = xmin;
calculator.SurroundData.YMax = ymax;
calculator.SurroundData.YMin = ymin;
calculator.SurroundData.PointCount = 40;
calculator.Run();
var result = calculator.Result;
if (result.IsValid = false) { return; }
var interactionResult = result as LimitCurveResult;
var unitForce = CommonOperation.GetUnit(UnitTypes.Force, "kN");
var unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
string[] labels = GetLabels(unitForce, unitMoment);
var items = interactionResult.Points;
arrayParameter = new ArrayParameter<double>(items.Count(), labels.Count(), labels);
var data = arrayParameter.Data;
for (int i = 0; i < items.Count(); i++)
{
var valueList = new List<double>
{
items[i].X * unitForce.Multiplyer,
items[i].Y * unitMoment.Multiplyer
};
for (int j = 0; j < valueList.Count; j++)
{
data[i, j] = valueList[j];
}
SetProgress?.Invoke(i);
}
}
private static string[] GetLabels(IUnit unitForce, IUnit unitMoment)
{
return new string[]
{
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
$"{GeometryNames.LongForceName}, {unitForce.Name}"
};
}
public void ShowWindow()
{
Show();
Result = true;
SafetyProcessor.RunSafeProcess(() =>
{
var wnd = new GraphView(arrayParameter);
wnd.ShowDialog();
},
"Errors appeared during showing a graph, see detailed information");
}
public void WorkerDoWork(object sender, DoWorkEventArgs e)
{
Show();
Result = true;
}
public void WorkerProgressChanged(object sender, ProgressChangedEventArgs e)
{
//nothing to do
}
public void WorkerRunWorkCompleted(object sender, RunWorkerCompletedEventArgs e)
{
//nothing to do
}
}
}

View File

@@ -1,25 +1,16 @@
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
using StructureHelper.Windows.Errors;
using StructureHelper.Windows.Errors;
using StructureHelper.Windows.Forces;
using StructureHelper.Windows.ViewModels.Errors;
using StructureHelper.Windows.ViewModels.Forces;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Cracking;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.Services.NdmCalculations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators.ForceResultLogic
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
{
internal class ShowCrackResultLogic
{

View File

@@ -8,7 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
{
internal class ShowCrackWidthLogic
{

View File

@@ -12,7 +12,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
{
internal class ShowDiagramLogic : ILongProcessLogic
{
@@ -25,7 +25,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
public int StepCount => ValidTupleList.Count();
public Action<int> SetProgress { get ; set; }
public Action<int> SetProgress { get; set; }
public bool Result { get; set; }
public void WorkerDoWork(object sender, DoWorkEventArgs e)

View File

@@ -9,7 +9,7 @@ using System.Linq;
using System.Windows;
using System.Windows.Forms;
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
{
internal class ShowProgressLogic
{
@@ -31,7 +31,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
WindowTitle = WindowTitle
};
wndProgress =new ShowProgressView(progressViewModel);
wndProgress = new ShowProgressView(progressViewModel);
wndProgress.Loaded += RunCalc;
wndProgress.ShowDialog();
}

View File

@@ -4,16 +4,25 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews"
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Calculations.Calculators"
d:DataContext="{d:DesignInstance vm:ForcesResultsViewModel}"
d:DataContext="{d:DesignInstance local:ForcesResultsViewModel}"
mc:Ignorable="d"
Title="Calculation Results" Height="350" Width="850" MinHeight="300" MinWidth="400" WindowStartupLocation="CenterScreen">
<DockPanel>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Style="{StaticResource ToolButton}"
Command="{Binding ShowCrackResultCommand}"
Content="Fcrc" ToolTip="Calc crack forces"/>
<Button Command="{Binding ShowCrackResultCommand}" ToolTip="Show force of cracking">
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_crack.png"/>
</Button>
<Button Command="{Binding InterpolateCommand}" ToolTip="Show result step by step">
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_interpolation_1_1.png"/>
</Button>
<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 ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
</Button>
</ToolBar>
</ToolBarTray>
<Grid>
@@ -48,14 +57,11 @@
</DataGrid>
<StackPanel Grid.Column="1">
<Button Margin="3" Content="Graphic" ToolTip="Show graphic results" Command="{Binding ShowIsoFieldCommand}"/>
<Button Margin="3" Content="Diagrams" ToolTip="Show diagrams" Command="{Binding ShowGraphsCommand}"/>
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
<Button Margin="3" Content="Interpolate" ToolTip="Create analysis by substep" Command="{Binding InterpolateCommand}"/>
<Button Margin="3" Content="Export" ToolTip="Export results to *.csv" Command="{Binding ExportToCSVCommand}"/>
<Button Margin="3" Content="Set Prestrain" ToolTip="Set strains as auto prestrain" Command="{Binding SetPrestrainCommand}"/>
<Button Margin="3" Content="Anchorage" ToolTip="Set strains as auto prestrain" Command="{Binding ShowAnchorageCommand}"/>
<Button Margin="3" Content="Geometry" ToolTip="Show Geometry Properties" Command="{Binding ShowGeometryResultCommand}"/>
<Button Margin="3" Content="Fcrc" ToolTip="Show crack force" Command="{Binding ShowCrackResultCommand}"/>
<Button Margin="3" Content="Acrc" ToolTip="Show crack width" Command="{Binding ShowCrackWidthResultCommand}"/>
</StackPanel>
</Grid>

View File

@@ -1,5 +1,4 @@
using StructureHelper.Windows.ViewModels.Calculations.Calculators;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

View File

@@ -5,13 +5,11 @@ using StructureHelper.Services.Exports;
using StructureHelper.Services.Reports;
using StructureHelper.Services.Reports.CalculationReports;
using StructureHelper.Services.ResultViewers;
using StructureHelper.Windows.CalculationWindows.CalculatorsViews;
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.GeometryCalculatorViews;
using StructureHelper.Windows.Errors;
using StructureHelper.Windows.Forces;
using StructureHelper.Windows.PrimitivePropertiesWindow;
using StructureHelper.Windows.ViewModels.Calculations.Calculators.ForceResultLogic;
using StructureHelper.Windows.ViewModels.Calculations.Calculators;
using StructureHelper.Windows.ViewModels.Errors;
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
using StructureHelperCommon.Infrastructures.Enums;
@@ -32,7 +30,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
{
public class ForcesResultsViewModel : ViewModelBase
{
@@ -40,6 +38,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
private ForceCalculator forceCalculator;
private ILongProcessLogic progressLogic;
private ShowProgressLogic showProgressLogic;
private InteractionDiagramLogic interactionDiagramLogic = new();
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
private IForcesResults forcesResults;
@@ -61,11 +60,27 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
private ICommand showCrackResult;
private ICommand showCrackGraphsCommand;
private RelayCommand showCrackWidthResult;
private ICommand showInteractionDiagramCommand;
public IForcesResults ForcesResults
{
get => forcesResults;
}
public ICommand ShowInteractionDiagramCommand
{
get
{
return showInteractionDiagramCommand ??
(showInteractionDiagramCommand = new RelayCommand(o =>
{
interactionDiagramLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple.Clone() as ForceTuple;
interactionDiagramLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
interactionDiagramLogic.CalcTerm = SelectedResult.DesignForceTuple.CalcTerm;
interactionDiagramLogic.NdmPrimitives = ndmPrimitives;
interactionDiagramLogic.ShowWindow();
}, o => SelectedResult != null && SelectedResult.IsValid));
}
}
public ICommand ShowIsoFieldCommand
{
get
@@ -77,7 +92,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
{
ShowIsoField();
}
}, o => (SelectedResult != null) && SelectedResult.IsValid));
}, o => SelectedResult != null && SelectedResult.IsValid));
}
}
public ICommand ExportToCSVCommand
@@ -169,7 +184,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
get => showCrackResult ??= new RelayCommand(o =>
{
SafetyProcessor.RunSafeProcess(ShowCrackResult);
}, o => (SelectedResult != null) && SelectedResult.IsValid);
}, o => SelectedResult != null && SelectedResult.IsValid);
}
private void ShowCrackResult()
{
@@ -185,7 +200,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
get => showCrackWidthResult ??= new RelayCommand(o =>
{
SafetyProcessor.RunSafeProcess(ShowCrackWidthResult);
}, o => (SelectedResult != null) && SelectedResult.IsValid);
}, o => SelectedResult != null && SelectedResult.IsValid);
}
private void ShowCrackWidthResult()
@@ -247,7 +262,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
get
{
return setPrestrainCommand ??
(setPrestrainCommand = new RelayCommand(o=>
(setPrestrainCommand = new RelayCommand(o =>
{
SetPrestrain();
}, o => SelectedResult != null
@@ -272,7 +287,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
{
get
{
return showAnchorageCommand??
return showAnchorageCommand ??
(showAnchorageCommand = new RelayCommand(o =>
{
showAnchorage();
@@ -292,11 +307,13 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
isoFieldReport = new IsoFieldReport(primitiveSets);
isoFieldReport.Show();
}
catch(Exception ex)
catch (Exception ex)
{
var vm = new ErrorProcessor()
{ ShortText = "Errors apearred during showing isofield, see detailed information",
DetailText = $"{ex}"};
{
ShortText = "Errors apearred during showing isofield, see detailed information",
DetailText = $"{ex}"
};
new ErrorMessage(vm).ShowDialog();
}
}
@@ -313,7 +330,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
var textParametrsLogic = new TextParametersLogic(ndms, strainMatrix);
var calculator = new GeometryCalculator(textParametrsLogic);
calculator.Run();
var result = calculator.Result as IGeometryResult;
var result = calculator.Result as IGeometryResult;
var wnd = new GeometryCalculatorResultView(result);
wnd.ShowDialog();
}
@@ -373,7 +390,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
}
if (selectedNdmPrimitives.Contains(item) & item.Triangulate == true)
{
ndmRange.AddRange(item.GetNdms(triangulationOptions));
}
}