Add primitive visual property

This commit is contained in:
RedikultsevEvg
2025-08-03 23:37:50 +05:00
parent 6e8f4bcc58
commit 466c57feef
52 changed files with 742 additions and 138 deletions

View File

@@ -1,6 +1,7 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperCommon.Services;
using StructureHelperLogics.Models.BeamShears;
@@ -10,6 +11,7 @@ namespace DataAccess.DTOs
{
private Dictionary<(Guid id, Type type), ISaveable> referenceDictionary;
private IShiftTraceLogger traceLogger;
private IUpdateStrategy<IHasVisualProperty> visualUpdateStrategy;
public HasStirrupsFromDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
{
@@ -63,7 +65,8 @@ namespace DataAccess.DTOs
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(stirrup));
}
visualUpdateStrategy = new HasVisualPropertyFromDTOUpdateStrategy(referenceDictionary, traceLogger);
visualUpdateStrategy.Update(newItem, stirrup);
return newItem;
}

View File

@@ -1,6 +1,7 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperCommon.Services;
using StructureHelperLogics.Models.BeamShears;
@@ -10,6 +11,7 @@ namespace DataAccess.DTOs
{
private Dictionary<(Guid id, Type type), ISaveable> referenceDictionary;
private IShiftTraceLogger traceLogger;
private IUpdateStrategy<IHasVisualProperty> visualUpdateStrategy;
public HasStirrupsToDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
{
@@ -64,6 +66,8 @@ namespace DataAccess.DTOs
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(stirrup));
}
visualUpdateStrategy = new HasVisualPropertyToDTOUpdateStrategy(referenceDictionary, traceLogger);
visualUpdateStrategy.Update(newItem, stirrup);
return newItem;
}

View File

@@ -1,5 +1,6 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.Models.Materials;
using System;
@@ -15,6 +16,7 @@ namespace DataAccess.DTOs
private IUpdateStrategy<IStirrupByInclinedRebar> updateStrategy;
private IConvertStrategy<RebarSectionDTO, IRebarSection> rebarConvertStrategy;
public StirrupByInclinedRebarToDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger)
{
}

View File

@@ -1,5 +1,6 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.Models.BeamShears.Logics;
using System;
@@ -15,6 +16,7 @@ namespace DataAccess.DTOs
private IUpdateStrategy<IStirrupGroup> updateStrategy;
private IUpdateStrategy<IHasStirrups> stirrupUpdateStrategy;
public StirrupGroupToDTOConvertStrategy(
Dictionary<(Guid id, Type type), ISaveable> referenceDictionary,
IShiftTraceLogger traceLogger)
@@ -34,7 +36,7 @@ namespace DataAccess.DTOs
private void InitializeStrategies()
{
updateStrategy ??= new StirrupGroupUpdateStrategy();
updateStrategy ??= new StirrupGroupUpdateStrategy() { UpdateChildren = false};
stirrupUpdateStrategy ??= new HasStirrupsToDTOUpdateStrategy(ReferenceDictionary, TraceLogger);
}
}

View File

@@ -0,0 +1,37 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperCommon.Services;
namespace DataAccess.DTOs
{
public class HasVisualPropertyFromDTOUpdateStrategy : IUpdateStrategy<IHasVisualProperty>
{
private Dictionary<(Guid id, Type type), ISaveable> referenceDictionary;
private IShiftTraceLogger traceLogger;
private IConvertStrategy<PrimitiveVisualProperty, PrimitiveVisualPropertyDTO> convertStrategy;
public HasVisualPropertyFromDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
{
this.referenceDictionary = referenceDictionary;
this.traceLogger = traceLogger;
}
public void Update(IHasVisualProperty targetObject, IHasVisualProperty sourceObject)
{
CheckObject.IsNull(targetObject);
CheckObject.IsNull(sourceObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; }
convertStrategy = new DictionaryConvertStrategy<PrimitiveVisualProperty, PrimitiveVisualPropertyDTO>(
referenceDictionary,
traceLogger,
new PrimitiveVisualPropertyFromDTOConvertStrategy(referenceDictionary, traceLogger));
if (sourceObject.VisualProperty is not PrimitiveVisualPropertyDTO visualProperty)
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(sourceObject.VisualProperty));
}
targetObject.VisualProperty = convertStrategy.Convert(visualProperty);
}
}
}

View File

@@ -0,0 +1,32 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperCommon.Services;
namespace DataAccess.DTOs
{
public class HasVisualPropertyToDTOUpdateStrategy : IUpdateStrategy<IHasVisualProperty>
{
private Dictionary<(Guid id, Type type), ISaveable> referenceDictionary;
private IShiftTraceLogger traceLogger;
private IConvertStrategy<PrimitiveVisualPropertyDTO, IPrimitiveVisualProperty> convertStrategy;
public HasVisualPropertyToDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
{
this.referenceDictionary = referenceDictionary;
this.traceLogger = traceLogger;
}
public void Update(IHasVisualProperty targetObject, IHasVisualProperty sourceObject)
{
CheckObject.IsNull(targetObject);
CheckObject.IsNull(sourceObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; }
convertStrategy = new DictionaryConvertStrategy<PrimitiveVisualPropertyDTO, IPrimitiveVisualProperty>(
referenceDictionary,
traceLogger,
new PrimitiveVisualPropertyToDTOConvertStrategy(referenceDictionary, traceLogger));
targetObject.VisualProperty = convertStrategy.Convert(sourceObject.VisualProperty);
}
}
}

