diff options
| author | Roy Ben Shabat <Roy@twine-s.com> | 2020-12-30 15:11:34 +0000 |
|---|---|---|
| committer | Roy Ben Shabat <Roy@twine-s.com> | 2020-12-30 15:11:34 +0000 |
| commit | d33c19b3ac6803de4b5c8d475832efef131c1a45 (patch) | |
| tree | ea725abc39def99a755b041c13cba1fe0d594ddc /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs | |
| parent | 1bdcaa9f51303bbff682507f31fb3b4414692ca4 (diff) | |
| download | Tango-d33c19b3ac6803de4b5c8d475832efef131c1a45.tar.gz Tango-d33c19b3ac6803de4b5c8d475832efef131c1a45.zip | |
Revert "Hope it is fine"
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
19 files changed, 1483 insertions, 24 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml new file mode 100644 index 000000000..66bd0392d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml @@ -0,0 +1,28 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.FirmwareUpgradeFromFileView" + 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:local="clr-namespace:Tango.PPC.UI.Dialogs" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:FirmwareUpgradeFromFileViewVM, 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">CANCEL</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">UPGRADE</touch:TouchButton> + </Grid> + <StackPanel> + <Image Source="../Images/firmware.png" Stretch="Uniform" Height="120"></Image> + <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Tango Firmware Upgrade</TextBlock> + <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">The selected file contains a firmware upgrade package. Press 'UPGRADE' to start updating your system.</TextBlock> + + <TextBlock TextAlignment="Center" HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + <Run FontWeight="SemiBold">Firmware:</Run> + <Run Text="{Binding Version}"></Run> + </TextBlock> + </StackPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs new file mode 100644 index 000000000..e7e1eb86c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.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 UpdateFromFileView.xaml + /// </summary> + public partial class FirmwareUpgradeFromFileView : UserControl + { + public FirmwareUpgradeFromFileView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs new file mode 100644 index 000000000..9a7322565 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common.Publish; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class FirmwareUpgradeFromFileViewVM : DialogViewVM + { + public String Version { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml index f3c471954..ad1c2ece3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml @@ -3,7 +3,7 @@ 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" mc:Ignorable="d" Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="700" Height="800" d:DataContext="{d:DesignInstance Type=local:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> @@ -20,28 +20,59 @@ <Run>The job cannot be completed.</Run> </TextBlock> </StackPanel> - <Grid> + <Grid VerticalAlignment="Top" Margin="0 30 0 0"> <ItemsControl ItemsSource="{Binding Exception.IdsPackLevels}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Vertical" IsItemsHost="True"></StackPanel> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <StackPanel Margin="15 0" Width="60"> - <TextBlock HorizontalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}" Margin="-20 0 -20 0" TextTrimming="CharacterEllipsis"></TextBlock> - <Border Margin="0 5 0 0" Height="150" Width="50" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}"> + <Grid Margin="0 0 0 4"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="40" /> + <ColumnDefinition Width="160" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <touch:TouchIcon VerticalAlignment="Center" Width="24" Height="24"> + <touch:TouchIcon.Style> + <Style TargetType="touch:TouchIcon"> + <Setter Property="Icon" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsValid}" Value="False"> + <Setter Property="Icon" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding IsOverMax}" Value="True"> + <Setter Property="Icon" Value="AlertOctagon"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoRedBrush}"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsValid}" Value="True" /> + <Condition Binding="{Binding IsOverMax}" Value="False" /> + </MultiDataTrigger.Conditions> + <Setter Property="Icon" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </touch:TouchIcon.Style> + </touch:TouchIcon> + + <Border Grid.Column="1" Margin="5 0 0 0" Height="45" Width="150" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}"> <Grid> - <Border CornerRadius="3" VerticalAlignment="Bottom" Loaded="IdsPackLoaded" MinHeight="5"> + <Border VerticalAlignment="Center" CornerRadius="3" Loaded="IdsPackLoaded" MinHeight="45" HorizontalAlignment="Left" MinWidth="5"> <Border.Background> - <LinearGradientBrush> - <GradientStop Offset="0" Color="#4DFFFFFF" /> + <LinearGradientBrush StartPoint="0,0" EndPoint="1,1"> <GradientStop Offset="0.5" Color="{Binding IdsPack.LiquidType.LiquidTypeColor}" /> + <GradientStop Offset="1" Color="#4EFFFFFF" /> </LinearGradientBrush> </Border.Background> </Border> - <Rectangle Loaded="Limit_Loaded" Stroke="Red" StrokeThickness="2" VerticalAlignment="Bottom"> + <Rectangle Loaded="Limit_Loaded" Stroke="{StaticResource TangoRedBrush}" StrokeThickness="2" HorizontalAlignment="Left"> <Rectangle.Style> <Style TargetType="Rectangle"> <Style.Triggers> @@ -66,9 +97,18 @@ </Style> </Rectangle.Style> </Rectangle> + + + <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoDarkForegroundBrush}" HorizontalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}" VerticalAlignment="Center"> + <TextBlock.Effect> + <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="White" /> + </TextBlock.Effect> + </TextBlock> + </Grid> </Border> - </StackPanel> + <TextBlock Grid.Column="2" HorizontalAlignment="Left" Text="{Binding Message}" VerticalAlignment="Center" Margin="20,0,0,0" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoRedBrush}"></TextBlock> + </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs index 9ec1eec0e..e0f02e4af 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs @@ -33,7 +33,7 @@ namespace Tango.PPC.UI.Dialogs Grid parent = border.Parent as Grid; IDSPackLevel packLevel = border.DataContext as IDSPackLevel; - border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + border.Width = Math.Max(((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth, 0); } private void Limit_Loaded(object sender, RoutedEventArgs e) @@ -42,8 +42,8 @@ namespace Tango.PPC.UI.Dialogs Grid parent = rect.Parent as Grid; IDSPackLevel packLevel = rect.DataContext as IDSPackLevel; - var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; - rect.Margin = new Thickness(0, 0, 0, top); + var left = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; + rect.Margin = new Thickness(left, 0, 0, 0); if (packLevel.IsValid) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml new file mode 100644 index 000000000..081778434 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml @@ -0,0 +1,32 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.PowerUpView" + 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: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="600" Height="800" d:DataContext="{d:DesignInstance Type=local:PowerUpViewVM, IsDesignTimeCreatable=False}"> + <Grid> + <StackPanel Margin="0 100 0 0" HorizontalAlignment="Center"> + <touch:TouchGifAnimation Source="../Images/powerup.gif" EnableAnimation="{Binding IsVisible}" /> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Margin="0 30 0 0">Continue getting ready for:</TextBlock> + <DockPanel HorizontalAlignment="Center" Margin="0 40 0 0"> + <touch:TouchRadioButton IsChecked="{Binding IsSelectedRml}" /> + <touch:TouchComboBox Margin="20 0 0 0" Width="300" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox> + </DockPanel> + <DockPanel HorizontalAlignment="Left" Margin="0 40 0 0"> + <touch:TouchRadioButton IsChecked="{Binding IsMinimalTemperature}" /> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">Minimal temperature</TextBlock> + </DockPanel> + + <touch:TouchButton Command="{Binding OKCommand}" Margin="0 150 0 0" Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Center" Padding="60 15" CornerRadius="25">CONTINUE</touch:TouchButton> + + <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" Visibility="{Binding IsTimeoutEnabled,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Run>auto select in</Run> + <Run Text="{Binding RemainingSeconds}"></Run> + <Run>sec</Run> + </TextBlock> + </StackPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs new file mode 100644 index 000000000..a9767276a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs @@ -0,0 +1,34 @@ +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 PowerUpView.xaml + /// </summary> + public partial class PowerUpView : UserControl + { + public PowerUpView() + { + InitializeComponent(); + } + + protected override void OnPreviewMouseUp(MouseButtonEventArgs e) + { + base.OnPreviewMouseUp(e); + (DataContext as PowerUpViewVM).IsTimeoutEnabled = false; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs new file mode 100644 index 000000000..ec4b3bb2b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Timers; +using Tango.BL.Entities; +using Tango.PPC.Common; +using Tango.Settings; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class PowerUpViewVM : DialogViewVM + { + private Timer _timer; + + private List<Rml> _rmls; + public List<Rml> Rmls + { + get { return _rmls; } + set { _rmls = value; RaisePropertyChangedAuto(); } + } + + private Rml _selectedRml; + public Rml SelectedRml + { + get { return _selectedRml; } + set { _selectedRml = value; RaisePropertyChangedAuto(); } + } + + private bool _isSelectedRml; + public bool IsSelectedRml + { + get { return _isSelectedRml; } + set + { + _isSelectedRml = value; + RaisePropertyChangedAuto(); + + if (_isSelectedRml) + { + IsMinimalTemperature = false; + } + } + } + + private bool _isMinimalTemperature; + public bool IsMinimalTemperature + { + get { return _isMinimalTemperature; } + set + { + _isMinimalTemperature = value; + RaisePropertyChangedAuto(); + + if (_isMinimalTemperature) + { + IsSelectedRml = false; + } + } + } + + private int _remainingSeconds; + public int RemainingSeconds + { + get { return _remainingSeconds; } + set { _remainingSeconds = value; RaisePropertyChangedAuto(); } + } + + private bool _isTimeoutEnabled; + public bool IsTimeoutEnabled + { + get { return _isTimeoutEnabled; } + set + { + _isTimeoutEnabled = value; RaisePropertyChangedAuto(); + + if (!_isTimeoutEnabled) + { + _timer.Stop(); + } + } + } + + public PowerUpViewVM() + { + RemainingSeconds = (int)SettingsManager.Default.GetOrCreate<PPCSettings>().PowerUpScreenTimeout.TotalSeconds; + CanClose = true; + IsMinimalTemperature = true; + IsTimeoutEnabled = true; + _timer = new Timer(); + _timer.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds; + _timer.Elapsed += _timer_Elapsed; + } + + private void _timer_Elapsed(object sender, ElapsedEventArgs e) + { + RemainingSeconds--; + + if (RemainingSeconds == 0) + { + InvokeUI(() => + { + Accept(); + }); + } + } + + protected override void Cancel() + { + _timer.Stop(); + base.Cancel(); + } + + protected override void Accept() + { + _timer.Stop(); + base.Accept(); + } + + public override void OnShow() + { + base.OnShow(); + _timer.Start(); + } + } +} 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(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml new file mode 100644 index 000000000..f17860d42 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml @@ -0,0 +1,225 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.ThreadBreakView" + 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common" + xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="700" Height="1150" d:DataContext="{d:DesignInstance Type=local:ThreadBreakViewVM, IsDesignTimeCreatable=False}"> + <Grid> + <DockPanel> + <StackPanel DockPanel.Dock="Top" Margin="0 30 0 0"> + <Image HorizontalAlignment="Center" Source="/Images/thread_loading.png" Stretch="None"></Image> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 30 0 0">Thread Break Wizard</TextBlock> + </StackPanel> + + <StackPanel Margin="10 0 0 0" Orientation="Horizontal" DockPanel.Dock="Bottom"> + <touch:TouchButton Command="{Binding BackCommand}"> + <touch:TouchButton.Style> + <Style TargetType="touch:TouchButton" BasedOn="{StaticResource TangoFlatButton}"> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Style.Triggers> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchButton.Style> + <StackPanel> + <touch:TouchIcon Icon="ArrowLeft" Width="24" Height="24" /> + <TextBlock Margin="0 5 0 0" HorizontalAlignment="Center">Back</TextBlock> + </StackPanel> + </touch:TouchButton> + </StackPanel> + + <Grid Margin="0 20 0 0"> + <controls:NavigationControl Margin="0 5 0 0" SelectedObject="{Binding Stage}" TransitionType="Slide" TransitionAlwaysFades="False" TransitionDuration="00:00:0.1" SelectedIndex="0"> + + <!--Guiding Units--> + <Grid controls:NavigationControl.NavigationName="GuidingUnits" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="20" Columns="3" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Padding="30 0" HorizontalAlignment="Left" Command="{Binding GuidingUnitsFoundCantFixCommand}">Found But Can't Fix</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Padding="40 0" HorizontalAlignment="Right" Command="{Binding GuidingUnitsFoundAndFixedCommand}">Found and Fixed</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Padding="50 0" HorizontalAlignment="Right" Command="{Binding GuidingUnitsCantFindItCommand}">Can't Find It</touch:TouchButton> + </UniformGrid> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please check guiding units on both sides of the system and fix/tie the thread if possible.</TextBlock> + </StackPanel> + + <commonControls:ImageGalleryControl Duration="00:00:03"> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/GuidingUnits/1.jpg"></Image> + </commonControls:ImageGalleryControl> + </DockPanel> + </DockPanel> + </Grid> + + <!--Feeding Units--> + <Grid controls:NavigationControl.NavigationName="FeedingUnits" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="20" Columns="2" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding FeedingUnitsFoundAndFixedCommand}">Found and Fixed</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding FeedingUnitsCantFixCommand}">Can't Fix</touch:TouchButton> + </UniformGrid> + <TextBlock Foreground="{StaticResource TangoErrorBrush}" DockPanel.Dock="Bottom" TextWrapping="Wrap" TextAlignment="Center" Margin="50 20"> + if the thread is out of is route or tangle on one of the components you can go to the maintenance screen and open the component to solve the problem + </TextBlock> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> + Open the covers and check the feeder and puller and fix/tie if possible. + </TextBlock> + </StackPanel> + + <Grid> + <Grid Visibility="{Binding IsArcHead,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <commonControls:ImageGalleryControl Duration="00:00:03"> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/1.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/2.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/3.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/4.jpg"></Image> + </commonControls:ImageGalleryControl> + </Grid> + + <Grid Visibility="{Binding IsArcHead,Converter={StaticResource BooleanToVisibilityConverter}}"> + <commonControls:ImageGalleryControl Duration="00:00:03"> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/1.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/2.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/3.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/4.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/5.jpg"></Image> + </commonControls:ImageGalleryControl> + </Grid> + </Grid> + </DockPanel> + </DockPanel> + </Grid> + + <!--The Dryer--> + <Grid controls:NavigationControl.NavigationName="TheDryer" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="20" Columns="2" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding TheDryerRemovedSuccessfullyCommand}">Removed Successfully</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding TheDryerCantRemoveCommand}">Can't Remove</touch:TouchButton> + </UniformGrid> + <StackPanel DockPanel.Dock="Bottom" TextElement.Foreground="{StaticResource TangoErrorBrush}" Margin="50 20"> + <DockPanel HorizontalAlignment="Center"> + <touch:TouchIcon Icon="Alert" Foreground="{StaticResource TangoErrorBrush}" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">HOT SURFACE!</TextBlock> + </DockPanel> + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" TextWrapping="Wrap" TextAlignment="Center"> + Recommended to cool down and/or to wear safety gloves + </TextBlock> + </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> + Open the dryer, cut the thread and remove any residue. + </TextBlock> + </StackPanel> + + <commonControls:ImageGalleryControl Duration="00:00:03"> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/1.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/2.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/3.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/4.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/5.jpg"></Image> + </commonControls:ImageGalleryControl> + </DockPanel> + </DockPanel> + </Grid> + + <!--Dryer Close--> + <Grid controls:NavigationControl.NavigationName="DryerClose" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="20" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="300" HorizontalAlignment="Center" Command="{Binding OpenThreadLoadingWizardCommand}">Open The Thread Loading Wizard</touch:TouchButton> + </UniformGrid> + <TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" TextAlignment="Center" Margin="50 20"> + You will be able to open the thread loading wizard once the dryer door is closed + </TextBlock> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> + Close the dryer door + </TextBlock> + </StackPanel> + + <commonControls:ImageGalleryControl Duration="00:00:03"> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/1.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/2.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/3.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/4.jpg"></Image> + </commonControls:ImageGalleryControl> + </DockPanel> + </DockPanel> + </Grid> + + <!--Contact Support--> + <Grid controls:NavigationControl.NavigationName="ContactSupport" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="20" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding CloseCommand}">Close</touch:TouchButton> + </UniformGrid> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> + Please Contact Twine Customer Care + </TextBlock> + </StackPanel> + + <Grid> + <TextBlock HorizontalAlignment="Center" Margin="0 50 0 0" FontSize="40" Foreground="{StaticResource TangoPrimaryAccentBrush}">support@twine-s.com</TextBlock> + </Grid> + </DockPanel> + </DockPanel> + </Grid> + + <!--Jogging--> + <Grid controls:NavigationControl.NavigationName="Jogging" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> + Verifying thread movement + </TextBlock> + </StackPanel> + + <StackPanel Margin="0 100 0 0"> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold">working...</TextBlock> + <touch:TouchBusyIndicator Foreground="{StaticResource TangoGrayBrush}" Width="130" Height="130" Margin="0 40 0 0" StrokeThickness="8" IsIndeterminate="{Binding IsVisible}" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> + + <!--Fixed--> + <Grid controls:NavigationControl.NavigationName="Fixed" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="20" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding CloseCommand}">Close</touch:TouchButton> + </UniformGrid> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> + Issue Resolved + </TextBlock> + </StackPanel> + + <Grid> + <touch:TouchIcon Icon="CheckCircleOutline" Foreground="{StaticResource TangoSuccessBrush}" HorizontalAlignment="Center" VerticalAlignment="Top" Width="100" Margin="0 100 0 0" /> + </Grid> + </DockPanel> + </DockPanel> + </Grid> + </controls:NavigationControl> + </Grid> + </DockPanel> + + <touch:TouchIconButton Command="{Binding CloseCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Icon="Close" Width="45" Height="45" Padding="14" Foreground="{StaticResource TangoDarkForegroundBrush}" /> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs new file mode 100644 index 000000000..c105a9a15 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.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 ThreadBreakWizard.xaml + /// </summary> + public partial class ThreadBreakView : UserControl + { + public ThreadBreakView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs new file mode 100644 index 000000000..e737f3b12 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs @@ -0,0 +1,245 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.Logging; +using Tango.PPC.Common.Connection; +using Tango.PPC.Common.Notifications; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class ThreadBreakViewVM : DialogViewVM + { + public enum ThreadBreakWizardResult + { + None, + StartThreadLoading + } + + public enum WizardStage + { + Welcome, + GuidingUnits, + FeedingUnits, + Jogging, + TheDryer, + DryerClose, + Fixed, + ContactSupport, + } + + [TangoInject] + private IMachineProvider MachineProvider { get; set; } + + [TangoInject] + private INotificationProvider NotificationProvider { get; set; } + + public ThreadBreakWizardResult Result { get; set; } + + private WizardStage _stage; + public WizardStage Stage + { + get { return _stage; } + set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private bool _isArcHead; + public bool IsArcHead + { + get { return _isArcHead; } + set { _isArcHead = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand BackCommand { get; set; } + + //Guiding Units + public RelayCommand GuidingUnitsFoundCantFixCommand { get; set; } + public RelayCommand GuidingUnitsCantFindItCommand { get; set; } + public RelayCommand GuidingUnitsFoundAndFixedCommand { get; set; } + + //Feeding Units + public RelayCommand FeedingUnitsCantFixCommand { get; set; } + public RelayCommand FeedingUnitsFoundAndFixedCommand { get; set; } + + //The Dryer + public RelayCommand TheDryerCantRemoveCommand { get; set; } + public RelayCommand TheDryerRemovedSuccessfullyCommand { get; set; } + + //Dryer Close + public RelayCommand OpenThreadLoadingWizardCommand { get; set; } + + public ThreadBreakViewVM() + { + CanClose = true; + TangoIOC.Default.Inject(this); + + MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged += MachineEventsStateProvider_EventsChanged; + MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; + + IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc; + + BackCommand = new RelayCommand(GoBack, CanGoBack); + + //Guiding Units Commands + GuidingUnitsFoundCantFixCommand = new RelayCommand(GuidingUnitsFoundCantFix); + GuidingUnitsCantFindItCommand = new RelayCommand(GuidingUnitsCantFindIt); + GuidingUnitsFoundAndFixedCommand = new RelayCommand(GuidingUnitsFoundAndFixed); + + //Feeding Units Commands + FeedingUnitsCantFixCommand = new RelayCommand(FeedingUnitsCantFix); + FeedingUnitsFoundAndFixedCommand = new RelayCommand(FeedingUnitsFoundAndFixed); + + //The Dryer Commands + TheDryerRemovedSuccessfullyCommand = new RelayCommand(TheDryerRemovedSuccessfully); + TheDryerCantRemoveCommand = new RelayCommand(TheDryerCantRemove); + + OpenThreadLoadingWizardCommand = new RelayCommand(OpenThreadLoadingWizard, () => !MachineProvider.MachineOperator.MachineEventsStateProvider.Events.Any(x => x.Type == BL.Enumerations.EventTypes.DRYER_DOOR_OPEN)); + } + + private void MachineProvider_MachineDisconnected(object sender, EventArgs e) + { + InvokeUI(() => + { + Cancel(); + }); + } + + private void MachineEventsStateProvider_EventsChanged(object sender, IEnumerable<BL.Entities.MachinesEvent> e) + { + InvalidateRelayCommands(); + } + + #region Back + + private bool CanGoBack() + { + return Stage != WizardStage.GuidingUnits && + Stage != WizardStage.Jogging && + Stage != WizardStage.Fixed; + } + + private void GoBack() + { + switch (Stage) + { + case WizardStage.FeedingUnits: + Stage = WizardStage.GuidingUnits; + break; + case WizardStage.TheDryer: + Stage = WizardStage.GuidingUnits; + break; + case WizardStage.ContactSupport: + Stage = WizardStage.TheDryer; + break; + case WizardStage.DryerClose: + Stage = WizardStage.TheDryer; + break; + } + } + + #endregion + + #region Guiding Units Commands + + private async void GuidingUnitsFoundAndFixed() + { + Stage = WizardStage.Jogging; + + try + { + await MachineProvider.MachineOperator.AttemptThreadJogging(); + Stage = WizardStage.Fixed; + } + catch (Exception ex) + { + LogManager.Log(ex, LogCategory.Warning, "Error occurred while attempting to perform thread jogging."); + await NotificationProvider.ShowError($"Thread movement verification failed.\n{ex.FlattenMessage()}"); + Stage = WizardStage.FeedingUnits; + } + } + + private void GuidingUnitsCantFindIt() + { + Stage = WizardStage.FeedingUnits; + } + + private void GuidingUnitsFoundCantFix() + { + Stage = WizardStage.TheDryer; + } + + #endregion + + #region Feeding Units Commands + + private void FeedingUnitsCantFix() + { + Stage = WizardStage.TheDryer; + } + + private async void FeedingUnitsFoundAndFixed() + { + Stage = WizardStage.Jogging; + + try + { + await MachineProvider.MachineOperator.AttemptThreadJogging(); + Stage = WizardStage.Fixed; + } + catch (Exception ex) + { + LogManager.Log(ex, LogCategory.Warning, "Error occurred while attempting to perform thread jogging."); + await NotificationProvider.ShowError($"Thread movement verification failed.\n{ex.FlattenMessage()}"); + Stage = WizardStage.TheDryer; + } + } + + #endregion + + #region The Dryer Commands + + private void TheDryerCantRemove() + { + Stage = WizardStage.ContactSupport; + } + + private void TheDryerRemovedSuccessfully() + { + Stage = WizardStage.DryerClose; + } + + #endregion + + #region Dryer Close Commands + + private void OpenThreadLoadingWizard() + { + Result = ThreadBreakWizardResult.StartThreadLoading; + Accept(); + } + + #endregion + + protected override void Accept() + { + base.Accept(); + CleanUp(); + } + + protected override void Cancel() + { + base.Cancel(); + CleanUp(); + } + + private void CleanUp() + { + MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged -= MachineEventsStateProvider_EventsChanged; + MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml new file mode 100644 index 000000000..e45065c61 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml @@ -0,0 +1,170 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.ThreadLoadingView" + 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="700" Height="1150" d:DataContext="{d:DesignInstance Type=local:ThreadLoadingViewVM, IsDesignTimeCreatable=False}"> + <Grid> + <DockPanel> + <StackPanel DockPanel.Dock="Top" Margin="0 30 0 0"> + <Image HorizontalAlignment="Center" Source="/Images/thread_loading.png" Stretch="None"></Image> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 30 0 0">Thread Loading</TextBlock> + </StackPanel> + + <Grid Margin="0 20 0 0"> + <controls:NavigationControl Margin="0 5 0 0" SelectedObject="{Binding Stage}" TransitionType="Slide" TransitionAlwaysFades="False" TransitionDuration="00:00:0.1" SelectedIndex="0"> + <!--Welcome--> + <Grid controls:NavigationControl.NavigationName="Welcome" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 50 0 0" > + <StackPanel DockPanel.Dock="Top"> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Welcome to the automatic thread loading wizard.</TextBlock> + <StackPanel HorizontalAlignment="Center" Margin="0 20 0 0"> + <touch:TouchIcon Icon="Alert" VerticalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" /> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Margin="0 10 0 0" Width="400"> + <Run>Please ensure there are no thread residue in the system and press</Run> + <Run FontWeight="SemiBold">continue</Run> + </TextBlock> + </StackPanel> + </StackPanel> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg" VerticalAlignment="Center" Margin="50"></Image> + </DockPanel> + </DockPanel> + </Grid> + + <!--Preparing--> + <Grid controls:NavigationControl.NavigationName="Preparing" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 20 0 0"> + <StackPanel VerticalAlignment="Top" DockPanel.Dock="Top" Margin="0 40 0 0"> + <TextBlock Margin="0 50 0 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + The system is now preparing... + </TextBlock> + <touch:TouchBusyIndicator Width="140" Height="140" StrokeThickness="8" IsIndeterminate="{Binding IsVisible}" Margin="0 50 0 0" Foreground="{StaticResource TangoGrayBrush}" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> + + <!--Ready For Loading--> + <Grid controls:NavigationControl.NavigationName="ReadyForLoading" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 50 0 0"> + <StackPanel DockPanel.Dock="Top"> + <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + <Run>Please select the thread type you are going to load and press</Run> + <Run FontWeight="SemiBold">continue</Run> + </TextBlock> + <touch:TouchComboBox Margin="0 40 0 0" Width="500" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox> + </StackPanel> + + <Grid> + <Grid Visibility="{Binding IsArcHead,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <touch:TouchGifAnimation Margin="50" Source="/Images/thread_loading.gif" VerticalAlignment="Center" Stretch="Uniform" EnableAnimation="{Binding IsVisible}" /> + </Grid> + + <Grid> + <commonControls:ImageGalleryControl Duration="00:00:03"> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.jpg"></Image> + <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg"></Image> + </commonControls:ImageGalleryControl> + </Grid> + </Grid> + </DockPanel> + </DockPanel> + </Grid> + + <!--Finalizing--> + <Grid controls:NavigationControl.NavigationName="Finalizing" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 20 0 0"> + <StackPanel VerticalAlignment="Center" DockPanel.Dock="Top"> + <TextBlock Margin="0 50 0 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + The system is now loading the thread... + </TextBlock> + <touch:TouchProgressBar Margin="50 40 50 0" Height="10" IsIndeterminate="{Binding IsVisible}" /> + </StackPanel> + + <Image VerticalAlignment="Center" Margin="50" Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/machine_full.jpg"></Image> + </DockPanel> + </DockPanel> + </Grid> + + <!--Completed--> + <Grid controls:NavigationControl.NavigationName="Completed" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding AbortCommand}">Close</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 50 0 0" > + <StackPanel DockPanel.Dock="Top"> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Thread loading completed successfully!</TextBlock> + <touch:TouchIcon Margin="0 40 0 0" Icon="CheckCircleOutline" HorizontalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Width="100" Height="100" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> + + <!--Preparation Error--> + <Grid controls:NavigationControl.NavigationName="PreparationError" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" Columns="2" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding AbortCommand}">Close</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">Retry</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 50 0 0" > + <StackPanel DockPanel.Dock="Top"> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Something went wrong, press 'retry' to try again</TextBlock> + <touch:TouchIcon Icon="AlertCircleOutline" Margin="0 40 0 0" HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" Width="100" Height="100" /> + <TextBlock Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding Error}"></TextBlock> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> + + <!--Finalization Error--> + <Grid controls:NavigationControl.NavigationName="FinalizationError" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <UniformGrid Margin="50" Columns="2" DockPanel.Dock="Bottom" Height="55"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding AbortCommand}">Close</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">Retry</touch:TouchButton> + </UniformGrid> + <DockPanel Margin="0 50 0 0" > + <StackPanel DockPanel.Dock="Top"> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Something went wrong, press 'retry' to try again</TextBlock> + <touch:TouchIcon Icon="AlertCircleOutline" Margin="0 40 0 0" HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" Width="100" Height="100" /> + <TextBlock Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding Error}"></TextBlock> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> + </controls:NavigationControl> + + </Grid> + </DockPanel> + + <touch:TouchIconButton Command="{Binding AbortCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Icon="Close" Width="45" Height="45" Padding="14" Foreground="{StaticResource TangoDarkForegroundBrush}" /> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs new file mode 100644 index 000000000..d4c737bcc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.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 PowerUpView.xaml + /// </summary> + public partial class ThreadLoadingView : UserControl + { + public ThreadLoadingView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs new file mode 100644 index 000000000..bb503e718 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs @@ -0,0 +1,287 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Builders; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.Integration.Operation; +using Tango.PMR.ThreadLoading; +using Tango.PPC.Common; +using Tango.PPC.Common.Connection; +using Tango.PPC.Common.Notifications; +using Tango.Settings; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class ThreadLoadingViewVM : DialogViewVM + { + public enum ThreadLoadingStage + { + Welcome, + Preparing, + ReadyForLoading, + Finalizing, + Completed, + PreparationError, + FinalizationError, + } + + [TangoInject] + private IMachineProvider MachineProvider { get; set; } + + [TangoInject] + private INotificationProvider NotificationProvider { get; set; } + + private PPCSettings _settings; + + private StartThreadLoadingResponse _status; + public StartThreadLoadingResponse Status + { + get { return _status; } + set { _status = value; RaisePropertyChangedAuto(); } + } + + private List<Rml> _rmls; + public List<Rml> Rmls + { + get { return _rmls; } + set { _rmls = value; RaisePropertyChangedAuto(); } + } + + private Rml _selectedRml; + public Rml SelectedRml + { + get { return _selectedRml; } + set { _selectedRml = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private ThreadLoadingStage _stage; + public ThreadLoadingStage Stage + { + get { return _stage; } + set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private bool _isArcHead; + public bool IsArcHead + { + get { return _isArcHead; } + set { _isArcHead = value; RaisePropertyChangedAuto(); } + } + + private String _error; + public String Error + { + get { return _error; } + set { _error = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand ContinueCommand { get; set; } + public RelayCommand AbortCommand { get; set; } + + public ThreadLoadingViewVM(bool userInvoked = false) + { + CanClose = false; + + TangoIOC.Default.Inject(this); + _settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + + MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged; + MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; + + IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc; + + ContinueCommand = new RelayCommand(Continue, CanContinue); + AbortCommand = new RelayCommand(Abort); + + AdaptToState(userInvoked); + } + + private void MachineProvider_MachineDisconnected(object sender, EventArgs e) + { + InvokeUI(() => + { + Cancel(); + }); + } + + private void AdaptToState(bool userInvoked = false) + { + var status = MachineProvider.MachineOperator.ThreadLoadingStatus; + + if (status != null) + { + if (status.State == ThreadLoadingState.Preparing) + { + Stage = ThreadLoadingStage.Preparing; + } + else if (status.State == ThreadLoadingState.ReadyForLoading) + { + Stage = ThreadLoadingStage.ReadyForLoading; + } + else if (status.State == ThreadLoadingState.Finalizing) + { + Stage = ThreadLoadingStage.Finalizing; + } + else if (status.State == ThreadLoadingState.PreparationError) + { + OnPreparationError(status.ErrorReason); + } + else if (status.State == ThreadLoadingState.FinalizationError) + { + OnFinalizationError(status.ErrorReason); + } + else if (status.State == ThreadLoadingState.Completed) + { + if (userInvoked) + { + Stage = ThreadLoadingStage.Welcome; + } + else + { + Stage = ThreadLoadingStage.Completed; + } + } + } + } + + private void MachineOperator_ThreadLoadingStatusChanged(object sender, StartThreadLoadingResponse e) + { + Status = e; + AdaptToState(); + } + + private void Continue() + { + if (Stage == ThreadLoadingStage.Welcome) + { + Stage = ThreadLoadingStage.Preparing; + StartPreparing(); + } + else if (Stage == ThreadLoadingStage.ReadyForLoading) + { + ContinueThreadLoading(); + } + else if (Stage == ThreadLoadingStage.Completed) + { + Accept(); + } + else if (Stage == ThreadLoadingStage.PreparationError) + { + Stage = ThreadLoadingStage.Preparing; + StartPreparing(); + } + else if (Stage == ThreadLoadingStage.FinalizationError) + { + ContinueThreadLoading(); + } + } + + private async void StartPreparing() + { + try + { + await MachineProvider.MachineOperator.StartThreadLoading(); + } + catch (Exception ex) + { + OnPreparationError(ex.Message); + } + } + + private async void ContinueThreadLoading() + { + try + { + Stage = ThreadLoadingStage.Finalizing; + await MachineProvider.MachineOperator.ContinueThreadLoading(SelectedRml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); + } + catch (Exception ex) + { + OnFinalizationError(ex.Message); + } + } + + private bool CanContinue() + { + bool canContinue = false; + + if (Stage != ThreadLoadingStage.Preparing && Stage != ThreadLoadingStage.Finalizing) + { + canContinue = true; + } + + if (Stage == ThreadLoadingStage.ReadyForLoading && SelectedRml == null) + { + canContinue = false; + } + + return canContinue; + } + + private void OnPreparationError(String error) + { + Error = error; + Stage = ThreadLoadingStage.PreparationError; + } + + private void OnFinalizationError(String error) + { + Error = error; + Stage = ThreadLoadingStage.FinalizationError; + } + + private void Abort() + { + Cancel(); + } + + public async override void OnShow() + { + base.OnShow(); + + LogManager.Log("Loading site RMLS..."); + + List<Rml> rmls = new List<Rml>(); + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).WithActiveParametersGroup().BuildListAsync(); + } + + var selectedRml = rmls.SingleOrDefault(x => x.Guid == _settings.LoadedRmlGuid); + + Rmls = rmls; + SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault(); + } + + protected override void Cancel() + { + CleanUp(); + base.Cancel(); + } + + protected override void Accept() + { + CleanUp(); + base.Accept(); + } + + private void CleanUp() + { + MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged; + MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected; + + if (SelectedRml != null) + { + _settings.LoadedRmlGuid = SelectedRml.Guid; + _settings.Save(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml index 231f5dabb..6f70b954d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml @@ -6,21 +6,24 @@ xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="550" Height="450" d:DataContext="{d:DesignInstance Type=local:UpdateFromFileViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:UpdateFromFileViewVM, IsDesignTimeCreatable=False}"> <Grid Margin="20"> <DockPanel> - <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal"> - <touch:TouchButton Command="{Binding CloseCommand}" CornerRadius="25" Style="{StaticResource TangoMessageBoxButton}" HorizontalContentAlignment="Center" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> - <touch:TouchButton Command="{Binding OKCommand}" CornerRadius="25" Style="{StaticResource TangoMessageBoxButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalContentAlignment="Center" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">UPDATE</touch:TouchButton> - </StackPanel> + <Grid DockPanel.Dock="Bottom"> + <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">UPDATE</touch:TouchButton> + </Grid> <StackPanel> <Image Source="../Images/update.png" Stretch="Uniform" Height="120"></Image> - <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">UPDATE PACKAGE</TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Tango Update Package</TextBlock> <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">The selected file contains a software update package. Press 'UPDATE' to start updating your system.</TextBlock> - <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> - <Run>Version</Run> - <Run Text="{Binding Version}"></Run> + <TextBlock TextAlignment="Center" HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + <Run FontWeight="SemiBold">Application:</Run> + <Run Text="{Binding PublishInfo.ApplicationVersion}"></Run> + <LineBreak/> + <Run FontWeight="SemiBold">Firmware:</Run> + <Run Text="{Binding FirmwareVersion,Mode=OneWay}"></Run> </TextBlock> </StackPanel> </DockPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs index b9e876809..a38b0431a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs @@ -3,12 +3,18 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.PPC.Common.Publish; using Tango.SharedUI; namespace Tango.PPC.UI.Dialogs { public class UpdateFromFileViewVM : DialogViewVM { - public String Version { get; set; } + public PublishInfo PublishInfo { get; set; } + + public String FirmwareVersion + { + get { return PublishInfo.GetFirmwareVersion(); } + } } } |
