From fadf83a50071ffba21db05eceff10c51c18f5fb3 Mon Sep 17 00:00:00 2001 From: Roy Date: Fri, 23 Feb 2018 12:03:18 +0200 Subject: Machine Studio Update & Publish. Improved user roles & permissions structure. Added permission for version publish. --- .../Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs index ee650dc13..b138af4f3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs @@ -69,7 +69,7 @@ namespace Tango.MachineStudio.DataCapture { get { - return Permissions.RunTechnicianModule; + return Permissions.RunDataCaptureModule; } } -- cgit v1.3.1 From 5d883d4f6bd18ca80fe26b25ed04dc01d7544371 Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 25 Feb 2018 00:57:29 +0200 Subject: Improved data capturing seeking. Fixed possible issue in diagnostics file recorder. Some design improvement. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../ViewModels/MainViewVM.cs | 57 +++++++++++++++++ .../Views/MainView.xaml | 47 ++++++++++---- .../Views/PlayingBarView.xaml | 12 +++- .../Tango.MachineStudio.UI/Views/MainView.xaml | 71 ++++++++++++++++++--- .../Diagnostics/DiagnosticsFileRecorder.cs | 5 +- 7 files changed, 169 insertions(+), 23 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 0cd506696..683e47294 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 c5851623a..6afb62f52 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.DataCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs index 269007dac..840863752 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs @@ -122,6 +122,26 @@ namespace Tango.MachineStudio.DataCapture.ViewModels /// public RelayCommand MediaPlayPauseCommand { get; set; } + /// + /// Gets or sets the media seek forward command. + /// + public RelayCommand MediaSeekForwardCommand { get; set; } + + /// + /// Gets or sets the media seek backward command. + /// + public RelayCommand MediaSeekBackwardCommand { get; set; } + + /// + /// Gets or sets the media seek command. + /// + public RelayCommand MediaSeekCommand { get; set; } + + /// + /// Gets or sets the media seek hold command. + /// + public RelayCommand MediaSeekHoldCommand { get; set; } + #endregion #region Constructors @@ -148,6 +168,10 @@ namespace Tango.MachineStudio.DataCapture.ViewModels MediaRecordingCommand = new RelayCommand(StartDiagnosticsRecording, () => !Recorder.IsRecording && MachineOperator != null && !Player.IsPlaying); MediaStopCommand = new RelayCommand(StopRecorderOrPlayer, () => Recorder.IsRecording || Player.IsPlaying); MediaPlayPauseCommand = new RelayCommand(DiagnosticsTogglePlayPause, () => !Recorder.IsRecording && SelectedRecording != null); + MediaSeekForwardCommand = new RelayCommand(MediaSeekForward, () => !Recorder.IsRecording && Player.IsPlaying); + MediaSeekBackwardCommand = new RelayCommand(MediaSeekBackward, () => !Recorder.IsRecording && Player.IsPlaying); + MediaSeekCommand = new RelayCommand(MediaSeek, (x) => Player.IsPlaying); + MediaSeekHoldCommand = new RelayCommand(MediaSeekHold,() => Player.IsPlaying); _recordingsFolder = Path.Combine(SettingsManager.DefaultFolder, "Recordings"); Directory.CreateDirectory(_recordingsFolder); @@ -321,6 +345,39 @@ namespace Tango.MachineStudio.DataCapture.ViewModels InvalidateRelayCommands(); } + private void MediaSeekBackward() + { + if (Player.IsPlaying) + { + Player.Seek(Player.CurrentFrame - 200); + } + } + + private void MediaSeekForward() + { + if (Player.IsPlaying) + { + Player.Seek(Player.CurrentFrame + 200); + } + } + + private void MediaSeek(double frame) + { + if (Player != null) + { + Player.Seek((int)frame); + Player.Play(); + } + } + + private void MediaSeekHold() + { + if (Player != null) + { + Player.Pause(); + } + } + #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 index 72f7da03d..e3f9d380a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml @@ -3,6 +3,7 @@ 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:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" @@ -161,7 +162,7 @@ - + Total Frames: @@ -175,7 +176,7 @@ - - - - - - - - / - - + + - + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml index 3e76ce6ef..ee423e676 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml @@ -3,6 +3,7 @@ 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:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" @@ -47,7 +48,16 @@ - + + + + + + + + + + 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 19c0c47df..f2c9ddba5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -47,7 +47,25 @@ + + + + , + + + + + + + + + + + + ... + + @@ -122,14 +140,39 @@ x:Name="MenuToggleButton"/> - + - - - @@ -233,8 +276,8 @@ - Welcome to Machine Studio - Select Your Studio Module... + Welcome to Machine Studio + The below modules are displayed according to your user roles and permissions. @@ -267,8 +310,18 @@ - + diff --git a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs index 770b222f4..9f62ae355 100644 --- a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs +++ b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs @@ -233,7 +233,10 @@ namespace Tango.Integration.Diagnostics _dataFileStream.Dispose(); - _stopCompletionSource.SetResult(new object()); + if (_stopCompletionSource != null) + { + _stopCompletionSource.SetResult(new object()); + } } #endregion -- cgit v1.3.1