Refactoring: add some button icons
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding WindowTitle}" Height="390" Width="400" MinHeight="300" MinWidth="400"
|
||||
ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
|
||||
Closing="Window_Closing" ShowInTaskbar="False" Icon="{Binding Mode=OneWay, Source={StaticResource CrackCalculator}}"
|
||||
Closing="Window_Closing" Icon="{Binding Mode=OneWay, Source={StaticResource CrackCalculator}}"
|
||||
>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
|
||||
d:DataContext="{d:DesignInstance local:CrackResultViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Result of calculations of crack" Height="450" Width="800" MinHeight="300" MinWidth="600" MaxHeight="800" MaxWidth="1000" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
||||
Title="Result of calculations of crack" Height="450" Width="800" MinHeight="300" MinWidth="600" MaxHeight="800" MaxWidth="1000" WindowStartupLocation="CenterScreen">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
|
||||
d:DataContext="{d:DesignInstance local:TupleCrackResultViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding WindowTitle}" Height="450" Width="900" MinHeight="300" MinWidth="500" MaxHeight="1000" MaxWidth="1400" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
||||
Title="{Binding WindowTitle}" Height="450" Width="900" MinHeight="300" MinWidth="500" MaxHeight="1000" MaxWidth="1400" WindowStartupLocation="CenterScreen">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private ValuePointsInterpolateViewModel viewModel;
|
||||
private IResult result;
|
||||
private ValuePointsInterpolationInputData inputData;
|
||||
public ForcesTupleResult SelectedResult { get; set; }
|
||||
public IForcesTupleResult SelectedResult { get; set; }
|
||||
public IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
|
||||
public ForceCalculator ForceCalculator { get; set; }
|
||||
|
||||
|
||||
@@ -4,39 +4,109 @@
|
||||
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:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||
d:DataContext="{d:DesignInstance local:ForcesResultsViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="Calculation Results" Height="350" Width="850" MinHeight="300" MinWidth="400" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
||||
Title="Calculation Results" Height="450" Width="850" MinHeight="400" MinWidth="650" WindowStartupLocation="CenterScreen">
|
||||
<DockPanel>
|
||||
<ToolBarTray DockPanel.Dock="Top">
|
||||
<ToolBar>
|
||||
<ToolBar Name="CrackResult">
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowCrackResultCommand}" ToolTip="Show force of cracking">
|
||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_crack.png"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding InterpolateCommand}" ToolTip="Show result step by step">
|
||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_interpolation_1_1.png"/>
|
||||
</ToolBar>
|
||||
<ToolBar Name="InterpolatedResultToolBar">
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding InterpolateCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show result step by step"
|
||||
IconContent="{StaticResource StepSolution}"
|
||||
DescriptionText="Show result step by step for selected load combination"/>
|
||||
</Button.ToolTip>
|
||||
<ContentControl ContentTemplate="{DynamicResource StepSolution}"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowGraphsCommand}" ToolTip="Show diagram moment-curvature">
|
||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowGraphsCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show moment-curvature diagram"
|
||||
IconContent="{StaticResource MomentCurvatureDiagram}"
|
||||
DescriptionText="Show moment-curvature diagram as result of stepped solution"/>
|
||||
</Button.ToolTip>
|
||||
<ContentControl ContentTemplate="{DynamicResource MomentCurvatureDiagram}"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding GraphValuePointsCommand}" ToolTip="Show diagram by value points">
|
||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding GraphValuePointsCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show diagram by value points"
|
||||
IconContent="{StaticResource ValuePointDiagram}"
|
||||
DescriptionText="Show results for value point as result of stepped solution"/>
|
||||
</Button.ToolTip>
|
||||
<ContentControl ContentTemplate="{DynamicResource ValuePointDiagram}"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
|
||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
|
||||
</ToolBar>
|
||||
<ToolBar Name="InteractionDiagramToolBar">
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowInteractionDiagramCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show interaction diagram"
|
||||
IconContent="{StaticResource InteractionDiagram}"
|
||||
DescriptionText="Show interaction diagram, which means line of limit bearing capacity"/>
|
||||
</Button.ToolTip>
|
||||
<ContentControl ContentTemplate="{DynamicResource InteractionDiagram}"/>
|
||||
</Button>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}" ToolTip="Show isofield results">
|
||||
</ToolBar>
|
||||
<ToolBar Name="IsoFieldToolBar">
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show isofield results"
|
||||
IconContent="{StaticResource IsoFieldResult}"
|
||||
DescriptionText="Show graphical results with color as function of result value"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource IsoFieldResult}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
<ToolBar>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowGeometryResultCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show Geometry Properties"
|
||||
IconContent="{DynamicResource GeometryTable}"
|
||||
DescriptionText="Show table of geometry properties of cross-section for selected load combination"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource GeometryTable}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowForceResultCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show Force Properties"
|
||||
IconContent="{StaticResource ForceTable}"
|
||||
DescriptionText="Show table of force geometry properties of cross-section - values of forces, moments and their eccentricities"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource ForceTable}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
<ToolBar>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ExportToCSVCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Export to *.csv"
|
||||
IconContent="{StaticResource ExportToXLS}"
|
||||
DescriptionText="Export all valid results to *.csv file"/>
|
||||
</Button.ToolTip>
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource ExportToXLS}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
</ToolBarTray>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="90"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="22"/>
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid x:Name="ResultGrid" IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding ForcesResults.ForcesResultList}" SelectedItem="{Binding SelectedResult}" >
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
@@ -64,11 +134,29 @@
|
||||
</DataGrid>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
|
||||
<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}"/>
|
||||
</StackPanel>
|
||||
<StatusBar Grid.Row="1">
|
||||
<StatusBarItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Valid result: "/>
|
||||
<TextBlock Text="{Binding ValidResultCount}"/>
|
||||
</StackPanel>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Invalid result: "/>
|
||||
<TextBlock Text="{Binding InvalidResultCount}"/>
|
||||
</StackPanel>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Total: "/>
|
||||
<TextBlock Text="{Binding TotalResultCount}"/>
|
||||
</StackPanel>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
|
||||
public ForcesTupleResult SelectedResult { get; set; }
|
||||
public IForcesTupleResult? SelectedResult { get; set; }
|
||||
private ICommand? showIsoFieldCommand;
|
||||
private ICommand? exportToCSVCommand;
|
||||
private ICommand? interpolateCommand;
|
||||
@@ -65,6 +65,11 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private ICommand? showCrackWidthResult;
|
||||
private ICommand? showInteractionDiagramCommand;
|
||||
private ICommand? graphValuepointsCommand;
|
||||
private ICommand showForceResultCommand;
|
||||
|
||||
public int ValidResultCount => forcesResults.ForcesResultList.Count(x => x.IsValid == true);
|
||||
public int InvalidResultCount => forcesResults.ForcesResultList.Count(x => x.IsValid == false);
|
||||
public int TotalResultCount => forcesResults.ForcesResultList.Count;
|
||||
|
||||
public IForcesResults ForcesResults
|
||||
{
|
||||
@@ -176,7 +181,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
};
|
||||
showProgressLogic.Show();
|
||||
}
|
||||
}, o => SelectedResult != null);
|
||||
}, o => SelectedResult is not null);
|
||||
}
|
||||
public ICommand ShowCrackGraphsCommand
|
||||
{
|
||||
@@ -206,8 +211,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
};
|
||||
showProgressLogic.Show();
|
||||
}
|
||||
}, o => SelectedResult != null && SelectedResult.IsValid
|
||||
);
|
||||
}, o => SelectedResult != null && SelectedResult.IsValid);
|
||||
}
|
||||
public ICommand ShowCrackResultCommand
|
||||
{
|
||||
@@ -225,22 +229,6 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
|
||||
}
|
||||
|
||||
//public ICommand ShowCrackWidthResultCommand
|
||||
//{
|
||||
// get => showCrackWidthResult ??= new RelayCommand(o =>
|
||||
// {
|
||||
// SafetyProcessor.RunSafeProcess(ShowCrackWidthResult);
|
||||
// }, o => SelectedResult != null && SelectedResult.IsValid);
|
||||
//}
|
||||
|
||||
//private void ShowCrackWidthResult()
|
||||
//{
|
||||
// showCrackWidthLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
// showCrackWidthLogic.CalcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
// showCrackWidthLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
|
||||
// showCrackWidthLogic.ndmPrimitives = ndmPrimitives.ToList();
|
||||
// showCrackWidthLogic.Show();
|
||||
//}
|
||||
public ICommand InterpolateCommand
|
||||
{
|
||||
get
|
||||
@@ -262,8 +250,10 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
progressLogic = interpolationLogic;
|
||||
showProgressLogic = new(interpolationLogic);
|
||||
showProgressLogic.ShowResult = ShowInterpolationProgressDialog;
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
ShowResult = ShowInterpolationProgressDialog
|
||||
};
|
||||
showProgressLogic.Show();
|
||||
}
|
||||
|
||||
@@ -275,7 +265,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
(graphValuepointsCommand = new RelayCommand(o =>
|
||||
{
|
||||
InterpolateValuePoints();
|
||||
}, o => SelectedResult != null));
|
||||
},
|
||||
o => SelectedResult != null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,7 +377,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var textParametrsLogic = new TextParametersLogic(ndms, strainMatrix);
|
||||
var textParametrsLogic = new GeometryParametersLogic(ndms, strainMatrix);
|
||||
var calculator = new GeometryCalculator(textParametrsLogic);
|
||||
calculator.Run();
|
||||
var result = calculator.Result as IGeometryResult;
|
||||
@@ -404,6 +395,36 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
}
|
||||
}
|
||||
public ICommand ShowForceResultCommand =>
|
||||
showForceResultCommand ??= new RelayCommand(o =>
|
||||
showForceResult(), o => SelectedResult != null && SelectedResult.IsValid);
|
||||
|
||||
private void showForceResult()
|
||||
{
|
||||
if (SelectPrimitives() == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var textParametrsLogic = new ForcesParametersLogic(ndms, strainMatrix);
|
||||
var calculator = new GeometryCalculator(textParametrsLogic);
|
||||
calculator.Run();
|
||||
var result = calculator.Result as IGeometryResult;
|
||||
var wnd = new GeometryCalculatorResultView(result);
|
||||
wnd.ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var vm = new ErrorProcessor()
|
||||
{
|
||||
ShortText = "Errors apearred during showing isofield, see detailed information",
|
||||
DetailText = $"{ex}"
|
||||
};
|
||||
new ErrorMessage(vm).ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ForcesResultsViewModel(ForceCalculator forceCalculator)
|
||||
{
|
||||
this.forceCalculator = forceCalculator;
|
||||
|
||||
Reference in New Issue
Block a user