diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-05 19:33:06 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-05 19:33:06 +0200 |
| commit | b9009a814b9c91010e44534b42fa15fe164757a3 (patch) | |
| tree | 007aa60379f5a519ce3c3328887c8aec4951931f /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | ee3f1aa159ebb326e7c7053501130afa06bf47d4 (diff) | |
| download | Tango-b9009a814b9c91010e44534b42fa15fe164757a3.tar.gz Tango-b9009a814b9c91010e44534b42fa15fe164757a3.zip | |
Completed ThreadBreak/Loading Wizards !!!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
36 files changed, 639 insertions, 220 deletions
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..6c64520a4 --- /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:02"> + <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:02"> + <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:02"> + <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:02"> + <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:02"> + <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..131f976c1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs @@ -0,0 +1,243 @@ +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."); + 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."); + 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 index a88d7a598..3d37c81bd 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml @@ -4,6 +4,7 @@ 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" @@ -17,123 +18,153 @@ <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="20" 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}">CONTINUE</touch:TouchButton> + <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> - <DockPanel HorizontalAlignment="Center" Margin="0 20 0 0"> - <touch:TouchIcon Icon="Alert" VerticalAlignment="Center" Foreground="{StaticResource TangoWarningBrush}" /> - <TextBlock TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Margin="10 0 0 0">Please ensure there are no thread residue in the system and press 'continue'.</TextBlock> - </DockPanel> + <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/thread_loading_preview.png" VerticalAlignment="Bottom"></Image> + <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="20" 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}">CONTINUE</touch:TouchButton> + <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"> + <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:TouchProgressBar Margin="50 10 50 0" Height="10" IsIndeterminate="{Binding IsVisible}" /> + <touch:TouchBusyIndicator Width="140" Height="140" StrokeThickness="8" IsIndeterminate="{Binding IsVisible}" Margin="0 50 0 0" Foreground="{StaticResource TangoGrayBrush}" /> </StackPanel> - <Image VerticalAlignment="Bottom" Stretch="Uniform" Source="/Images/thread_loading_preview.png"></Image> </DockPanel> </DockPanel> </Grid> + + <!--Ready For Loading--> <Grid controls:NavigationControl.NavigationName="ReadyForLoading" 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 AbortCommand}">CLOSE</touch:TouchButton> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">CONTINUE</touch:TouchButton> + <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"> - Please select the thread type you are going to load and press 'continue'. + <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> - <touch:TouchGifAnimation Margin="10" Source="/Images/thread_loading.gif" VerticalAlignment="Bottom" Stretch="Uniform" EnableAnimation="{Binding IsVisible}" /> + + <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:02"> + <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="20" 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}">CONTINUE</touch:TouchButton> + <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 10 50 0" Height="10" IsIndeterminate="{Binding IsVisible}" /> + <touch:TouchProgressBar Margin="50 40 50 0" Height="10" IsIndeterminate="{Binding IsVisible}" /> </StackPanel> - <Image VerticalAlignment="Bottom" Stretch="Uniform" Source="/Images/thread_loading_preview.png"></Image> + + <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="20" DockPanel.Dock="Bottom" Height="55"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding AbortCommand}">CLOSE</touch:TouchButton> + <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"> - <touch:TouchIcon Icon="Check" HorizontalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Width="100" Height="100" /> <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> - <Image Stretch="Uniform" Source="/Images/thread_loading_preview.png" VerticalAlignment="Bottom"></Image> </DockPanel> </DockPanel> </Grid> + + <!--Preparation Error--> <Grid controls:NavigationControl.NavigationName="PreparationError" 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 AbortCommand}">CLOSE</touch:TouchButton> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">RETRY</touch:TouchButton> + <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"> - <touch:TouchIcon Icon="Alert" HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" Width="100" Height="100" /> <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Something went wrong</TextBlock> - <TextBlock Margin="0 5 0 0" FontSize="{StaticResource TangoSmallFontSize}" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding Error}"></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> - <Image Stretch="Uniform" Source="/Images/thread_loading_preview.png" VerticalAlignment="Bottom"></Image> </DockPanel> </DockPanel> </Grid> + + <!--Finalization Error--> <Grid controls:NavigationControl.NavigationName="FinalizationError" 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 AbortCommand}">CLOSE</touch:TouchButton> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">RETRY</touch:TouchButton> + <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"> - <touch:TouchIcon Icon="Alert" HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" Width="100" Height="100" /> <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Something went wrong</TextBlock> - <TextBlock Margin="0 5 0 0" FontSize="{StaticResource TangoSmallFontSize}" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding Error}"></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> - <Image Stretch="Uniform" Source="/Images/thread_loading_preview.png" VerticalAlignment="Bottom"></Image> </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/ThreadLoadingViewVM - Copy.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM - Copy.cs deleted file mode 100644 index 95fb77e48..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM - Copy.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.Core.Commands; -using Tango.Integration.Operation; -using Tango.PMR.ThreadLoading; -using Tango.PPC.Common.Connection; -using Tango.SharedUI; - -namespace Tango.PPC.UI.Dialogs -{ - public class ThreadLoadingViewVM : DialogViewVM - { - public class ThreadLoadingResult - { - public bool IsCompleted { get; set; } - public Exception FailedException { get; set; } - } - - private ThreadLoadingConfirmationRequiredEventArgs _confirmationArgs; - - public ThreadLoadingResult Result { get; set; } - - public IMachineProvider MachineProvider { get; set; } - - private StartThreadLoadingResponse _status; - public StartThreadLoadingResponse Status - { - get { return _status; } - set { _status = value; RaisePropertyChangedAuto(); } - } - - private bool _isFinalizing; - public bool IsFinalizing - { - get { return _isFinalizing; } - set { _isFinalizing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private bool _isPreparing; - public bool IsPreparing - { - get { return _isPreparing; } - set { _isPreparing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - public List<Rml> Rmls { get; set; } - - private Rml _selectedRml; - public Rml SelectedRml - { - get { return _selectedRml; } - set { _selectedRml = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - public RelayCommand ContinueCommand { get; set; } - - public ThreadLoadingViewVM(IMachineProvider machineProvider) - { - CanClose = false; - IsPreparing = true; - ContinueCommand = new RelayCommand(ContinueThreadLoading, () => !IsFinalizing && SelectedRml != null); - MachineProvider = machineProvider; - MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged; - MachineProvider.MachineOperator.ThreadLoadingCompleted += MachineOperator_ThreadLoadingCompleted; - MachineProvider.MachineOperator.ThreadLoadingFailed += MachineOperator_ThreadLoadingFailed; - MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired; - } - - public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) : this(machineProvider) - { - _confirmationArgs = confirmationArgs; - IsPreparing = false; - } - - private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e) - { - _confirmationArgs = e; - IsPreparing = false; - } - - private async void ContinueThreadLoading() - { - IsFinalizing = true; - - try - { - await Task.Factory.StartNew(() => { _confirmationArgs.Confirm(SelectedRml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); }); - } - catch (Exception ex) - { - Result = new ThreadLoadingResult() - { - FailedException = ex, - }; - - IsFinalizing = false; - - if (IsVisible) - { - InvokeUI(() => - { - Accept(); - }); - } - } - } - - private void MachineOperator_ThreadLoadingCompleted(object sender, StartThreadLoadingResponse e) - { - Result = new ThreadLoadingResult() - { - IsCompleted = true - }; - - if (IsVisible) - { - InvokeUI(() => - { - Accept(); - }); - } - } - - private void MachineOperator_ThreadLoadingFailed(object sender, StartThreadLoadingResponse e) - { - Result = new ThreadLoadingResult() - { - FailedException = new Exception(e.ErrorReason), - }; - - if (IsVisible) - { - InvokeUI(() => - { - Accept(); - }); - } - } - - private void MachineOperator_ThreadLoadingStatusChanged(object sender, StartThreadLoadingResponse e) - { - Status = e; - - if (Status.State == ThreadLoadingState.Finalizing) - { - IsFinalizing = true; - } - } - - protected override void Cancel() - { - IsFinalizing = false; - ClearEvents(); - base.Cancel(); - } - - protected override void Accept() - { - IsFinalizing = false; - ClearEvents(); - base.Accept(); - } - - private void ClearEvents() - { - MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged; - MachineProvider.MachineOperator.ThreadLoadingCompleted -= MachineOperator_ThreadLoadingCompleted; - MachineProvider.MachineOperator.ThreadLoadingFailed -= MachineOperator_ThreadLoadingFailed; - MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired -= MachineOperator_ThreadLoadingConfirmationRequired; - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs index 75354caf2..bb503e718 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs @@ -67,6 +67,13 @@ namespace Tango.PPC.UI.Dialogs set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } + private bool _isArcHead; + public bool IsArcHead + { + get { return _isArcHead; } + set { _isArcHead = value; RaisePropertyChangedAuto(); } + } + private String _error; public String Error { @@ -74,7 +81,6 @@ namespace Tango.PPC.UI.Dialogs set { _error = value; RaisePropertyChangedAuto(); } } - public RelayCommand ContinueCommand { get; set; } public RelayCommand AbortCommand { get; set; } @@ -86,6 +92,9 @@ namespace Tango.PPC.UI.Dialogs _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); @@ -93,6 +102,14 @@ namespace Tango.PPC.UI.Dialogs AdaptToState(userInvoked); } + private void MachineProvider_MachineDisconnected(object sender, EventArgs e) + { + InvokeUI(() => + { + Cancel(); + }); + } + private void AdaptToState(bool userInvoked = false) { var status = MachineProvider.MachineOperator.ThreadLoadingStatus; @@ -258,6 +275,7 @@ namespace Tango.PPC.UI.Dialogs private void CleanUp() { MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged; + MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected; if (SelectedRml != null) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpg Binary files differnew file mode 100644 index 000000000..3b2f58620 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpg Binary files differnew file mode 100644 index 000000000..a2f5ae568 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpg Binary files differnew file mode 100644 index 000000000..6069e9c29 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpg Binary files differnew file mode 100644 index 000000000..7588d68e2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPG Binary files differnew file mode 100644 index 000000000..68921f1ca --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPG Binary files differnew file mode 100644 index 000000000..a8b5d9ba4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPG Binary files differnew file mode 100644 index 000000000..407f1eae6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPG Binary files differnew file mode 100644 index 000000000..575066c23 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpg Binary files differnew file mode 100644 index 000000000..68921f1ca --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpg Binary files differnew file mode 100644 index 000000000..a8b5d9ba4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpg Binary files differnew file mode 100644 index 000000000..407f1eae6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpg Binary files differnew file mode 100644 index 000000000..575066c23 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpg Binary files differnew file mode 100644 index 000000000..fa2c8312d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPG Binary files differnew file mode 100644 index 000000000..8d58771d4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg Binary files differnew file mode 100644 index 000000000..81aa412ec --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPG Binary files differnew file mode 100644 index 000000000..68921f1ca --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPG Binary files differnew file mode 100644 index 000000000..a8b5d9ba4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPG Binary files differnew file mode 100644 index 000000000..9f200198d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPG Binary files differnew file mode 100644 index 000000000..fa2c8312d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPG Binary files differnew file mode 100644 index 000000000..7956b0695 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPG diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg Binary files differnew file mode 100644 index 000000000..4ca8677cd --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg Binary files differnew file mode 100644 index 000000000..f41898bc1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpg Binary files differnew file mode 100644 index 000000000..212edc547 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpg Binary files differnew file mode 100644 index 000000000..d8da5726d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpg Binary files differnew file mode 100644 index 000000000..a8b5d9ba4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpg Binary files differnew file mode 100644 index 000000000..86dd6f397 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpg Binary files differnew file mode 100644 index 000000000..9d36f3642 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpg diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpg Binary files differnew file mode 100644 index 000000000..6ac67aa46 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpg 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 4e9c8af59..7f520ecc5 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 @@ -144,6 +144,10 @@ <DependentUpon>SafetyLevelOperationsConfirmationView.xaml</DependentUpon> </Compile> <Compile Include="Dialogs\SafetyLevelOperationsConfirmationViewVM.cs" /> + <Compile Include="Dialogs\ThreadBreakView.xaml.cs"> + <DependentUpon>ThreadBreakView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\ThreadBreakViewVM.cs" /> <Compile Include="Dialogs\ThreadLoadingView.xaml.cs"> <DependentUpon>ThreadLoadingView.xaml</DependentUpon> </Compile> @@ -160,7 +164,6 @@ </Compile> <Compile Include="Dialogs\ScreenLockViewVM.cs" /> <Compile Include="Dialogs\TechnicianModeLoginViewVM.cs" /> - <None Include="Dialogs\ThreadLoadingViewVM - Copy.cs" /> <Compile Include="Dialogs\ThreadLoadingViewVM.cs" /> <Compile Include="Dialogs\FirmwareUpgradeFromFileView.xaml.cs"> <DependentUpon>FirmwareUpgradeFromFileView.xaml</DependentUpon> @@ -273,6 +276,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Dialogs\ThreadBreakView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Dialogs\ThreadLoadingView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -454,6 +461,34 @@ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Resource Include="Images\thread_loading_preview.png" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\1.JPG" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\2.JPG" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\3.JPG" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\4.JPG" /> + <Resource Include="Images\ThreadLoading\GuidingUnits\1.JPG" /> + <Resource Include="Images\ThreadLoading\TheDryer\1.jpg" /> + <Resource Include="Images\ThreadLoading\TheDryer\2.jpg" /> + <Resource Include="Images\ThreadLoading\TheDryer\3.jpg" /> + <Resource Include="Images\ThreadLoading\TheDryer\4.jpg" /> + <Resource Include="Images\ThreadLoading\TheDryer\5.jpg" /> + <Resource Include="Images\ThreadLoading\DryerClose\1.jpg" /> + <Resource Include="Images\ThreadLoading\DryerClose\2.jpg" /> + <Resource Include="Images\ThreadLoading\DryerClose\3.jpg" /> + <Resource Include="Images\ThreadLoading\DryerClose\4.jpg" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\arc\1.jpg" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\arc\2.jpg" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\arc\3.jpg" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\arc\4.jpg" /> + <Resource Include="Images\ThreadLoading\FeedingUnits\arc\5.jpg" /> + <Resource Include="Images\ThreadLoading\NewThread\TS1800_CloseUp_Feeder_P.jpg" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\1.jpg" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\2.JPG" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\3.JPG" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\4.JPG" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\5.JPG" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\6.JPG" /> + <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\7.jpg" /> + <Resource Include="Images\ThreadLoading\NewThread\machine_full.jpg" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> <None Include="firmware_package.tfp"> @@ -726,7 +761,7 @@ if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)"</ </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs index 5656300a7..a6479da63 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs @@ -40,11 +40,26 @@ namespace Tango.PPC.UI.ThreadLoading } } - public async void StartThreadLoading() + public async void StartThreadLoadingWizard() { _dialogShown = true; await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM(true)); _dialogShown = false; } + + public async void StartThreadBreakWizard() + { + if (!_dialogShown) + { + _dialogShown = true; + var vm = await _notificationsProvider.ShowDialog<ThreadBreakViewVM>(); + _dialogShown = false; + + if (vm.Result == ThreadBreakViewVM.ThreadBreakWizardResult.StartThreadLoading) + { + StartThreadLoadingWizard(); + } + } + } } } |