View File

@@ -0,0 +1,23 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
namespace DataAccess.DTOs
{
internal class PrimitiveVisualPropertyFromDTOConvertStrategy : ConvertStrategy<PrimitiveVisualProperty, PrimitiveVisualPropertyDTO>
{
private IUpdateStrategy<IPrimitiveVisualProperty> _updateStrategy;
public PrimitiveVisualPropertyFromDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger)
{
}
public override PrimitiveVisualProperty GetNewItem(PrimitiveVisualPropertyDTO source)
{
_updateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy();
ChildClass = this;
NewItem = new(source.Id);
return NewItem;
}
}
}

View File

@@ -0,0 +1,25 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.VisualProperties;
namespace DataAccess.DTOs
{
public class PrimitiveVisualPropertyToDTOConvertStrategy : ConvertStrategy<PrimitiveVisualPropertyDTO, IPrimitiveVisualProperty>
{
private IUpdateStrategy<IPrimitiveVisualProperty> _updateStrategy;
public PrimitiveVisualPropertyToDTOConvertStrategy(
Dictionary<(Guid id, Type type), ISaveable> referenceDictionary,
IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger)
{
}
public override PrimitiveVisualPropertyDTO GetNewItem(IPrimitiveVisualProperty source)
{
_updateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy();
ChildClass = this;
NewItem = new(source.Id);
return NewItem;
}
}
}

View File

