From 84a74bd9ea68a3f913e733a470ec64d1f8f50424 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 7 Feb 2018 19:50:40 +0200 Subject: Started working on monitoring view.. --- .../Controls/IOMonitorControl.xaml | 115 +++++++++++++++++++++ .../Controls/IOMonitorControl.xaml.cs | 109 +++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml new file mode 100644 index 000000000..c40e69d98 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml.cs new file mode 100644 index 000000000..bc408958d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/IOMonitorControl.xaml.cs @@ -0,0 +1,109 @@ +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.Navigation; +using System.Windows.Shapes; +using Tango.Core.Commands; + +namespace Tango.MachineStudio.Developer.Controls +{ + /// + /// Interaction logic for IOMonitorControl.xaml + /// + public partial class IOMonitorControl : UserControl + { + public ICommand ForwardPressedCommand + { + get { return (ICommand)GetValue(ForwardPressedCommandProperty); } + set { SetValue(ForwardPressedCommandProperty, value); } + } + public static readonly DependencyProperty ForwardPressedCommandProperty = + DependencyProperty.Register("ForwardPressedCommand", typeof(ICommand), typeof(IOMonitorControl), new PropertyMetadata(null)); + + public ICommand ForwardReleasedCommand + { + get { return (ICommand)GetValue(ForwardReleasedCommandProperty); } + set { SetValue(ForwardReleasedCommandProperty, value); } + } + public static readonly DependencyProperty ForwardReleasedCommandProperty = + DependencyProperty.Register("ForwardReleasedCommand", typeof(ICommand), typeof(IOMonitorControl), new PropertyMetadata(null)); + + public ICommand BackwardPressedCommand + { + get { return (ICommand)GetValue(BackwardPressedCommandProperty); } + set { SetValue(BackwardPressedCommandProperty, value); } + } + public static readonly DependencyProperty BackwardPressedCommandProperty = + DependencyProperty.Register("BackwardPressedCommand", typeof(ICommand), typeof(IOMonitorControl), new PropertyMetadata(null)); + + public ICommand BackwardReleasedCommand + { + get { return (ICommand)GetValue(BackwardReleasedCommandProperty); } + set { SetValue(BackwardReleasedCommandProperty, value); } + } + public static readonly DependencyProperty BackwardReleasedCommandProperty = + DependencyProperty.Register("BackwardReleasedCommand", typeof(ICommand), typeof(IOMonitorControl), new PropertyMetadata(null)); + + public object CommandParameter + { + get { return (object)GetValue(CommandParameterProperty); } + set { SetValue(CommandParameterProperty, value); } + } + public static readonly DependencyProperty CommandParameterProperty = + DependencyProperty.Register("CommandParameter", typeof(object), typeof(IOMonitorControl), new PropertyMetadata(null)); + + public String Value + { + get { return (String)GetValue(ValueProperty); } + set { SetValue(ValueProperty, value); } + } + public static readonly DependencyProperty ValueProperty = + DependencyProperty.Register("Value", typeof(String), typeof(IOMonitorControl), new PropertyMetadata("0000")); + + public IOMonitorControl() + { + InitializeComponent(); + } + + private void OnForwardPressed(object sender, MouseButtonEventArgs e) + { + if (ForwardPressedCommand != null) + { + ForwardPressedCommand.Execute(CommandParameter); + } + } + + private void OnForwardReleased(object sender, MouseButtonEventArgs e) + { + if (ForwardReleasedCommand != null) + { + ForwardReleasedCommand.Execute(CommandParameter); + } + } + + private void OnBackwardPressed(object sender, MouseButtonEventArgs e) + { + if (BackwardPressedCommand != null) + { + BackwardPressedCommand.Execute(CommandParameter); + } + } + + private void OnBackwardReleased(object sender, MouseButtonEventArgs e) + { + if (BackwardReleasedCommand != null) + { + BackwardReleasedCommand.Execute(CommandParameter); + } + } + } +} -- cgit v1.3.1