From af4e99d71390d050e321e4de3530b2774f84ba0c Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 9 May 2023 16:10:17 +0300 Subject: Added loading video on Eureka. --- Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv | Bin 0 -> 6369158 bytes .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 15 ++++++- .../PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 9 +++++ .../PPC/Tango.PPC.UI/Views/LoadingView.xaml | 43 +++------------------ .../PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs | 16 ++++++++ .../Visual_Studio/PPC/Tango.PPC.UI/packages.config | 1 + 6 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv b/Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv new file mode 100644 index 000000000..7f4a8dd66 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 7772c1f55..4e0671b57 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -130,6 +130,9 @@ + + ..\..\packages\WPFMediaKit.2.2.0\lib\WPFMediaKit.dll + @@ -607,6 +610,7 @@ + @@ -615,7 +619,9 @@ PreserveNewest - + + Designer + SettingsSingleFileGenerator Settings.Designer.cs @@ -852,6 +858,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + RD /S /Q "$(TargetDir)cs\" @@ -929,7 +936,10 @@ if $(ConfigurationName) == Eureka del WebRtc.NET.pdb if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" -if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string "Comments" "Debug Tag" +if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string "Comments" "Debug Tag" + +if $(ConfigurationName) == Eureka_Debug copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir)" +if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir)" copy /Y "$(ProjectDir)Manifests\$(ConfigurationName).xml" "$(ProjectDir)app.manifest" @@ -940,4 +950,5 @@ if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string " + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs index ec316989f..07b58e55f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs @@ -13,6 +13,7 @@ using Tango.PPC.Common.Authentication; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Logging; +using Tango.PPC.UI.Views; namespace Tango.PPC.UI.ViewModels { @@ -95,6 +96,14 @@ namespace Tango.PPC.UI.ViewModels if (!AuthenticationProvider.AuthenticationRequired) { LogManager.Log("Application is ready! Navigating to home module..."); + + if (BuildProvider.IsEureka) + { + var secondsPassed = (DateTime.Now - LoadingView.VideoStartTime).TotalSeconds; + var secondsToHold = Math.Max(10 - secondsPassed, 0); + await Task.Delay(TimeSpan.FromSeconds(secondsToHold)); + } + await NavigationManager.NavigateTo(NavigationView.HomeModule); IsLoading = false; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml index 146d4b50d..3ed91e5db 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml @@ -9,47 +9,16 @@ xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Views" + xmlns:mediaKit="clr-namespace:WPFMediaKit.DirectShow.Controls;assembly=WPFMediaKit" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:LoadingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoadingView}"> - - - + + + + + - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs index a1214a0df..4616ea438 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs @@ -12,6 +12,9 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Build; namespace Tango.PPC.UI.Views { @@ -20,9 +23,22 @@ namespace Tango.PPC.UI.Views /// public partial class LoadingView : UserControl { + public static DateTime VideoStartTime { get; set; } + public LoadingView() { InitializeComponent(); + + var buildProvider = TangoIOC.Default.GetInstance(); + var appManager = TangoIOC.Default.GetInstance(); + + if (buildProvider.IsEureka) + { + VideoStartTime = DateTime.Now; + videoPlayer.Source = new Uri(appManager.StartPath + "\\Intro.wmv", UriKind.Absolute); + videoPlayer.MediaOpened += (_, __) => VideoStartTime = DateTime.Now; + videoPlayer.Play(); + } } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config index ec7ec1e3a..9e3e48198 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config @@ -11,4 +11,5 @@ + \ No newline at end of file -- cgit v1.3.1