aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
blob: 40b296d1e4b1c8749114c62c32a97ac6ab84fb48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008
<UserControl x:Class="Tango.PPC.UI.Views.MachineSetupView"
             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: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:web="clr-namespace:Tango.Web;assembly=Tango.Web"
             xmlns:local="clr-namespace:Tango.PPC.UI.Views"
             xmlns:common="clr-namespace:Tango.PPC.Common;assembly=Tango.PPC.Common"
             mc:Ignorable="d" 
             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>
            <DockPanel>

                <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" Foreground="{StaticResource TangoGrayTextBrush}" FontSize="12" SelectionBrush="#8BB0B0B0" IsReadOnly="True" Padding="5" Background="Transparent" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">

                        </TextBox>
                    </Border>
                </Grid>

                <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 20 0 0">
                            <TextBlock TextAlignment="Center" LineHeight="40" 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="{Binding CurrentView,Converter={StaticResource EnumToBooleanConverter},ConverterParameter='WiFiTestView'}" />
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="TimeZoneView">
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="500">

                            <Image Source="/Images/time-zone.png" Width="128" />
                            <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please select the machine time zone</TextBlock>
                            <touch:TouchComboBox Margin="0 80 0 0" ItemsSource="{Binding TimeZones}" SelectedItem="{Binding SelectedTimeZone,Mode=TwoWay}">
                                
                            </touch:TouchComboBox>

                            <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding TimeZoneSelectedCommand}">CONTINUE</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="EnvironmentView">
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="500">

                            <Image Source="/Images/environment.png" Width="128" />
                            <TextBlock Margin="0 20 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please select the machine working environment</TextBlock>
                            <touch:TouchComboBox Margin="0 80 0 0" Title="Select Environment" ItemsSource="{Binding Source={x:Type web:DeploymentSlot},Converter={StaticResource EnumToItemsSourceConverter},ConverterParameter='false'}" SelectedItem="{Binding DeploymentSlot}">
                                <touch:TouchComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Padding="10" FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}">
                                            <TextBlock.Style>
                                                <Style TargetType="TextBlock">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected}" Value="True">
                                                            <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </TextBlock.Style>
                                        </TextBlock>
                                    </DataTemplate>
                                </touch:TouchComboBox.ItemTemplate>
                                <touch:TouchComboBox.SelectedItemTemplate>
                                    <DataTemplate>
                                        <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
                                    </DataTemplate>
                                </touch:TouchComboBox.SelectedItemTemplate>
                            </touch:TouchComboBox>

                            <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding EnvironmentSelectedCommand}">CONTINUE</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="SetupWelcomeView">
                        <StackPanel>
                            <TextBlock TextAlignment="Center" LineHeight="40" FontSize="{StaticResource TangoTitleFontSize}" Margin="40 0" TextWrapping="Wrap">
                                The next step is to download the latest software package and synchronize the machine data. Please enter your machine serial number 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}" />

                                <StackPanel HorizontalAlignment="Center">
                                    <TextBlock Margin="0 80 0 0" FontSize="12" Foreground="{StaticResource TangoGrayTextBrush}">MACHINE SERVICE ADDRESS</TextBlock>
                                    <TextBlock FontSize="11" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 5 0 0" Text="{Binding HostAddress}" />
                                </StackPanel>

                                <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding InstallCommand}">INSTALL</touch:TouchButton>
                            </StackPanel>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="SetupProgressView">
                        <StackPanel>
                            <TextBlock TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
                    <Run>Please wait while we're setting up this machine.</Run>
                    <Run>Do not turn off this PC.</Run>
                            </TextBlock>
                            <StackPanel Margin="0 200 0 0">
                                <TextBlock Text="{Binding MachineSetupManager.Status.Name,FallbackValue='Download Software Package'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
                                <TextBlock HorizontalAlignment="Center" Text="{Binding MachineSetupManager.Status.Message,FallbackValue='Connecting to machine service...'}" Margin="0 40 0 0"></TextBlock>
                                <touch:TouchProgressBar Margin="50 10" Height="10" IsIndeterminate="{Binding MachineSetupManager.Status.IsIntermediate}" Maximum="{Binding MachineSetupManager.Status.Total}" Value="{Binding MachineSetupManager.Status.Progress,Mode=OneWay}" />
                            </StackPanel>
                        </StackPanel>
                    </Grid>

                    <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>

                    <Grid controls:NavigationControl.NavigationName="SetupFailedView">
                        <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0">
                            <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" />
                            <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0"  FontSize="{StaticResource TangoTitleFontSize}">Setup Failed</TextBlock>
                            <TextBlock HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Margin="30 5 30 0" Foreground="{StaticResource TangoErrorBrush}" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock>
                            <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Tap 'RESTART' to restart the process</TextBlock>
                            <touch:TouchButton Margin="0 180 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">RESTART</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                </controls:NavigationControl>
            </DockPanel>
        </Grid>
    </Grid>
</UserControl>