diff --git a/StructureHelper/StructureHelper.csproj.user b/StructureHelper/StructureHelper.csproj.user
index a0b9e13..261919a 100644
--- a/StructureHelper/StructureHelper.csproj.user
+++ b/StructureHelper/StructureHelper.csproj.user
@@ -57,6 +57,9 @@
Code
+
+ Code
+
Code
@@ -81,6 +84,9 @@
Code
+
+ Code
+
Code
@@ -158,6 +164,9 @@
Designer
+
+ Designer
+
Designer
@@ -182,6 +191,9 @@
Designer
+
+ Designer
+
Designer
diff --git a/StructureHelper/Windows/MainGraph/AddTable.xaml b/StructureHelper/Windows/MainGraph/AddTable.xaml
new file mode 100644
index 0000000..b10c9fc
--- /dev/null
+++ b/StructureHelper/Windows/MainGraph/AddTable.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/MainGraph/AddTable.xaml.cs b/StructureHelper/Windows/MainGraph/AddTable.xaml.cs
new file mode 100644
index 0000000..870629f
--- /dev/null
+++ b/StructureHelper/Windows/MainGraph/AddTable.xaml.cs
@@ -0,0 +1,27 @@
+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.MainGraph
+{
+ ///
+ /// Interaction logic for AddTable.xaml
+ ///
+ public partial class AddTable : Window
+ {
+ public AddTable()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/StructureHelper/Windows/MainGraph/AddTableViewModel.cs b/StructureHelper/Windows/MainGraph/AddTableViewModel.cs
new file mode 100644
index 0000000..7719aea
--- /dev/null
+++ b/StructureHelper/Windows/MainGraph/AddTableViewModel.cs
@@ -0,0 +1,14 @@
+using StructureHelper.Infrastructure;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StructureHelper.Windows.MainGraph
+{
+ class AddTableViewModel : ViewModelBase
+ {
+
+ }
+}
diff --git a/StructureHelper/Windows/MainGraph/GraphView.xaml b/StructureHelper/Windows/MainGraph/GraphView.xaml
index 4c7aed6..d2c363f 100644
--- a/StructureHelper/Windows/MainGraph/GraphView.xaml
+++ b/StructureHelper/Windows/MainGraph/GraphView.xaml
@@ -3,15 +3,76 @@
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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:local="clr-namespace:StructureHelper.Windows.MainGraph"
mc:Ignorable="d"
- Title="GraphView" Height="450" Width="800">
+ d:DataContext="{d:DesignInstance local:GraphViewModel}"
+ Title="StructureHelper" Height="700"
+ Width="1000" MinHeight="400" MinWidth="600">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/MainGraph/GraphView.xaml.cs b/StructureHelper/Windows/MainGraph/GraphView.xaml.cs
index 6fc8315..5603b4d 100644
--- a/StructureHelper/Windows/MainGraph/GraphView.xaml.cs
+++ b/StructureHelper/Windows/MainGraph/GraphView.xaml.cs
@@ -1,4 +1,8 @@
-using System;
+using StructureHelper.Windows.MainWindow;
+using StructureHelper.Windows.ViewModels.Materials;
+using StructureHelperLogics.Models.CrossSections;
+using StructureHelperLogics.Models.Graphs;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,9 +23,15 @@ namespace StructureHelper.Windows.MainGraph
///
public partial class GraphView : Window
{
- public GraphView()
+ private GraphViewModel viewModel;
+ public GraphView(GraphViewModel viewModel)
{
+ this.viewModel = viewModel;
+ DataContext = this.viewModel;
InitializeComponent();
}
+ public GraphView() : this(new GraphViewModel())
+ {
+ }
}
}
diff --git a/StructureHelper/Windows/MainGraph/GraphViewModel.cs b/StructureHelper/Windows/MainGraph/GraphViewModel.cs
new file mode 100644
index 0000000..52c929b
--- /dev/null
+++ b/StructureHelper/Windows/MainGraph/GraphViewModel.cs
@@ -0,0 +1,142 @@
+using LiveCharts;
+using LiveCharts.Wpf;
+using StructureHelper.Infrastructure;
+using StructureHelper.Windows.TreeGraph;
+using StructureHelperCommon.Infrastructures.Interfaces;
+using StructureHelperCommon.Models.Functions;
+using StructureHelperLogics.Models.Graphs;
+using System.Collections.Generic;
+using System.Windows.Input;
+
+namespace StructureHelper.Windows.MainGraph
+{
+ public class GraphViewModel : ViewModelBase
+ {
+ public SeriesCollection SeriesCollection { get; set; }
+ public List Labels { get; set; }
+
+
+
+ private IOneVariableFunction selectedFunction;
+ public IOneVariableFunction SelectedFuntion
+ {
+ get
+ {
+ return selectedFunction;
+ }
+ set
+ {
+ selectedFunction = value;
+ OnPropertyChanged(nameof(SelectedFuntion));
+ }
+ }
+ private List functions;
+ public List Functions { get; set; }
+
+
+
+
+
+
+
+ private RelayCommand addTableCommand;
+ private RelayCommand addFormulaCommand;
+ private RelayCommand editCommand;
+ private RelayCommand deleteCommand;
+ private RelayCommand copyCommand;
+ private RelayCommand treeCommand;
+ public ICommand AddTableCommand
+ {
+ get => addTableCommand ??= new RelayCommand(o => AddTable());
+ }
+ public ICommand AddFormulaCommand
+ {
+ get => addFormulaCommand ??= new RelayCommand(o => AddTable());
+ }
+ public ICommand EditCommand
+ {
+ get => editCommand ??= new RelayCommand(o => AddTable());
+ }
+ public ICommand DeleteCommand
+ {
+ get => deleteCommand ??= new RelayCommand(o => AddTable());
+ }
+ public ICommand CopyCommand
+ {
+ get => copyCommand ??= new RelayCommand(o => AddTable());
+ }
+ public ICommand TreeCommand
+ {
+ get => treeCommand ??= new RelayCommand(o => Tree());
+ }
+ public GraphViewModel()
+ {
+ Functions = new List();
+ var f1 = new TableFunction();
+ f1.Name = "Пробная табличная системная функция 1";
+ f1.IsUser = false;
+ f1.Description = "Описание 1";
+ var f2 = new TableFunction();
+ f2.Name = "Пробная табличная пользовательская функция 2";
+ f2.IsUser = true;
+ f2.Description = "Описание 2";
+ var f3 = new FormulaFunction();
+ f3.Name = "Пробная формульная системная функция 3";
+ f3.IsUser = false;
+ f3.Description = "Описание 3";
+ Functions.Add(f1);
+ Functions.Add(f2);
+ Functions.Add(f3);
+
+
+ Labels = new List();
+ Labels.Add("1");
+ Labels.Add("2");
+ Labels.Add("2");
+ Labels.Add("3");
+ var chartValues = new ChartValues();
+ chartValues.Add(1);
+ chartValues.Add(10);
+ chartValues.Add(100);
+ chartValues.Add(25);
+ chartValues.Add(150);
+ chartValues.Add(100);
+ chartValues.Add(200);
+ chartValues.Add(50);
+ var lineSeries = new LineSeries();
+ lineSeries.Values = chartValues;
+ SeriesCollection = new SeriesCollection();
+ SeriesCollection.Add(lineSeries);
+ }
+ /*public GraphViewModel(IGraph graph)
+ {
+ }*/
+ private void AddTable()
+ {
+
+ }
+ private void AddFormula()
+ {
+
+ }
+ private void Edit()
+ {
+
+ }
+ private void Delete()
+ {
+
+ }
+ private void Cppy()
+ {
+
+ }
+ private void Tree()
+ {
+ var treeGraphVM = new TreeGraphViewModel(SelectedFuntion);
+ var treeGraph = new TreeGraph.TreeGraph();
+ treeGraph.DataContext = treeGraphVM;
+ treeGraph.ShowDialog();
+ }
+ }
+}
diff --git a/StructureHelper/Windows/MainWindow/Analyses/AnalysesLogic.cs b/StructureHelper/Windows/MainWindow/Analyses/AnalysesLogic.cs
index cdee9a3..6ee64d6 100644
--- a/StructureHelper/Windows/MainWindow/Analyses/AnalysesLogic.cs
+++ b/StructureHelper/Windows/MainWindow/Analyses/AnalysesLogic.cs
@@ -140,11 +140,13 @@ namespace StructureHelper.Windows.MainWindow
}
private void AddGraphEditor()
{
- var editor = new GraphEditorAnalysis();
+ var graphView = new MainGraph.GraphView();
+ graphView.ShowDialog();
+ /*var editor = new GraphEditorAnalysis(); //Код, который встраивал графики в "проигрыватель"
editor.Name = "New Graph Editor";
editor.Tags = "#New group";
var visualAnalysis = new VisualAnalysis(editor);
- ProgramSetting.CurrentProject.VisualAnalyses.Add(visualAnalysis);
+ ProgramSetting.CurrentProject.VisualAnalyses.Add(visualAnalysis);*/
}
}
}
diff --git a/StructureHelper/Windows/MainWindow/Analyses/VisualAnalysis.cs b/StructureHelper/Windows/MainWindow/Analyses/VisualAnalysis.cs
index 2c1a9e3..f4fe14d 100644
--- a/StructureHelper/Windows/MainWindow/Analyses/VisualAnalysis.cs
+++ b/StructureHelper/Windows/MainWindow/Analyses/VisualAnalysis.cs
@@ -37,10 +37,10 @@ namespace StructureHelper.Windows.MainWindow.Analyses
{
ProcessCrossSection(crossSection);
}
- else if (version.Item is IGraph graph)
+ /*else if (version.AnalysisVersion is IGraph graph)
{
ProcessEditGraph(graph);
- }
+ }*/
else
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(version));
@@ -52,11 +52,11 @@ namespace StructureHelper.Windows.MainWindow.Analyses
var window = new CrossSectionView(crossSection);
window.ShowDialog();
}
- private void ProcessEditGraph(IGraph graph)
+ /*private void ProcessEditGraph(IGraph graph)
{
- var window = new GraphView();
+ var window = new GraphView(graph);
window.ShowDialog();
- }
+ }*/
public object Clone()
{
diff --git a/StructureHelper/Windows/TreeGraph/TreeGraph.xaml b/StructureHelper/Windows/TreeGraph/TreeGraph.xaml
new file mode 100644
index 0000000..eb02237
--- /dev/null
+++ b/StructureHelper/Windows/TreeGraph/TreeGraph.xaml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs b/StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs
new file mode 100644
index 0000000..d9c2376
--- /dev/null
+++ b/StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs
@@ -0,0 +1,28 @@
+using StructureHelperCommon.Infrastructures.Interfaces;
+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.TreeGraph
+{
+ ///
+ /// Interaction logic for TreeGraph.xaml
+ ///
+ public partial class TreeGraph : Window
+ {
+ public TreeGraph()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs b/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
new file mode 100644
index 0000000..09030e3
--- /dev/null
+++ b/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
@@ -0,0 +1,22 @@
+using NLog.Common;
+using StructureHelper.Infrastructure;
+using StructureHelperCommon.Infrastructures.Interfaces;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StructureHelper.Windows.TreeGraph
+{
+ public class TreeGraphViewModel : ViewModelBase
+ {
+ private List nodes;
+ public List Nodes { get; set; }
+ public TreeGraphViewModel(IOneVariableFunction function)
+ {
+ Nodes = new List();
+ Nodes.Add(function);
+ }
+ }
+}
diff --git a/StructureHelperCommon/FunctionDecorator.cd b/StructureHelperCommon/FunctionDecorator.cd
index b352279..6c994c1 100644
--- a/StructureHelperCommon/FunctionDecorator.cd
+++ b/StructureHelperCommon/FunctionDecorator.cd
@@ -24,21 +24,21 @@
-
+
AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA=
Models\Functions\IScaleFunction.cs
-
+
AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=
Models\Functions\ILimitFunction.cs
-
+
AAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAA=
Infrastructures\Interfaces\IFunctionDecorator.cs
diff --git a/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs b/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs
index cbe3e92..77d97ef 100644
--- a/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs
+++ b/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs
@@ -9,8 +9,11 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
{
public interface IOneVariableFunction
{
+
+ public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public string Name { get; set; }
+ public string Description { get; set; }
public bool Check();
public double GetByX(double xValue);
}
diff --git a/StructureHelperCommon/Models/Functions/FormulaFunction.cs b/StructureHelperCommon/Models/Functions/FormulaFunction.cs
index 544c02c..0965eb5 100644
--- a/StructureHelperCommon/Models/Functions/FormulaFunction.cs
+++ b/StructureHelperCommon/Models/Functions/FormulaFunction.cs
@@ -10,8 +10,10 @@ namespace StructureHelperCommon.Models.Functions
{
public class FormulaFunction : IOneVariableFunction
{
+ public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public string Name { get; set; }
+ public string Description { get ; set; }
public bool Check()
{
@@ -25,8 +27,10 @@ namespace StructureHelperCommon.Models.Functions
public class CopyOfFormulaFunction : IOneVariableFunction
{
+ public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public string Name { get; set; }
+ public string Description { get; set; }
public bool Check()
{
diff --git a/StructureHelperCommon/Models/Functions/TableFunction.cs b/StructureHelperCommon/Models/Functions/TableFunction.cs
index 27e9df1..4b9de96 100644
--- a/StructureHelperCommon/Models/Functions/TableFunction.cs
+++ b/StructureHelperCommon/Models/Functions/TableFunction.cs
@@ -10,8 +10,10 @@ namespace StructureHelperCommon.Models.Functions
{
public class TableFunction : IOneVariableFunction
{
+ public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public string Name { get; set; }
+ public string Description { get; set; }
public bool Check()
{
@@ -25,8 +27,10 @@ namespace StructureHelperCommon.Models.Functions
public class CopyOfTableFunction : IOneVariableFunction
{
+ public bool IsUser { get; set; }
public FunctionType Type { get; set; }
public string Name { get; set; }
+ public string Description { get; set; }
public bool Check()
{
diff --git a/StructureHelperTests/StructureHelperTests.csproj b/StructureHelperTests/StructureHelperTests.csproj
index 2e75b34..691d459 100644
--- a/StructureHelperTests/StructureHelperTests.csproj
+++ b/StructureHelperTests/StructureHelperTests.csproj
@@ -1,5 +1,4 @@
-
net6.0-windows
enable
@@ -34,5 +33,4 @@
-
\ No newline at end of file