@@ -22,7 +22,7 @@ namespace DataAccess.DTOs
(this, new RectangleShapeFromDTOConvertStrategy(this));
NewItem = rectangleConvertStrategy.Convert(rectangleShapeDTO);
}
if (source is CircleShapeDTO circleShapeDTO)
else if (source is CircleShapeDTO circleShapeDTO)
{
circleConvertStrategy ??= new DictionaryConvertStrategy<CircleShape, CircleShapeDTO>
(this, new CircleShapeFromDTOConvertStrategy(this));

View File

@@ -1,5 +1,7 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.BeamShears;
using System.Windows.Media;
namespace DataAccess.DTOs
{
@@ -10,13 +12,23 @@ namespace DataAccess.DTOs
[JsonProperty("Name")]
public string? Name { get; set; } = string.Empty;
[JsonProperty("StirrupDensity")]
public double StirrupDensity { get; set; }
public double StirrupDensity { get; set; } = 30000;
[JsonProperty("CompressedGap")]
public double CompressedGap { get; set; }
public double CompressedGap { get; set; } = 0;
[JsonProperty("StartCoordinate")]
public double StartCoordinate { get; set; } = 0;
[JsonProperty("EndCoordinate")]
public double EndCoordinate { get; set; } = 100;
[JsonProperty("VisualProperty")]
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupByDensityDTO(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,6 +1,8 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.Models.Materials;
using System.Windows.Media;
namespace DataAccess.DTOs
{
@@ -22,11 +24,16 @@ namespace DataAccess.DTOs
public double LegCount { get; set; }
[JsonProperty("RebarSection")]
public IRebarSection RebarSection { get; set; }
[JsonProperty("VisualProperty")]
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupByInclinedRebarDTO(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,6 +1,8 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.Models.Materials;
using System.Windows.Media;
namespace DataAccess.DTOs
{
@@ -9,23 +11,33 @@ namespace DataAccess.DTOs
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string? Name { get; set; }
public string? Name { get; set; } = string.Empty;
[JsonProperty("LegCount")]
public double LegCount { get; set; }
public double LegCount { get; set; } = 2;
[JsonProperty("Diameter")]
public double Diameter { get; set; }
public double Diameter { get; set; } = 0.008;
[JsonProperty("Material")]
public IReinforcementLibMaterial Material { get; set; }
[JsonProperty("Spacing")]
public double Spacing { get; set; }
public double Spacing { get; set; } = 0.1;
[JsonProperty("CompressedGap")]
public double CompressedGap { get; set; }
public double CompressedGap { get; set; } = 0;
[JsonProperty("IsSpiral")]
public bool IsSpiral { get; set; } = false;
[JsonProperty("StartCoordinate")]
public double StartCoordinate { get; set; } = 0;
[JsonProperty("EndCoordinate")]
public double EndCoordinate { get; set; } = 100;
[JsonProperty("VisualProperty")]
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupByRebarDTO(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,5 +1,8 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.NdmCalculations.Primitives;
using System.Windows.Media;
namespace DataAccess.DTOs
{
@@ -8,20 +11,27 @@ namespace DataAccess.DTOs
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string? Name { get; set; }
public string? Name { get; set; } = string.Empty;
[JsonProperty("CompressedGap")]
public double CompressedGap { get; set; }
public double CompressedGap { get; set; } = 0;
[JsonProperty("Stirrups")]
public List<IStirrup> Stirrups { get; } = new();
[JsonProperty("VisualProperty")]
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupGroupDTO(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()
{
throw new NotImplementedException();
return this;
}
}
}

View File

@@ -0,0 +1,32 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperCommon.Services.ColorServices;
using System.Windows.Media;
namespace DataAccess.DTOs
{
public class PrimitiveVisualPropertyDTO : IPrimitiveVisualProperty
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("IsVisible")]
public bool IsVisible { get; set; } = true;
[JsonProperty("Color")]
public Color Color { get; set; } = ColorProcessor.GetRandomColor();
[JsonProperty("Zindex")]
public int ZIndex { get; set; } = 0;
[JsonProperty("Opacity")]
public double Opacity { get; set; } = 1;
public PrimitiveVisualPropertyDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -74,6 +74,7 @@ namespace DataAccess.DTOs
{ (typeof(List<IVisualAnalysis>), "ListOfIVisualAnalysis") },
{ (typeof(Point2DDTO), "Point2D") },
{ (typeof(PointNdmPrimitiveDTO), "PointNdmPrimitive") },
{ (typeof(PrimitiveVisualPropertyDTO), "PrimitiveVisualProperty") },
{ (typeof(ProjectDTO), "Project") },
{ (typeof(RebarNdmPrimitiveDTO), "RebarNdmPrimitive") },
{ (typeof(RebarSectionDTO), "RebarSection") },

View File

@@ -1,10 +1,5 @@
using Newtonsoft.Json;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace DataAccess.DTOs
@@ -24,5 +19,9 @@ namespace DataAccess.DTOs
[JsonProperty("Opacity")]
public double Opacity { get; set; }
public object Clone()
{
throw new NotImplementedException();
}
}
}

View File

@@ -49,5 +49,5 @@ using System.Windows;
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2025.06.23.01")]
[assembly: AssemblyFileVersion("2025.06.23.01")]
[assembly: AssemblyVersion("2025.07.23.01")]
[assembly: AssemblyFileVersion("2025.07.23.01")]

View File

@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2025-01-27T09:32:31.9770658Z||;True|2024-12-29T20:48:11.7280613+05:00||;True|2024-12-27T13:24:44.0055462+05:00||;True|2024-11-13T09:16:22.8894163+05:00||;True|2024-08-13T14:00:35.8311260+05:00||;True|2024-08-12T12:59:16.1785759+05:00||;True|2024-03-11T20:33:14.1457807+05:00||;True|2024-03-10T19:11:27.6834663+05:00||;True|2024-02-02T12:22:50.1454015+05:00||;True|2023-02-25T13:37:39.2738786+05:00||;False|2023-02-25T13:37:24.0284261+05:00||;True|2023-02-25T13:34:01.6858860+05:00||;True|2023-02-25T13:31:18.8295711+05:00||;False|2023-02-25T13:25:21.5807199+05:00||;False|2023-02-25T13:24:41.7164398+05:00||;</History>
<History>True|2025-07-21T06:22:35.9564230Z||;True|2025-01-27T14:32:31.9770658+05:00||;True|2024-12-29T20:48:11.7280613+05:00||;True|2024-12-27T13:24:44.0055462+05:00||;True|2024-11-13T09:16:22.8894163+05:00||;True|2024-08-13T14:00:35.8311260+05:00||;True|2024-08-12T12:59:16.1785759+05:00||;True|2024-03-11T20:33:14.1457807+05:00||;True|2024-03-10T19:11:27.6834663+05:00||;True|2024-02-02T12:22:50.1454015+05:00||;True|2023-02-25T13:37:39.2738786+05:00||;False|2023-02-25T13:37:24.0284261+05:00||;True|2023-02-25T13:34:01.6858860+05:00||;True|2023-02-25T13:31:18.8295711+05:00||;False|2023-02-25T13:25:21.5807199+05:00||;False|2023-02-25T13:24:41.7164398+05:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@@ -8,7 +8,7 @@
<UseWPF>true</UseWPF>
<ImplicitUsings>disable</ImplicitUsings>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<ApplicationIcon>Infrastructure\UI\Icons\SH_лого_16.ico</ApplicationIcon>
<AssemblyVersion></AssemblyVersion>
</PropertyGroup>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>D:\Repos\StructureHelper\StructureHelper\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
<_LastSelectedProfileId>C:\Repos\StructureHelper\StructureHelper\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
</PropertyGroup>
<ItemGroup>
<ApplicationDefinition Update="App.xaml">

View File

@@ -51,9 +51,7 @@
</Button>
</ToolBar>
<ToolBar ToolTip="Stirrups" DataContext="{Binding Stirrups}">
<Button Style="{StaticResource ToolButton}"
Command="{Binding Add}"
CommandParameter="{x:Static enums:StirrupTypes.GroupOfStirrups}">
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.GroupOfStirrups}">
<Button.ToolTip>
<uc:ButtonToolTipEh HeaderText="Add group of stirrup"
IconContent="{StaticResource TreeGroup}"
@@ -152,7 +150,15 @@ CommandParameter="{x:Static enums:StirrupTypes.GroupOfStirrups}">
</Grid.ColumnDefinitions>
<ScrollViewer>
<StackPanel>
<Expander Header="Actions" DataContext="{Binding Actions}">
<Expander DataContext="{Binding Actions}">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource DistributedLoad}"/>
</Viewbox>
<TextBlock Text="Actions"/>
</StackPanel>
</Expander.Header>
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add" Command="{Binding Add}"/>
@@ -168,32 +174,29 @@ CommandParameter="{x:Static enums:StirrupTypes.GroupOfStirrups}">
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Cross-Sections" DataContext="{Binding Sections}">
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ContextMenu="{StaticResource EditCopyDelete}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Stirrups" DataContext="{Binding Stirrups}">
<Expander DataContext="{Binding Sections}">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource ShearRectangleSection}"/>
</Viewbox>
<TextBlock Text="Cross-sections"/>
</StackPanel>
</Expander.Header>
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">
<MenuItem Header="Uniformly distributed density" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.Density}">
<MenuItem Header="Rectangle section" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
<MenuItem.Icon>
<Viewbox Height="24" Width="24">
<ContentControl ContentTemplate="{DynamicResource StirrupDensity}"/>
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource ShearRectangleSection}"/>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Uniformly distributed rebars" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.UniformRebar}">
<MenuItem Header="Circle section" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
<MenuItem.Icon>
<Viewbox Height="24" Width="24">
<ContentControl ContentTemplate="{DynamicResource StirrupRebars}"/>
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource ShearCircleSection}"/>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
@@ -210,7 +213,68 @@ CommandParameter="{x:Static enums:StirrupTypes.GroupOfStirrups}">
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Calculators" DataContext="{Binding Calculators}">
<Expander DataContext="{Binding Stirrups}">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource StirrupRebars}"/>
</Viewbox>
<TextBlock Text="Stirrups"/>
</StackPanel>
</Expander.Header>
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">
<MenuItem Header="Group of stirrup" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.GroupOfStirrups}">
<MenuItem.Icon>
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource TreeGroup}"/>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Uniformly distributed density" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.Density}">
<MenuItem.Icon>
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource StirrupDensity}"/>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Uniformly distributed rebars" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.UniformRebar}">
<MenuItem.Icon>
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource StirrupRebars}"/>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Inclined rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:StirrupTypes.Density}">
<MenuItem.Icon>
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource StirrupInclinedRebar}"/>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ContextMenu="{StaticResource EditCopyDelete}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander DataContext="{Binding Calculators}">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<Viewbox Height="16" Width="16">
<ContentControl ContentTemplate="{DynamicResource ShearCalculator}"/>
</Viewbox>
<TextBlock Text="Calculators"/>
</StackPanel>
</Expander.Header>
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">

