diff --git a/SmartAquaViewer/Controls/SegmentedControl.xaml.cs b/SmartAquaViewer/Controls/SegmentedControl.xaml.cs
index 6293c78..09dde83 100644
--- a/SmartAquaViewer/Controls/SegmentedControl.xaml.cs
+++ b/SmartAquaViewer/Controls/SegmentedControl.xaml.cs
@@ -41,7 +41,6 @@ namespace SmartAquaViewer.Controls
if (sender is RadioButton rb && rb.Tag != null)
{
SelectedValue = rb.Tag.ToString();
- Debug.WriteLine($"SelectedValue changed to: {SelectedValue}");
}
}
}
diff --git a/SmartAquaViewer/Resources/Generic.xaml b/SmartAquaViewer/Resources/Generic.xaml
index aa395fe..133b2d2 100644
--- a/SmartAquaViewer/Resources/Generic.xaml
+++ b/SmartAquaViewer/Resources/Generic.xaml
@@ -95,4 +95,13 @@
+
+
\ No newline at end of file
diff --git a/SmartAquaViewer/SmartAquaViewer.csproj b/SmartAquaViewer/SmartAquaViewer.csproj
index 3c0030f..e30e0c5 100644
--- a/SmartAquaViewer/SmartAquaViewer.csproj
+++ b/SmartAquaViewer/SmartAquaViewer.csproj
@@ -39,12 +39,17 @@
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/SmartAquaViewer/View/MonitoringView.xaml b/SmartAquaViewer/View/MonitoringView.xaml
index eacbb80..fd4199b 100644
--- a/SmartAquaViewer/View/MonitoringView.xaml
+++ b/SmartAquaViewer/View/MonitoringView.xaml
@@ -20,10 +20,14 @@
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SmartAquaViewer/View/MonitoringView.xaml.cs b/SmartAquaViewer/View/MonitoringView.xaml.cs
index 13912db..1844d34 100644
--- a/SmartAquaViewer/View/MonitoringView.xaml.cs
+++ b/SmartAquaViewer/View/MonitoringView.xaml.cs
@@ -12,6 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using SmartAquaViewer.ViewModel;
using static SmartAquaViewer.Model.Enums;
namespace SmartAquaViewer.View
@@ -21,11 +22,20 @@ namespace SmartAquaViewer.View
///
public partial class MonitoringView : UserControl
{
+ private MonitoringViewModel? monitoringViewModel;
+
private PanelState _state = PanelState.Normal;
public MonitoringView()
{
InitializeComponent();
+ monitoringViewModel = this.DataContext as MonitoringViewModel;
+ monitoringViewModel.OnSystemChanged += MonitoringViewModel_OnSystemChanged;
+ }
+
+ private void MonitoringViewModel_OnSystemChanged(string systemName)
+ {
+
}
}
}
diff --git a/SmartAquaViewer/ViewModel/MonitoringViewModel.cs b/SmartAquaViewer/ViewModel/MonitoringViewModel.cs
index c207363..f2decec 100644
--- a/SmartAquaViewer/ViewModel/MonitoringViewModel.cs
+++ b/SmartAquaViewer/ViewModel/MonitoringViewModel.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.ComponentModel;
+using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
@@ -13,6 +15,44 @@ namespace SmartAquaViewer.ViewModel
{
public class MonitoringViewModel : INotifyPropertyChanged
{
+ public delegate void SystemChangedEventHandler(string systemName);
+ public event SystemChangedEventHandler OnSystemChanged;
+
+ public ObservableCollection GraphTypes { get; }
+
+ private string _selectedGraphType;
+ public string SelectedGraphType
+ {
+ get => _selectedGraphType;
+ set
+ {
+ if (_selectedGraphType != value)
+ {
+ _selectedGraphType = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private string _currentSystem;
+ public string CurrentSystem
+ {
+ get => _currentSystem;
+ set
+ {
+ if (_currentSystem != value)
+ {
+ _currentSystem = value;
+ OnPropertyChanged();
+
+ Debug.WriteLine($"CurrentSyetem changed to: {_currentSystem}");
+ SetGraphType();
+ SelectedGraphType = GraphTypes.FirstOrDefault() ?? string.Empty;
+ OnSystemChanged?.Invoke(CurrentSystem);
+ }
+ }
+ }
+
private bool _isOpenMode;
public bool IsOpenMode
{
@@ -65,9 +105,43 @@ namespace SmartAquaViewer.ViewModel
IsOpenMode = true;
BtnVisibilityUp = Visibility.Collapsed;
+ GraphTypes = new ObservableCollection();
+ CurrentSystem = "Tank"; // Default system
+ SetGraphType();
+
ChangeDrawerStatusCommand = new RelayCommand(_ => IsOpenMode = !IsOpenMode);
}
+ private void SetGraphType()
+ {
+ GraphTypes.Clear();
+
+ switch (CurrentSystem)
+ {
+ case "Tank":
+ GraphTypes.Add("LINE");
+ GraphTypes.Add("BOX");
+ GraphTypes.Add("SCATTER");
+ break;
+ case "Filter":
+ GraphTypes.Add("LINE");
+ GraphTypes.Add("STEP");
+ break;
+ case "Sterilizer":
+ GraphTypes.Add("LINE");
+ GraphTypes.Add("STEP");
+ break;
+ default:
+ break;
+ }
+
+ string graphTypes = string.Empty;
+ foreach (string str in GraphTypes)
+ graphTypes += (str + ", ");
+
+ Debug.WriteLine(graphTypes);
+ }
+
public event PropertyChangedEventHandler? PropertyChanged;
private void OnPropertyChanged([CallerMemberName] string? name = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));