blob: 5cf23e79e15c2beaeb7f54f74e4b68cce73a1e9f (
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
114
115
116
|
<UserControl x:Class="Tango.MachineStudio.UI.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:local="clr-namespace:Tango.MachineStudio.UI.Views"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="400" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">
<UserControl.Resources>
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
</UserControl.Resources>
<UserControl.Style>
<Style TargetType="UserControl">
<Setter Property="Cursor" Value="Arrow"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsFree}" Value="False">
<Setter Property="Cursor" Value="Wait"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Style>
<Grid>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="121"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid>
<StackPanel>
<StackPanel Orientation="Horizontal">
<Image Source="/Images/firmware_upgrade.png" Height="100" />
<TextBlock VerticalAlignment="Center" FontSize="30" FontWeight="SemiBold" Margin="20 0 0 0">FIRMWARE UPGRADE</TextBlock>
</StackPanel>
<Rectangle Stroke="{StaticResource BorderBrushGainsboro}" StrokeDashArray="5 5 5 5" Margin="20 10" />
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<controls:NavigationControl TransitionType="Zoom" SelectedIndex="{Binding CurrentPage}" TransitionDuration="00:00:0.3">
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="174*"/>
<RowDefinition Height="85*"/>
</Grid.RowDefinitions>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock TextAlignment="Center">
<Run>This upgrade wizard will help you upgrade the connected machine firmware version.</Run>
<LineBreak/>
<Run>Press 'SELECT' to browse for an .tfp file (Tango Firmware Package).</Run>
</TextBlock>
<StackPanel>
<DockPanel Margin="0 30 0 0" Width="600" HorizontalAlignment="Left">
<Button DockPanel.Dock="Right" Margin="10 0 0 0" Command="{Binding SelectCommand}">SELECT</Button>
<TextBox Style="{x:Null}" VerticalContentAlignment="Center" BorderBrush="{StaticResource AccentColorBrush}" Padding="5 0" Foreground="{StaticResource DimGrayBrush}" IsReadOnly="True" Text="{Binding SelectedFile,Mode=OneWay}"></TextBox>
</DockPanel>
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
<RadioButton IsChecked="{Binding DFU,Mode=TwoWay}">DFU</RadioButton>
<RadioButton IsChecked="{Binding UploadTFP,Mode=TwoWay}" Margin="25 0 0 0">TFP Package</RadioButton>
<RadioButton IsChecked="{Binding DFUAndTFP,Mode=TwoWay}" Margin="10 0 0 0">DFU & Package</RadioButton>
</StackPanel>
</StackPanel>
</StackPanel>
<Grid Height="60" Grid.Row="1">
<Button Height="50" Width="200" VerticalAlignment="Top" Command="{Binding UpgradeCommand}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Flash" Width="32" Height="32" />
<TextBlock VerticalAlignment="Center" Margin="5 0 0 0">UPGRADE</TextBlock>
</StackPanel>
</Button>
</Grid>
</Grid>
</Grid>
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="18" FontWeight="SemiBold">Upgrading Machine Firmware</TextBlock>
<TextBlock Margin="0 40 0 0" HorizontalAlignment="Center" Foreground="{StaticResource GrayBrush}" Text="{Binding Handler.Message,Converter={StaticResource EnumToDescriptionConverter},Mode=OneWay}"></TextBlock>
<ProgressBar Height="15" Width="600" Margin="0 5 0 0" Maximum="{Binding Handler.Total,Mode=OneWay}" Value="{Binding Handler.Current,Mode=OneWay}" IsIndeterminate="{Binding Handler.IsIndeterminate,Mode=OneWay}"></ProgressBar>
<Button Width="150" Background="{StaticResource RedBrush100}" BorderBrush="{StaticResource RedBrush100}" Margin="0 40 0 0" Height="35" Command="{Binding AbortCommand}">ABORT</Button>
</StackPanel>
</Grid>
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="18" FontWeight="SemiBold">Firmware Upgrade Completed</TextBlock>
<materialDesign:PackIcon HorizontalAlignment="Center" Width="100" Margin="0 10 0 0" Height="100" Kind="Check" Foreground="#2DCB2D" />
<Button Width="150" Margin="0 10 0 0" Height="35" Command="{Binding CloseCommand}">CLOSE</Button>
</StackPanel>
</Grid>
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="18" FontWeight="SemiBold">Firmware Upgrade Failed</TextBlock>
<materialDesign:PackIcon HorizontalAlignment="Center" Width="100" Margin="0 10 0 0" Height="100" Kind="AlertOutline" Foreground="{StaticResource RedBrush100}" />
<TextBlock HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding UpgradeError}" Foreground="{StaticResource RedBrush100}" FontWeight="SemiBold"></TextBlock>
<Button Width="150" Margin="0 15 0 0" Height="35" Command="{Binding CloseCommand}">CLOSE</Button>
</StackPanel>
</Grid>
</controls:NavigationControl>
</Grid>
</Grid>
</Grid>
</UserControl>
|