View File

@@ -12,6 +12,8 @@
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<TabControl>
<TabItem Header="Main">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -27,6 +29,25 @@
<TextBlock Grid.Row="1" Text="Density"/>
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding Density, Converter={StaticResource DistributedLoadConverter}, ValidatesOnDataErrors=True}"/>
</Grid>
</TabItem>
<TabItem Header="Misc.">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Start coordinate"/>
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
<TextBlock Grid.Row="1" Text="End coordinate"/>
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding EndCoordinate, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
</Grid>
</TabItem>
</TabControl>
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
</Grid>
</Window>

View File

@@ -28,6 +28,28 @@ namespace StructureHelper.Windows.BeamShears
}
}
public double StartCoordinate
{
get => stirrupByDensity.StartCoordinate;
set
{
if (value < 0) { value = 0; }
stirrupByDensity.StartCoordinate = value;
OnPropertyChanged(nameof(StartCoordinate));
}
}
public double EndCoordinate
{
get => stirrupByDensity.EndCoordinate;
set
{
if (value < 0) { value = 0; }
stirrupByDensity.EndCoordinate = value;
OnPropertyChanged(nameof(EndCoordinate));
}
}
public string Error => null;
public string this[string columnName]

View File

@@ -44,6 +44,23 @@
<TabItem Header="Material" DataContext="{Binding Material}">
<ContentControl ContentTemplate="{StaticResource ReinforcementMaterial}" Content="{Binding}"/>
</TabItem>
<TabItem Header="Misc.">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Start coordinate"/>
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
<TextBlock Grid.Row="1" Text="End coordinate"/>
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding EndCoordinate, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
</Grid>
</TabItem>
</TabControl>
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
</Grid>

View File

