aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-05-13 13:27:01 +0300
committerAvi Levkovich <avi@twine-s.com>2020-05-13 13:27:01 +0300
commit15dfc2cdcbc2e518c09c1ee75f32ff149d4a337d (patch)
tree4c0b49773706b85282e6f6b1ec3d2e949d3ca22e /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs
parent6a49e917c587dcbbfe8175b8dde73840b7d105fc (diff)
parentcd750d626d3780990797faf09446033bbaa4311c (diff)
downloadTango-15dfc2cdcbc2e518c09c1ee75f32ff149d4a337d.tar.gz
Tango-15dfc2cdcbc2e518c09c1ee75f32ff149d4a337d.zip
commit merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml52
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs82
3 files changed, 162 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml
new file mode 100644
index 000000000..e96b39a63
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml
@@ -0,0 +1,52 @@
+<UserControl x:Class="Tango.PPC.UI.Dialogs.SafetyLevelOperationsConfirmationView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
+ mc:Ignorable="d"
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="700" Height="900" d:DataContext="{d:DesignInstance Type=local:SafetyLevelOperationsConfirmationViewVM, IsDesignTimeCreatable=False}">
+ <Grid Margin="20">
+ <DockPanel>
+ <Grid DockPanel.Dock="Bottom">
+ <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">DECLINE</touch:TouchButton>
+
+ <Grid HorizontalAlignment="Center">
+ <touch:TouchRingProgress Width="50" Height="50" Maximum="{Binding MaxSeconds}" Value="{Binding SecondsRemaining}" />
+ <TextBlock Text="{Binding SecondsRemaining}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+ </Grid>
+
+ <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">APPROVE</touch:TouchButton>
+ </Grid>
+ <StackPanel DockPanel.Dock="Top">
+ <touch:TouchIcon Icon="Alert" Foreground="{StaticResource TangoWarningBrush}" Height="120"></touch:TouchIcon>
+ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Safety Level Access Request</TextBlock>
+ <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">
+ <Run>A remote client is requesting a safety level connection to this machine.</Run>
+ <LineBreak/>
+ <Run>Once approved, the remote user will be able to perform any mechanical operation remotely.</Run>
+ </TextBlock>
+ </StackPanel>
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock FontSize="{StaticResource TangoTitleFontSize}">Request Information</TextBlock>
+ <controls:TableGrid Margin="0 30 0 0" HorizontalAlignment="Center" RowHeight="30" Width="280">
+ <TextBlock FontWeight="Bold">Address:</TextBlock>
+ <TextBlock Text="{Binding Connection.Address}"></TextBlock>
+
+ <TextBlock FontWeight="Bold">Host Name:</TextBlock>
+ <TextBlock Text="{Binding Connection.Request.HostName}"></TextBlock>
+
+ <TextBlock FontWeight="Bold">App ID:</TextBlock>
+ <TextBlock Text="{Binding Connection.Request.AppID}"></TextBlock>
+
+ <TextBlock FontWeight="Bold">User:</TextBlock>
+ <TextBlock Text="{Binding Connection.Request.UserName,TargetNullValue='Unknown',FallbackValue='Unknown'}"></TextBlock>
+ </controls:TableGrid>
+ </StackPanel>
+ </Grid>
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs
new file mode 100644
index 000000000..ef689f1de
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs
@@ -0,0 +1,28 @@
+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;
+
+namespace Tango.PPC.UI.Dialogs
+{
+ /// <summary>
+ /// Interaction logic for SafetyLevelOperationsConfirmationView.xaml
+ /// </summary>
+ public partial class SafetyLevelOperationsConfirmationView : UserControl
+ {
+ public SafetyLevelOperationsConfirmationView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs
new file mode 100644
index 000000000..f8027b4c2
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+using Tango.Integration.ExternalBridge;
+using Tango.PMR.Integration;
+using Tango.SharedUI;
+
+namespace Tango.PPC.UI.Dialogs
+{
+ public class SafetyLevelOperationsConfirmationViewVM : DialogViewVM
+ {
+ private DispatcherTimer _timer;
+
+ private int _maxSeconds;
+ public int MaxSeconds
+ {
+ get { return _maxSeconds; }
+ set { _maxSeconds = value; RaisePropertyChangedAuto(); }
+ }
+
+ private int _secondsRemaining;
+ public int SecondsRemaining
+ {
+ get { return _secondsRemaining; }
+ set { _secondsRemaining = value; RaisePropertyChangedAuto(); }
+ }
+
+ private ExternalBridgeClientConnectedEventArgs _connection;
+ /// <summary>
+ /// Gets or sets the last client connection event arguments.
+ /// </summary>
+ public ExternalBridgeClientConnectedEventArgs Connection
+ {
+ get { return _connection; }
+ set { _connection = value; RaisePropertyChangedAuto(); }
+ }
+
+ public SafetyLevelOperationsConfirmationViewVM(ExternalBridgeClientConnectedEventArgs connection)
+ {
+ Connection = connection;
+
+ MaxSeconds = 30;
+ SecondsRemaining = 30;
+
+ _timer = new DispatcherTimer(DispatcherPriority.Background, Application.Current.Dispatcher);
+ _timer.Interval = TimeSpan.FromMilliseconds(800);
+ _timer.Tick += _timer_Tick;
+ }
+
+ public override void OnShow()
+ {
+ base.OnShow();
+ _timer.Start();
+ }
+
+ protected override void Accept()
+ {
+ _timer.Stop();
+ base.Accept();
+ }
+
+ protected override void Cancel()
+ {
+ _timer.Stop();
+ base.Cancel();
+ }
+
+ private void _timer_Tick(object sender, EventArgs e)
+ {
+ SecondsRemaining--;
+
+ if (SecondsRemaining == 0)
+ {
+ Cancel();
+ }
+ }
+ }
+}