Icons for calculators were changed
This commit is contained in:
@@ -10,6 +10,7 @@ namespace StructureHelper.Infrastructure.Enums
|
||||
{
|
||||
ForceCalculator,
|
||||
LimitCurveCalculator,
|
||||
CrackCalculator,
|
||||
FireCalculator
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
|
||||
<Style TargetType="Button" x:Key="ButtonBase">
|
||||
|
||||
|
||||
</Style>
|
||||
<Style TargetType="Button" x:Key="CommandButton" BasedOn="{StaticResource ButtonBase}">
|
||||
<Style.Setters>
|
||||
@@ -64,6 +64,19 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style TargetType="Viewbox">
|
||||
<Setter Property="Margin" Value="-2"/>
|
||||
<Setter Property="Width" Value="32"/>
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Stretch" Value="UniformToFill"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.25"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Style.Resources>
|
||||
<Setter Property="Width" Value="32"/>
|
||||
<Setter Property="Height" Value="32"/>
|
||||
@@ -81,12 +94,87 @@
|
||||
<Setter Property="Width" Value="32"/>
|
||||
</Style>
|
||||
|
||||
<Color x:Key="ButtonLight" A="255" B="255" G="255" R="255"/>
|
||||
<Color x:Key="CalculatorColor" A="255" B="149" G="149" R="211"/>
|
||||
<Color x:Key="CalculatorFrameColor" A="255" B="109" G="109" R="166"/>
|
||||
<SolidColorBrush x:Key="CalculatorCanvas" Color="{DynamicResource CalculatorColor}"/>
|
||||
<SolidColorBrush x:Key="CalculatorFrame" Color="{DynamicResource CalculatorFrameColor}"/>
|
||||
|
||||
<Style x:Key="ButtonCanvas" TargetType="Canvas">
|
||||
<Setter Property="Width" Value="32"/>
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ButtonCalculatorCanvas" TargetType="Canvas" BasedOn="{StaticResource ButtonCanvas}">
|
||||
<Setter Property="Background" Value="{DynamicResource CalculatorCanvas}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ButtonRect" TargetType="Rectangle">
|
||||
<Setter Property="Margin" Value="3"/>
|
||||
<Setter Property="Width" Value="26"/>
|
||||
<Setter Property="Height" Value="26"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="StrokeThickness" Value="1"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<DataTemplate x:Key="OkCancelButtons">
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource CancelButton}" Command="{Binding CancelCommand}"/>
|
||||
<Button Style="{StaticResource OkButton}" Command="{Binding OkCommand}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
<DataTemplate x:Key="ButtonCalculatorRectangle">
|
||||
<Rectangle Style="{DynamicResource ButtonRect}" Stroke="{DynamicResource CalculatorFrame}">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="{DynamicResource ButtonLight}" Offset="0.2"/>
|
||||
<GradientStop Color="{DynamicResource CalculatorColor}" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="DiagramCalculator">
|
||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
||||
<Canvas.Children>
|
||||
<ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
|
||||
<Line Margin="4" X1="0" Y1="20" X2="25" Y2="20" StrokeThickness="1.5" Stroke="{DynamicResource CalculatorFrame}"/>
|
||||
<Line Margin="4" X1="4" Y1="0" X2="4" Y2="25" StrokeThickness="1.5" Stroke="{DynamicResource CalculatorFrame}"/>
|
||||
<Path Margin="4" Data="M 0 5 l 4 -4 l 7 4 l 7 6 l 2 4 l -2 7 l -2 2 " Stroke="{DynamicResource CalculatorFrame}"/>
|
||||
<TextBlock Margin="4,2,0,0" Text="M-N" Foreground="Black" FontSize="10" HorizontalAlignment="Stretch" FontWeight="Bold" />
|
||||
</Canvas.Children>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="CrackCalculator">
|
||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
||||
<Canvas.Children>
|
||||
<ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
|
||||
<Path Margin="4" Data="M 0 0 l 25 0 l 0 20
|
||||
l -4 0
|
||||
l -1 -5 l 1 -5 l -2 5 l -2 5
|
||||
l -3 0
|
||||
l 0 -5 l 0 -10 l -2 10 l -2 5
|
||||
l -3 0
|
||||
l -1 -5 l 1 -5 l -2 5 l -2 5
|
||||
l -4 0" Fill="{DynamicResource CalculatorFrame}"/>
|
||||
<TextBlock Margin="4,2,0,0" Text="Crc" Foreground="White" FontSize="10" HorizontalAlignment="Stretch" FontWeight="Bold" />
|
||||
</Canvas.Children>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="CalculatorRun">
|
||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
||||
<Canvas.Children>
|
||||
<ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
|
||||
<Path Margin="4" Data="M 4 2 l 12 10 l -12 10 l 0 -20" Fill="{DynamicResource CalculatorFrame}"/>
|
||||
</Canvas.Children>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -21,9 +21,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
var inputData = new CrackWidthCalculatorInputData()
|
||||
{
|
||||
LimitState = LimitState,
|
||||
CalcTerm = CalcTerm,
|
||||
ForceTuple = ForceTuple,
|
||||
//LimitState = LimitState,
|
||||
//CalcTerm = CalcTerm,
|
||||
LongTermTuple = ForceTuple,
|
||||
NdmPrimitives = ndmPrimitives
|
||||
};
|
||||
var calculator = new CrackWidthCalculator() { InputData = inputData };
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var material = valuePoint.ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
var userPrestrain = valuePoint.ndmPrimitive.UsersPrestrain;
|
||||
var autoPrestrain = valuePoint.ndmPrimitive.AutoPrestrain;
|
||||
var ndm = new RebarNdm()
|
||||
var ndm = new Ndm()
|
||||
{
|
||||
Area = valuePoint.areaPoint.Area,
|
||||
CenterX = valuePoint.areaPoint.Point.X,
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
<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="Acrc" ToolTip="Show crack width" Command="{Binding ShowCrackWidthResultCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private ShowProgressLogic showProgressLogic;
|
||||
private InteractionDiagramLogic interactionDiagramLogic;
|
||||
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
|
||||
private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
||||
//private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
||||
private IForcesResults forcesResults;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private IEnumerable<INdmPrimitive> selectedNdmPrimitives;
|
||||
@@ -225,22 +225,22 @@ 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);
|
||||
}
|
||||
//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();
|
||||
}
|
||||
//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
|
||||
|
||||
@@ -79,7 +79,9 @@
|
||||
<ContextMenu x:Key="AnalisesCRUD">
|
||||
<MenuItem Header="Run" Command="{Binding Run}">
|
||||
<MenuItem.Icon>
|
||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Run.png" />
|
||||
<Viewbox Width="16" Height="16">
|
||||
<ContentControl ContentTemplate="{DynamicResource CalculatorRun}"/>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
@@ -194,11 +196,20 @@
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}" ToolTip="Add Force Calculator">
|
||||
<Image Source="/Windows/MainWindow/Calculator32.png"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.LimitCurveCalculator}" ToolTip="Add Interaction Diagram Calculator">
|
||||
<Image Source="/Windows/MainWindow/Calculator32.png"/>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.LimitCurveCalculator}" ToolTip="Add Interaction Diagram Calculator">
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource DiagramCalculator}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Run}" ToolTip="Run Calculations">
|
||||
<Image Source="/Windows/MainWindow/Analysis32.png"/>
|
||||
<Button Visibility="Hidden" Style="{DynamicResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.CrackCalculator}" ToolTip="Add Interaction Diagram Calculator">
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource CrackCalculator}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding Run}" ToolTip="Run Calculations">
|
||||
<Viewbox>
|
||||
<ContentControl ContentTemplate="{DynamicResource CalculatorRun}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
<ToolBar ToolTip="Tools">
|
||||
@@ -341,7 +352,16 @@
|
||||
</MenuItem>
|
||||
<MenuItem Header="Add Interaction Diagram Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.LimitCurveCalculator}">
|
||||
<MenuItem.Icon>
|
||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
||||
<Viewbox Width="16" Height="16">
|
||||
<ContentControl ContentTemplate="{DynamicResource DiagramCalculator}"/>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Visibility="Hidden" Header="Add Crack Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.CrackCalculator}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<ContentControl ContentTemplate="{DynamicResource CrackCalculator}"/>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
|
||||
@@ -44,12 +44,21 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
{
|
||||
AddLimitCurveCalculator();
|
||||
}
|
||||
else if (parameterType == CalculatorTypes.CrackCalculator)
|
||||
{
|
||||
AddCrackCalculator();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(parameterType));
|
||||
}
|
||||
}
|
||||
|
||||
private void AddCrackCalculator()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private void AddLimitCurveCalculator()
|
||||
{
|
||||
var inputData = new LimitCurveInputData(repository.Primitives);
|
||||
|
||||
Reference in New Issue
Block a user