From de57858a147ece47a71e288660fbf85451e396b5 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 12 Feb 2018 17:56:24 +0200 Subject: Fixed issue with CMYK display on developer module. --- .../Converters/OneToPercentConverter.cs | 23 ++++++++++++++++++++++ .../Tango.MachineStudio.Developer.csproj | 1 + .../Views/MainView.xaml | 9 +++++---- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs new file mode 100644 index 000000000..292de5cb4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Developer.Converters +{ + public class OneToPercentConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return System.Convert.ToDouble(value) * 100d; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return System.Convert.ToDouble(value) / 100d; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 43ebc515d..f076106bc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -103,6 +103,7 @@ + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index cd5cdb8a2..f53fd003e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -57,6 +57,7 @@ + @@ -1180,7 +1181,7 @@ - + - + + + + @@ -1361,7 +1380,7 @@ - + @@ -1371,7 +1390,25 @@ - + + + + + + + + + + + + + + + + + @@ -1423,10 +1460,25 @@ - - - - + @@ -1961,7 +2013,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Integration/Dispensing/DispenserStepDivisions.cs b/Software/Visual_Studio/Tango.Integration/Dispensing/DispenserStepDivisions.cs new file mode 100644 index 000000000..55d47ab75 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Dispensing/DispenserStepDivisions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Integration.Dispensing +{ + public enum DispenserStepDivisions + { + [Description("Auto")] + Auto = 0, + [Description("2")] + D2 = 2, + [Description("4")] + D4 = 4, + [Description("8")] + D8 = 8, + [Description("16")] + D16 = 16, + [Description("32")] + D32 = 32, + [Description("64")] + D64 = 64, + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Dispensing/DispensingCalcBase.cs b/Software/Visual_Studio/Tango.Integration/Dispensing/DispensingCalcBase.cs index 27f5de79d..d4abc2a33 100644 --- a/Software/Visual_Studio/Tango.Integration/Dispensing/DispensingCalcBase.cs +++ b/Software/Visual_Studio/Tango.Integration/Dispensing/DispensingCalcBase.cs @@ -54,7 +54,7 @@ namespace Tango.Integration.Dispensing /// public virtual double CalculatePulsePerSecond(LiquidVolume liquidVolume) { - return CalculateNanoliterPerSecond(liquidVolume) / liquidVolume.IdsPack.DispenserType.NlPerPulse; + return (CalculateNanoliterPerSecond(liquidVolume) / liquidVolume.IdsPack.DispenserType.NlPerPulse) * (liquidVolume.DispenserStepDivision != DispenserStepDivisions.Auto ? (double)liquidVolume.DispenserStepDivision.ToInt32() : 1d); } /// diff --git a/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs b/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs index 802ea8462..f3e4df309 100644 --- a/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs +++ b/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs @@ -59,6 +59,14 @@ namespace Tango.Integration.Printing } } + private DispenserStepDivisions _dispenserStepDivision; + + public DispenserStepDivisions DispenserStepDivision + { + get { return _dispenserStepDivision; } + set { _dispenserStepDivision = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(PulsePerSecond)); } + } + public void Invalidate() { InvalidateSolo(); diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 4e1500c22..346d91f12 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -178,6 +178,7 @@ + diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs index 1699647bb..38f3467cf 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs @@ -8,7 +8,7 @@ using System.Windows.Data; namespace Tango.SharedUI.Converters { - internal class EnumToItemsSourceConverter : IValueConverter + public class EnumToItemsSourceConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { -- cgit v1.3.1 From 94ac70f0eaf29fcca4ae3ff5552c52cad22df492 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 14 Feb 2018 10:55:19 +0200 Subject: Refactored all studio modules to use StudioModuleBase. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Modules/Tango.MachineStudio.DB/DBModule.cs | 43 +++------------- .../DeveloperModule.cs | 54 +++++++++++---------- .../MachineDesignerModule.cs | 34 +++---------- .../Tango.MachineStudio.Stubs/StubsModule.cs | 36 +++----------- .../SynchronizationModule.cs | 42 +++------------- .../TechnicianModule.cs | 8 --- .../Properties/AssemblyInfo.cs | 3 ++ .../Tango.MachineStudio.Common/StudioModuleBase.cs | 25 +++++++++- 10 files changed, 85 insertions(+), 160 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 4354c3d3f..b3ae0ea82 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 54a54624a..f105194a9 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs index 82cd716b3..0ad6aa541 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs @@ -15,66 +15,39 @@ namespace Tango.MachineStudio.DB /// Represents a Machine Studio database module. /// /// - public class DBModule : IStudioModule + public class DBModule : StudioModuleBase { - private bool _isInitialized; - private bool _isLoaded; - /// /// Gets the module name. /// - public string Name => "Data Base"; + public override string Name => "Data Base"; /// /// Gets the module description. /// - public string Description => "Provides access to raw database tables."; + public override string Description => "Provides access to raw database tables."; /// /// Gets the module cover image. /// - public BitmapSource Image => SharedUI.Helpers.ResourceHelper.GetImageFromResources("Images/db.png"); + public override BitmapSource Image => SharedUI.Helpers.ResourceHelper.GetImageFromResources("Images/db.png"); /// /// Gets the module entry point view. /// - public FrameworkElement MainView => new MainDBView(); - - /// - /// Gets a value indicating whether this module has been initialized. - /// - public bool IsInitialized => _isInitialized; + public override FrameworkElement MainView => new MainDBView(); /// /// Gets the permission required to see and load this module. /// - public Permissions Permission => Permissions.RunDataBaseModule; - - /// - /// Sets a value indicating whether this module is loaded. - /// - public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + public override Permissions Permission => Permissions.RunDataBaseModule; /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// - /// - public void Dispose() + public override void Dispose() { - throw new NotImplementedException(); - } - - /// - /// Perform any operations required to initialize this module. - /// - public void Initialize() - { - if (!_isInitialized) - { - //Initialize - - _isInitialized = true; - } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs index 1a405f861..6cdda4bc8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs @@ -12,41 +12,43 @@ using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.Developer { - public class DeveloperModule : IStudioModule + /// + /// Represents the Machine Studio developer module. + /// + /// + public class DeveloperModule : StudioModuleBase { - private bool _isInitialized; - private bool _isLoaded; - - public string Name => "Developer"; - - public string Description => "Research and development, manage RML, STRIP and Process."; - - public BitmapSource Image => ResourceHelper.GetImageFromResources("Images/developer.jpg"); - - public FrameworkElement MainView => new MainView(); + /// + /// Gets the module name. + /// + public override string Name => "Developer"; - public bool IsInitialized => _isInitialized; + /// + /// Gets the module description. + /// + public override string Description => "Research and development, manage RML, STRIP and Process."; /// - /// Sets a value indicating whether this module is loaded. + /// Gets the module cover image. /// - public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/developer.jpg"); - public Permissions Permission => Permissions.RunDeveloperModule; + /// + /// Gets the module entry point view. + /// + public override FrameworkElement MainView => new MainView(); - public void Dispose() - { - throw new NotImplementedException(); - } + /// + /// Gets the permission required to see and load this module. + /// + public override Permissions Permission => Permissions.RunDeveloperModule; - public void Initialize() + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public override void Dispose() { - if (!_isInitialized) - { - //Initialize.. - - _isInitialized = true; - } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs index f5b0cba98..a6fa13f08 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs @@ -16,57 +16,37 @@ namespace Tango.MachineStudio.MachineDesigner /// Represents a machine designer Machine Studio module providing an interactive GUI for managing machine configurations. /// /// - public class MachineDesignerModule : IStudioModule + public class MachineDesignerModule : StudioModuleBase { - private bool _isLoaded; - /// /// Gets the module name. /// - public string Name => "Machine Designer"; + public override string Name => "Machine Designer"; /// /// Gets the module description. /// - public string Description => "Provides a graphical control over machine configurations. Create, manage and deploy machine configurations using simple drag and drop interface."; + public override string Description => "Provides a graphical control over machine configurations. Create, manage and deploy machine configurations using simple drag and drop interface."; /// /// Gets the module cover image. /// - public BitmapSource Image => ResourceHelper.GetImageFromResources("Images/machine-designer-module.jpg"); - - /// - /// Sets a value indicating whether this module is loaded. - /// - public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/machine-designer-module.jpg"); /// /// Gets the module entry point view. /// - public FrameworkElement MainView => new MainView(); + public override FrameworkElement MainView => new MainView(); /// /// Gets the permission required to see and load this module. /// - public Permissions Permission => Permissions.RunMachineDesignerModule; - - /// - /// Gets a value indicating whether this module has been initialized. - /// - public bool IsInitialized => true; + public override Permissions Permission => Permissions.RunMachineDesignerModule; /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// - public void Dispose() - { - - } - - /// - /// Perform any operations required to initialize this module. - /// - public void Initialize() + public override void Dispose() { } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs index 359ac2977..817c68b49 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs @@ -16,59 +16,39 @@ namespace Tango.MachineStudio.Stubs /// Represents a stubs execution Machine Studio module capable of executing stubs against the current connected machine using a C# script engine. /// /// - public class StubsModule : IStudioModule + public class StubsModule : StudioModuleBase { - private bool _isLoaded; - /// /// Gets the module name. /// - public string Name => "Stubs"; + public override string Name => "Stubs"; /// /// Gets the module description. /// - public string Description => "Execute machine tests using an interactive C# scripting editor"; + public override string Description => "Execute machine tests using an interactive C# scripting editor"; /// /// Gets the module cover image. /// - public BitmapSource Image => ResourceHelper.GetImageFromResources("Images/stubs.jpg"); + public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/stubs.jpg"); /// /// Gets the module entry point view. /// - public FrameworkElement MainView => new MainView(); - - /// - /// Sets a value indicating whether this module is loaded. - /// - public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + public override FrameworkElement MainView => new MainView(); /// /// Gets the permission required to see and load this module. /// - public Permissions Permission => Permissions.RunSynchronizationModule; - - /// - /// Gets a value indicating whether this module has been initialized. - /// - public bool IsInitialized => true; + public override Permissions Permission => Permissions.RunSynchronizationModule; /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// - public void Dispose() - { - //throw new NotImplementedException(); - } - - /// - /// Perform any operations required to initialize this module. - /// - public void Initialize() + public override void Dispose() { - //throw new NotImplementedException(); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs index bbf0f8ca1..5292c6048 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs @@ -16,65 +16,39 @@ namespace Tango.MachineStudio.Synchronization /// Represents a Machine Studio module capable of comparing and synchronizing machines data against Twine remote database. /// /// - public class SynchronizationModule : IStudioModule + public class SynchronizationModule : StudioModuleBase { - private bool _isLoaded; - private bool _isInitialized; - /// /// Gets the module name. /// - public string Name => "Synchronization"; + public override string Name => "Synchronization"; /// /// Gets the module description. /// - public string Description => "Perform local to local or remote to local database synchronization."; + public override string Description => "Perform local to local or remote to local database synchronization."; /// /// Gets the module cover image. /// - public BitmapSource Image => ResourceHelper.GetImageFromResources("Images/synchronization.jpg"); + public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/synchronization.jpg"); /// /// Gets the module entry point view. /// - public FrameworkElement MainView => new MainView(); - - /// - /// Sets a value indicating whether this module is loaded. - /// - public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } - - /// - /// Gets a value indicating whether this module has been initialized. - /// - public bool IsInitialized => _isInitialized; + public override FrameworkElement MainView => new MainView(); /// /// Gets the permission required to see and load this module. /// - public Permissions Permission => Permissions.RunSynchronizationModule; + public override Permissions Permission => Permissions.RunSynchronizationModule; /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// - public void Dispose() + public override void Dispose() { - //Dispose... - } - - /// - /// Perform any operations required to initialize this module. - /// - public void Initialize() - { - if (!_isInitialized) - { - //Initialize.. - - _isInitialized = true; - } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs index 7e0fdd3a4..e55fde0e5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs @@ -50,13 +50,5 @@ namespace Tango.MachineStudio.Technician { } - - /// - /// Perform any operations required to initialize this module. - /// - public override void Initialize() - { - IsInitialized = true; - } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs index 33d6edb60..f03b250be 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs @@ -15,3 +15,6 @@ using System.Windows; //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] + +//Friends With +[assembly: InternalsVisibleTo("Tango.MachineStudio.UI")] diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs index a773adf8b..5c594ab70 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs @@ -57,7 +57,7 @@ namespace Tango.MachineStudio.Common { return _isInitialized; } - protected set + private set { _isInitialized = value; } @@ -87,6 +87,27 @@ namespace Tango.MachineStudio.Common /// /// Perform any operations required to initialize this module. /// - public abstract void Initialize(); + public void Initialize() + { + OnInitialized(); + IsInitialized = true; + } + + /// + /// Called when machine studio initializes this module. + /// + protected virtual void OnInitialized() + { + + } + + /// + /// Raises the event. + /// + /// if set to true the module is loaded. + protected virtual void OnLoadedChanged(bool loaded) + { + + } } } -- cgit v1.3.1 From b7b277736c7e3ec9258915cdd5a54e7b33ba1123 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 14 Feb 2018 19:14:06 +0200 Subject: Working on Data Capture Module. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Machine Studio Modules/data-capture.jpg | Bin 0 -> 121309 bytes Software/Graphics/capture-device.png | Bin 0 -> 1812 bytes Software/Graphics/recordings.png | Bin 0 -> 858 bytes .../DataCaptureModule.cs | 84 ++++++ .../Images/capture-device.png | Bin 0 -> 1812 bytes .../Images/data-capture.jpg | Bin 0 -> 121309 bytes .../Images/recordings.png | Bin 0 -> 858 bytes .../Images/tape.png | Bin 0 -> 713 bytes .../Images/video-frame.png | Bin 0 -> 97254 bytes .../Properties/AssemblyInfo.cs | 18 ++ .../Properties/Resources.Designer.cs | 62 +++++ .../Properties/Resources.resx | 117 ++++++++ .../Properties/Settings.Designer.cs | 30 +++ .../Properties/Settings.settings | 7 + .../Recording/DataRecording.cs | 37 +++ .../Tango.MachineStudio.DataCapture.csproj | 174 ++++++++++++ .../ViewModelLocator.cs | 33 +++ .../ViewModels/MainViewVM.cs | 297 +++++++++++++++++++++ .../Views/MainView.xaml | 250 +++++++++++++++++ .../Views/MainView.xaml.cs | 28 ++ .../Views/RecordingBarView.xaml | 50 ++++ .../Views/RecordingBarView.xaml.cs | 28 ++ .../packages.config | 8 + .../ViewModels/MainViewVM.cs | 5 - .../Diagnostics/DefaultDiagnosticsFrameProvider.cs | 84 ++++++ .../Diagnostics/IDiagnosticsFrameProvider.cs | 31 +++ .../Notifications/BarItem.cs | 46 ++++ .../Notifications/INotificationProvider.cs | 25 ++ .../Tango.MachineStudio.Common.csproj | 11 + .../Video/DefaultVideoCaptureProvider.cs | 16 +- .../Notifications/DefaultNotificationProvider.cs | 39 +++ .../Tango.MachineStudio.UI.csproj | 4 + .../Tango.MachineStudio.UI/ViewModelLocator.cs | 3 + .../Tango.MachineStudio.UI/Views/MainView.xaml | 55 ++-- .../Diagnostics/DiagnosticsFileRecorder.cs | 10 + Software/Visual_Studio/Tango.sln | 35 ++- .../Utilities/Tango.UITests/MainWindow.xaml | 2 +- 39 files changed, 1563 insertions(+), 26 deletions(-) create mode 100644 Software/Graphics/Machine Studio Modules/data-capture.jpg create mode 100644 Software/Graphics/capture-device.png create mode 100644 Software/Graphics/recordings.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/capture-device.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/data-capture.jpg create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/recordings.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/tape.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/video-frame.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.resx create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.settings create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Recording/DataRecording.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/BarItem.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 6e039a824..da65c19c8 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index e1cd1c455..c6adffec8 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/Machine Studio Modules/data-capture.jpg b/Software/Graphics/Machine Studio Modules/data-capture.jpg new file mode 100644 index 000000000..87524f07a Binary files /dev/null and b/Software/Graphics/Machine Studio Modules/data-capture.jpg differ diff --git a/Software/Graphics/capture-device.png b/Software/Graphics/capture-device.png new file mode 100644 index 000000000..5f04b660a Binary files /dev/null and b/Software/Graphics/capture-device.png differ diff --git a/Software/Graphics/recordings.png b/Software/Graphics/recordings.png new file mode 100644 index 000000000..a965c62af Binary files /dev/null and b/Software/Graphics/recordings.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs new file mode 100644 index 000000000..ee650dc13 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Integration.Observables; +using Tango.MachineStudio.Common; +using Tango.MachineStudio.DataCapture.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.DataCapture +{ + /// + /// Represents the machine studio data capturing and playing module. + /// + /// + public class DataCaptureModule : StudioModuleBase + { + /// + /// Gets the module name. + /// + public override string Name + { + get + { + return "Data Capture"; + } + } + + /// + /// Gets the module description. + /// + public override string Description + { + get + { + return "Capture and synchronize diagnostics machine data with video capturing devices for later analysis"; + } + } + + /// + /// Gets the module cover image. + /// + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/data-capture.jpg"); + } + } + + /// + /// Gets the module entry point view. + /// + public override FrameworkElement MainView + { + get + { + return new MainView(); + } + } + + /// + /// Gets the permission required to see and load this module. + /// + public override Permissions Permission + { + get + { + return Permissions.RunTechnicianModule; + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/capture-device.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/capture-device.png new file mode 100644 index 000000000..5f04b660a Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/capture-device.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/data-capture.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/data-capture.jpg new file mode 100644 index 000000000..87524f07a Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/data-capture.jpg differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/recordings.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/recordings.png new file mode 100644 index 000000000..a965c62af Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/recordings.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/tape.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/tape.png new file mode 100644 index 000000000..8a4739b23 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/tape.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/video-frame.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/video-frame.png new file mode 100644 index 000000000..9c29dc438 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Images/video-frame.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0fd6e93b2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Machine Studio Data Capturing Module")] + +[assembly: ComVisible(false)] + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.Designer.cs new file mode 100644 index 000000000..fdd6d78b8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.MachineStudio.DataCapture.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.MachineStudio.DataCapture.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.Designer.cs new file mode 100644 index 000000000..8a9ab67ad --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.MachineStudio.DataCapture.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.settings b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Recording/DataRecording.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Recording/DataRecording.cs new file mode 100644 index 000000000..a191c244e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Recording/DataRecording.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.MachineStudio.DataCapture.Recording +{ + public class DataRecording : ExtendedObject + { + private DateTime _date; + + public DateTime Date + { + get { return _date; } + set { _date = value; RaisePropertyChangedAuto(); } + } + + private String _name; + + public String Name + { + get { return _name; } + set { _name = value; RaisePropertyChangedAuto(); } + } + + private String _file; + + public String FilePath + { + get { return _file; } + set { _file = value; RaisePropertyChangedAuto(); } + } + + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj new file mode 100644 index 000000000..1c13be809 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj @@ -0,0 +1,174 @@ + + + + + Debug + AnyCPU + {FC337A7F-1214-41D8-9992-78092A3B961E} + library + Tango.MachineStudio.DataCapture + Tango.MachineStudio.DataCapture + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\..\Build\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll + + + ..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll + + + ..\..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll + + + ..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll + + + ..\..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll + + + + + ..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + 4.0 + + + + + + + + + + + MainView.xaml + + + GlobalVersionInfo.cs + + + + RecordingBarView.xaml + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {9652f972-2bd1-4283-99cb-fc6240434c17} + Tango.Video + + + {cb0b0aa2-bb24-4bca-a720-45e397684e12} + Tango.MachineStudio.Common + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModelLocator.cs new file mode 100644 index 000000000..98c5db8fe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModelLocator.cs @@ -0,0 +1,33 @@ +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Ioc; +using Microsoft.Practices.ServiceLocation; +using Tango.MachineStudio.DataCapture.ViewModels; +using Tango.MachineStudio.DataCapture.Views; + +namespace Tango.MachineStudio.DataCapture +{ + /// + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); + + SimpleIoc.Default.Register(); + } + + public static MainViewVM MainViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..b63ee51d0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs @@ -0,0 +1,297 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using Tango.Core.Commands; +using Tango.Integration.Diagnostics; +using Tango.Integration.Operators; +using Tango.MachineStudio.Common.Diagnostics; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.Common.StudioApplication; +using Tango.MachineStudio.Common.Video; +using Tango.MachineStudio.DataCapture.Recording; +using Tango.MachineStudio.DataCapture.Views; +using Tango.PMR.Diagnostics; +using Tango.Settings; +using Tango.SharedUI; +using Tango.Video.DirectCapture; + +namespace Tango.MachineStudio.DataCapture.ViewModels +{ + /// + /// Represents the data capture main view, view model. + /// + /// + public class MainViewVM : ViewModel + { + private INotificationProvider _notification; + private IStudioApplicationManager _applicationManager; + private IDiagnosticsFrameProvider _frameProvider; + private String _recordingsFolder; + + #region Properties + + private ObservableCollection _recordings; + /// + /// Gets or sets the recordings collection. + /// + public ObservableCollection Recordings + { + get { return _recordings; } + set { _recordings = value; RaisePropertyChangedAuto(); } + } + + private DataRecording _selectedRecording; + /// + /// Gets or sets the selected recording. + /// + public DataRecording SelectedRecording + { + get { return _selectedRecording; } + set { _selectedRecording = value; RaisePropertyChangedAuto(); } + } + + /// + /// Gets or sets the video capture provider. + /// + public IVideoCaptureProvider VideoCaptureProvider { get; set; } + + private DiagnosticsFileRecorder _recorder; + /// + /// Gets or sets the diagnostics file recorder. + /// + public DiagnosticsFileRecorder Recorder + { + get { return _recorder; } + set { _recorder = value; RaisePropertyChangedAuto(); } + } + + private DiagnosticsFilePlayer _player; + /// + /// Gets or sets the diagnostics file player. + /// + public DiagnosticsFilePlayer Player + { + get { return _player; } + set { _player = value; RaisePropertyChangedAuto(); } + } + + /// + /// Gets or sets the machine operator. + /// + public IMachineOperator MachineOperator { get; set; } + + #endregion + + #region Commands + + /// + /// Gets or sets the remove recording command. + /// + public RelayCommand RemoveRecordingCommand { get; set; } + + /// + /// Gets or sets the toggle camera command. + /// + public RelayCommand ToggleCameraCommand { get; set; } + + /// + /// Gets or sets the media recording command. + /// + public RelayCommand MediaRecordingCommand { get; set; } + + /// + /// Gets or sets the media stop command. + /// + public RelayCommand MediaStopCommand { get; set; } + + /// + /// Gets or sets the media toggle play pause command. + /// + public RelayCommand MediaTogglePlayPauseCommand { get; set; } + + /// + /// Gets or sets the media play pause command. + /// + public RelayCommand MediaPlayPauseCommand { get; set; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public MainViewVM(IVideoCaptureProvider videoCaptureProvider, INotificationProvider notification, IStudioApplicationManager applicationManager, IDiagnosticsFrameProvider frameProvider) + { + _notification = notification; + _applicationManager = applicationManager; + _frameProvider = frameProvider; + + Recorder = new DiagnosticsFileRecorder(); + Player = new DiagnosticsFilePlayer(); + + VideoCaptureProvider = videoCaptureProvider; + Recordings = new ObservableCollection(); + + ToggleCameraCommand = new RelayCommand(ToggleCamera); + + Recordings.Add(new DataRecording() + { + Name = "Recording 1" + }); + Recordings.Add(new DataRecording() + { + Name = "Recording 2" + }); + Recordings.Add(new DataRecording() + { + Name = "Recording 3" + }); + + RemoveRecordingCommand = new RelayCommand(RemoveRecording); + + MediaRecordingCommand = new RelayCommand(StartDiagnosticsRecording, () => !Recorder.IsRecording && MachineOperator != null && !Player.IsPlaying); + MediaStopCommand = new RelayCommand(StopRecorderOrPlayer, () => Recorder.IsRecording || Player.IsPlaying); + MediaPlayPauseCommand = new RelayCommand(DiagnosticsTogglePlayPause, () => !Recorder.IsRecording && Player.IsLoaded); + + _recordingsFolder = Path.Combine(SettingsManager.DefaultFolder, "Recordings"); + Directory.CreateDirectory(_recordingsFolder); + + _frameProvider.FrameReceived += _frameProvider_FrameReceived; + + _notification.PushBarItem(new RecordingBarView() { DataContext = this }); + + applicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; + } + + private void ApplicationManager_ConnectedMachineChanged(object sender, Integration.Services.IExternalBridgeClient machine) + { + MachineOperator = machine; + InvalidateRelayCommands(); + } + + private void _frameProvider_FrameReceived(object sender, PushDiagnosticsResponse frame) + { + if (!_frameProvider.Disable) + { + if (Recorder.IsRecording) + { + Recorder.Write(frame); + } + } + } + + #endregion + + #region Private Methods + + /// + /// Removes the recording. + /// + /// The recording. + private void RemoveRecording(DataRecording recording) + { + Recordings.Remove(recording); + } + + /// + /// Toggles the camera. + /// + /// The capture device. + private void ToggleCamera(CaptureDevice captureDevice) + { + if (captureDevice.Device != null) + { + captureDevice.IsStarted = !captureDevice.IsStarted; + } + } + + private void DiagnosticsTogglePlayPause() + { + if (!Player.IsPlaying || Player.IsPaused) + { + _frameProvider.Disable = true; + Player.Play(); + } + else + { + Player.Pause(); + } + + InvalidateRelayCommands(); + } + + private async void LoadSelectedRecording() + { + using (_notification.PushTaskItem("Loading Recording...")) + { + if (Player != null) + { + Player.Dispose(); + } + + Player = new DiagnosticsFilePlayer(); + Player.FrameReceived += Player_FrameReceived; + await Player.Load(SelectedRecording.FilePath); + } + + InvalidateRelayCommands(); + } + + private void Player_FrameReceived(object sender, DataFileFrame frame) + { + if (_frameProvider.Disable) + { + _frameProvider.PushFrame(frame.PushDiagnosticsResponse); + } + } + + private void StartDiagnosticsRecording() + { + using (_notification.PushTaskItem("Starting Recording...")) + { + Recorder.Start(); + } + + InvalidateRelayCommands(); + } + + private async void StopRecorderOrPlayer() + { + if (Recorder.IsRecording) + { + using (_notification.PushTaskItem("Stopping Recording...")) + { + await Recorder.Stop(); + } + + String recordingName = _notification.ShowTextInput("Enter recording name", "Recording name"); + + if (!String.IsNullOrWhiteSpace(recordingName)) + { + using (_notification.PushTaskItem("Saving Recording...")) + { + await Recorder.Save(Path.Combine(_recordingsFolder, recordingName + ".tdr")); + } + } + + Recorder.Dispose(); + Recorder = new DiagnosticsFileRecorder(); + } + else if (Player.IsPlaying) + { + await Player.Stop(); + _frameProvider.Disable = false; + } + + InvalidateRelayCommands(); + } + + #endregion + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml new file mode 100644 index 000000000..74addf942 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + RECORDINGS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CAPTURE DEVICES + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Total Frames: + + + + File Size: + + + + + + + + + + + + + + + + + + + + / + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml.cs new file mode 100644 index 000000000..624840d66 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml.cs @@ -0,0 +1,28 @@ +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; + +namespace Tango.MachineStudio.DataCapture.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml new file mode 100644 index 000000000..d076eb631 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml.cs new file mode 100644 index 000000000..97389a1e5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/RecordingBarView.xaml.cs @@ -0,0 +1,28 @@ +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; + +namespace Tango.MachineStudio.DataCapture.Views +{ + /// + /// Interaction logic for RecordingBarView.xaml + /// + public partial class RecordingBarView : UserControl + { + public RecordingBarView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config new file mode 100644 index 000000000..4fd672b32 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 8ce8c64d0..148e4375c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -459,11 +459,6 @@ namespace Tango.MachineStudio.Developer.ViewModels /// public RelayCommand MediaTogglePlayPauseCommand { get; set; } - /// - /// Gets or sets the media load file command. - /// - public RelayCommand MediaLoadFileCommand { get; set; } - /// /// Gets or sets the media play pause command. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs new file mode 100644 index 000000000..b77619ac2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Integration.Operators; +using Tango.MachineStudio.Common.StudioApplication; +using Tango.PMR.Diagnostics; + +namespace Tango.MachineStudio.Common.Diagnostics +{ + /// + /// Represents the default diagnostics frame provider. + /// + /// + public class DefaultDiagnosticsFrameProvider : IDiagnosticsFrameProvider + { + /// + /// Disables the frame delivery from the current connected machine and enables the manual push frame method. + /// + public bool Disable { get; set; } + + /// + /// Occurs when a new data frame is available. + /// + public event EventHandler FrameReceived; + + /// + /// Initializes a new instance of the class. + /// + /// The application manager. + public DefaultDiagnosticsFrameProvider(IStudioApplicationManager applicationManager) + { + applicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; + } + + /// + /// Applications the manager connected machine changed. + /// + /// The sender. + /// The machine. + private void ApplicationManager_ConnectedMachineChanged(object sender, Integration.Services.IExternalBridgeClient machine) + { + if (machine != null) + { + (machine as MachineOperator).DiagnosticsDataAvailable += DefaultDiagnosticsFrameProvider_DiagnosticsDataAvailable; + } + } + + /// + /// Defaults the diagnostics frame provider diagnostics data available. + /// + /// The sender. + /// The frame. + private void DefaultDiagnosticsFrameProvider_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse frame) + { + if (!Disable) + { + OnFrameReceived(frame); + } + } + + /// + /// Push frames manual. (Only when Disable = true) + /// + /// The frame. + public void PushFrame(PushDiagnosticsResponse frame) + { + if (Disable) + { + OnFrameReceived(frame); + } + } + + /// + /// Raises the event. + /// + /// The frame. + protected virtual void OnFrameReceived(PushDiagnosticsResponse frame) + { + FrameReceived?.Invoke(this, frame); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs new file mode 100644 index 000000000..0d63b59b6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR.Diagnostics; + +namespace Tango.MachineStudio.Common.Diagnostics +{ + /// + /// Represents a tango machine diagnostics frame provider. + /// + public interface IDiagnosticsFrameProvider + { + /// + /// Occurs when a new data frame is available. + /// + event EventHandler FrameReceived; + + /// + /// Disables the frame delivery from the current connected machine and enables the manual push frame method. + /// + bool Disable { get; set; } + + /// + /// Push frames manual. (Only when Disable = true) + /// + /// The frame. + void PushFrame(PushDiagnosticsResponse frame); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/BarItem.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/BarItem.cs new file mode 100644 index 000000000..8d3cefa40 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/BarItem.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Tango.Core; + +namespace Tango.MachineStudio.Common.Notifications +{ + public class BarItem : ExtendedObject, IDisposable + { + private INotificationProvider _notificationProvider; + + public FrameworkElement Element { get; set; } + + public BarItem(INotificationProvider notificationProvider) + { + _notificationProvider = notificationProvider; + } + + /// + /// Removed this item from the queue. + /// + public void Pop() + { + _notificationProvider.PopBarItem(this); + } + + /// + /// Pushes this item to the queue. + /// + public void Push() + { + _notificationProvider.PushBarItem(this); + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() + { + Pop(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs index 8161ce885..e1b6275bd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs @@ -20,6 +20,11 @@ namespace Tango.MachineStudio.Common.Notifications /// ObservableCollection TaskItems { get; } + /// + /// Gets the collection of active bar items. + /// + ObservableCollection BarItems { get; } + /// /// Gets the current displayed task item. /// @@ -43,12 +48,32 @@ namespace Tango.MachineStudio.Common.Notifications /// TaskItem PushTaskItem(String message); + /// + /// Creates and push a new bar item from the specified framework element. + /// + /// The element. + /// + BarItem PushBarItem(FrameworkElement element); + + /// + /// Pushes the specified bar item. + /// + /// The bar item. + /// + BarItem PushBarItem(BarItem barItem); + /// /// Removed the specified task item from the queue. /// /// The task item. void PopTaskItem(TaskItem taskItem); + /// + /// Removed the specified bar item. + /// + /// The bar item. + void PopBarItem(BarItem barItem); + /// /// Creates a new instance of the specified View type and displays it as a modal dialog. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 20079ff68..ba4fbab84 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -83,7 +83,10 @@ + + + @@ -186,6 +189,10 @@ {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} Tango.Settings @@ -194,6 +201,10 @@ {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + {9652f972-2bd1-4283-99cb-fc6240434c17} Tango.Video diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs index 5aace7705..3aa9d4c88 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs @@ -24,7 +24,21 @@ namespace Tango.MachineStudio.Common.Video /// public DefaultVideoCaptureProvider() { - AvailableCaptureDevices = CaptureDevice.GetAvailableCaptureDevices().Select(device => new CaptureDevice() { Device = device }).ToObservableCollection(); + AvailableCaptureDevices = new ObservableCollection(); + + var availableDevices = CaptureDevice.GetAvailableCaptureDevices(); + + for (int i = 0; i < 3; i++) + { + if (i > availableDevices.Count - 1) + { + AvailableCaptureDevices.Add(new CaptureDevice() { Device = null }); + } + else + { + AvailableCaptureDevices.Add(new CaptureDevice() { Device = availableDevices[i] }); + } + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs index 31fb4b1e0..1ea22c587 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -30,6 +30,11 @@ namespace Tango.MachineStudio.UI.Notifications /// public ObservableCollection TaskItems { get; private set; } + /// + /// Gets the collection of active bar items. + /// + public ObservableCollection BarItems { get; private set; } + /// /// Gets a value indicating whether there are any queued task items. /// @@ -58,6 +63,7 @@ namespace Tango.MachineStudio.UI.Notifications public DefaultNotificationProvider() { TaskItems = new ObservableCollection(); + BarItems = new ObservableCollection(); } /// @@ -289,6 +295,39 @@ namespace Tango.MachineStudio.UI.Notifications RaisePropertyChanged(nameof(HasTaskItems)); } + /// + /// Pushes the specified bar item. + /// + /// The bar item. + /// + public BarItem PushBarItem(BarItem barItem) + { + BarItems.Add(barItem); + return barItem; + } + + /// + /// Creates and push a new bar item from the specified framework element. + /// + /// The element. + /// + public BarItem PushBarItem(FrameworkElement element) + { + BarItem item = new BarItem(this); + item.Element = element; + PushBarItem(item); + return item; + } + + /// + /// Removed the specified bar item. + /// + /// The bar item. + public void PopBarItem(BarItem barItem) + { + BarItems.Remove(barItem); + } + /// /// Shows a dialog with a text input field and returns the response. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index 4569d1439..f48561e40 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -292,6 +292,10 @@ {74e700b0-1156-4126-be40-ee450d3c3026} Tango.Transport + + {fc337a7f-1214-41d8-9992-78092a3b961e} + Tango.MachineStudio.DataCapture + {94f7acf8-55e1-4a02-b9bc-a818413fdbbf} Tango.MachineStudio.DB diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 7ee3d50d5..1907074c0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -5,6 +5,7 @@ using System; using Tango.Integration.Services; using Tango.Logging; using Tango.MachineStudio.Common.Authentication; +using Tango.MachineStudio.Common.Diagnostics; using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Navigation; using Tango.MachineStudio.Common.Notifications; @@ -53,6 +54,7 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Unregister(); SimpleIoc.Default.Unregister(); SimpleIoc.Default.Unregister(); + SimpleIoc.Default.Unregister(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); @@ -61,6 +63,7 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 7fe900dff..479052cc5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -18,7 +18,7 @@ - + - - + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs index e89e55651..770b222f4 100644 --- a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs +++ b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs @@ -63,6 +63,14 @@ namespace Tango.Integration.Diagnostics private set { _totalBytesRecorded = value; RaisePropertyChanged(nameof(TotalBytesRecorded)); } } + /// + /// Gets the recording time. + /// + public TimeSpan RecordingTime + { + get { return _stopWatch != null ? _stopWatch.Elapsed : TimeSpan.Zero; } + } + #endregion #region Public Methods @@ -140,6 +148,8 @@ namespace Tango.Integration.Diagnostics frame.Milliseconds = (int)_stopWatch.Elapsed.TotalMilliseconds; _frames.Enqueue(frame); + + RaisePropertyChanged(nameof(RecordingTime)); } /// diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 7d1339354..f5fe8c1c0 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.14 +VisualStudioVersion = 15.0.26430.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" EndProject @@ -125,6 +125,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Editors", "Tango.Edit EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Visuals", "Tango.Visuals\Tango.Visuals.csproj", "{CF7C0FF4-9440-42CF-83B8-C060772792D4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.DataCapture", "MachineStudio\Modules\Tango.MachineStudio.DataCapture\Tango.MachineStudio.DataCapture.csproj", "{FC337A7F-1214-41D8-9992-78092A3B961E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1625,6 +1627,36 @@ Global {CF7C0FF4-9440-42CF-83B8-C060772792D4}.Release|x64.Build.0 = Release|Any CPU {CF7C0FF4-9440-42CF-83B8-C060772792D4}.Release|x86.ActiveCfg = Release|Any CPU {CF7C0FF4-9440-42CF-83B8-C060772792D4}.Release|x86.Build.0 = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|ARM.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|ARM.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|ARM64.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|x64.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|x64.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|x86.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Debug|x86.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|Any CPU.Build.0 = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|ARM.ActiveCfg = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|ARM.Build.0 = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|ARM64.ActiveCfg = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|ARM64.Build.0 = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|x64.ActiveCfg = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|x64.Build.0 = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|x86.ActiveCfg = Release|Any CPU + {FC337A7F-1214-41D8-9992-78092A3B961E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1659,5 +1691,6 @@ Global {8A03ADC0-991B-4DA8-8A19-E1D03F92E81C} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} {37E4CEAB-B54B-451F-B535-04CF7DA9C459} = {EC62BC9C-F2FE-4333-B7E4-110E38D43958} {5B954D98-4020-4AC6-939F-C52B5646E8E6} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} + {FC337A7F-1214-41D8-9992-78092A3B961E} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} EndGlobalSection EndGlobal diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml index 403723a92..3d0a14c4e 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml @@ -18,7 +18,7 @@ - + IS ON -- cgit v1.3.1