Material Update Strategy was added
This commit is contained in:
@@ -1,15 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
using StructureHelperCommon.Services.Units;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.Converters.Units
|
namespace StructureHelper.Infrastructure.UI.Converters.Units
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
using StructureHelperCommon.Services.Units;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using StructureHelper.Infrastructure.UI.Converters.Units;
|
using StructureHelper.Infrastructure.UI.Converters.Units;
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,24 +1,10 @@
|
|||||||
using System;
|
using StructureHelper.Models.Materials;
|
||||||
using System.Collections.Generic;
|
using StructureHelper.Services.Primitives;
|
||||||
using System.Windows;
|
using StructureHelper.Windows.MainWindow;
|
||||||
using System.Windows.Documents;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
|
||||||
using StructureHelper.Infrastructure.UI.Converters.Units;
|
|
||||||
using StructureHelper.Models.Materials;
|
|
||||||
using StructureHelper.Services.Primitives;
|
|
||||||
using StructureHelper.UnitSystem.Systems;
|
|
||||||
using StructureHelper.Windows.MainWindow;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
|
||||||
using StructureHelperLogics.Models.Primitives;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.Primitives;
|
using StructureHelperLogics.Models.Primitives;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,14 +1,5 @@
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
using StructureHelper.UnitSystem.Systems;
|
|
||||||
using StructureHelper.Windows.MainWindow;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using System;
|
|
||||||
using StructureHelperLogics.Models.Primitives;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,5 +49,10 @@
|
|||||||
<Setter Property="Margin" Value="5"/>
|
<Setter Property="Margin" Value="5"/>
|
||||||
</Style.Setters>
|
</Style.Setters>
|
||||||
</Style>
|
</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>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using StructureHelper.Windows.Errors;
|
using StructureHelper.Windows.Errors;
|
||||||
using StructureHelper.Windows.ViewModels.Errors;
|
using StructureHelper.Windows.ViewModels.Errors;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses;
|
using StructureHelperLogics.NdmCalculations.Analyses;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
25
StructureHelper/Services/Settings/GlobalRepository.cs
Normal file
25
StructureHelper/Services/Settings/GlobalRepository.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Repositories;
|
||||||
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Services.Settings
|
||||||
|
{
|
||||||
|
internal static class GlobalRepository
|
||||||
|
{
|
||||||
|
private static IDataRepository<IHeadMaterial> materials;
|
||||||
|
public static IDataRepository<IHeadMaterial> Materials
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
materials ??= new ListRepository<IHeadMaterial>(new MaterialUpdateStrategy());
|
||||||
|
return materials;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelper.Services.Settings;
|
||||||
using StructureHelper.Windows.PrimitiveTemplates.RCs.Beams;
|
using StructureHelper.Windows.PrimitiveTemplates.RCs.Beams;
|
||||||
using StructureHelper.Windows.PrimitiveTemplates.RCs.RectangleBeam;
|
using StructureHelper.Windows.PrimitiveTemplates.RCs.RectangleBeam;
|
||||||
using StructureHelper.Windows.ViewModels;
|
using StructureHelper.Windows.ViewModels;
|
||||||
@@ -10,7 +11,6 @@ using StructureHelper.Windows.ViewModels.Materials;
|
|||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
||||||
using StructureHelperLogics.Models.Templates.RCs;
|
using StructureHelperLogics.Models.Templates.RCs;
|
||||||
@@ -403,6 +403,10 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
item.RegisterDeltas(CanvasWidth / 2, CanvasHeight / 2);
|
item.RegisterDeltas(CanvasWidth / 2, CanvasHeight / 2);
|
||||||
}
|
}
|
||||||
PrimitiveLogic.Refresh();
|
PrimitiveLogic.Refresh();
|
||||||
|
foreach (var item in newRepository.HeadMaterials)
|
||||||
|
{
|
||||||
|
GlobalRepository.Materials.Create(item);
|
||||||
|
}
|
||||||
return primitives;
|
return primitives;
|
||||||
}
|
}
|
||||||
return new List<PrimitiveBase>();
|
return new List<PrimitiveBase>();
|
||||||
|
|||||||
@@ -14,7 +14,12 @@
|
|||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ResourceDictionary Source="/Infrastructure/UI/Resources/Materials.xaml"/>
|
<ResourceDictionary Source="/Infrastructure/UI/Resources/Materials.xaml"/>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<ScrollViewer>
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition Height="35"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ScrollViewer>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="46"/>
|
<RowDefinition Height="46"/>
|
||||||
@@ -46,4 +51,6 @@
|
|||||||
<StackPanel Grid.Row="1" x:Name="StpMaterialProperties"/>
|
<StackPanel Grid.Row="1" x:Name="StpMaterialProperties"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||||
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.ViewModels.Materials;
|
using StructureHelper.Windows.ViewModels.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -31,7 +30,10 @@ namespace StructureHelper.Windows.MainWindow.Materials
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.headMaterial = headMaterial;
|
this.headMaterial = headMaterial;
|
||||||
vm = new HeadMaterialViewModel(this.headMaterial);
|
vm = new HeadMaterialViewModel(this.headMaterial)
|
||||||
|
{
|
||||||
|
ParentWindow = this
|
||||||
|
};
|
||||||
DataContext = vm;
|
DataContext = vm;
|
||||||
AddDataTemplates();
|
AddDataTemplates();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="35"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ContentControl ContentTemplate="{StaticResource CircleShapeEdit}" Content="{Binding}"/>
|
<ContentControl ContentTemplate="{StaticResource CircleShapeEdit}" Content="{Binding}"/>
|
||||||
@@ -33,9 +33,6 @@
|
|||||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BarCount, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BarCount, ValidatesOnExceptions=True}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||||
<Button Width="60" Height="20" Margin="5" Content="Cancel" Command="{Binding CancelCommand}"/>
|
|
||||||
<Button Width="60" Height="20" Margin="5" Content="OK" Command="{Binding OkCommand}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="35"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ContentControl ContentTemplate="{StaticResource RectangleShapeEdit}" Content="{Binding}"/>
|
<ContentControl ContentTemplate="{StaticResource RectangleShapeEdit}" Content="{Binding}"/>
|
||||||
@@ -42,9 +42,6 @@
|
|||||||
<TextBox Grid.Row="4" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding HeightCount, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="4" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding HeightCount, ValidatesOnExceptions=True}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||||
<Button Width="60" Height="20" Margin="5" Content="Cancel" Command="{Binding CancelCommand}"/>
|
|
||||||
<Button Width="60" Height="20" Margin="5" Content="OK" Command="{Binding OkCommand}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
using StructureHelper.Services.Primitives;
|
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperLogics.Models.Primitives;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ using StructureHelper.Windows.ViewModels.Graphs;
|
|||||||
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
|
using StructureHelper.Windows.ViewModels.PrimitiveProperties;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Parameters;
|
using StructureHelperCommon.Models.Parameters;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
@@ -32,8 +31,6 @@ using StructureHelperLogics.Services.NdmCalculations;
|
|||||||
using StructureHelperLogics.Services.NdmPrimitives;
|
using StructureHelperLogics.Services.NdmPrimitives;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.Windows.Forces;
|
using StructureHelper.Windows.Forces;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using StructureHelper.Infrastructure;
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.AddMaterialWindow;
|
using StructureHelper.Windows.AddMaterialWindow;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
@@ -16,7 +15,7 @@ using System.Windows.Media;
|
|||||||
|
|
||||||
namespace StructureHelper.Windows.ViewModels.Materials
|
namespace StructureHelper.Windows.ViewModels.Materials
|
||||||
{
|
{
|
||||||
internal class HeadMaterialViewModel : ViewModelBase
|
internal class HeadMaterialViewModel : OkCancelViewModelBase
|
||||||
{
|
{
|
||||||
IHeadMaterial headMaterial;
|
IHeadMaterial headMaterial;
|
||||||
HelperMaterialViewModel helperMaterialViewModel;
|
HelperMaterialViewModel helperMaterialViewModel;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelper.Services.Settings;
|
||||||
using StructureHelper.Windows.MainWindow.Materials;
|
using StructureHelper.Windows.MainWindow.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -42,6 +42,7 @@ namespace StructureHelper.Windows.ViewModels.Materials
|
|||||||
else if (paramType == MaterialType.CarbonFiber) { AddCarbonFiber(); }
|
else if (paramType == MaterialType.CarbonFiber) { AddCarbonFiber(); }
|
||||||
else if (paramType == MaterialType.GlassFiber) { AddGlassFiber(); }
|
else if (paramType == MaterialType.GlassFiber) { AddGlassFiber(); }
|
||||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $". Expected: {typeof(MaterialType)}, Actual type: {nameof(paramType)}");
|
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $". Expected: {typeof(MaterialType)}, Actual type: {nameof(paramType)}");
|
||||||
|
GlobalRepository.Materials.Create(NewItem);
|
||||||
base.AddMethod(parameter);
|
base.AddMethod(parameter);
|
||||||
}
|
}
|
||||||
public override void DeleteMethod(object parameter)
|
public override void DeleteMethod(object parameter)
|
||||||
@@ -57,15 +58,35 @@ namespace StructureHelper.Windows.ViewModels.Materials
|
|||||||
var dialogResult = MessageBox.Show("Delete material?", "Please, confirm deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
var dialogResult = MessageBox.Show("Delete material?", "Please, confirm deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
|
GlobalRepository.Materials.Delete(SelectedItem.Id);
|
||||||
base.DeleteMethod(parameter);
|
base.DeleteMethod(parameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void EditMethod(object parameter)
|
public override void EditMethod(object parameter)
|
||||||
{
|
{
|
||||||
|
var copyObject = GlobalRepository.Materials.GetById(SelectedItem.Id).Clone() as IHeadMaterial;
|
||||||
var wnd = new HeadMaterialView(SelectedItem);
|
var wnd = new HeadMaterialView(SelectedItem);
|
||||||
wnd.ShowDialog();
|
wnd.ShowDialog();
|
||||||
|
if (wnd.DialogResult == true)
|
||||||
|
{
|
||||||
|
GlobalRepository.Materials.Update(SelectedItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var updateStrategy = new MaterialUpdateStrategy();
|
||||||
|
updateStrategy.Update(SelectedItem, copyObject);
|
||||||
|
}
|
||||||
base.EditMethod(parameter);
|
base.EditMethod(parameter);
|
||||||
}
|
}
|
||||||
|
public override void CopyMethod(object parameter)
|
||||||
|
{
|
||||||
|
NewItem = SelectedItem.Clone() as IHeadMaterial;
|
||||||
|
NewItem.Name = $"{NewItem.Name} copy";
|
||||||
|
GlobalRepository.Materials.Create(NewItem);
|
||||||
|
Collection.Add(NewItem);
|
||||||
|
Items.Add(NewItem);
|
||||||
|
SelectedItem = NewItem;
|
||||||
|
}
|
||||||
private void AddElastic()
|
private void AddElastic()
|
||||||
{
|
{
|
||||||
var material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Elastic200);
|
var material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Elastic200);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Codes;
|
using StructureHelperCommon.Models.Codes;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using StructureHelper.Infrastructure;
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperLogics.Models.Primitives;
|
using StructureHelperLogics.Models.Primitives;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using ViewModelBase = StructureHelper.Infrastructure.ViewModelBase;
|
using ViewModelBase = StructureHelper.Infrastructure.ViewModelBase;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
|
|||||||
@@ -1,12 +1,4 @@
|
|||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using StructureHelper.Models.Materials;
|
|||||||
using StructureHelper.Windows.MainWindow.Materials;
|
using StructureHelper.Windows.MainWindow.Materials;
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace StructureHelperCommon.Infrastructures.Strings
|
namespace StructureHelperCommon.Infrastructures.Exceptions
|
||||||
{
|
{
|
||||||
public static class ErrorStrings
|
public static class ErrorStrings
|
||||||
{
|
{
|
||||||
@@ -8,8 +8,10 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
|
|||||||
{
|
{
|
||||||
public interface IDataRepository<T>
|
public interface IDataRepository<T>
|
||||||
{
|
{
|
||||||
void Save(T entity);
|
void Create(T entity);
|
||||||
T Load(Guid Id);
|
void Update(T entity);
|
||||||
|
void Delete(Guid Id);
|
||||||
|
T GetById(Guid Id);
|
||||||
|
List<T> GetAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
|
|||||||
/// Unique identifier
|
/// Unique identifier
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Guid Id { get;}
|
Guid Id { get;}
|
||||||
void Save();
|
//void Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||||
|
{
|
||||||
|
public interface IUpdateStrategy<T>
|
||||||
|
{
|
||||||
|
void Update(T targetObject, T sourceObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Forces
|
namespace StructureHelperCommon.Models.Forces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Forces
|
namespace StructureHelperCommon.Models.Forces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using System.Linq;
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Codes;
|
using StructureHelperCommon.Models.Codes;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
@@ -177,7 +176,6 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
|||||||
new ConcreteMaterialEntity(new Guid("2f5b70b9-f4c1-470d-ac27-a39a7093b6ea"))
|
new ConcreteMaterialEntity(new Guid("2f5b70b9-f4c1-470d-ac27-a39a7093b6ea"))
|
||||||
{
|
{
|
||||||
CodeType = codeType,
|
CodeType = codeType,
|
||||||
Code = code,
|
|
||||||
Name = "B30",
|
Name = "B30",
|
||||||
MainStrength = 30e6
|
MainStrength = 30e6
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
{
|
{
|
||||||
public interface IMaterialSafetyFactor : ICloneable
|
public interface IMaterialSafetyFactor : ISaveable, ICloneable
|
||||||
{
|
{
|
||||||
string Name { get; set; }
|
string Name { get; set; }
|
||||||
bool Take { get; set; }
|
bool Take { get; set; }
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using System;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
{
|
{
|
||||||
public interface IPartialFactor : ICloneable
|
public interface IPartialFactor : ISaveable, ICloneable
|
||||||
{
|
{
|
||||||
double FactorValue {get;set;}
|
double FactorValue {get;set;}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
|
{
|
||||||
|
internal class MaterialPartialFactorUpdateStrategy : IUpdateStrategy<IMaterialPartialFactor>
|
||||||
|
{
|
||||||
|
public void Update(IMaterialPartialFactor targetObject, IMaterialPartialFactor sourceObject)
|
||||||
|
{
|
||||||
|
targetObject.LimitState = sourceObject.LimitState;
|
||||||
|
targetObject.StressState = sourceObject.StressState;
|
||||||
|
targetObject.CalcTerm = sourceObject.CalcTerm;
|
||||||
|
targetObject.FactorValue = sourceObject.FactorValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
|
{
|
||||||
|
internal class MaterialSafetyFactorUpdateStrategy : IUpdateStrategy<IMaterialSafetyFactor>
|
||||||
|
{
|
||||||
|
public void Update(IMaterialSafetyFactor targetObject, IMaterialSafetyFactor sourceObject)
|
||||||
|
{
|
||||||
|
targetObject.Name = sourceObject.Name;
|
||||||
|
targetObject.Take = sourceObject.Take;
|
||||||
|
targetObject.Description = sourceObject.Description;
|
||||||
|
targetObject.PartialFactors.Clear();
|
||||||
|
foreach (var item in sourceObject.PartialFactors)
|
||||||
|
{
|
||||||
|
targetObject.PartialFactors.Add(item.Clone() as IMaterialPartialFactor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using System;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||||
{
|
{
|
||||||
public class MaterialPartialFactor : IMaterialPartialFactor
|
public class MaterialPartialFactor : IMaterialPartialFactor
|
||||||
{
|
{
|
||||||
private double factorValue;
|
private double factorValue;
|
||||||
|
public Guid Id { get; }
|
||||||
public StressStates StressState { get; set; }
|
public StressStates StressState { get; set; }
|
||||||
public CalcTerms CalcTerm { get; set; }
|
public CalcTerms CalcTerm { get; set; }
|
||||||
public LimitStates LimitState { get; set; }
|
public LimitStates LimitState { get; set; }
|
||||||
@@ -24,23 +24,24 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialPartialFactor()
|
|
||||||
|
public MaterialPartialFactor(Guid id)
|
||||||
{
|
{
|
||||||
|
Id = id;
|
||||||
StressState = StressStates.Compression;
|
StressState = StressStates.Compression;
|
||||||
LimitState = LimitStates.ULS;
|
LimitState = LimitStates.ULS;
|
||||||
CalcTerm = CalcTerms.LongTerm;
|
CalcTerm = CalcTerms.LongTerm;
|
||||||
FactorValue = 1d;
|
FactorValue = 1d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MaterialPartialFactor() : this (Guid.NewGuid())
|
||||||
|
{ }
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
var newItem = new MaterialPartialFactor()
|
var newItem = new MaterialPartialFactor();
|
||||||
{
|
var updateStrategy = new MaterialPartialFactorUpdateStrategy();
|
||||||
StressState = StressState,
|
updateStrategy.Update(newItem, this);
|
||||||
CalcTerm = CalcTerm,
|
|
||||||
LimitState = LimitState,
|
|
||||||
FactorValue = FactorValue,
|
|
||||||
};
|
|
||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
|
||||||
@@ -6,23 +7,32 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
|||||||
{
|
{
|
||||||
public class MaterialSafetyFactor : IMaterialSafetyFactor
|
public class MaterialSafetyFactor : IMaterialSafetyFactor
|
||||||
{
|
{
|
||||||
|
public Guid Id { get; }
|
||||||
public string Name {get; set; }
|
public string Name {get; set; }
|
||||||
public bool Take { get; set; }
|
public bool Take { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public List<IMaterialPartialFactor> PartialFactors { get; }
|
public List<IMaterialPartialFactor> PartialFactors { get; }
|
||||||
|
|
||||||
public MaterialSafetyFactor()
|
|
||||||
|
public MaterialSafetyFactor(Guid id)
|
||||||
{
|
{
|
||||||
|
Id = id;
|
||||||
Take = true;
|
Take = true;
|
||||||
Name = "New factor";
|
Name = "New factor";
|
||||||
Description = "Material safety factor for ...";
|
Description = "Material safety factor for ...";
|
||||||
PartialFactors = new List<IMaterialPartialFactor>();
|
PartialFactors = new List<IMaterialPartialFactor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MaterialSafetyFactor() : this (Guid.NewGuid())
|
||||||
|
{ }
|
||||||
|
|
||||||
public double GetFactor(StressStates stressState, CalcTerms calcTerm, LimitStates limitStates)
|
public double GetFactor(StressStates stressState, CalcTerms calcTerm, LimitStates limitStates)
|
||||||
{
|
{
|
||||||
double result = 1d;
|
double result = 1d;
|
||||||
var coefficients = PartialFactors.Where(x => (x.StressState == stressState & x.CalcTerm == calcTerm & x.LimitState == limitStates));
|
var coefficients = PartialFactors
|
||||||
|
.Where(x => x.StressState == stressState
|
||||||
|
& x.CalcTerm == calcTerm
|
||||||
|
& x.LimitState == limitStates);
|
||||||
foreach (var item in coefficients) { result *= item.FactorValue;}
|
foreach (var item in coefficients) { result *= item.FactorValue;}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -30,13 +40,8 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
|||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
var newItem = new MaterialSafetyFactor();
|
var newItem = new MaterialSafetyFactor();
|
||||||
newItem.Take = Take;
|
var updateSrategy = new MaterialSafetyFactorUpdateStrategy();
|
||||||
newItem.Name = Name;
|
updateSrategy.Update(newItem, this);
|
||||||
newItem.Description = Description;
|
|
||||||
foreach (var item in PartialFactors)
|
|
||||||
{
|
|
||||||
newItem.PartialFactors.Add(item.Clone() as IMaterialPartialFactor);
|
|
||||||
}
|
|
||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
58
StructureHelperCommon/Models/Repositories/ListRepository.cs
Normal file
58
StructureHelperCommon/Models/Repositories/ListRepository.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Repositories
|
||||||
|
{
|
||||||
|
public class ListRepository<T> : IDataRepository<T>
|
||||||
|
where T : ISaveable
|
||||||
|
{
|
||||||
|
List<T> internalData;
|
||||||
|
private IUpdateStrategy<T> updateStrategy;
|
||||||
|
public void Create(T entity)
|
||||||
|
{
|
||||||
|
var isExists = internalData.Exists(x => x.Id == entity.Id);
|
||||||
|
if (isExists == true)
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $":\nobject with Id={entity.Id} already exists");
|
||||||
|
}
|
||||||
|
internalData.Add(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Delete(Guid Id)
|
||||||
|
{
|
||||||
|
T existingObject = GetById(Id);
|
||||||
|
internalData.Remove(existingObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> GetAll()
|
||||||
|
{
|
||||||
|
return new List<T>(internalData);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetById(Guid id)
|
||||||
|
{
|
||||||
|
T existingObject = internalData.Single(x => x.Id == id);
|
||||||
|
return existingObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(T updateObject)
|
||||||
|
{
|
||||||
|
T existingObject = GetById(updateObject.Id);
|
||||||
|
updateStrategy.Update(existingObject, updateObject);
|
||||||
|
}
|
||||||
|
public ListRepository(List<T> initialData, IUpdateStrategy<T> updateStrategy)
|
||||||
|
{
|
||||||
|
internalData = initialData;
|
||||||
|
this.updateStrategy = updateStrategy;
|
||||||
|
}
|
||||||
|
public ListRepository(IUpdateStrategy<T> updateStrategy) : this(new List<T>(), updateStrategy)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
using StructureHelperCommon.Services.Units;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ namespace StructureHelperLogics.Models.Materials
|
|||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
return new ConcreteLibMaterial() { MaterialEntity = MaterialEntity, TensionForULS = TensionForULS, TensionForSLS = TensionForSLS };
|
var newItem = new ConcreteLibMaterial();
|
||||||
|
var updateStrategy = new ConcreteLibUpdateStrategy();
|
||||||
|
updateStrategy.Update(newItem, this);
|
||||||
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
public LM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ namespace StructureHelperLogics.Models.Materials
|
|||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
return new ElasticMaterial() { Modulus = Modulus, CompressiveStrength = CompressiveStrength, TensileStrength = TensileStrength };
|
var newItem = new ElasticMaterial();
|
||||||
|
var updateStrategy = new ElasticUpdateStrategy();
|
||||||
|
updateStrategy.Update(newItem, this);
|
||||||
|
return newItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,14 +48,9 @@ namespace StructureHelperLogics.Models.Materials
|
|||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
var newItem = new FRMaterial(materialType)
|
var newItem = new FRMaterial(this.materialType);
|
||||||
{
|
var updateStrategy = new FRUpdateStrategy();
|
||||||
Modulus = Modulus,
|
updateStrategy.Update(newItem, this);
|
||||||
CompressiveStrength = CompressiveStrength,
|
|
||||||
TensileStrength = TensileStrength,
|
|
||||||
ULSConcreteStrength = ULSConcreteStrength,
|
|
||||||
SumThickness = SumThickness,
|
|
||||||
};
|
|
||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Codes;
|
using StructureHelperCommon.Models.Codes;
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -50,13 +50,11 @@ namespace StructureHelper.Models.Materials
|
|||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
IHeadMaterial material = new HeadMaterial
|
var newItem = new HeadMaterial();
|
||||||
{
|
newItem.HelperMaterial = this.HelperMaterial.Clone() as IHelperMaterial;
|
||||||
Name = Name,
|
var updateStrategy = new MaterialUpdateStrategy();
|
||||||
Color = Color,
|
updateStrategy.Update(newItem, this);
|
||||||
HelperMaterial = HelperMaterial.Clone() as IHelperMaterial
|
return newItem;
|
||||||
};
|
|
||||||
return material;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ namespace StructureHelper.Models.Materials
|
|||||||
string Name { get; set; }
|
string Name { get; set; }
|
||||||
Color Color { get; set; }
|
Color Color { get; set; }
|
||||||
IHelperMaterial HelperMaterial { get; set; }
|
IHelperMaterial HelperMaterial { get; set; }
|
||||||
//MaterialDefinitionBase Material { get; set; }
|
|
||||||
IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm);
|
IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using LCM = LoaderCalculator.Data.Materials;
|
using LCM = LoaderCalculator.Data.Materials;
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
internal class ConcreteLibUpdateStrategy : IUpdateStrategy<IConcreteLibMaterial>
|
||||||
|
{
|
||||||
|
LibMaterialUpdateStrategy libUpdateStrategy = new LibMaterialUpdateStrategy();
|
||||||
|
public void Update(IConcreteLibMaterial targetObject, IConcreteLibMaterial sourceObject)
|
||||||
|
{
|
||||||
|
libUpdateStrategy.Update(targetObject, sourceObject);
|
||||||
|
targetObject.TensionForULS = sourceObject.TensionForULS;
|
||||||
|
targetObject.TensionForSLS = sourceObject.TensionForSLS;
|
||||||
|
targetObject.Humidity = sourceObject.Humidity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
|
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
internal class ElasticUpdateStrategy : IUpdateStrategy<IElasticMaterial>
|
||||||
|
{
|
||||||
|
public void Update(IElasticMaterial targetObject, IElasticMaterial sourceObject)
|
||||||
|
{
|
||||||
|
targetObject.Modulus = sourceObject.Modulus;
|
||||||
|
targetObject.CompressiveStrength = sourceObject.CompressiveStrength;
|
||||||
|
targetObject.TensileStrength = sourceObject.TensileStrength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
internal class FRUpdateStrategy : IUpdateStrategy<IFRMaterial>
|
||||||
|
{
|
||||||
|
public void Update(IFRMaterial targetObject, IFRMaterial sourceObject)
|
||||||
|
{
|
||||||
|
targetObject.Modulus = sourceObject.Modulus;
|
||||||
|
targetObject.CompressiveStrength = sourceObject.CompressiveStrength;
|
||||||
|
targetObject.TensileStrength = targetObject.TensileStrength;
|
||||||
|
targetObject.ULSConcreteStrength = targetObject.ULSConcreteStrength;
|
||||||
|
targetObject.SumThickness = targetObject.SumThickness;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
internal class LibMaterialUpdateStrategy : IUpdateStrategy<ILibMaterial>
|
||||||
|
{
|
||||||
|
public void Update(ILibMaterial targetObject, ILibMaterial sourceObject)
|
||||||
|
{
|
||||||
|
targetObject.MaterialEntity = sourceObject.MaterialEntity;
|
||||||
|
targetObject.SafetyFactors.Clear();
|
||||||
|
foreach (var item in sourceObject.SafetyFactors)
|
||||||
|
{
|
||||||
|
targetObject.SafetyFactors.Add(item.Clone() as IMaterialSafetyFactor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
public class MaterialUpdateStrategy : IUpdateStrategy<IHeadMaterial>
|
||||||
|
{
|
||||||
|
public void Update(IHeadMaterial targetObject, IHeadMaterial sourceObject)
|
||||||
|
{
|
||||||
|
targetObject.Name = sourceObject.Name;
|
||||||
|
targetObject.Color = sourceObject.Color;
|
||||||
|
targetObject.HelperMaterial = sourceObject.HelperMaterial.Clone() as IHelperMaterial;
|
||||||
|
UpdateHelperMaterial(targetObject.HelperMaterial, sourceObject.HelperMaterial);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void UpdateHelperMaterial(IHelperMaterial target, IHelperMaterial source)
|
||||||
|
{
|
||||||
|
Check(target, source);
|
||||||
|
UpdateMaterial(target, source);
|
||||||
|
}
|
||||||
|
private static void Check(IHelperMaterial target, IHelperMaterial source)
|
||||||
|
{
|
||||||
|
if (target.GetType() != source.GetType())
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"target type is {target.GetType()}, \n is no coinside with source type {source.GetType()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static void UpdateMaterial(IHelperMaterial target, IHelperMaterial source)
|
||||||
|
{
|
||||||
|
if (source is ILibMaterial)
|
||||||
|
{
|
||||||
|
UpdateLibMaterial(target, source);
|
||||||
|
}
|
||||||
|
else if (source is IElasticMaterial)
|
||||||
|
{
|
||||||
|
UpdateElastic(target, source);
|
||||||
|
}
|
||||||
|
else if (source is IFRMaterial)
|
||||||
|
{
|
||||||
|
UpdateFR(target, source);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $"\n Expected: {typeof(IHelperMaterial)},\n But was: {source.GetType()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static void UpdateFR(IHelperMaterial target, IHelperMaterial source)
|
||||||
|
{
|
||||||
|
var targetMaterial = target as IFRMaterial;
|
||||||
|
var sourceMaterial = source as IFRMaterial;
|
||||||
|
var logic = new FRUpdateStrategy();
|
||||||
|
logic.Update(targetMaterial, sourceMaterial);
|
||||||
|
}
|
||||||
|
private static void UpdateElastic(IHelperMaterial target, IHelperMaterial source)
|
||||||
|
{
|
||||||
|
var targetMaterial = target as IElasticMaterial;
|
||||||
|
var sourceMaterial = source as IElasticMaterial;
|
||||||
|
var logic = new ElasticUpdateStrategy();
|
||||||
|
logic.Update(targetMaterial, sourceMaterial);
|
||||||
|
}
|
||||||
|
private static void UpdateLibMaterial(IHelperMaterial target, IHelperMaterial source)
|
||||||
|
{
|
||||||
|
if (source is IConcreteLibMaterial)
|
||||||
|
{
|
||||||
|
var targetMaterial = target as IConcreteLibMaterial;
|
||||||
|
var sourceMaterial = source as IConcreteLibMaterial;
|
||||||
|
var logic = new ConcreteLibUpdateStrategy();
|
||||||
|
logic.Update(targetMaterial, sourceMaterial);
|
||||||
|
}
|
||||||
|
else if (source is IReinforcementLibMaterial)
|
||||||
|
{
|
||||||
|
var targetMaterial = target as IReinforcementLibMaterial;
|
||||||
|
var sourceMaterial = source as IReinforcementLibMaterial;
|
||||||
|
var logic = new ReinforcementLibUpdateStrategy();
|
||||||
|
logic.Update(targetMaterial, sourceMaterial);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $"\n Expected: {typeof(ILibMaterial)},\n But was: {source.GetType()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
internal class ReinforcementLibUpdateStrategy : IUpdateStrategy<IReinforcementLibMaterial>
|
||||||
|
{
|
||||||
|
LibMaterialUpdateStrategy libUpdateStrategy = new LibMaterialUpdateStrategy();
|
||||||
|
public void Update(IReinforcementLibMaterial targetObject, IReinforcementLibMaterial sourceObject)
|
||||||
|
{
|
||||||
|
libUpdateStrategy.Update(targetObject, sourceObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Materials.Libraries;
|
using StructureHelperCommon.Models.Materials.Libraries;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Loadermaterials = LoaderCalculator.Data.Materials;
|
|||||||
using LMBuilders = LoaderCalculator.Data.Materials.MaterialBuilders;
|
using LMBuilders = LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||||
using LoaderMaterialLogics = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
|
using LoaderMaterialLogics = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
|
||||||
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
public class ReinforcementLibMaterial : IReinforcementLibMaterial
|
public class ReinforcementLibMaterial : IReinforcementLibMaterial
|
||||||
@@ -29,7 +30,10 @@ namespace StructureHelperLogics.Models.Materials
|
|||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
return new ReinforcementLibMaterial() { MaterialEntity = MaterialEntity};
|
var newItem = new ReinforcementLibMaterial();
|
||||||
|
var updateStrategy = new ReinforcementLibUpdateStrategy();
|
||||||
|
updateStrategy.Update(newItem, this);
|
||||||
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Loadermaterials.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
public Loadermaterials.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Analyses
|
namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using LoaderCalculator.Logics;
|
using LoaderCalculator.Logics;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
|||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
repository.Save(this);
|
repository.Create(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using LoaderCalculator.Data.Materials;
|
using LoaderCalculator.Data.Materials;
|
||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperLogics.Models.Primitives;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using System.Collections.Generic;
|
|||||||
using LoaderCalculator.Data.Ndms.Transformations;
|
using LoaderCalculator.Data.Ndms.Transformations;
|
||||||
using LoaderCalculator.Data.Matrix;
|
using LoaderCalculator.Data.Matrix;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperLogics.Models.Primitives;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
|
|||||||
@@ -1,15 +1,7 @@
|
|||||||
using System;
|
using LoaderCalculator.Data.Materials;
|
||||||
using System.Collections.Generic;
|
|
||||||
using LoaderCalculator.Data.Materials;
|
|
||||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
|
||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using StructureHelperLogics.Models.Primitives;
|
|
||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Services.Forces;
|
using StructureHelperCommon.Services.Forces;
|
||||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
||||||
|
|||||||
Reference in New Issue
Block a user