@@ -60,6 +60,28 @@ namespace StructureHelper.Windows.BeamShears
}
}
public double StartCoordinate
{
get => stirrupByRebar.StartCoordinate;
set
{
if (value < 0) { value = 0;}
stirrupByRebar.StartCoordinate = value;
OnPropertyChanged(nameof(StartCoordinate));
}
}
public double EndCoordinate
{
get => stirrupByRebar.EndCoordinate;
set
{
if (value < 0) { value = 0; }
stirrupByRebar.EndCoordinate = value;
OnPropertyChanged(nameof(EndCoordinate));
}
}
public bool IsSpiral
{
get => stirrupByRebar.IsSpiral;
@@ -104,7 +126,21 @@ namespace StructureHelper.Windows.BeamShears
{
if (Spacing < MinSpacing)
{
result = $"Spacing of stirrups must not be less than {MinSpacing}";
result = $"Spacing of stirrups must not be less than {MinSpacing}(m)";
}
}
if (columnName == nameof(StartCoordinate))
{
if (StartCoordinate < 0)
{
result = $"Start coordinate must not be less than zero";
}
}
if (columnName == nameof(EndCoordinate))
{
if (EndCoordinate < StartCoordinate)
{
result = $"End coordinate must not be greate than start coordinate {StartCoordinate}(m)";
}
}
return result;

View File

@@ -7,7 +7,7 @@
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Help"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance vm:AboutViewModel}"
Title="Structure Helper" Height="250" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
Title="Structure Helper" Height="300" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="22"/>
@@ -17,6 +17,8 @@
<RowDefinition Height="22"/>
<RowDefinition Height="22"/>
<RowDefinition Height="22"/>
<RowDefinition Height="22"/>
<RowDefinition Height="22"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
@@ -24,11 +26,13 @@
<TextBlock Grid.Row="1" Text="{Binding Authors}"/>
<TextBlock Grid.Row="2" Text="Version"/>
<TextBlock Grid.Row="3" Text="{Binding Version}"/>
<TextBlock Grid.Row="4" Text="Copy Right (c) Redikultsev Evgeny"/>
<TextBlock Grid.Row="5" Text="www.structurehelper.ru"/>
<TextBlock Grid.Row="6" Text="https://vk.com/structurehelper"/>
<TextBlock Grid.Row="7" Text="https://t.me/StructureHelper"/>
<TextBlock Grid.Row="4" Text="Assembly"/>
<TextBlock Grid.Row="5" Text="{Binding Assembly}"/>
<TextBlock Grid.Row="6" Text="Copy Right (c) Redikultsev Evgeny"/>
<TextBlock Grid.Row="7" Text="www.structurehelper.ru"/>
<TextBlock Grid.Row="8" Text="https://vk.com/structurehelper"/>
<TextBlock Grid.Row="9" Text="https://t.me/StructureHelper"/>
<Button Grid.Row="8" Style="{StaticResource OkButton}" Click="Button_Click"/>
<Button Grid.Row="10" Style="{StaticResource OkButton}" Click="Button_Click"/>
</Grid>
</Window>

View File

@@ -1,8 +1,11 @@
using StructureHelper.Infrastructure;
using StructureHelperCommon.Infrastructures.Settings;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
@@ -11,15 +14,26 @@ namespace StructureHelper.Windows.ViewModels.Help
{
internal class AboutViewModel : OkCancelViewModelBase
{
public string Authors => "Redikultsev Evgeny";
public string Version
public string Authors => "Redikultsev Evgeny, Redikultseva Svetlana";
public string Assembly
{
get
{
string version;
version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
return version;
}
}
private string version1;
public string Version
{
get
{
var fileVersion = ProgramSetting.GetCurrentFileVersion();
return $"{fileVersion.VersionNumber}.{fileVersion.SubVersionNumber}";
}
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.VisualProperties
{
public interface IHasVisualProperty
{
IPrimitiveVisualProperty VisualProperty { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace StructureHelperCommon.Models.VisualProperties
{
/// <summary>
/// Implements visual settings for graphical primetives
/// </summary>
public interface IPrimitiveVisualProperty : ISaveable, ICloneable
{
/// <summary>
/// Flag of visibility
/// </summary>
bool IsVisible { get; set; }
/// <summary>
/// Color of primitive
/// </summary>
Color Color { get; set; }
/// <summary>
/// Index by z-coordinate
/// </summary>
int ZIndex { get; set; }
/// <summary>
/// Opacity of filling
/// </summary>
double Opacity { get; set; }
}
}

View File

@@ -0,0 +1,54 @@
using StructureHelperCommon.Services.ColorServices;
using System;
using System.Windows.Media;
namespace StructureHelperCommon.Models.VisualProperties
{
/// <inheritdoc/>
public class PrimitiveVisualProperty : IPrimitiveVisualProperty
{
private double opacity = 0;
/// <inheritdoc/>
public Guid Id { get; }
/// <inheritdoc/>
public bool IsVisible { get; set; } = true;
/// <inheritdoc/>
public Color Color { get; set; } = ColorProcessor.GetRandomColor();
/// <inheritdoc/>
public int ZIndex { get; set; } = 0;
/// <inheritdoc/>
public double Opacity
{
get => opacity;
set
{
if (value < 0)
{
opacity = 1;
return;
}
if (value > 1)
{
opacity = 1;
return;
}
opacity = value;
}
}
public PrimitiveVisualProperty(Guid id)
{
Id = id;
}
public object Clone()
{
var logic = new PrimitiveVisualPropertyUpdateStrategy();
PrimitiveVisualProperty newItem = new(Guid.NewGuid());
logic.Update(newItem, this);
return newItem;
}
}
}

View File

@@ -0,0 +1,20 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Services;
namespace StructureHelperCommon.Models.VisualProperties
{
public class PrimitiveVisualPropertyUpdateStrategy : IUpdateStrategy<IPrimitiveVisualProperty>
{
public void Update(IPrimitiveVisualProperty targetObject, IPrimitiveVisualProperty sourceObject)
{
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; }
targetObject.IsVisible = sourceObject.IsVisible;
targetObject.Color = sourceObject.Color;
targetObject.Opacity = sourceObject.Opacity;
targetObject.ZIndex = sourceObject.ZIndex;
}
}
}

View File

@@ -0,0 +1,14 @@
namespace StructureHelperLogics.Models.BeamShears
{
public interface IHasStartEndCoordinate
{
/// <summary>
/// Coordinate of start of zone of stirrups
/// </summary>
double StartCoordinate { get; set; }
/// <summary>
/// Coordinate of end of zone of stirrups
/// </summary>
double EndCoordinate { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.VisualProperties;
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
@@ -8,12 +9,13 @@ namespace StructureHelperLogics.Models.BeamShears
/// <summary>
/// Implement properties of stirrups
/// </summary>
public interface IStirrup : ISaveable, ICloneable
public interface IStirrup : ISaveable, ICloneable, IHasVisualProperty
{
string? Name { get; set; }
/// <summary>
/// Distance from axis of comressed rebar to edge of comressed zone, m
/// </summary>
double CompressedGap { get; set; }
}
}

View File

@@ -9,7 +9,7 @@ namespace StructureHelperLogics.Models.BeamShears
/// <summary>
/// Implement logic for calculation of bearing capacity of stirrups by value of their density
/// </summary>
public interface IStirrupByDensity : IStirrup
public interface IStirrupByDensity : IStirrup, IHasStartEndCoordinate
{
/// <summary>
/// Direct density of stirrups, N/m

View File

@@ -10,7 +10,7 @@ namespace StructureHelperLogics.Models.BeamShears
/// <summary>
/// Implement properties for uniformly distributed stirrups
/// </summary>
public interface IStirrupByRebar : IStirrup
public interface IStirrupByRebar : IStirrup, IHasStartEndCoordinate
{
/// <summary>
/// Material of stirrups

View File

@@ -36,15 +36,30 @@ namespace StructureHelperLogics.Models.BeamShears
TraceMessage(errorString);
}
else
{
CheckEntity();
}
return result;
}
private void CheckEntity()
{
if (Entity.StirrupDensity < minDensity)
{
result = false;
TraceMessage($"\nStirrup {Entity.Name} density d = {Entity.StirrupDensity} must not be less than dmin = {minDensity}");
}
if (Entity.StartCoordinate < 0)
{
result = false;
TraceMessage($"\nStirrup {Entity.Name} start coordinate must not be less than zero, but was {Entity.StartCoordinate}");
}
if (Entity.EndCoordinate <= Entity.StartCoordinate)
{
result = false;
TraceMessage($"\nStirrup {Entity.Name} start coordinate must be less than end coordinte, but was Xstart = {Entity.StartCoordinate}(m), Xend = {Entity.EndCoordinate}(m)");
}
return result;
}
private void TraceMessage(string errorString)

View File

@@ -40,6 +40,13 @@ namespace StructureHelperLogics.Models.BeamShears
TraceMessage(errorString);
}
else
{
CheckEntity();
}
return result;
}
private void CheckEntity()
{
if (Entity.Diameter < minDiameter)
{
@@ -66,9 +73,18 @@ namespace StructureHelperLogics.Models.BeamShears
result = false;
TraceMessage($"\nStirrup {Entity.Name} leg count n = {Entity.LegCount} must not be less than nmin = {minLegCount}");
}
if (Entity.StartCoordinate < 0)
{
result = false;
TraceMessage($"\nStirrup {Entity.Name} start coordinate must not be less than zero, but was {Entity.StartCoordinate}");
}
return result;
if (Entity.EndCoordinate <= Entity.StartCoordinate)
{
result = false;
TraceMessage($"\nStirrup {Entity.Name} start coordinate must be less than end coordinte, but was Xstart = {Entity.StartCoordinate}(m), Xend = {Entity.EndCoordinate}(m)");
}
}
private void TraceMessage(string errorString)
{
checkResult += errorString;

View File

@@ -1,5 +1,7 @@
using StructureHelperCommon.Models;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Loggers;
using StructureHelperCommon.Models.Shapes;
namespace StructureHelperLogics.Models.BeamShears
{
@@ -91,7 +93,18 @@ namespace StructureHelperLogics.Models.BeamShears
private void GetAreas()
{
reducingFactor = reinforcementModulus / concreteModulus;
if (inclinedSection.BeamShearSection.Shape is IRectangleShape)
{
concreteArea = inclinedSection.WebWidth * inclinedSection.FullDepth;
}
else if (inclinedSection.BeamShearSection.Shape is ICircleShape)
{
concreteArea = inclinedSection.WebWidth * inclinedSection.FullDepth * 0.785398; // * 0.785398 = PI/4
}
else
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(inclinedSection.BeamShearSection.Shape));
}
TraceLogger?.AddMessage($"Concrete area Ac = {concreteArea}(m^2)");
reinforcementArea = inclinedSection.BeamShearSection.ReinforcementArea;
TraceLogger?.AddMessage($"Reinforcement area As = {reinforcementArea}(m^2)");

View File

@@ -1,10 +1,14 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperCommon.Services;
namespace StructureHelperLogics.Models.BeamShears
{
public class StirrupBaseUpdateStrategy : IUpdateStrategy<IStirrup>
public class StirrupBaseUpdateStrategy : IParentUpdateStrategy<IStirrup>
{
private IUpdateStrategy<IPrimitiveVisualProperty> visualUpdateStrategy;
public bool UpdateChildren { get; set; } = true;
public void Update(IStirrup targetObject, IStirrup sourceObject)
{
CheckObject.IsNull(targetObject);
@@ -12,6 +16,18 @@ namespace StructureHelperLogics.Models.BeamShears
if (ReferenceEquals(targetObject, sourceObject)) { return; }
targetObject.Name = sourceObject.Name;
targetObject.CompressedGap = sourceObject.CompressedGap;
if (UpdateChildren == true)
{
UpdateTargetChildren(targetObject, sourceObject);
}
}
private void UpdateTargetChildren(IStirrup targetObject, IStirrup sourceObject)
{
CheckObject.IsNull(sourceObject.VisualProperty);
CheckObject.IsNull(targetObject.VisualProperty);
visualUpdateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy();
visualUpdateStrategy.Update(targetObject.VisualProperty, sourceObject.VisualProperty);
}
}
}

View File

@@ -38,10 +38,14 @@ namespace StructureHelperLogics.Models.BeamShears
TraceLogger?.AddMessage("Calculation has been started", TraceLogStatuses.Debug);
double crackLength = inclinedSection.EndCoord - inclinedSection.StartCoord;
TraceLogger?.AddMessage($"Length of crack = {inclinedSection.EndCoord} - {inclinedSection.StartCoord} = {crackLength}(m)");
double crackEndCoord = Math.Min(stirrupByDensity.EndCoordinate, inclinedSection.EndCoord);
double crackStartCoord = Math.Max(stirrupByDensity.StartCoordinate, inclinedSection.StartCoord);
double crackLengthViaStirrup = crackEndCoord - crackStartCoord;
TraceLogger?.AddMessage($"Length of crack via stirrup = {crackEndCoord} - {crackStartCoord} = {crackLengthViaStirrup}(m)");
double maxCrackLength = stirrupEffectiveness.MaxCrackLengthRatio * inclinedSection.EffectiveDepth;
TraceLogger?.AddMessage($"Max length of crack = {stirrupEffectiveness.MaxCrackLengthRatio} * {inclinedSection.EffectiveDepth} = {maxCrackLength}(m)");
double finalCrackLength = Math.Min(crackLength, maxCrackLength);
TraceLogger?.AddMessage($"Length of crack = Min({crackLength}, {maxCrackLength}) = {finalCrackLength}(m)");
double finalCrackLength = Math.Min(crackLengthViaStirrup, maxCrackLength);
TraceLogger?.AddMessage($"Length of crack = Min({crackLengthViaStirrup}, {maxCrackLength}) = {finalCrackLength}(m)");
double finalDensity = stirrupEffectiveness.StirrupShapeFactor * stirrupEffectiveness.StirrupPlacementFactor * stirrupByDensity.StirrupDensity;
TraceLogger?.AddMessage($"Stirrups design density qsw = {stirrupEffectiveness.StirrupShapeFactor} * {stirrupEffectiveness.StirrupPlacementFactor} * {stirrupByDensity.StirrupDensity} = {finalDensity}(N/m)");
double concreteDensity = inclinedSection.WebWidth * inclinedSection.ConcreteTensionStrength;

View File

@@ -17,6 +17,8 @@ namespace StructureHelperLogics.Models.BeamShears
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy();
baseUpdateStrategy.Update(targetObject, sourceObject);
targetObject.StirrupDensity = sourceObject.StirrupDensity;
targetObject.StartCoordinate = sourceObject.StartCoordinate;
targetObject.EndCoordinate = sourceObject.EndCoordinate;
}
}
}

View File

@@ -32,6 +32,8 @@ namespace StructureHelperLogics.Models.BeamShears
StirrupByDensity stirrupByDensity = new(Guid.NewGuid());
updateStrategy.Update(stirrupByDensity, source);
stirrupByDensity.StirrupDensity = GetStirrupDensity(source);
stirrupByDensity.StartCoordinate = source.StartCoordinate;
stirrupByDensity.EndCoordinate = source.EndCoordinate;
return stirrupByDensity;
}

View File

@@ -25,6 +25,8 @@ namespace StructureHelperLogics.Models.BeamShears
targetObject.LegCount = sourceObject.LegCount;
targetObject.Spacing = sourceObject.Spacing;
targetObject.IsSpiral = sourceObject.IsSpiral;
targetObject.StartCoordinate = sourceObject.StartCoordinate;
targetObject.EndCoordinate = sourceObject.EndCoordinate;
}
}
}

