Window function material done

This commit is contained in:
Иван Ивашкин
2025-02-21 15:17:10 +05:00
parent 27d4ca95c8
commit 0a7a696b5f
18 changed files with 218 additions and 48 deletions

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Infrastructures.Enums
{
public enum FunctionPurpose
{
StressStrain,
FireProtection
}
}

View File

@@ -19,6 +19,7 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
public bool IsUser { get; set; }
public string Group { get; set; }
public FunctionType Type { get; set; }
public FunctionPurpose FunctionPurpose { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public List<GraphPoint> Table { get; set; }

View File

@@ -20,6 +20,7 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
public bool IsUser { get; set; }
public string Group { get; set; }
public FunctionType Type { get; set; }
public FunctionPurpose FunctionPurpose { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public double MinArg { get; set; }
@@ -27,6 +28,7 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
public Color Color { get; set; }
public string Trace { get; set; }
public ObservableCollection<IOneVariableFunction> Functions { get; set; }
public bool Check();
public double GetByX(double xValue);
public GraphSettings GetGraphSettings();

View File

@@ -2,6 +2,7 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Codes;
using StructureHelperCommon.Models.Codes.Factories;
using StructureHelperCommon.Models.Functions;
using StructureHelperCommon.Models.Materials;
using StructureHelperCommon.Models.Materials.Libraries;
using StructureHelperCommon.Models.Projects;
@@ -41,7 +42,8 @@ namespace StructureHelperCommon.Infrastructures.Settings
public static LimitStatesList LimitStatesList => new LimitStatesList();
public static CalcTermList CalcTermList => new CalcTermList();
public static List<ICodeEntity> CodesList
{ get
{
get
{
codesList ??= CodeFactory
.GetCodeEntities()
@@ -92,6 +94,33 @@ namespace StructureHelperCommon.Infrastructures.Settings
SubVersionNumber = 0
};
}
public static ObservableCollection<IOneVariableFunction> Functions { get; set; }
public static ObservableCollection<IOneVariableFunction> Functions { get; set; } = new ObservableCollection<IOneVariableFunction>
{
new TableFunction()
{
Name = "Табличная системная функция",
Table = new List<GraphPoint>()
{
new GraphPoint(1, 1),
new GraphPoint(2, 2),
new GraphPoint(3, 3),
new GraphPoint(4, 4),
new GraphPoint(5, 5),
new GraphPoint(6, 6),
},
IsUser = false,
Description = "Пример описания",
},
new FormulaFunction()
{
Name = "Формульная системная функция",
Formula = "x^2",
Step = 100,
MinArg = 1,
MaxArg = 1000,
IsUser = false,
Description = "Пример описания",
}
};
}
}

View File

@@ -27,6 +27,7 @@ namespace StructureHelperCommon.Models.Functions
public const string GROUP_TYPE_2 = "User function";
public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public FunctionPurpose FunctionPurpose { get; set; }
public string Group { get; set; }
public string Name { get; set; }
public string Description { get ; set; }

View File

@@ -24,6 +24,7 @@ namespace StructureHelperCommon.Models.Functions
public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public FunctionPurpose FunctionPurpose { get; set; }
public string Group { get; set; }
public string Name { get; set; }
public string Description { get; set; }

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Compile Update="Windows\FunctionSelectionView.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Update="Windows\FunctionSelectionView.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,23 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Functions;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Windows
{
public class FunctionSelectionVM
{
public string SHORT_TERM { get; } = "Short Term";
public string LONG_TERM { get; } = "Long Term";
public string ULS { get; } = "Ultimate Limit State (ULS)";
public string SLS { get; } = "Serviceability Limit State (SLS)";
public string SPECIAL { get; } = "Special Limit State";
public string CREATE_MATERIAL { get; } = "Create Function Material";
public ObservableCollection<IOneVariableFunction> Functions { get; set; } = ProgramSetting.Functions;
}
}

View File

@@ -0,0 +1,86 @@
<Window x:Class="StructureHelperCommon.Windows.FunctionSelectionView"
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:StructureHelperCommon.Windows"
mc:Ignorable="d"
Title="FunctionMaterial" Height="250" Width="860">
<!--Window.DataContext>
<local:FunctionSelectionVM/>
</Window.DataContext-->
<Window.Resources>
<Style x:Key="BoarderPropertyStyle" TargetType="Border">
<Setter Property="Background" Value="LightYellow"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style x:Key="BoarderValueStyle" TargetType="Border">
<Setter Property="Background" Value="AliceBlue"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="Background" Value="LightYellow"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="FuncComboBox" TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding Functions}"/>
<Setter Property="DisplayMemberPath" Value="Name"/>
<Setter Property="Margin" Value="10"/>
</Style>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="220"/>
<ColumnDefinition Width="220"/>
<ColumnDefinition Width="220"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Border Grid.Column="0" Grid.Row="0"/>
<Border Grid.Column="0" Grid.Row="1" Style="{StaticResource BoarderPropertyStyle}"/>
<Border Grid.Column="0" Grid.Row="2" Style="{StaticResource BoarderPropertyStyle}"/>
<Border Grid.Column="1" Grid.Row="0" Style="{StaticResource BoarderPropertyStyle}"/>
<Border Grid.Column="1" Grid.Row="1" Style="{StaticResource BoarderValueStyle}"/>
<Border Grid.Column="1" Grid.Row="2" Style="{StaticResource BoarderValueStyle}"/>
<Border Grid.Column="2" Grid.Row="0" Style="{StaticResource BoarderPropertyStyle}"/>
<Border Grid.Column="2" Grid.Row="1" Style="{StaticResource BoarderValueStyle}"/>
<Border Grid.Column="2" Grid.Row="2" Style="{StaticResource BoarderValueStyle}"/>
<Border Grid.Column="3" Grid.Row="0" Style="{StaticResource BoarderPropertyStyle}"/>
<Border Grid.Column="3" Grid.Row="1" Style="{StaticResource BoarderValueStyle}"/>
<Border Grid.Column="3" Grid.Row="2" Style="{StaticResource BoarderValueStyle}"/>
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding SHORT_TERM}" Style="{StaticResource TextBlockStyle}"/>
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding LONG_TERM}" Style="{StaticResource TextBlockStyle}"/>
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding ULS}" Style="{StaticResource TextBlockStyle}"/>
<TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding SLS}" Style="{StaticResource TextBlockStyle}"/>
<TextBlock Grid.Column="3" Grid.Row="0" Text="{Binding SPECIAL}" Style="{StaticResource TextBlockStyle}"/>
<ComboBox Style="{StaticResource FuncComboBox}"
Grid.Column="1" Grid.Row="1"/>
<ComboBox Style="{StaticResource FuncComboBox}"
Grid.Column="1" Grid.Row="2"/>
<ComboBox Style="{StaticResource FuncComboBox}"
Grid.Column="2" Grid.Row="1"/>
<ComboBox Style="{StaticResource FuncComboBox}"
Grid.Column="2" Grid.Row="2"/>
<ComboBox Style="{StaticResource FuncComboBox}"
Grid.Column="3" Grid.Row="1"/>
<ComboBox Style="{StaticResource FuncComboBox}"
Grid.Column="3" Grid.Row="2"/>
<Button Grid.Column="3"
Grid.Row="3"
Margin="10"
Content="{Binding CREATE_MATERIAL}"/>
</Grid>
</Window>

View File

@@ -0,0 +1,33 @@
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 StructureHelperCommon.Windows
{
/// <summary>
/// Interaction logic for FunctionSelection.xaml
/// </summary>
public partial class FunctionSelectionView : Window
{
private FunctionSelectionVM viewModel;
public FunctionSelectionView(FunctionSelectionVM viewModel)
{
this.viewModel = viewModel;
DataContext = this.viewModel;
InitializeComponent();
}
public FunctionSelectionView() : this(new FunctionSelectionVM())
{
}
}
}