diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-23 22:25:54 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-23 22:25:54 +0300 |
| commit | ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb (patch) | |
| tree | 293aee8b1751ce7fce542645722c0f1a96b73097 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 52967e858bd52621208f6360e84f4c47ec435816 (diff) | |
| parent | 636ad730569dfef1a4ee04c8d716d510bcc47ee1 (diff) | |
| download | Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.tar.gz Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.zip | |
merge alarm handling from remote
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
35 files changed, 871 insertions, 182 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config index 9a0087c43..61d4cf5bc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config @@ -12,6 +12,98 @@ + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml new file mode 100644 index 000000000..8a90b03a0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.ScreenLockView" + 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:local="clr-namespace:Tango.PPC.UI.Dialogs" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="250" d:DataContext="{d:DesignInstance Type=local:ScreenLockViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.InputBindings> + <KeyBinding Key="Return" Command="{Binding OKCommand}"></KeyBinding> + </UserControl.InputBindings> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal"> + <touch:TouchButton Command="{Binding CloseCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> + <touch:TouchButton Command="{Binding OKCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">OK</touch:TouchButton> + </StackPanel> + <DockPanel> + <touch:TouchIcon Foreground="{StaticResource TangoErrorBrush}" Icon="Lock" VerticalAlignment="Top" Height="70"></touch:TouchIcon> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Screen Locked</TextBlock> + <TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the password to unlock the screen.</TextBlock> + <touch:TouchTextBox x:Name="txtPassword" Margin="0 30 40 0" IsPassword="True" KeyboardAction="Go" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs new file mode 100644 index 000000000..4a28984e6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs @@ -0,0 +1,36 @@ +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 TechnicianModeLoginView.xaml + /// </summary> + public partial class ScreenLockView : UserControl + { + public ScreenLockView() + { + InitializeComponent(); + + Loaded += ScreenLockView_Loaded; + } + + private async void ScreenLockView_Loaded(object sender, RoutedEventArgs e) + { + await Task.Delay(200); + txtPassword.Focus(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs new file mode 100644 index 000000000..e19117621 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class ScreenLockViewVM : DialogViewVM + { + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml new file mode 100644 index 000000000..24a5416ba --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml @@ -0,0 +1,31 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.TechnicianModeLoginView" + 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:local="clr-namespace:Tango.PPC.UI.Dialogs" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="250" d:DataContext="{d:DesignInstance Type=local:TechnicianModeLoginViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.InputBindings> + <KeyBinding Key="Return" Command="{Binding OKCommand}"></KeyBinding> + </UserControl.InputBindings> + + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal"> + <touch:TouchButton Command="{Binding CloseCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> + <touch:TouchButton Command="{Binding OKCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">OK</touch:TouchButton> + </StackPanel> + <DockPanel> + <Image Source="/Images/technician-mode.png" Stretch="Uniform" VerticalAlignment="Top" Height="70"></Image> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Technician Mode</TextBlock> + <TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the technician mode password.</TextBlock> + <touch:TouchTextBox x:Name="txtPassword" KeyboardAction="Go" Margin="0 30 40 0" IsPassword="True" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs new file mode 100644 index 000000000..3a809b6f3 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs @@ -0,0 +1,36 @@ +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 TechnicianModeLoginView.xaml + /// </summary> + public partial class TechnicianModeLoginView : UserControl + { + public TechnicianModeLoginView() + { + InitializeComponent(); + + Loaded += TechnicianModeLoginView_Loaded; + } + + private async void TechnicianModeLoginView_Loaded(object sender, RoutedEventArgs e) + { + await Task.Delay(200); + txtPassword.Focus(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs new file mode 100644 index 000000000..2a46bcd96 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class TechnicianModeLoginViewVM : DialogViewVM + { + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif Binary files differnew file mode 100644 index 000000000..11cef3b10 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif Binary files differnew file mode 100644 index 000000000..058d9a34d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif Binary files differnew file mode 100644 index 000000000..9bf0d84f3 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif Binary files differnew file mode 100644 index 000000000..79256816a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif Binary files differnew file mode 100644 index 000000000..9ca81da39 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif Binary files differnew file mode 100644 index 000000000..f5962c36c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif Binary files differnew file mode 100644 index 000000000..d936476b6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif Binary files differnew file mode 100644 index 000000000..89491179d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/power.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/power.png Binary files differnew file mode 100644 index 000000000..1f42d43a1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/power.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/update.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/update.png Binary files differnew file mode 100644 index 000000000..45f4608c9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/update.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-update.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-update.png Binary files differindex 3e49520dd..d8db51337 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-update.png +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-update.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-machine.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-machine.png Binary files differnew file mode 100644 index 000000000..5c8608b61 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-machine.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-tablet.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-tablet.png Binary files differnew file mode 100644 index 000000000..34191593c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-tablet.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png Binary files differnew file mode 100644 index 000000000..7d98c6734 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs index 364ca8ee7..b90a1afff 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs @@ -11,7 +11,9 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Forms; using System.Windows.Input; +using System.Windows.Interop; using System.Windows.Media; +using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; @@ -32,6 +34,8 @@ namespace Tango.PPC.UI { Instance = this; + //Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline),new FrameworkPropertyMetadata { DefaultValue = 30 }); + InitializeComponent(); bool has_touch = false; @@ -77,6 +81,16 @@ namespace Tango.PPC.UI Closing += MainWindow_Closing; } + protected override void OnSourceInitialized(EventArgs e) + { + //var hwndSource = PresentationSource.FromVisual(this) as HwndSource; + + //if (hwndSource != null) + // hwndSource.CompositionTarget.RenderMode = RenderMode.SoftwareOnly; + + base.OnSourceInitialized(e); + } + private void LockAspectRatio() { this.Width = (this.Height * (800d / 1280d)) - 10; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs index d7dca484e..5062df1d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -140,7 +140,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.AlertOctagon, + Icon = TouchIconKind.AlertCircleOutline, Title = "Error", Brush = Application.Current.Resources["TangoMessageBoxErrorBrush"] as Brush, }); @@ -156,7 +156,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.InfoCircleSolid, + Icon = TouchIconKind.AlertCircleOutline, Title = "Information", Brush = Application.Current.Resources["TangoMessageBoxInfoBrush"] as Brush, }); @@ -172,7 +172,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.Alert, + Icon = TouchIconKind.AlertCircleOutline, Title = "Warning", Brush = Application.Current.Resources["TangoMessageBoxWarningBrush"] as Brush, }); @@ -188,7 +188,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.QuestionCircleSolid, + Icon = TouchIconKind.QuestionCircleRegular, Title = "Confirm", HasCancel = true, Brush = Application.Current.Resources["TangoMessageBoxQuestionBrush"] as Brush, @@ -218,6 +218,8 @@ namespace Tango.PPC.UI.Notifications /// <returns></returns> private Task<bool> ShowMessageBox(MessageBoxVM vm) { + ReleaseGlobalBusyMessage(); + LogManager.Log($"Displaying MessagBox '{vm.Message}'."); TaskCompletionSource<bool> source = new TaskCompletionSource<bool>(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 788d2b178..1550e97e1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -28,6 +28,9 @@ using Tango.PPC.Common.EventLogging; using Tango.BL.Enumerations; using Tango.PPC.Common.Notifications; using Tango.PPC.Common.WatchDog; +using Tango.PPC.UI.Dialogs; +using Tango.Core.Threading; +using Tango.PPC.Common.Messages; namespace Tango.PPC.UI.PPCApplication { @@ -47,6 +50,7 @@ namespace Tango.PPC.UI.PPCApplication private INotificationProvider _notificationProvider; private WatchDogServer _watchdogServer; private ObservablesContext _machineContext; + private ActionTimer _screenLockTimer; /// <summary> /// Occurs when a system restart is required. @@ -89,6 +93,11 @@ namespace Tango.PPC.UI.PPCApplication public bool IsShuttingDown { get; private set; } /// <summary> + /// Gets a value indicating whether the application is in technician mode. + /// </summary> + public bool IsInTechnicianMode { get; private set; } + + /// <summary> /// Gets the application version. /// </summary> public Version Version @@ -110,6 +119,16 @@ namespace Tango.PPC.UI.PPCApplication } } + private bool _isScreenLocked; + /// <summary> + /// Gets or sets a value indicating whether the screen is currently locked. + /// </summary> + public bool IsScreenLocked + { + get { return _isScreenLocked; } + set { _isScreenLocked = value; RaisePropertyChangedAuto(); } + } + /// <summary> /// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class. /// </summary> @@ -300,6 +319,8 @@ namespace Tango.PPC.UI.PPCApplication /// </summary> private void FinalizeModuleInitialization() { + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + LogManager.Log("Finalizing application initialization..."); LogManager.Log("Initializing Machine Provider..."); @@ -329,6 +350,31 @@ namespace Tango.PPC.UI.PPCApplication LogManager.Log($"Invoking {vm.GetType().Name}.OnApplicationReady..."); vm.OnApplicationReady(); } + + if (settings.EnableTechnicianModeByDefault) + { + EnterTechnicianMode(false); + } + + if (settings.EnableLockScreen) + { + _screenLockTimer = new ActionTimer(settings.LockScreenTimeout); + _screenLockTimer.ResetReplace(ScreenLockTimerAction); + } + + TangoMessenger.Default.Register<MachineSettingsSavedMessage>((msg) => + { + if (_screenLockTimer != null) + { + _screenLockTimer.Dispose(); + } + + if (settings.EnableLockScreen) + { + _screenLockTimer = new ActionTimer(settings.LockScreenTimeout); + _screenLockTimer.ResetReplace(ScreenLockTimerAction); + } + }); }); } @@ -412,10 +458,32 @@ namespace Tango.PPC.UI.PPCApplication /// <summary> /// Enteres the application technician mode. /// </summary> - public void EnterTechnicianMode() + public async void EnterTechnicianMode(bool displayNotification = true) { - _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); - _notificationProvider.ShowInfo("Technician mode is now enabled."); + if (displayNotification) + { + var vm = await _notificationProvider.ShowDialog<TechnicianModeLoginViewVM>(); + + if (vm.DialogResult) + { + if (vm.Password == "Aa123456") + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + await _notificationProvider.ShowInfo("Technician mode is now enabled."); + } + else + { + await _notificationProvider.ShowError("Invalid technician mode password."); + EnterTechnicianMode(); + } + } + } + else + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + } } /// <summary> @@ -423,8 +491,42 @@ namespace Tango.PPC.UI.PPCApplication /// </summary> public void ExitTechnicianMode() { + IsInTechnicianMode = false; _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianExited()); _notificationProvider.ShowInfo("Technician mode is now disabled."); } + + /// <summary> + /// Invokes a dialog for entering a password and releasing the screen lock. + /// </summary> + public async void ReleaseScreenLock() + { + if (IsScreenLocked) + { + var vm = await _notificationProvider.ShowDialog<ScreenLockViewVM>(); + + if (vm.DialogResult) + { + if (vm.Password == SettingsManager.Default.GetOrCreate<PPCSettings>().LockScreenPassword) + { + IsScreenLocked = false; + ResetScreenLockTimer(); + } + } + } + } + + public void ResetScreenLockTimer() + { + if (_screenLockTimer != null) + { + _screenLockTimer.ResetReplace(ScreenLockTimerAction); + } + } + + private void ScreenLockTimerAction() + { + IsScreenLocked = true; + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index d6770ed45..7d4aa154e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core; using Tango.Core.DI; using Tango.Integration.Operation; @@ -42,13 +43,23 @@ namespace Tango.PPC.UI.Printing /// <param name="job">The job.</param> /// <param name="context">The context.</param> /// <returns></returns> - public JobHandler Print(Job job, ObservablesContext context) + public async Task<JobHandler> Print(Job job, ObservablesContext context) { + JobHandler handler = null; + #if STUBPRINT - var handler = _machineProvider.MachineOperator.PrintStub(job); + handler = await _machineProvider.MachineOperator.PrintStub(job); #else - var handler = _machineProvider.MachineOperator.Print(job); + + if (job.ColorSpace.Code != ColorSpaces.Volume.ToInt32()) + { + handler = await _machineProvider.MachineOperator.Print(job); + } + else + { + handler = await _machineProvider.MachineOperator.Print(job, job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); + } #endif handler.Completed += async (x, e) => @@ -104,7 +115,7 @@ namespace Tango.PPC.UI.Printing /// <param name="job">The job.</param> /// <param name="context">The context.</param> /// <returns></returns> - public JobHandler PrintSample(Job job, ObservablesContext context) + public async Task<JobHandler> PrintSample(Job job, ObservablesContext context) { LogManager.Log("Cloning job..."); Job sampleDyeJob = job.Clone(); @@ -131,7 +142,7 @@ namespace Tango.PPC.UI.Printing LogManager.Log("Executing sample dye job..."); - var handler = _machineProvider.MachineOperator.Print(sampleDyeJob); + var handler = await _machineProvider.MachineOperator.Print(sampleDyeJob); handler.Completed += async (x, e) => { try @@ -157,7 +168,7 @@ namespace Tango.PPC.UI.Printing /// <param name="context">The context.</param> /// <param name="fineTuneItems">The fine tune items.</param> /// <returns></returns> - public JobHandler PrintFineTuning(Job job, ObservablesContext context, IEnumerable<FineTuneItem> fineTuneItems) + public async Task<JobHandler> PrintFineTuning(Job job, ObservablesContext context, IEnumerable<FineTuneItem> fineTuneItems) { LogManager.Log("Cloning job..."); Job fineTuneJob = job.Clone(); @@ -172,7 +183,7 @@ namespace Tango.PPC.UI.Printing var segment = fineTuneJob.AddSolidSegment(suggestion.Color); } - var handler = _machineProvider.MachineOperator.Print(fineTuneJob); + var handler = await _machineProvider.MachineOperator.Print(fineTuneJob); handler.Completed += async (x, e) => { try diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 9b8f8f4ae..a0db99ffb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.9.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 1891139e9..71fa82504 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -122,6 +122,14 @@ <Compile Include="Connectivity\WiFiAuthenticationViewVM.cs" /> <Compile Include="Converters\AppBarItemConverter.cs" /> <Compile Include="Converters\ItemBaseConverter.cs" /> + <Compile Include="Dialogs\ScreenLockView.xaml.cs"> + <DependentUpon>ScreenLockView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\TechnicianModeLoginView.xaml.cs"> + <DependentUpon>TechnicianModeLoginView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\ScreenLockViewVM.cs" /> + <Compile Include="Dialogs\TechnicianModeLoginViewVM.cs" /> <Compile Include="Dialogs\UpdateFromFileView.xaml.cs"> <DependentUpon>UpdateFromFileView.xaml</DependentUpon> </Compile> @@ -182,6 +190,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Dialogs\ScreenLockView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Dialogs\TechnicianModeLoginView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Dialogs\UpdateFromFileView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -274,6 +290,19 @@ </EmbeddedResource> <None Include="app.manifest" /> <Resource Include="Images\machine.png" /> + <Resource Include="Images\power-machine.png" /> + <Resource Include="Images\power-tablet.png" /> + <Resource Include="Images\Menu\power.png" /> + <Resource Include="Images\Menu\update.png" /> + <Resource Include="Images\technician-mode.png" /> + <Resource Include="Images\GlobalStatus\getting_ready_Anim.gif" /> + <Resource Include="Images\GlobalStatus\dyeing_Anim.gif" /> + <Resource Include="Images\GlobalStatus\error_Anim.gif" /> + <Resource Include="Images\GlobalStatus\machine_off_Anim.gif" /> + <Resource Include="Images\GlobalStatus\Ready_Anim.gif" /> + <Resource Include="Images\GlobalStatus\service_Anim.gif" /> + <Resource Include="Images\GlobalStatus\shutdown_icon_Anim.gif" /> + <Resource Include="Images\GlobalStatus\standby_Anim.gif" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> <None Include="packages.config" /> @@ -362,22 +391,18 @@ <Project>{096f16c8-6d06-4b5f-9496-b9d2df2d94a3}</Project> <Name>Tango.PPC.Jobs</Name> </ProjectReference> - <ProjectReference Include="..\Modules\Tango.PPC.Logging\Tango.PPC.Logging.csproj"> - <Project>{d2ee865b-b006-487a-9487-60a663636ac3}</Project> - <Name>Tango.PPC.Logging</Name> - </ProjectReference> <ProjectReference Include="..\Modules\Tango.PPC.MachineSettings\Tango.PPC.MachineSettings.csproj"> <Project>{91b70e9b-66a7-4873-ae10-400e71cf404f}</Project> <Name>Tango.PPC.MachineSettings</Name> </ProjectReference> - <ProjectReference Include="..\Modules\Tango.PPC.Power\Tango.PPC.Power.csproj"> - <Project>{1d0f15b7-c1f3-4b9e-b0bc-a5b9e50c91d0}</Project> - <Name>Tango.PPC.Power</Name> - </ProjectReference> <ProjectReference Include="..\Modules\Tango.PPC.Storage\Tango.PPC.Storage.csproj"> <Project>{04febb02-f782-4b96-b47d-f6902afa43be}</Project> <Name>Tango.PPC.Storage</Name> </ProjectReference> + <ProjectReference Include="..\Modules\Tango.PPC.Technician\Tango.PPC.Technician.csproj"> + <Project>{d2ee865b-b006-487a-9487-60a663636ac3}</Project> + <Name>Tango.PPC.Technician</Name> + </ProjectReference> <ProjectReference Include="..\Tango.PPC.Common\Tango.PPC.Common.csproj"> <Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project> <Name>Tango.PPC.Common</Name> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index a8faeea7b..80a95d1bf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -7,6 +7,7 @@ using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.ExternalBridge; +using Tango.PMR.Integration; using Tango.PPC.Common; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.Navigation; @@ -115,12 +116,15 @@ namespace Tango.PPC.UI.ViewModels /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void ExternalBridgeService_ClientDisconnected(object sender, EventArgs e) { - LogManager.Log("External bridge client disconnected. Navigating to home module..."); - - InvokeUI(() => + if (IsVisible) { - NavigationManager.NavigateTo(NavigationView.HomeModule); - }); + LogManager.Log("External bridge client disconnected. Navigating to home module..."); + + InvokeUI(() => + { + NavigationManager.NavigateTo(NavigationView.HomeModule); + }); + } } /// <summary> @@ -132,7 +136,7 @@ namespace Tango.PPC.UI.ViewModels { LogManager.Log($"External bridge connection request received.\n{e.ToJsonString()}"); - if (e.Request.Password == Settings.ExternalBridgePassword) + if (!e.Request.Intent.RequiresPassword() || e.Request.Password == Settings.ExternalBridgePassword) { e.Confirmed = true; @@ -145,11 +149,14 @@ namespace Tango.PPC.UI.ViewModels LogManager.Log($"External bridge connection user has been identified as {User.Contact.FullName}"); } - LogManager.Log("Navigating to external bridge view..."); - InvokeUI(() => + if (e.Request.Intent == ExternalBridgeLoginIntent.FullControl) { - NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false); - }); + LogManager.Log("Navigating to external bridge view..."); + InvokeUI(() => + { + NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false); + }); + } } else { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 52f0fb403..9e8a9fe34 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -38,7 +38,15 @@ namespace Tango.PPC.UI.ViewModels public bool IsMenuOpened { get { return _isMenuOpened; } - set { _isMenuOpened = value; RaisePropertyChangedAuto(); } + set + { + _isMenuOpened = value; RaisePropertyChangedAuto(); + + if (!_isMenuOpened) + { + IsPowerOpened = false; + } + } } private bool _isNotificationsOpened; @@ -48,7 +56,20 @@ namespace Tango.PPC.UI.ViewModels public bool IsNotificationsOpened { get { return _isNotificationsOpened; } - set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } + set + { + _isNotificationsOpened = value; RaisePropertyChangedAuto(); + } + } + + private bool _isPowerOpened; + /// <summary> + /// Gets or sets a value indicating whether the power area is opened. + /// </summary> + public bool IsPowerOpened + { + get { return _isPowerOpened; } + set { _isPowerOpened = value; RaisePropertyChangedAuto(); } } #endregion @@ -90,6 +111,16 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public RelayCommand UpdateCommand { get; set; } + /// <summary> + /// Gets or sets the power command. + /// </summary> + public RelayCommand PowerCommand { get; set; } + + /// <summary> + /// Gets or sets the restart application command. + /// </summary> + public RelayCommand RestartApplicationCommand { get; set; } + #endregion #region Constructors @@ -106,12 +137,15 @@ namespace Tango.PPC.UI.ViewModels StopPrintingCommand = new RelayCommand(StopPrinting); SignOutCommand = new RelayCommand(SignOut); - UpdateCommand = new RelayCommand(() => + UpdateCommand = new RelayCommand(() => { NavigationManager.NavigateTo(NavigationView.MachineUpdateView); TangoIOC.Default.GetInstance<MachineUpdateViewVM>().CheckForUpdates(); IsMenuOpened = false; }); + + PowerCommand = new RelayCommand(() => IsPowerOpened = true); + RestartApplicationCommand = new RelayCommand(RestartApplication); } #endregion @@ -194,6 +228,17 @@ namespace Tango.PPC.UI.ViewModels } } + /// <summary> + /// Restarts the application. + /// </summary> + private async void RestartApplication() + { + if (await NotificationProvider.ShowQuestion("Are you sure you want to restart the application?")) + { + ApplicationManager.Restart(); + } + } + #endregion #region Override Methods @@ -217,6 +262,25 @@ namespace Tango.PPC.UI.ViewModels #endregion + #region Public Methods + + /// <summary> + /// Toggles the application technician mode. + /// </summary> + public void ToggleTechnicianMode() + { + if (!ApplicationManager.IsInTechnicianMode) + { + ApplicationManager.EnterTechnicianMode(); + } + else + { + ApplicationManager.ExitTechnicianMode(); + } + } + + #endregion + #region Event Handlers /// <summary> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index b5b5f56bc..f265c5dbf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -33,6 +33,7 @@ namespace Tango.PPC.UI.ViewModels private MachineUpdateResult _update_result; private DbCompareResult _db_compare_result; + private bool _isChecking; #region Properties @@ -132,10 +133,21 @@ namespace Tango.PPC.UI.ViewModels { await NavigateTo(MachineUpdateView.UpdateCheckView); + if (_isChecking) return; + try { + _isChecking = true; IsDbUpdate = false; + await Task.Delay(2000); + if (!await ConnectivityProvider.CheckInternetConnection()) + { + _isChecking = false; + await NavigateTo(MachineUpdateView.UpdateCheckErrorView); + return; + } + var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber); if (response.IsUpdateAvailable) @@ -164,6 +176,10 @@ namespace Tango.PPC.UI.ViewModels LogManager.Log(ex, "Error while trying to check for updates."); await NavigateTo(MachineUpdateView.UpdateFailedView); } + finally + { + _isChecking = false; + } } private async void Update() diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 2743e5126..56b4c2283 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -23,38 +23,43 @@ </UserControl.Resources> <Grid> - <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1"> + <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1" > <touch:TouchSideMenu.MenuContent> - <Border Width="400" x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDarkForegroundBrush}" TextElement.Foreground="{StaticResource TangoDarkForegroundBrush}"> + <Border TextElement.FontSize="{StaticResource TangoMenuItemFontSize}" TextElement.FontFamily="{StaticResource TangoFlexoFontFamily}" Width="450" x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDarkForegroundBrush}" TextElement.Foreground="{StaticResource TangoDarkForegroundBrush}"> <DockPanel LastChildFill="False" Background="{StaticResource TangoPrimaryBackgroundBrush}"> <StackPanel MinWidth="300" DockPanel.Dock="Top"> - <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1"> + <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Height="320"> <Grid> - <Image Source="/Images/logo.png" Stretch="Uniform" Margin="20 50 50 50"></Image> - <touch:TouchToggleButton Style="{StaticResource TangoTouchToggleButtonHamburger}" + <Image Source="/Images/logo.png" Stretch="Uniform" HorizontalAlignment="Left" Margin="40 0 0 0" Width="320"></Image> + <touch:TouchToggleButton Width="70" Height="70" Padding="15" Style="{StaticResource TangoTouchToggleButtonHamburger}" VerticalAlignment="Top" - HorizontalAlignment="Right" Margin="16" - IsChecked="{Binding ElementName=menu,Path=IsOpened}" /> + HorizontalAlignment="Right" + IsChecked="{Binding ElementName=menu,Path=IsOpened}" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" FontSize="{StaticResource TangoSmallFontSize}" Margin="40 20 20 50" VerticalAlignment="Bottom" HorizontalAlignment="Left"> + <Run>Machine S/N:</Run> + <Run FontStyle="Italic" Text="{Binding MachineProvider.Machine.SerialNumber,Mode=OneWay,IsAsync=True}"></Run> + </TextBlock> </Grid> </Border> - <StackPanel Margin="0 5 0 0"> - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding HomeCommand}" FontSize="{StaticResource TangoHeaderFontSize}"> + <!--<StackPanel Margin="0 5 0 0"> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding HomeCommand}" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="Normal"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="/Images/home.png" VerticalAlignment="Center" Width="48" Height="48"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">Home</TextBlock> + <Image Source="/Images/home.png" VerticalAlignment="Center" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}">Home</TextBlock> </StackPanel> </touch:TouchButton> - </StackPanel> + </StackPanel>--> <ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}"> <ItemsControl.ItemTemplate> <DataTemplate> <Border Visibility="{Binding DockToBottom,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> - <Border BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0 1 0 0" Visibility="{Binding IsVisibleInMenu,Converter={StaticResource BooleanToVisibilityConverter}}"> - <touch:TouchButton Margin="0 0 0 0" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoFlatButton}" FontSize="{StaticResource TangoHeaderFontSize}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}"> + <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Visibility="{Binding IsVisibleInMenu,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchButton Margin="0 0 0 0" Padding="40 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoFlatButton}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image VerticalAlignment="Center" Source="{Binding Image}" Width="48" Height="48"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}"></TextBlock> + <Image VerticalAlignment="Center" Source="{Binding Image}" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Text="{Binding Name}" Foreground="{StaticResource TangoPrimaryAccentBrush}"></TextBlock> </StackPanel> </touch:TouchButton> </Border> @@ -64,20 +69,18 @@ </ItemsControl> <StackPanel Margin="0 5 0 0"> - - <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 1 0 0"> - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}" FontSize="{StaticResource TangoHeaderFontSize}"> + <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1"> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="40 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="/Images/right-arrow-64.png" VerticalAlignment="Center" Width="48" Height="48"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">Update</TextBlock> + <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}">Update</TextBlock> </StackPanel> </touch:TouchButton> </Border> </StackPanel> </StackPanel> - <StackPanel DockPanel.Dock="Bottom"> - <Separator Margin="0 10 0 0" Background="{StaticResource TangoDividerBrush}" /> + <Grid DockPanel.Dock="Bottom"> <!--<touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Command="{Binding SignOutCommand}" FontSize="{StaticResource TangoHeaderFontSize}" Foreground="{StaticResource TangoDarkForegroundBrush}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <touch:TouchIcon VerticalAlignment="Center" Angle="180" Icon="Logout" Width="32" Height="32"></touch:TouchIcon> @@ -85,7 +88,7 @@ </StackPanel> </touch:TouchButton>--> - <ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}"> + <!--<ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}"> <ItemsControl.ItemTemplate> <DataTemplate> <Border Visibility="{Binding DockToBottom,Converter={StaticResource BooleanToVisibilityConverter}}"> @@ -100,8 +103,107 @@ </Border> </DataTemplate> </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> + </ItemsControl>--> + + + <Border Background="{StaticResource TangoPowerMenuOpenedBackgroundBrush}" Height="350" Padding="20" RenderTransformOrigin="0.5,1" VerticalAlignment="Bottom"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsPowerOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="188*"/> + <ColumnDefinition Width="261*"/> + </Grid.ColumnDefinitions> + + <Image Source="/Images/power-machine.png" Margin="30" /> + + <UniformGrid Grid.Column="1" Rows="2"> + <touch:TouchButton HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}">Turn Off</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}">Stand By</touch:TouchButton> + </UniformGrid> + </Grid> + + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="25 0" Opacity="0.3" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" /> + + <Grid Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="188*"/> + <ColumnDefinition Width="261*"/> + </Grid.ColumnDefinitions> + <Image Source="/Images/power-tablet.png" Margin="30" /> + + <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}" FontSize="{StaticResource TangoTitleFontSize}">Restart</touch:TouchButton> + </Grid> + </Grid> + </Border> + + <Border Background="{StaticResource TangoMidBackgroundBrush}" RenderTransformOrigin="0.5,1" VerticalAlignment="Bottom"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsPowerOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="40 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding PowerCommand}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> + <Image Source="/Images/menu/power.png" VerticalAlignment="Center" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}">Power</TextBlock> + </StackPanel> + </touch:TouchButton> + </Border> + </Grid> </DockPanel> </Border> </touch:TouchSideMenu.MenuContent> @@ -111,33 +213,36 @@ <DockPanel> <Border BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}"> <touch:TouchHamburgerButton Width="100" Height="100" Padding="15" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}"> - + </touch:TouchHamburgerButton> </Border> <Grid DockPanel.Dock="Right" Margin="0 0 20 0"> <StackPanel Orientation="Horizontal"> - <StackPanel VerticalAlignment="Center"> - <Image Width="33" HorizontalAlignment="Center"> - <Image.Style> - <Style TargetType="Image"> + <StackPanel x:Name="techPressElement" VerticalAlignment="Center" Background="Transparent"> + <touch:TouchGifAnimation Width="36" HorizontalAlignment="Center" EnableAnimation="True"> + <touch:TouchGifAnimation.Style> + <Style TargetType="touch:TouchGifAnimation"> <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Disconnected}"> - <Setter Property="Source" Value="/Images/GlobalStatus/machine-off.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/machine_off_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Standby}"> - <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/standby_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}"> - <Setter Property="Source" Value="/Images/GlobalStatus/ready-to-dye.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/Ready_Anim.gif"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.GettingReady}"> + <Setter Property="Source" Value="/Images/GlobalStatus/getting_ready_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Printing}"> - <Setter Property="Source" Value="/Images/GlobalStatus/dyeing.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/dyeing_Anim.gif"></Setter> </DataTrigger> </Style.Triggers> </Style> - </Image.Style> - </Image> + </touch:TouchGifAnimation.Style> + </touch:TouchGifAnimation> <TextBlock Margin="0 10 0 0" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> </StackPanel> @@ -179,7 +284,12 @@ <!--MODULES GOES HERE--> </controls:NavigationControl> </Grid> + </DockPanel> </touch:TouchSideMenu> + + <Grid PreviewMouseUp="Grid_PreviewMouseUp" IsHitTestVisible="True" Background="Transparent" Visibility="{Binding ApplicationManager.IsScreenLocked,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchIcon HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="40" Icon="Lock" Width="60" Height="60" Opacity="0.5" Foreground="{StaticResource TangoSuccessBrush}" /> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs index 50b9df550..883d3f893 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs @@ -14,9 +14,11 @@ using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using System.Windows.Threading; using Tango.Core.EventArguments; using Tango.Logging; using Tango.PPC.Common; +using Tango.PPC.UI.ViewModels; using Tango.PPC.UI.ViewsContracts; namespace Tango.PPC.UI.Views @@ -27,11 +29,65 @@ namespace Tango.PPC.UI.Views public partial class LayoutView : UserControl, ILayoutView { public static LayoutView Instance { get; private set; } + private LayoutViewVM _vm; + private DispatcherTimer _timer; public LayoutView() { InitializeComponent(); Instance = this; + Loaded += (_, __) => _vm = DataContext as LayoutViewVM; + techPressElement.RegisterForPreviewMouseOrTouchDown(OnMouseOrTouchDown); + techPressElement.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp); + _timer = new DispatcherTimer(); + _timer.Interval = TimeSpan.FromSeconds(10); + _timer.Tick += _timer_Tick; + + this.PreviewMouseUp += LayoutView_PreviewMouseUp; + } + + private void LayoutView_PreviewMouseUp(object sender, MouseButtonEventArgs e) + { + _vm.ApplicationManager.ResetScreenLockTimer(); + } + + private void _timer_Tick(object sender, EventArgs e) + { + _timer.Stop(); + _vm.ToggleTechnicianMode(); + } + + private void OnMouseOrTouchDown(object sender, MouseOrTouchEventArgs e) + { + //if (e.TouchDevice != null) + //{ + // techPressElement.CaptureTouch(e.TouchDevice); + //} + //else + //{ + // techPressElement.CaptureMouse(); + //} + + _timer.Start(); + } + + private void OnMouseOrTouchUp(object sender, MouseOrTouchEventArgs e) + { + //if (e.TouchDevice != null) + //{ + // techPressElement.ReleaseTouchCapture(e.TouchDevice); + //} + //else + //{ + // techPressElement.ReleaseMouseCapture(); + //} + + _timer.Stop(); + } + + private void Grid_PreviewMouseUp(object sender, MouseButtonEventArgs e) + { + _vm.ApplicationManager.ReleaseScreenLock(); } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml index 179d1dde3..dee4e9c7b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml @@ -27,13 +27,6 @@ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Forgot password?</TextBlock> </StackPanel> - <StackPanel> - <controls:AsyncAdornerControl Height="130" Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityConverter}}"> - <StackPanel VerticalAlignment="Center"> - <touch:TouchGifAnimation Source="/Images/preloader_rectangles.gif" EnableAnimation="{Binding IsLoading}" /> - </StackPanel> - </controls:AsyncAdornerControl> - </StackPanel> </StackPanel> </StackPanel> </Grid> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml index 0fb9d9e09..fba8a599d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml @@ -11,115 +11,127 @@ xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:MachineUpdateViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineUpdateViewVM}"> + d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:MachineUpdateViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineUpdateViewVM}"> <Grid> <DockPanel> - <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 10 0 0"> - <Image Source="/Images/machine-update.png" Stretch="None" /> + <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 20 0 0"> + <Image Source="/Images/machine-update.png" Stretch="Fill" Width="700" /> </StackPanel> <controls:NavigationControl x:Name="navigationControl" TransitionType="Slide" KeepElementsAttached="True" Margin="0 20 0 0" SelectedIndex="0"> <Grid controls:NavigationControl.NavigationName="UpdateCheckView"> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> - <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> - <TextBlock DockPanel.Dock="Top" Margin="0 100" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 0 30 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> + <TextBlock DockPanel.Dock="Top" Margin="0 50 0 0" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> Checking for updates, please wait... - </TextBlock> - </StackPanel> + </TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateAvailableView"> - <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> + <DockPanel Margin="0 50 0 0"> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" CornerRadius="35" Command="{Binding UpdateCommand}">UPDATE</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 80 0 30" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center"> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> <Run>Version</Run> <Run Foreground="{StaticResource TangoPrimaryAccentBrush}" Text="{Binding LatestVersion}"></Run> <Run>is available</Run> - </TextBlock> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsDbUpdate}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> + </TextBlock> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsDbUpdate}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> Database update is available - </TextBlock> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> + </TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> - <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Margin="0 40 0 0"> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Margin="0 40 0 0"> Updating your machine can improve the following: - </TextBlock> + </TextBlock> - <StackPanel Margin="0 40 0 0"> - <StackPanel Orientation="Horizontal" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Support for new media</TextBlock> - </StackPanel> + <StackPanel Margin="0 40 0 0"> + <StackPanel Orientation="Horizontal" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Support for new media</TextBlock> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Refined color conversion and calibration algorithms</TextBlock> - </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Refined color conversion and calibration algorithms</TextBlock> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Software fixes and improvements</TextBlock> - </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Software fixes and improvements</TextBlock> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Firmware upgrade</TextBlock> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Firmware upgrade</TextBlock> + </StackPanel> </StackPanel> - </StackPanel> - <TextBlock Margin="0 60 0 0" FontSize="{StaticResource TangoTitleFontSize}"> + <TextBlock Margin="0 60 0 0" FontSize="{StaticResource TangoTitleFontSize}"> Tap 'UPDATE' to start updating now. - </TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding UpdateCommand}">UPDATE</touch:TouchButton> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 80 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + </TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpToDateView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Your machine is up to date!</TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Margin="0 0 0 140" Width="300" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Your machine is up to date!</TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateCheckErrorView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Width="600" TextWrapping="Wrap" TextAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to check for updates. Please check your internet connection and try again.</TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 200 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 80 0 30" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Width="600" TextWrapping="Wrap" TextAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to check for updates. Please check your internet connection and try again.</TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateProgressView"> <StackPanel> - <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Updating your machine</TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 80 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Updating your machine</TextBlock> <TextBlock Margin="0 10 0 0" TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayBrush}">Do not turn off the machine</TextBlock> - + <StackPanel Margin="0 200 0 0"> <TextBlock Text="{Binding MachineUpdateManager.Status.Name,FallbackValue='Download Software Package'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> <TextBlock HorizontalAlignment="Center" Text="{Binding MachineUpdateManager.Status.Message,FallbackValue='Connecting to machine service...'}" Margin="0 40 0 0"></TextBlock> @@ -129,37 +141,46 @@ </Grid> <Grid controls:NavigationControl.NavigationName="UpdateDbProgressView"> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> - <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> - <TextBlock DockPanel.Dock="Top" Margin="0 100" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> - Updating database... - </TextBlock> + <StackPanel> + <TextBlock HorizontalAlignment="Center" Margin="0 80 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Updating your machine</TextBlock> + <TextBlock Margin="0 10 0 0" TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayBrush}">Do not turn off the machine</TextBlock> + + <StackPanel Margin="0 200 0 0"> + <TextBlock Text="{Binding MachineUpdateManager.Status.Name,FallbackValue='Synchronizing database'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> + <TextBlock HorizontalAlignment="Center" Text="{Binding MachineUpdateManager.Status.Message,FallbackValue='Retrieving data...'}" Margin="0 40 0 0"></TextBlock> + <touch:TouchProgressBar Margin="50 10" Height="10" IsIndeterminate="{Binding MachineUpdateManager.Status.IsIntermediate}" Maximum="{Binding MachineUpdateManager.Status.Total}" Value="{Binding MachineUpdateManager.Status.Progress,Mode=OneWay}" /> + </StackPanel> </StackPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateCompletedView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Update completed successfully !</TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Margin="0 0 0 130" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Your machine is up to date!</TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateFailedView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> - <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoTitleFontSize}">Update Failed</TextBlock> - <TextBlock HorizontalAlignment="Center" Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock> - - <touch:TouchButton Margin="0 180 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 200 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 100 0 30" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoTitleFontSize}">Update Failed</TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" TextAlignment="Center" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateFromPackageView"> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> + <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0" VerticalAlignment="Top"> <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> <TextBlock DockPanel.Dock="Top" Margin="0 100" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> Updating your software @@ -168,12 +189,15 @@ </Grid> <Grid controls:NavigationControl.NavigationName="UpdateFailedFromPackageView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to update the machine.</TextBlock> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 200 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" Margin="0 0 0 130" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to update the machine.</TextBlock> + </StackPanel> + </DockPanel> </Grid> </controls:NavigationControl> </DockPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index e4c107049..604c79aeb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -28,7 +28,9 @@ ItemExpandedPropertyPath="IsExpanded" HasDialog="{Binding NotificationProvider.HasDialog}" CurrentDialog="{Binding NotificationProvider.CurrentDialog}" - NotificationBarVisibility="{Binding NotificationProvider.NotificationsVisible,Converter={StaticResource BooleanToVisibilityConverter}}"> + NotificationBarVisibility="{Binding NotificationProvider.NotificationsVisible,Converter={StaticResource BooleanToVisibilityConverter}}" + IsBusy="{Binding NotificationProvider.IsInGlobalBusyState}" + BusyMessage="{Binding NotificationProvider.GlobalBusyMessage}"> <touch:TouchPanel.NotificationTemplate> <DataTemplate> <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="0" Command="{Binding PressedCommand}" components:TransformationHelper.TransformWhenPressed="False"> @@ -59,7 +61,7 @@ </touch:TouchIcon.Style> </touch:TouchIcon> - <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="AccessPointNetwork" Visibility="{Binding ConnectivityProvider.IsHotspotActive,Converter={StaticResource BooleanToVisibilityConverter}}" /> + <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="AccessPointNetwork" Visibility="{Binding HotSpotProvider.IsEnabled,Converter={StaticResource BooleanToVisibilityConverter}}" /> <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="Bridge" Visibility="{Binding ExternalBridgeService.Enabled,Converter={StaticResource BooleanToVisibilityConverter}}" /> |
