aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Views
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-06 15:48:47 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-06 15:48:47 +0200
commite47f736bca350350a55fa287093dad560da8f678 (patch)
treee74e726fd90cb6e791ecb5872010cb6eb61a13c8 /Software/Visual_Studio/PPC/Tango.PPC.UI/Views
parent1eb3962e5923cbb398c5ebad505e69f4617f963f (diff)
downloadTango-e47f736bca350350a55fa287093dad560da8f678.tar.gz
Tango-e47f736bca350350a55fa287093dad560da8f678.zip
Working on PPC firmware upgrade !!!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Views')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml55
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml.cs47
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml1
4 files changed, 107 insertions, 24 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml
new file mode 100644
index 000000000..985e00291
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml
@@ -0,0 +1,55 @@
+<UserControl x:Class="Tango.PPC.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:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
+ xmlns:local="clr-namespace:Tango.PPC.UI.Views"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:global="clr-namespace:Tango.PPC.UI"
+ xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
+ mc:Ignorable="d"
+ d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.FirmwareUpgradeViewVM}">
+ <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
+ <Grid>
+ <DockPanel>
+
+ <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 100 0 0">
+ <Image Source="/Images/chip_128px.png" Width="128" Height="128" />
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="50">FIRMWARE UPGRADE</TextBlock>
+ </StackPanel>
+
+ <controls:NavigationControl x:Name="navigationControl" TransitionType="Slide" KeepElementsAttached="True" Margin="0 20 0 0" SelectedIndex="0">
+ <Grid controls:NavigationControl.NavigationName="FirmwareProgressView">
+ <StackPanel HorizontalAlignment="Center" Margin="0 0 0 0">
+ <TextBlock TextAlignment="Center" LineHeight="40" Margin="20 0" TextWrapping="Wrap" FontSize="{StaticResource TangoTitleFontSize}">
+ <Run>Now it's time to perform a firmware upgrade and verify the connection to the machine's embedded firmware. Please wait..</Run>
+ </TextBlock>
+ <TextBlock Text="{Binding Status}" DockPanel.Dock="Top" Margin="20 300 20 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"></TextBlock>
+ <touch:TouchProgressBar Height="20" Width="700" Margin="0 40 0 0" IsIndeterminate="{Binding IsIntermediate}" Maximum="{Binding MaxProgress}" Value="{Binding Progress}" />
+ </StackPanel>
+ </Grid>
+
+ <Grid controls:NavigationControl.NavigationName="FirmwareCompletedView">
+ <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0">
+ <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" />
+ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">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="FirmwareFailedView">
+ <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}">Firmware upgrade failed, tap 'try again' to restart the process.</TextBlock>
+
+ <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding TryAgainCommand}">TRY AGAIN</touch:TouchButton>
+ </StackPanel>
+ </Grid>
+
+ </controls:NavigationControl>
+ </DockPanel>
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml.cs
new file mode 100644
index 000000000..867309d6a
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/FirmwareUpgradeView.xaml.cs
@@ -0,0 +1,47 @@
+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;
+using Tango.Core.DI;
+using Tango.PPC.UI.ViewModels;
+using Tango.PPC.UI.ViewsContracts;
+
+namespace Tango.PPC.UI.Views
+{
+ /// <summary>
+ /// Interaction logic for FirmwareUpgradeView.xaml
+ /// </summary>
+ public partial class FirmwareUpgradeView : UserControl, IFirmwareUpgradeView
+ {
+ public FirmwareUpgradeView()
+ {
+ InitializeComponent();
+ TangoIOC.Default.Register<IFirmwareUpgradeView>(this);
+ }
+
+ public Task NavigateTo(FirmwareUpgradeViewVM.FirmUpgradeView view)
+ {
+ TaskCompletionSource<object> source = new TaskCompletionSource<object>();
+
+ this.BeginInvoke(() =>
+ {
+ navigationControl.NavigateTo(view.ToString(), () =>
+ {
+ source.SetResult(new object());
+ });
+ });
+
+ return source.Task;
+ }
+ }
+}
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 d397cfa35..4ac6dab92 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
@@ -33,7 +33,7 @@
<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}">
+ <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/>
@@ -67,29 +67,9 @@
</StackPanel>
</Grid>
- <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 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">
+ <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>
@@ -110,7 +90,7 @@
<Grid controls:NavigationControl.NavigationName="SetupProgressView">
<StackPanel>
<TextBlock TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- <Run>Please wait while we setting up this machine.</Run>
+ <Run>Please wait while we're setting up this machine.</Run>
<Run>Do not turn off this PC.</Run>
</TextBlock>
@@ -126,7 +106,7 @@
</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:TouchStepProgressBar FontSize="12" 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>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
index 3436bb3bb..ed15180c4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
@@ -84,6 +84,7 @@
<local:ExternalBridgeView></local:ExternalBridgeView>
<local:MachineSetupView></local:MachineSetupView>
<local:MachineUpdateView></local:MachineUpdateView>
+ <local:FirmwareUpgradeView></local:FirmwareUpgradeView>
</controls:NavigationControl>
</touch:TouchPanel>