View File

@@ -18,7 +18,7 @@ namespace StructureHelperLogics.Models.BeamShears
public double GetShearStrength()
{
double parameter = GetInclinedCrackRatio();
double parameter = GetCrackLengthRatio();
BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(parameter);
TraceLogger?.AddMessage($"New value of dangerous inclinated crack has been obtained: start point Xstart = {newInputData.InclinedSection.StartCoord}(m), end point Xend = {newInputData.InclinedSection.EndCoord}(m)");
stirrupLogic = new(newInputData, TraceLogger);
@@ -31,7 +31,7 @@ namespace StructureHelperLogics.Models.BeamShears
/// </summary>
/// <returns></returns>
/// <exception cref="StructureHelperException"></exception>
private double GetInclinedCrackRatio()
private double GetCrackLengthRatio()
{
var parameterCalculator = new FindParameterCalculator();
parameterCalculator.InputData.Predicate = GetPredicate;
@@ -48,6 +48,7 @@ namespace StructureHelperLogics.Models.BeamShears
{
crackLengthRatio += 0.0001;
}
crackLengthRatio = Math.Max(crackLengthRatio, 0);
return crackLengthRatio;
}
/// <summary>

View File

@@ -16,7 +16,10 @@ namespace StructureHelperLogics.Models.BeamShears
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; }
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy();
baseUpdateStrategy ??= new StirrupBaseUpdateStrategy()
{
UpdateChildren = this.UpdateChildren
};
baseUpdateStrategy.Update(targetObject, sourceObject);
if (UpdateChildren == true)
{

View File

@@ -1,4 +1,7 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.VisualProperties;
using System.Windows.Media;
namespace StructureHelperLogics.Models.BeamShears
{
@@ -9,10 +12,17 @@ namespace StructureHelperLogics.Models.BeamShears
public string Name { get; set; } = string.Empty;
public double StirrupDensity { get; set; }
public double CompressedGap { get; set; }
public IPrimitiveVisualProperty VisualProperty { get; set; }
public double StartCoordinate { get; set; } = 0;
public double EndCoordinate { get; set; } = 100;
public StirrupByDensity(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,10 +1,12 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.Materials;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace StructureHelperLogics.Models.BeamShears
{
@@ -64,10 +66,15 @@ namespace StructureHelperLogics.Models.BeamShears
public IRebarSection RebarSection { get; set; } = new RebarSection(Guid.NewGuid());
/// <inheritdoc>
public double LegCount { get; set; } = 2;
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupByInclinedRebar(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,6 +1,8 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.VisualProperties;
using StructureHelperLogics.Models.Materials;
using System.Windows.Media;
namespace StructureHelperLogics.Models.BeamShears
{
@@ -62,11 +64,18 @@ namespace StructureHelperLogics.Models.BeamShears
public double CompressedGap { get; set; } = 0;
/// <inheritdoc/>
public bool IsSpiral { get; set; } = false;
public double StartCoordinate { get; set; } = 0;
public double EndCoordinate { get; set; } = 100;
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupByRebar(Guid id)
{
Id = id;
Material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400).HelperMaterial as IReinforcementLibMaterial;
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StructureHelperCommon.Models.VisualProperties;
using System.Windows.Media;
namespace StructureHelperLogics.Models.BeamShears
{
@@ -13,10 +9,15 @@ namespace StructureHelperLogics.Models.BeamShears
public string Name { get; set; } = string.Empty;
public List<IStirrup> Stirrups { get; } = new();
public double CompressedGap { get; set; }
public IPrimitiveVisualProperty VisualProperty { get; set; }
public StirrupGroup(Guid id)
{
Id = id;
VisualProperty = new PrimitiveVisualProperty(Guid.NewGuid())
{
Color = (Color)ColorConverter.ConvertFromString("Black")
};
}
public object Clone()

View File

@@ -1,31 +1,14 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StructureHelperCommon.Models.VisualProperties;
using System.Windows.Media;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
public interface IVisualProperty : ISaveable
public interface IVisualProperty : IPrimitiveVisualProperty
{
/// <summary>
/// Flag of visibility
/// </summary>
bool IsVisible { get; set; }
Color Color { get; set; }
/// <summary>
/// Flag of assigning of color from material or from primitive's settings
/// </summary>
bool SetMaterialColor { get; set; }
/// <summary>
/// Index by z-coordinate
/// </summary>
int ZIndex { get; set; }
/// <summary>
/// Opacity of filling
/// </summary>
double Opacity { get; set; }
}
}

View File

@@ -41,5 +41,10 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
{
}
public object Clone()
{
throw new NotImplementedException();
}
}
}