From 39d2d7ff77e3ac949db6d9adde861275401e5e57 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 13 Feb 2018 18:35:58 +0200 Subject: Added embedded version information to technician view. --- .../ViewModels/MachineTechViewVM.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index c6f72be3e..2a55d12c6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -37,6 +37,8 @@ namespace Tango.MachineStudio.Technician.ViewModels private static object _elementsLock = new object(); private String _lastTechProjectFile; private INotificationProvider _notification; + private DateTime _lastDiagnosticsResponseUpdate; + private const int MIN_DIAGNOSTICS_UPDATE_MILI = 500; #region Properties @@ -110,6 +112,29 @@ namespace Tango.MachineStudio.Technician.ViewModels set { _hideMenu = value; RaisePropertyChangedAuto(); } } + private PushDiagnosticsResponse _currentDiagnosticsResponse; + /// + /// Gets or sets the current diagnostics response. + /// + public PushDiagnosticsResponse CurrentDiagnosticsResponse + { + get { return _currentDiagnosticsResponse; } + set { _currentDiagnosticsResponse = value; RaisePropertyChanged(nameof(CurrentDiagnosticsResponse)); } + } + + private int _currentDiagnosticsResponseSize; + /// + /// Gets or sets the size of the current diagnostics response. + /// + /// + /// The size of the current diagnostics response. + /// + public int CurrentDiagnosticsResponseSize + { + get { return _currentDiagnosticsResponseSize; } + set { _currentDiagnosticsResponseSize = value; RaisePropertyChanged(nameof(CurrentDiagnosticsResponseSize)); } + } + #endregion #region Commands @@ -192,6 +217,13 @@ namespace Tango.MachineStudio.Technician.ViewModels private void PopulateDiagnosticsData(PushDiagnosticsResponse data) { + if (DateTime.Now > _lastDiagnosticsResponseUpdate.AddMilliseconds(MIN_DIAGNOSTICS_UPDATE_MILI)) + { + CurrentDiagnosticsResponse = data; + _lastDiagnosticsResponseUpdate = DateTime.Now; + CurrentDiagnosticsResponseSize = data.CalculateSize(); + } + lock (_elementsLock) { var elements = Elements.ToList(); -- cgit v1.3.1