diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-16 15:59:12 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-16 15:59:12 +0300 |
| commit | 04fd2234090e23ff2e648d997a1cc753c9354941 (patch) | |
| tree | 5624cfac25a0439ad6dfaae64132fbe5b62a50a0 /Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml | |
| parent | 9dbb8f8eb3d07ee07cf7ce1beab72df056e157c6 (diff) | |
| download | Tango-04fd2234090e23ff2e648d997a1cc753c9354941.tar.gz Tango-04fd2234090e23ff2e648d997a1cc753c9354941.zip | |
Implemented full machine setup with connectivity and communication testing!
Fixed an issue with auto reset event on transport and logging :/
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml | 159 |
1 files changed, 116 insertions, 43 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml index e67905eba..a097eeb45 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml @@ -4,17 +4,24 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:setup="clr-namespace:Tango.PPC.Common.MachineSetup;assembly=Tango.PPC.Common" + xmlns:connectivity="clr-namespace:Tango.PPC.Common.Connectivity;assembly=Tango.PPC.Common" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" - d:DesignHeight="2000" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineSetupViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineSetupViewVM}"> + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineSetupViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineSetupViewVM}"> <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}"> - <Grid x:Name="Container"> + <Grid> <DockPanel> - <Grid DockPanel.Dock="Bottom" Height="200" Background="{StaticResource TangoMidBackgroundBrush}" Visibility="{Binding State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Working,Failed,Completed'}"> + <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 100 0 0"> + <Image Source="/Images/package.png" Width="180" Height="180" /> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="30">MACHINE SETUP WIZARD</TextBlock> + </StackPanel> + + <Grid DockPanel.Dock="Bottom" Height="200" Background="{StaticResource TangoMidBackgroundBrush}"> <Border BorderThickness="0 1 0 0" BorderBrush="{StaticResource TangoGrayBrush}"> <TextBox x:Name="txtLog" SelectionBrush="Transparent" IsReadOnly="True" Padding="5" Background="Transparent" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> @@ -22,63 +29,129 @@ </Border> </Grid> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> - <Image Source="/Images/package.png" Width="180" Height="180" /> - <TextBlock HorizontalAlignment="Center" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}" Margin="30">MACHINE SETUP</TextBlock> + <controls:NavigationControl x:Name="navigationControl" TransitionType="Slide" KeepElementsAttached="True" Margin="0 20 0 0" SelectedIndex="0"> + + <Grid controls:NavigationControl.NavigationName="WelcomeView"> + <StackPanel HorizontalAlignment="Center" Margin="0 100 0 0"> + <TextBlock TextAlignment="Center" LineHeight="20" Margin="20 0" TextWrapping="Wrap" FontSize="{StaticResource TangoTitleFontSize}"> + <Run>Welcome to the machine setup wizard!</Run> + <Run>In the next steps the software will gather required information, perform tests and apply an initial configuration to this machine.</Run> + <LineBreak/> + <LineBreak/> + <Run>Press 'START' to initiate the setup process.</Run> + </TextBlock> + + <touch:TouchButton Margin="0 250 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding NavigateToWiFiCommand}">START</touch:TouchButton> + </StackPanel> + </Grid> + + <Grid controls:NavigationControl.NavigationName="WiFiSelectionView"> + <DockPanel> + <TextBlock DockPanel.Dock="Top" Margin="20 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + <Run>We need an active internet connection in order to fetch the latest software package and machine configuration.</Run> + <LineBreak/> + <LineBreak/> + <Run>Please connect to one of the available WiFi networks.</Run> + </TextBlock> + + <connectivity:AvailableWiFiConnectionsControl DataContext="{Binding ConnectivityProvider}" Margin="50 100 50 20" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 1 0 0" /> + </DockPanel> + </Grid> + + <Grid controls:NavigationControl.NavigationName="WiFiTestView"> + <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> + <TextBlock DockPanel.Dock="Top" Margin="20 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + Checking internet connection, please wait... + </TextBlock> + <touch:TouchBusyIndicator Width="250" Margin="0 100 0 0" Height="250" IsIndeterminate="True" /> + </StackPanel> + </Grid> - <StackPanel Visibility="{Binding State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='None'}"> - <TextBlock TextAlignment="Center" LineHeight="25"> - <Run>This machine has not been configured yet and require several steps in order to be ready.</Run> - <LineBreak/> - <Run>Enter this machine serial number, synchronization server address and tap 'INSTALL'.</Run> - </TextBlock> + <Grid controls:NavigationControl.NavigationName="EmbeddedWelcomeView"> + <StackPanel HorizontalAlignment="Center" Margin="0 100 0 0"> + <TextBlock TextAlignment="Center" LineHeight="20" Margin="20 0" TextWrapping="Wrap" FontSize="{StaticResource TangoTitleFontSize}"> + <Run>It is recommended to perform a quick communication test with the machine before proceeding. Please turn on and connect the machine, then tap 'PERFORM TEST'.</Run> + </TextBlock> - <StackPanel Width="500" Margin="0 100 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <TextBlock>SERIAL NUMBER</TextBlock> - <touch:TouchTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 10 0 0" Text="{Binding SerialNumber}" KeyboardContainer="{Binding ElementName=Container}" /> + <StackPanel Orientation="Horizontal" Margin="0 250 0 0" HorizontalAlignment="Center"> + <touch:TouchButton Margin="10" Background="{StaticResource TangoGrayBrush}" Padding="20" Width="300" CornerRadius="35" Command="{Binding SkipEmbeddedTestCommand}">SKIP</touch:TouchButton> + <touch:TouchButton Margin="10" Padding="20" Width="300" CornerRadius="35" Command="{Binding PerformEmbeddedTestCommand}">PERFORM TEST</touch:TouchButton> + </StackPanel> + </StackPanel> + </Grid> + + <Grid controls:NavigationControl.NavigationName="EmbeddedTestView"> + <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> + <TextBlock Text="{Binding MachineConnectionStatus}" DockPanel.Dock="Top" Margin="20 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"></TextBlock> + <touch:TouchProgressBar Height="20" Width="700" Margin="0 40 0 0" IsIndeterminate="True" /> + </StackPanel> + </Grid> + + <Grid controls:NavigationControl.NavigationName="SetupWelcomeView"> + <StackPanel> + <TextBlock TextAlignment="Center" LineHeight="25" FontSize="{StaticResource TangoTitleFontSize}" Margin="40 0" TextWrapping="Wrap"> + The next step is to download the latest software package and synchronize the machine data. Enter the machine serial number, service address and press 'INSTALL'. + </TextBlock> + + <StackPanel Width="500" Margin="0 100 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <TextBlock>SERIAL NUMBER</TextBlock> + <touch:TouchTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 10 0 0" Text="{Binding SerialNumber}" KeyboardContainer="{Binding ElementName=Container}" /> - <TextBlock Margin="0 40 0 0">MACHINE SERVICE ADDRESS</TextBlock> - <touch:TouchTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 10 0 0" Text="{Binding HostAddress}" KeyboardContainer="{Binding ElementName=Container}" /> + <TextBlock Margin="0 80 0 0">MACHINE SERVICE ADDRESS</TextBlock> + <touch:TouchTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 10 0 0" Text="{Binding HostAddress}" KeyboardContainer="{Binding ElementName=Container}" /> - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding StartCommand}">INSTALL</touch:TouchButton> + <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding InstallCommand}">INSTALL</touch:TouchButton> + </StackPanel> </StackPanel> - </StackPanel> + </Grid> - <StackPanel Visibility="{Binding State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Working'}"> - <TextBlock TextAlignment="Center"> + <Grid controls:NavigationControl.NavigationName="SetupProgressView"> + <StackPanel> + <TextBlock TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> <Run>Please wait while we setting up this machine.</Run> <Run>Do not turn off this PC.</Run> - </TextBlock> + </TextBlock> - <touch:TouchBusyIndicator Width="100" Height="100" Margin="0 80 0 0"> - <touch:TouchBusyIndicator.Style> - <Style TargetType="touch:TouchBusyIndicator"> - <Setter Property="IsIndeterminate" Value="False"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding State}" Value="Working"> - <Setter Property="IsIndeterminate" Value="True"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchBusyIndicator.Style> - </touch:TouchBusyIndicator> - <touch:TouchStepProgressBar FontSize="10" Width="720" Height="50" Margin="0 100 0 0" ItemsSource="{Binding Source={x:Type setup:MachineSetupSteps},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding MachineSetupManager.CurrentStep}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" /> + <touch:TouchBusyIndicator Width="100" Height="100" Margin="0 80 0 0"> + <touch:TouchBusyIndicator.Style> + <Style TargetType="touch:TouchBusyIndicator"> + <Setter Property="IsIndeterminate" Value="False"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding State}" Value="Working"> + <Setter Property="IsIndeterminate" Value="True"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchBusyIndicator.Style> + </touch:TouchBusyIndicator> + <touch:TouchStepProgressBar FontSize="10" Width="720" Height="50" Margin="0 100 0 0" ItemsSource="{Binding Source={x:Type setup:MachineSetupSteps},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding MachineSetupManager.CurrentStep}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" /> - <StackPanel Margin="100 100 100 0" Visibility="{Binding MachineSetupManager.CurrentStep,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='DownloadingPackage'}"> - <TextBlock Text="{Binding MachineSetupManager.DownloadingPackagesStatus,Mode=OneWay}"></TextBlock> - <touch:TouchProgressBar Margin="0 10 0 0" Height="10" Maximum="100" Value="{Binding MachineSetupManager.DownloadingPackagesProgress,Mode=OneWay}" /> + <StackPanel Margin="100 100 100 0" Visibility="{Binding MachineSetupManager.CurrentStep,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='DownloadingPackage'}"> + <TextBlock Text="{Binding MachineSetupManager.DownloadingPackagesStatus,Mode=OneWay}"></TextBlock> + <touch:TouchProgressBar Margin="0 10 0 0" Height="10" Maximum="100" Value="{Binding MachineSetupManager.DownloadingPackagesProgress,Mode=OneWay}" /> + </StackPanel> </StackPanel> - </StackPanel> + </Grid> - <StackPanel Visibility="{Binding State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Completed'}"> + <Grid controls:NavigationControl.NavigationName="SetupCompletedView"> <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}">Setup completed successfully. Machine is ready!</TextBlock> + + <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> </StackPanel> + </Grid> - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> - </StackPanel> - </StackPanel> + <Grid controls:NavigationControl.NavigationName="SetupFailedView"> + <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">Setup failed, tap 'RESTART' to restart the process.</TextBlock> + + <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">RESTART</touch:TouchButton> + </StackPanel> + </Grid> + + </controls:NavigationControl> </DockPanel> </Grid> </Grid> |
