From 525cb05b5ab2c7168599d01d298d187a763d6b3c Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 4 May 2023 21:24:11 +0300 Subject: New Job Running control. --- .../PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 2a851e007..fba49ced3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -6,8 +6,10 @@ using System.Threading.Tasks; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core.Commands; +using Tango.Core.DI; using Tango.Integration.Operation; using Tango.PPC.Common; +using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; @@ -19,7 +21,11 @@ namespace Tango.PPC.UI.ViewModels { #region Properties - private JobHandler _handler; + [TangoInject] + public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } + + + private JobHandler _handler; private Job _job; /// @@ -230,8 +236,15 @@ namespace Tango.PPC.UI.ViewModels { MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; + + //DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived; } - + + private void DefaultDiagnosticsFrameProvider_FrameReceived(object sender, PMR.Diagnostics.StartDiagnosticsResponse e) + { + var frame = e; + } + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { _handler = e.JobHandler; -- cgit v1.3.1 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. --- .../Converters/BuildTypeToVisibilityConverter.cs | 2 +- .../BuildTypeToVisibilityInverseConverter.cs | 2 +- .../PPC/Tango.PPC.Common/Resources/Merged.xaml | 4 +- 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 + 9 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs index e697c1c6a..a9b3ff8bc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs @@ -15,7 +15,7 @@ namespace Tango.PPC.Common.Converters { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return (BuildType)value == (BuildType)parameter ? Visibility.Visible : Visibility.Collapsed; + return (BuildType)value == (BuildType)Enum.Parse(typeof(BuildType), parameter.ToStringSafe()) ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs index a603a6d52..744d0d975 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs @@ -15,7 +15,7 @@ namespace Tango.PPC.Common.Converters { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return (BuildType)value == (BuildType)parameter ? Visibility.Collapsed : Visibility.Visible; + return (BuildType)value == (BuildType)Enum.Parse(typeof(BuildType), parameter.ToStringSafe()) ? Visibility.Collapsed : Visibility.Visible; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml index 5f8cabcca..da4e63b51 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -72,8 +72,8 @@ - - + + - - --> - + + + + + - 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