aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Upgrade/Views/FirmwareUpgradeView.xaml
blob: 3e93300c063e7d65def501aea39e42aea3bdf661 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<UserControl x:Class="Tango.FSE.Upgrade.Views.FirmwareUpgradeView"
             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.FSE.Common.Controls;assembly=Tango.FSE.Common"
             xmlns:global="clr-namespace:Tango.FSE.Upgrade"
             xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete"
             xmlns:vm="clr-namespace:Tango.FSE.Upgrade.ViewModels"
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:local="clr-namespace:Tango.FSE.Upgrade.Views"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.FirmwareUpgradeViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">

    <Grid IsEnabled="{Binding IsFree}">
        <StackPanel>
            <TextBlock FontSize="{StaticResource FSE_LargeFontSize}">Firmware Upgrade</TextBlock>

            <TextBlock Margin="0 10 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="20" Visibility="{Binding ResolutionService.IsHighResolution,Converter={StaticResource BooleanToVisibilityConverter}}">
                <Run>You chose to perform a machine firmware upgrade.</Run>
                <LineBreak/>
                <Run>The upgrade is done by downloading the specified Tango system version below and composing a .tfp file (Tango Firmware Package).</Run>
            </TextBlock>

            <TextBlock Margin="0 20 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="20">
                <Run>Once the .tfp file has been generated, you will be able to store that file on a removable storage which can be later inserted into a machine.</Run>
                <LineBreak/>
                <Run>In case you chose to upgrade the currently connected machine, you will be able to perform the upgrade remotely.</Run>
            </TextBlock>

            <StackPanel Margin="0 20 0 0">
                <RadioButton x:Name="chkDownload" VerticalContentAlignment="Center" Cursor="Hand" Padding="30 0 0 0" IsChecked="{Binding UseExistingTfpFile,Converter={StaticResource BooleanInverseConverter},Mode=TwoWay}">
                    <DockPanel>
                        <Image Source="../Images/tfp_download.png" Width="48" Height="48" />
                        <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">I want download and create a .tfp file from an existing version.</TextBlock>
                    </DockPanel>
                </RadioButton>

                <DockPanel Margin="80 10 0 0" IsEnabled="{Binding ElementName=chkDownload,Path=IsChecked}" Width="800" HorizontalAlignment="Left">

                    <StackPanel HorizontalAlignment="Left" Width="380">
                        <TextBlock>Select the desired firmware version</TextBlock>
                        <ComboBox Margin="0 5 0 0" Height="30" HorizontalContentAlignment="Stretch" FontSize="{StaticResource FSE_SmallFontSize}" material:ComboBoxAssist.ClassicMode="True" material:ComboBoxAssist.ShowSelectedItem="False" ItemsSource="{Binding TangoVersions}" SelectedItem="{Binding SelectedVersion}" Foreground="{StaticResource FSE_PrimaryAccentBrush}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <DockPanel>
                                        <TextBlock DockPanel.Dock="Right" VerticalAlignment="Center" Margin="10 0 0 -4" Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallFontSize}">
                                    <Run>(</Run><Run Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></Run><Run>)</Run>
                                        </TextBlock>
                                        <StackPanel>
                                            <TextBlock Margin="0 5 0 0">
                                        <Run Foreground="{StaticResource FSE_GrayBrush}">Firmware:</Run>
                                        <Run>v</Run><Run Text="{Binding FirmwareVersion}"></Run>
                                            </TextBlock>
                                        </StackPanel>
                                    </DockPanel>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </StackPanel>
                </DockPanel>

                <RadioButton x:Name="chkExisting" IsChecked="{Binding ElementName=chkDownload,Path=IsChecked,Converter={StaticResource BooleanInverseConverter},Mode=TwoWay}" Margin="0 20 0 0" VerticalContentAlignment="Center" Cursor="Hand" Padding="25 0 0 0">
                    <DockPanel>
                        <Image Source="../Images/tfp_ready.png" Width="48" Height="48" />
                        <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">I already have the .tfp file and just want to upgrade the currently connected machine. (requires an active machine connection)</TextBlock>
                    </DockPanel>
                </RadioButton>

                <StackPanel IsEnabled="{Binding ElementName=chkExisting,Path=IsChecked}" Margin="80 10 0 0" HorizontalAlignment="Left">
                    <TextBlock>Select an existing .tfp file on your computer</TextBlock>

                    <DockPanel Margin="0 0 0 0">
                        <DockPanel DockPanel.Dock="Right" Margin="0 0 0 0" Visibility="{Binding ExistingTfpFileLocation,Converter={StaticResource IsNullToVisibilityConverter}}">
                            <TextBlock Margin="10 0 0 0" Foreground="{StaticResource FSE_PrimaryAccentBrush}" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center">
                                <Run>v</Run><Run Text="{Binding ExistingTfpFileVersion}"></Run>
                            </TextBlock>
                        </DockPanel>
                        <controls:IconButton ToolTip="Browse for .tfp file" Margin="5 0 0 0" DockPanel.Dock="Right" Icon="FolderOpenOutline" Width="38" Height="38" Command="{Binding SelectExistingTfpFileLocationCommand}" />
                        <TextBox Width="350" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" IsReadOnly="True" Text="{Binding ExistingTfpFileLocation,Converter={StaticResource FilePathToFileNameConverter}}" VerticalContentAlignment="Bottom"></TextBox>
                    </DockPanel>
                </StackPanel>
            </StackPanel>
        </StackPanel>

        <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="1000">
            <DockPanel>
                <Grid DockPanel.Dock="Right" HorizontalAlignment="Right" >
                    <Button material:ButtonAssist.CornerRadius="25" Visibility="{Binding ElementName=chkDownload,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding GeneratePackageCommand}" Width="250" Height="50">
                        <StackPanel Orientation="Horizontal">
                            <material:PackIcon Width="32" Height="28" Kind="PackageDown" />
                            <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource FSE_LargeFontSize}" Text="GENERATE PACKAGE"/>
                        </StackPanel>
                    </Button>

                    <Button material:ButtonAssist.CornerRadius="25" Visibility="{Binding ElementName=chkExisting,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding ContinueCommand}" Width="250" Height="50">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock VerticalAlignment="Center" FontSize="{StaticResource FSE_LargeFontSize}">CONTINUE</TextBlock>
                            <material:PackIcon Margin="10 -5 0 0" Width="32" Height="28" Kind="ArrowRight" />
                        </StackPanel>
                    </Button>
                </Grid>

                <StackPanel VerticalAlignment="Bottom" Margin="0 0 40 0">
                    <TextBlock Text="{Binding Handler.Progress.Message}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"></TextBlock>
                    <ProgressBar Margin="0 5 0 0" Minimum="0" Maximum="{Binding Handler.Progress.Maximum}" Value="{Binding Handler.Progress.Value}" IsIndeterminate="{Binding Handler.Progress.IsIndeterminate}"></ProgressBar>
                </StackPanel>
            </DockPanel>

            <Rectangle StrokeThickness="1" Stroke="{StaticResource FSE_GrayBrush}" StrokeDashArray="4" Margin="0 10 0 0"></Rectangle>
        </StackPanel>
    </Grid>
</UserControl>