List of analyses was added into main window
This commit is contained in:
@@ -22,15 +22,17 @@ namespace StructureHelper
|
|||||||
builder.RegisterType<PrimitiveRepository>().As<IPrimitiveRepository>().SingleInstance();
|
builder.RegisterType<PrimitiveRepository>().As<IPrimitiveRepository>().SingleInstance();
|
||||||
builder.RegisterType<UnitSystemService>().AsSelf().SingleInstance();
|
builder.RegisterType<UnitSystemService>().AsSelf().SingleInstance();
|
||||||
builder.RegisterType<CalculationService>().AsSelf().SingleInstance();
|
builder.RegisterType<CalculationService>().AsSelf().SingleInstance();
|
||||||
builder.RegisterType<CrossSectionModel>().AsSelf().SingleInstance();
|
//builder.RegisterType<CrossSectionModel>().AsSelf().SingleInstance();
|
||||||
builder.RegisterType<CrossSectionViewModel>().AsSelf().SingleInstance();
|
//builder.RegisterType<CrossSectionViewModel>().AsSelf().SingleInstance();
|
||||||
|
//builder.RegisterType<CrossSectionView>().AsSelf();
|
||||||
|
|
||||||
builder.RegisterType<CrossSectionView>().AsSelf();
|
builder.RegisterType<AnalysesManagerViewModel>().AsSelf().SingleInstance();
|
||||||
|
builder.RegisterType<AnalysesManagerView>().AsSelf();
|
||||||
|
|
||||||
Container = builder.Build();
|
Container = builder.Build();
|
||||||
Scope = Container.Resolve<ILifetimeScope>();
|
Scope = Container.Resolve<ILifetimeScope>();
|
||||||
|
|
||||||
var window = Scope.Resolve<CrossSectionView>();
|
var window = Scope.Resolve<AnalysesManagerView>();
|
||||||
window.Show();
|
window.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -278,8 +278,8 @@
|
|||||||
<DataTemplate x:Key="SelectAll">
|
<DataTemplate x:Key="SelectAll">
|
||||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
<Canvas.Children>
|
<Canvas.Children>
|
||||||
<CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="True"/>
|
<CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="True" IsEnabled="False"/>
|
||||||
<CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="True"/>
|
<CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="True" IsEnabled="False"/>
|
||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
@@ -287,8 +287,8 @@
|
|||||||
<DataTemplate x:Key="DeSelectAll">
|
<DataTemplate x:Key="DeSelectAll">
|
||||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
<Canvas.Children>
|
<Canvas.Children>
|
||||||
<CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="False"/>
|
<CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="False" IsEnabled="False"/>
|
||||||
<CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="False"/>
|
<CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="False" IsEnabled="False"/>
|
||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
@@ -296,8 +296,8 @@
|
|||||||
<DataTemplate x:Key="InvertSelection">
|
<DataTemplate x:Key="InvertSelection">
|
||||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
||||||
<Canvas.Children>
|
<Canvas.Children>
|
||||||
<CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="True"/>
|
<CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="True" IsEnabled="False"/>
|
||||||
<CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="False"/>
|
<CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="False" IsEnabled="False"/>
|
||||||
</Canvas.Children>
|
</Canvas.Children>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -63,6 +63,9 @@
|
|||||||
<Compile Update="Windows\MainWindow\AnalysesManagerView.xaml.cs">
|
<Compile Update="Windows\MainWindow\AnalysesManagerView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="Windows\MainWindow\Analyses\AnalysisView.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Windows\MainWindow\Materials\HeadMaterialView.xaml.cs">
|
<Compile Update="Windows\MainWindow\Materials\HeadMaterialView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -158,6 +161,9 @@
|
|||||||
<Page Update="Windows\MainWindow\AnalysesManagerView.xaml">
|
<Page Update="Windows\MainWindow\AnalysesManagerView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="Windows\MainWindow\Analyses\AnalysisView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="Windows\MainWindow\Materials\HeadMaterialView.xaml">
|
<Page Update="Windows\MainWindow\Materials\HeadMaterialView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
128
StructureHelper/Windows/MainWindow/Analyses/AnalysesLogic.cs
Normal file
128
StructureHelper/Windows/MainWindow/Analyses/AnalysesLogic.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using StructureHelper.Windows.MainWindow.Analyses;
|
||||||
|
using StructureHelperLogic.Models.Analyses;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow
|
||||||
|
{
|
||||||
|
public class AnalysesLogic : ViewModelBase
|
||||||
|
{
|
||||||
|
private RelayCommand? addAnalyisCommand;
|
||||||
|
private RelayCommand? runCommand;
|
||||||
|
private RelayCommand? editCommand;
|
||||||
|
private RelayCommand? deleteCommand;
|
||||||
|
|
||||||
|
public IVisualAnalysis? SelectedAnalysis { get; set; }
|
||||||
|
|
||||||
|
public List<IVisualAnalysis> AnalysesList { get; }
|
||||||
|
public ObservableCollection<IVisualAnalysis> FilteredAnalyses { get; }
|
||||||
|
public RelayCommand AddAnalysisCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return addAnalyisCommand ??= new RelayCommand(obj =>
|
||||||
|
{
|
||||||
|
AddCrossSectionNdmAnalysis();
|
||||||
|
Refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RelayCommand RunCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return runCommand ??= new RelayCommand(obj =>
|
||||||
|
{
|
||||||
|
RunAnalysis();
|
||||||
|
Refresh();
|
||||||
|
},
|
||||||
|
b => SelectedAnalysis is not null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RelayCommand EditCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return editCommand ??= new RelayCommand(obj =>
|
||||||
|
{
|
||||||
|
EditAnalysis();
|
||||||
|
Refresh();
|
||||||
|
},
|
||||||
|
b => SelectedAnalysis is not null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RelayCommand DeleteCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return deleteCommand ??= new RelayCommand(obj =>
|
||||||
|
{
|
||||||
|
DeleteAnalysis();
|
||||||
|
Refresh();
|
||||||
|
},
|
||||||
|
b => SelectedAnalysis is not null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AnalysesLogic()
|
||||||
|
{
|
||||||
|
AnalysesList = new();
|
||||||
|
FilteredAnalyses = new();
|
||||||
|
}
|
||||||
|
public void Refresh()
|
||||||
|
{
|
||||||
|
FilteredAnalyses.Clear();
|
||||||
|
var analysesList = AnalysesList.ToList();
|
||||||
|
foreach (var analysis in analysesList)
|
||||||
|
{
|
||||||
|
FilteredAnalyses.Add(analysis);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void EditAnalysis()
|
||||||
|
{
|
||||||
|
if (SelectedAnalysis is not null)
|
||||||
|
{
|
||||||
|
var name = SelectedAnalysis.Analysis.Name;
|
||||||
|
var tags = SelectedAnalysis.Analysis.Tags;
|
||||||
|
var wnd = new AnalysisView(SelectedAnalysis);
|
||||||
|
wnd.ShowDialog();
|
||||||
|
if (wnd.DialogResult != true)
|
||||||
|
{
|
||||||
|
SelectedAnalysis.Analysis.Name = name;
|
||||||
|
SelectedAnalysis.Analysis.Tags = tags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void DeleteAnalysis()
|
||||||
|
{
|
||||||
|
if (SelectedAnalysis is not null)
|
||||||
|
{
|
||||||
|
var dialogResult = MessageBox.Show("Delete analysis?", "Please, confirm deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||||
|
if (dialogResult == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
AnalysesList.Remove(SelectedAnalysis);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void RunAnalysis()
|
||||||
|
{
|
||||||
|
SelectedAnalysis?.Run();
|
||||||
|
}
|
||||||
|
private void AddCrossSectionNdmAnalysis()
|
||||||
|
{
|
||||||
|
var analysis = new CrossSectionNdmAnalysis();
|
||||||
|
analysis.Name = "New NDM Analysis";
|
||||||
|
analysis.Tags = "#New group";
|
||||||
|
var visualAnalysis = new VisualAnalysis(analysis);
|
||||||
|
AnalysesList.Add(visualAnalysis);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.MainWindow.Analyses.AnalysisView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:StructureHelper.Windows.MainWindow.Analyses"
|
||||||
|
d:DataContext="{d:DesignInstance local:AnalysisViewModel}"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Analysis" Height="200" Width="300" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition Height="35"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" Text="Name"/>
|
||||||
|
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Text="{Binding Name}"/>
|
||||||
|
<GroupBox Grid.Row="1" Grid.ColumnSpan="2" Header="Tags">
|
||||||
|
<TextBox Margin="1" Text="{Binding Tags}"/>
|
||||||
|
</GroupBox>
|
||||||
|
</Grid>
|
||||||
|
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using StructureHelperCommon.Models.Analyses;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow.Analyses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for AnalysisView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class AnalysisView : Window
|
||||||
|
{
|
||||||
|
private readonly AnalysisViewModel viewModel;
|
||||||
|
|
||||||
|
public AnalysisView(AnalysisViewModel viewModel)
|
||||||
|
{
|
||||||
|
this.viewModel = viewModel;
|
||||||
|
this.viewModel.ParentWindow = this;
|
||||||
|
this.DataContext = this.viewModel;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
public AnalysisView(IAnalysis analysis) : this(new AnalysisViewModel(analysis))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnalysisView(IVisualAnalysis visualAnalysis) : this(visualAnalysis.Analysis)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
|
using StructureHelperCommon.Models.Analyses;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow.Analyses
|
||||||
|
{
|
||||||
|
public class AnalysisViewModel : OkCancelViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IAnalysis analysis;
|
||||||
|
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get => analysis.Name;
|
||||||
|
set => analysis.Name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Tags
|
||||||
|
{
|
||||||
|
get => analysis.Tags;
|
||||||
|
set => analysis.Tags = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnalysisViewModel(IAnalysis analysis)
|
||||||
|
{
|
||||||
|
this.analysis = analysis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using StructureHelperCommon.Models.Analyses;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow.Analyses
|
||||||
|
{
|
||||||
|
public interface IVisualAnalysis
|
||||||
|
{
|
||||||
|
IAnalysis Analysis {get;set;}
|
||||||
|
void Run();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models.Analyses;
|
||||||
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow.Analyses
|
||||||
|
{
|
||||||
|
public class VisualAnalysis : IVisualAnalysis
|
||||||
|
{
|
||||||
|
public IAnalysis Analysis { get; set; }
|
||||||
|
|
||||||
|
public VisualAnalysis(IAnalysis analysis)
|
||||||
|
{
|
||||||
|
Analysis = analysis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run()
|
||||||
|
{
|
||||||
|
var version = Analysis.VersionProcessor.GetCurrentVersion();
|
||||||
|
if (version is null)
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.NullReference);
|
||||||
|
}
|
||||||
|
if (version.Item is ICrossSection crossSection)
|
||||||
|
{
|
||||||
|
ProcessCrossSection(crossSection);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(version));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessCrossSection(ICrossSection crossSection)
|
||||||
|
{
|
||||||
|
var window = new CrossSectionView(crossSection);
|
||||||
|
window.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.MainWindow
|
|
||||||
{
|
|
||||||
public class AnalisesLogic : ViewModelBase
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
xmlns:local="clr-namespace:StructureHelper.Windows.MainWindow"
|
xmlns:local="clr-namespace:StructureHelper.Windows.MainWindow"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance local:AnalysesManagerViewModel}"
|
d:DataContext="{d:DesignInstance local:AnalysesManagerViewModel}"
|
||||||
Title="Analyses Manager" Height="450" Width="800" MinHeight="400" MinWidth="600">
|
Title="Analyses Manager" Height="450" Width="800" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
||||||
<Grid>
|
<Grid>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<ToolBarTray DockPanel.Dock="Top">
|
<ToolBarTray DockPanel.Dock="Top">
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ToolBar ToolTip="Cross-sections">
|
<ToolBar ToolTip="Cross-sections">
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding Add}" ToolTip="NDM Analisis">
|
<Button Style="{DynamicResource ToolButton}" Command="{Binding AnalysesLogic.AddAnalysisCommand}" ToolTip="NDM Analysis">
|
||||||
<Viewbox>
|
<Viewbox>
|
||||||
<ContentControl ContentTemplate="{DynamicResource NdmCrossSection}"/>
|
<ContentControl ContentTemplate="{DynamicResource NdmCrossSection}"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
@@ -70,30 +70,43 @@
|
|||||||
|
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Column="1">
|
<Grid Grid.Column="1" DataContext="{Binding AnalysesLogic}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="30"/>
|
<RowDefinition Height="30"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ToolBar HorizontalAlignment="Right">
|
<ToolBar HorizontalAlignment="Right">
|
||||||
<Button Style="{StaticResource ToolButton24}" Command="{Binding Add}" ToolTip="Select all">
|
<Button Style="{StaticResource ToolButton24}" Command="{Binding RunCommand}" ToolTip="Run Analysis">
|
||||||
<Viewbox Width="24" Height="24">
|
<Viewbox Width="24" Height="24">
|
||||||
<ContentControl ContentTemplate="{DynamicResource RunAnalisis}"/>
|
<ContentControl ContentTemplate="{DynamicResource RunAnalisis}"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton24}" Command="{Binding Add}" ToolTip="Select all">
|
<Button Style="{StaticResource ToolButton24}" Command="{Binding EditCommand}" ToolTip="Edit Analysis">
|
||||||
<Viewbox Width="24" Height="24">
|
<Viewbox Width="24" Height="24">
|
||||||
<ContentControl ContentTemplate="{DynamicResource EditAnalisis}"/>
|
<ContentControl ContentTemplate="{DynamicResource EditAnalisis}"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton24}" Command="{Binding Add}" ToolTip="Select all">
|
<Button Style="{StaticResource ToolButton24}" Command="{Binding DeleteCommand}" ToolTip="Delete Analysis">
|
||||||
<Viewbox Width="24" Height="24">
|
<Viewbox Width="24" Height="24">
|
||||||
<ContentControl ContentTemplate="{DynamicResource DeleteAnalisis}"/>
|
<ContentControl ContentTemplate="{DynamicResource DeleteAnalisis}"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ListBox Grid.Row="1">
|
<ListBox Grid.Row="1" ItemsSource="{Binding FilteredAnalyses}" SelectedItem="{Binding SelectedAnalysis}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="1" Text="{Binding Analysis.Name}"/>
|
||||||
|
<TextBlock Grid.Column="3" Text="{Binding Analysis.Tags}"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,11 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class AnalysesManagerView : Window
|
public partial class AnalysesManagerView : Window
|
||||||
{
|
{
|
||||||
|
private AnalysesManagerViewModel viewModel;
|
||||||
public AnalysesManagerView()
|
public AnalysesManagerView()
|
||||||
{
|
{
|
||||||
|
this.viewModel = new();
|
||||||
|
this.DataContext = viewModel;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
public FileLogic FileLogic { get; }
|
public FileLogic FileLogic { get; }
|
||||||
public DiagramLogic DiagramLogic { get; }
|
public DiagramLogic DiagramLogic { get; }
|
||||||
public AnalisesLogic AnalisesLogic { get; }
|
public AnalysesLogic AnalysesLogic { get; }
|
||||||
|
|
||||||
public AnalysesManagerViewModel()
|
public AnalysesManagerViewModel()
|
||||||
{
|
{
|
||||||
FileLogic = new();
|
FileLogic = new();
|
||||||
DiagramLogic = new();
|
DiagramLogic = new();
|
||||||
AnalisesLogic = new();
|
AnalysesLogic = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
using LoaderCalculator;
|
|
||||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
|
||||||
using LoaderCalculator.Data.Matrix;
|
|
||||||
using LoaderCalculator.Data.Ndms;
|
|
||||||
using LoaderCalculator.Data.ResultData;
|
|
||||||
using LoaderCalculator.Data.SourceData;
|
|
||||||
using StructureHelper.Models.Materials;
|
|
||||||
using StructureHelper.Services;
|
|
||||||
using StructureHelper.Services.Primitives;
|
|
||||||
using StructureHelper.UnitSystem;
|
|
||||||
using StructureHelper.UnitSystem.Systems;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Models;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
|
||||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
|
||||||
using StructureHelperLogics.Models.Materials;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
|
||||||
using StructureHelperLogics.Services;
|
|
||||||
using StructureHelperLogics.Services.NdmCalculations;
|
|
||||||
using StructureHelperLogics.Services.NdmPrimitives;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.MainWindow
|
|
||||||
{
|
|
||||||
public class CrossSectionModel
|
|
||||||
{
|
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
|
||||||
|
|
||||||
public ICrossSection Section { get; private set; }
|
|
||||||
private IPrimitiveRepository primitiveRepository;
|
|
||||||
public IHeadMaterialRepository HeadMaterialRepository { get; }
|
|
||||||
public List<IHeadMaterial> HeadMaterials { get; }
|
|
||||||
private CalculationService calculationService;
|
|
||||||
private UnitSystemService unitSystemService;
|
|
||||||
|
|
||||||
public IPrimitiveRepository PrimitiveRepository => primitiveRepository;
|
|
||||||
|
|
||||||
public ICalculationProperty CalculationProperty { get; private set; }
|
|
||||||
|
|
||||||
public CrossSectionModel(IPrimitiveRepository primitiveRepository, CalculationService calculationService, UnitSystemService unitSystemService)
|
|
||||||
{
|
|
||||||
this.primitiveRepository = primitiveRepository;
|
|
||||||
this.calculationService = calculationService;
|
|
||||||
this.unitSystemService = unitSystemService;
|
|
||||||
|
|
||||||
Section = new CrossSection();
|
|
||||||
CalculationProperty = new CalculationProperty();
|
|
||||||
HeadMaterials = new List<IHeadMaterial>();
|
|
||||||
HeadMaterialRepository = new HeadMaterialRepository(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<INdm> GetNdms(ICalculationProperty calculationProperty)
|
|
||||||
{
|
|
||||||
var ndmPrimitives = Section.SectionRepository.Primitives;
|
|
||||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
|
||||||
{
|
|
||||||
Primitives = ndmPrimitives,
|
|
||||||
LimitState = calculationProperty.LimitState,
|
|
||||||
CalcTerm = calculationProperty.CalcTerm
|
|
||||||
};
|
|
||||||
return triangulateLogic.GetNdms();
|
|
||||||
////Настройки триангуляции, пока опции могут быть только такие
|
|
||||||
//ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
|
||||||
|
|
||||||
////Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
|
|
||||||
//return ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,22 +3,27 @@ using System.Windows.Controls;
|
|||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
using StructureHelper.Services;
|
using StructureHelper.Services;
|
||||||
using StructureHelper.Services.Primitives;
|
using StructureHelper.Services.Primitives;
|
||||||
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
|
|
||||||
namespace StructureHelper.Windows.MainWindow
|
namespace StructureHelper.Windows.MainWindow
|
||||||
{
|
{
|
||||||
public partial class CrossSectionView : Window
|
public partial class CrossSectionView : Window
|
||||||
{
|
{
|
||||||
private CrossSectionViewModel viewModel;
|
private CrossSectionViewModel viewModel;
|
||||||
public IPrimitiveRepository PrimitiveRepository { get; }
|
//public IPrimitiveRepository PrimitiveRepository { get; }
|
||||||
|
|
||||||
public CrossSectionView(IPrimitiveRepository primitiveRepository, CrossSectionViewModel viewModel)
|
public CrossSectionView(CrossSectionViewModel viewModel)
|
||||||
{
|
{
|
||||||
PrimitiveRepository = primitiveRepository;
|
|
||||||
this.viewModel = viewModel;
|
this.viewModel = viewModel;
|
||||||
DataContext = this.viewModel;
|
DataContext = this.viewModel;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CrossSectionView(ICrossSection crossSection) : this(new CrossSectionViewModel(crossSection))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void ContentPresenter_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
private void ContentPresenter_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
var contentPresenter = sender as ContentPresenter;
|
var contentPresenter = sender as ContentPresenter;
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
public class CrossSectionViewModel : ViewModelBase
|
public class CrossSectionViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
private ICrossSection section;
|
public ICrossSection Section { get; set; }
|
||||||
private ICrossSectionRepository repository => section.SectionRepository;
|
private ICrossSectionRepository repository => Section.SectionRepository;
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||||
|
|
||||||
|
|
||||||
@@ -43,15 +43,13 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
public PrimitiveViewModelLogic PrimitiveLogic { get; }
|
public PrimitiveViewModelLogic PrimitiveLogic { get; }
|
||||||
public HelpLogic HelpLogic => new HelpLogic();
|
public HelpLogic HelpLogic => new HelpLogic();
|
||||||
|
|
||||||
private CrossSectionModel Model { get; }
|
|
||||||
|
|
||||||
|
|
||||||
public ObservableCollection<IHeadMaterial> HeadMaterials
|
public ObservableCollection<IHeadMaterial> HeadMaterials
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var collection = new ObservableCollection<IHeadMaterial>();
|
var collection = new ObservableCollection<IHeadMaterial>();
|
||||||
foreach (var obj in Model.Section.SectionRepository.HeadMaterials)
|
foreach (var obj in Section.SectionRepository.HeadMaterials)
|
||||||
{
|
{
|
||||||
collection.Add(obj);
|
collection.Add(obj);
|
||||||
}
|
}
|
||||||
@@ -125,15 +123,14 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
private RelayCommand showVisualProperty;
|
private RelayCommand showVisualProperty;
|
||||||
private RelayCommand selectPrimitive;
|
private RelayCommand selectPrimitive;
|
||||||
|
|
||||||
public CrossSectionViewModel(CrossSectionModel model)
|
public CrossSectionViewModel(ICrossSection section)
|
||||||
{
|
{
|
||||||
|
Section = section;
|
||||||
VisualProperty = new CrossSectionVisualPropertyVM()
|
VisualProperty = new CrossSectionVisualPropertyVM()
|
||||||
{
|
{
|
||||||
ScaleValue = 500d,
|
ScaleValue = 500d,
|
||||||
ParentViewModel = this
|
ParentViewModel = this
|
||||||
};
|
};
|
||||||
Model = model;
|
|
||||||
section = model.Section;
|
|
||||||
CombinationsLogic = new ActionsViewModel(repository);
|
CombinationsLogic = new ActionsViewModel(repository);
|
||||||
MaterialsLogic = new MaterialsViewModel(repository);
|
MaterialsLogic = new MaterialsViewModel(repository);
|
||||||
MaterialsLogic.AfterItemsEdit += AfterMaterialEdit;
|
MaterialsLogic.AfterItemsEdit += AfterMaterialEdit;
|
||||||
@@ -143,6 +140,7 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
Width = VisualProperty.Width,
|
Width = VisualProperty.Width,
|
||||||
Height = VisualProperty.Height
|
Height = VisualProperty.Height
|
||||||
};
|
};
|
||||||
|
PrimitiveLogic.Refresh();
|
||||||
|
|
||||||
LeftButtonUp = new RelayCommand(o =>
|
LeftButtonUp = new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Analyses
|
||||||
|
{
|
||||||
|
public class AnalysisUpdateStrategy : IUpdateStrategy<IAnalysis>
|
||||||
|
{
|
||||||
|
public void Update(IAnalysis targetObject, IAnalysis sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject, "Analysis Properties");
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
targetObject.Name = sourceObject.Name;
|
||||||
|
targetObject.Tags = sourceObject.Tags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
StructureHelperCommon/Models/Analyses/IAnalysis.cs
Normal file
16
StructureHelperCommon/Models/Analyses/IAnalysis.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Analyses
|
||||||
|
{
|
||||||
|
public interface IAnalysis : ISaveable
|
||||||
|
{
|
||||||
|
string Name { get; set; }
|
||||||
|
string Tags { get; set; }
|
||||||
|
IVersionProcessor VersionProcessor { get;}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
StructureHelperCommon/Models/Analyses/IVersion.cs
Normal file
15
StructureHelperCommon/Models/Analyses/IVersion.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Analyses
|
||||||
|
{
|
||||||
|
public interface IVersion
|
||||||
|
{
|
||||||
|
DateTime DateTime { get; }
|
||||||
|
ISaveable Item { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
16
StructureHelperCommon/Models/Analyses/IVersionProcessor.cs
Normal file
16
StructureHelperCommon/Models/Analyses/IVersionProcessor.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Analyses
|
||||||
|
{
|
||||||
|
public interface IVersionProcessor : ISaveable
|
||||||
|
{
|
||||||
|
void AddVersion(ISaveable newItem);
|
||||||
|
List<IVersion> Versions { get; }
|
||||||
|
IVersion GetCurrentVersion();
|
||||||
|
}
|
||||||
|
}
|
||||||
16
StructureHelperCommon/Models/Analyses/Version.cs
Normal file
16
StructureHelperCommon/Models/Analyses/Version.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Analyses
|
||||||
|
{
|
||||||
|
public class Version : IVersion
|
||||||
|
{
|
||||||
|
public DateTime DateTime { get; set; }
|
||||||
|
|
||||||
|
public ISaveable Item { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
48
StructureHelperCommon/Models/Analyses/VersionProcessor.cs
Normal file
48
StructureHelperCommon/Models/Analyses/VersionProcessor.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Analyses
|
||||||
|
{
|
||||||
|
public class VersionProcessor : IVersionProcessor
|
||||||
|
{
|
||||||
|
public List<IVersion> Versions { get; }
|
||||||
|
|
||||||
|
public Guid Id { get; }
|
||||||
|
|
||||||
|
public VersionProcessor(Guid id)
|
||||||
|
{
|
||||||
|
|
||||||
|
Id = id;
|
||||||
|
Versions = new();
|
||||||
|
}
|
||||||
|
public VersionProcessor() : this (new Guid())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddVersion(IVersion version)
|
||||||
|
{
|
||||||
|
Versions.Add(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddVersion(ISaveable newItem)
|
||||||
|
{
|
||||||
|
var version = new Version()
|
||||||
|
{
|
||||||
|
DateTime = DateTime.Now,
|
||||||
|
Item = newItem
|
||||||
|
};
|
||||||
|
AddVersion(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IVersion GetCurrentVersion()
|
||||||
|
{
|
||||||
|
return Versions[^1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
|
{
|
||||||
|
public class HasForceCombinationUpdateStrategy : IUpdateStrategy<IHasForceCombinations>
|
||||||
|
{
|
||||||
|
public void Update(IHasForceCombinations targetObject, IHasForceCombinations sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject, "Interface IHasForceCombination");
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
targetObject.ForceActions.Clear();
|
||||||
|
targetObject.ForceActions.AddRange(sourceObject.ForceActions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,14 +24,20 @@ namespace StructureHelperCommon.Services
|
|||||||
/// <exception cref="StructureHelperException"></exception>
|
/// <exception cref="StructureHelperException"></exception>
|
||||||
public static void CompareTypes(object targetObject, object sourceObject)
|
public static void CompareTypes(object targetObject, object sourceObject)
|
||||||
{
|
{
|
||||||
IsNull(targetObject, "target object");
|
IsNull(targetObject, sourceObject);
|
||||||
IsNull(sourceObject, "source object");
|
|
||||||
if (targetObject.GetType() != sourceObject.GetType())
|
if (targetObject.GetType() != sourceObject.GetType())
|
||||||
{
|
{
|
||||||
throw new StructureHelperException
|
throw new StructureHelperException
|
||||||
($"{ErrorStrings.DataIsInCorrect}: target type is {targetObject.GetType()},\n does not coinside with source type {sourceObject.GetType()}");
|
($"{ErrorStrings.DataIsInCorrect}: target type is {targetObject.GetType()},\n does not coinside with source type {sourceObject.GetType()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void IsNull(object targetObject, object sourceObject, string senderName = "")
|
||||||
|
{
|
||||||
|
IsNull(targetObject,$"{senderName} target object");
|
||||||
|
IsNull(sourceObject, $"{senderName} source object");
|
||||||
|
}
|
||||||
|
|
||||||
public static void IsNull(object item, string message = "")
|
public static void IsNull(object item, string message = "")
|
||||||
{
|
{
|
||||||
if (item is null)
|
if (item is null)
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using StructureHelperCommon.Models.Analyses;
|
||||||
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogic.Models.Analyses
|
||||||
|
{
|
||||||
|
public class CrossSectionNdmAnalysis : IAnalysis
|
||||||
|
{
|
||||||
|
public Guid Id { get; private set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Tags { get; set; }
|
||||||
|
public IVersionProcessor VersionProcessor { get; private set; }
|
||||||
|
|
||||||
|
public CrossSectionNdmAnalysis(Guid Id, IVersionProcessor versionProcessor)
|
||||||
|
{
|
||||||
|
this.Id = Id;
|
||||||
|
VersionProcessor = versionProcessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CrossSectionNdmAnalysis() : this(new Guid(), new VersionProcessor())
|
||||||
|
{
|
||||||
|
CrossSection crossSection = new CrossSection();
|
||||||
|
VersionProcessor.AddVersion(crossSection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,9 +10,16 @@ namespace StructureHelperLogics.Models.CrossSections
|
|||||||
{
|
{
|
||||||
public ICrossSectionRepository SectionRepository { get; private set; }
|
public ICrossSectionRepository SectionRepository { get; private set; }
|
||||||
|
|
||||||
|
public Guid Id { get; private set; }
|
||||||
|
|
||||||
public CrossSection()
|
public CrossSection()
|
||||||
{
|
{
|
||||||
SectionRepository = new CrossSectionRepository();
|
SectionRepository = new CrossSectionRepository();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.CrossSections
|
||||||
|
{
|
||||||
|
internal class CrossSectionRepositoryUpdateStrategy : IUpdateStrategy<ICrossSectionRepository>
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public void Update(ICrossSectionRepository targetObject, ICrossSectionRepository sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.CrossSections
|
||||||
|
{
|
||||||
|
public class CrossSectionUpdateStrategy : IUpdateStrategy<ICrossSection>
|
||||||
|
{
|
||||||
|
|
||||||
|
public CrossSectionUpdateStrategy()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(ICrossSection targetObject, ICrossSection sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.CrossSections
|
namespace StructureHelperLogics.Models.CrossSections
|
||||||
{
|
{
|
||||||
public interface ICrossSection
|
public interface ICrossSection : ISaveable, ICloneable
|
||||||
{
|
{
|
||||||
ICrossSectionRepository SectionRepository { get; }
|
ICrossSectionRepository SectionRepository { get; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
@@ -13,7 +14,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.CrossSections
|
namespace StructureHelperLogics.Models.CrossSections
|
||||||
{
|
{
|
||||||
public interface ICrossSectionRepository : IHasHeadMaterials, IHasPrimitives
|
public interface ICrossSectionRepository : IHasHeadMaterials, IHasPrimitives, IHasForceCombinations
|
||||||
{
|
{
|
||||||
List<IForceAction> ForceActions { get; }
|
List<IForceAction> ForceActions { get; }
|
||||||
List<ICalculator> CalculatorsList { get; }
|
List<ICalculator> CalculatorsList { get; }
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models.Forces.Logics;
|
||||||
using StructureHelperCommon.Models.Sections;
|
using StructureHelperCommon.Models.Sections;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives.Logics;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -12,19 +15,34 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
{
|
{
|
||||||
public class ForceCalculatorInputDataUpdateStrategy : IUpdateStrategy<ForceInputData>
|
public class ForceCalculatorInputDataUpdateStrategy : IUpdateStrategy<ForceInputData>
|
||||||
{
|
{
|
||||||
|
private IUpdateStrategy<IHasPrimitives> primitivesUpdateStrategy;
|
||||||
|
private IUpdateStrategy<IHasForceCombinations> forceCombinationUpdateStrategy;
|
||||||
private IUpdateStrategy<IAccuracy> accuracyUpdateStrategy;
|
private IUpdateStrategy<IAccuracy> accuracyUpdateStrategy;
|
||||||
private IUpdateStrategy<ICompressedMember> compressedMemberUpdateStrategy;
|
private IUpdateStrategy<ICompressedMember> compressedMemberUpdateStrategy;
|
||||||
public ForceCalculatorInputDataUpdateStrategy(IUpdateStrategy<IAccuracy> accuracyUpdateStrategy, IUpdateStrategy<ICompressedMember> compressedMemberUpdateStrategy)
|
public ForceCalculatorInputDataUpdateStrategy(IUpdateStrategy<IHasPrimitives> primitivesUpdateStrategy,
|
||||||
|
IUpdateStrategy<IHasForceCombinations> forceCombinationUpdateStrategy,
|
||||||
|
IUpdateStrategy<IAccuracy> accuracyUpdateStrategy,
|
||||||
|
IUpdateStrategy<ICompressedMember> compressedMemberUpdateStrategy)
|
||||||
{
|
{
|
||||||
|
this.primitivesUpdateStrategy = primitivesUpdateStrategy;
|
||||||
|
this.forceCombinationUpdateStrategy = forceCombinationUpdateStrategy;
|
||||||
this.accuracyUpdateStrategy = accuracyUpdateStrategy;
|
this.accuracyUpdateStrategy = accuracyUpdateStrategy;
|
||||||
this.compressedMemberUpdateStrategy = compressedMemberUpdateStrategy;
|
this.compressedMemberUpdateStrategy = compressedMemberUpdateStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForceCalculatorInputDataUpdateStrategy() : this(new AccuracyUpdateStrategy(), new CompressedMemberUpdateStrategy()) { }
|
public ForceCalculatorInputDataUpdateStrategy() :
|
||||||
|
this(
|
||||||
|
new HasPrimitivesUpdateStrategy(),
|
||||||
|
new HasForceCombinationUpdateStrategy(),
|
||||||
|
new AccuracyUpdateStrategy(),
|
||||||
|
new CompressedMemberUpdateStrategy()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
public void Update(ForceInputData targetObject, ForceInputData sourceObject)
|
public void Update(ForceInputData targetObject, ForceInputData sourceObject)
|
||||||
{
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject, "Force calculator input data");
|
||||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
|
||||||
targetObject.Accuracy ??= new Accuracy();
|
targetObject.Accuracy ??= new Accuracy();
|
||||||
accuracyUpdateStrategy.Update(targetObject.Accuracy, sourceObject.Accuracy);
|
accuracyUpdateStrategy.Update(targetObject.Accuracy, sourceObject.Accuracy);
|
||||||
targetObject.CompressedMember ??= new CompressedMember();
|
targetObject.CompressedMember ??= new CompressedMember();
|
||||||
@@ -33,10 +51,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
targetObject.LimitStatesList.AddRange(sourceObject.LimitStatesList);
|
targetObject.LimitStatesList.AddRange(sourceObject.LimitStatesList);
|
||||||
targetObject.CalcTermsList.Clear();
|
targetObject.CalcTermsList.Clear();
|
||||||
targetObject.CalcTermsList.AddRange(sourceObject.CalcTermsList);
|
targetObject.CalcTermsList.AddRange(sourceObject.CalcTermsList);
|
||||||
targetObject.Primitives.Clear();
|
primitivesUpdateStrategy.Update(targetObject, sourceObject);
|
||||||
targetObject.Primitives.AddRange(sourceObject.Primitives);
|
forceCombinationUpdateStrategy.Update(targetObject, sourceObject);
|
||||||
targetObject.ForceActions.Clear();
|
|
||||||
targetObject.ForceActions.AddRange(sourceObject.ForceActions);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Sections;
|
using StructureHelperCommon.Models.Sections;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
||||||
{
|
{
|
||||||
@@ -14,6 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
|||||||
public ForceCalculatorUpdateStrategy() : this(new ForceCalculatorInputDataUpdateStrategy()) { }
|
public ForceCalculatorUpdateStrategy() : this(new ForceCalculatorInputDataUpdateStrategy()) { }
|
||||||
public void Update(ForceCalculator targetObject, ForceCalculator sourceObject)
|
public void Update(ForceCalculator targetObject, ForceCalculator sourceObject)
|
||||||
{
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject);
|
||||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
targetObject.Name = sourceObject.Name;
|
targetObject.Name = sourceObject.Name;
|
||||||
targetObject.InputData ??= new ForceInputData();
|
targetObject.InputData ??= new ForceInputData();
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ILengthBetweenCracksLogic : ILogic
|
public interface ILengthBetweenCracksLogic : ILogic
|
||||||
{
|
{
|
||||||
#error
|
|
||||||
//to do change to primitive collection since it is required to gain difference rebar strain and concrete strain
|
//to do change to primitive collection since it is required to gain difference rebar strain and concrete strain
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Full collection of ndm parts of cross-section
|
/// Full collection of ndm parts of cross-section
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.NdmCalculations.Primitives.Logics
|
||||||
|
{
|
||||||
|
public class HasPrimitivesUpdateStrategy : IUpdateStrategy<IHasPrimitives>
|
||||||
|
{
|
||||||
|
public void Update(IHasPrimitives targetObject, IHasPrimitives sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(targetObject, sourceObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
targetObject.Primitives.Clear();
|
||||||
|
targetObject.Primitives.AddRange(sourceObject.Primitives);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user