Add rename and tree modifiers, binding function purpose enum

This commit is contained in:
Иван Ивашкин
2025-03-05 12:58:02 +05:00
parent 45dc56a63e
commit 0829b9c57e
15 changed files with 326 additions and 13 deletions

View File

@@ -96,9 +96,26 @@ namespace StructureHelperCommon.Infrastructures.Settings
}
public static ObservableCollection<IOneVariableFunction> Functions { get; set; } = new ObservableCollection<IOneVariableFunction>
{
new TableFunction()
{
Name = "Not StressStrain",
FunctionPurpose = FunctionPurpose.FireProtection,
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 TableFunction()
{
Name = "Табличная системная функция",
FunctionPurpose = FunctionPurpose.StressStrain,
Table = new List<GraphPoint>()
{
new GraphPoint(1, 1),
@@ -114,6 +131,7 @@ namespace StructureHelperCommon.Infrastructures.Settings
new FormulaFunction()
{
Name = "Формульная системная функция",
FunctionPurpose = FunctionPurpose.StressStrain,
Formula = "x^2",
Step = 100,
MinArg = 1,

View File

@@ -95,6 +95,7 @@ namespace StructureHelperCommon.Models.Functions
formulaFunction.Step = Step;
formulaFunction.MinArg = MinArg;
formulaFunction.MaxArg = MaxArg;
formulaFunction.FunctionPurpose = FunctionPurpose;
return formulaFunction;
}

View File

@@ -68,6 +68,7 @@ namespace StructureHelperCommon.Models.Functions
tableFunction.Table = newTable;
tableFunction.IsUser = true;
tableFunction.Group = GROUP_TYPE_2;
tableFunction.FunctionPurpose = FunctionPurpose;
return tableFunction;
}

View File

@@ -27,7 +27,7 @@ namespace StructureHelperCommon.Windows
public string SPECIAL { get; } = "Special Limit State";
public string CREATE_MATERIAL { get; } = "Create Function Material";
private const string ERROR_TEXT_1 = "Not all material states have functions ";
public ObservableCollection<IOneVariableFunction> Functions { get; set; } = ProgramSetting.Functions;
public ObservableCollection<IOneVariableFunction> Functions { get; set; }
public IOneVariableFunction Func_ST_ULS { get; set; }
public IOneVariableFunction Func_ST_SLS { get; set; }
public IOneVariableFunction Func_ST_Special { get; set; }
@@ -35,6 +35,11 @@ namespace StructureHelperCommon.Windows
public IOneVariableFunction Func_LT_SLS { get; set; }
public IOneVariableFunction Func_LT_Special { get; set; }
public FunctionStorage FunctionStorage { get; set; } = new();
public FunctionSelectionVM()
{
var listFunctions = ProgramSetting.Functions.Where(x => x.FunctionPurpose == Infrastructures.Enums.FunctionPurpose.StressStrain).ToList();
Functions = new ObservableCollection<IOneVariableFunction>();
}
private void CreateFunctionMaterial(object parameter)
{
var window = parameter as Window;