From 178e25e4dba37decbcbc389955539997e0321df7 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Fri, 31 Jul 2020 19:28:46 +0300 Subject: Fixed total dye time formating on PPC and MS. --- .../Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs index 302c50e8e..30b2c83fd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs @@ -97,7 +97,7 @@ namespace Tango.MachineStudio.UI.ViewModels { var jobRuns = await db.JobRuns.Where(x => x.MachineGuid == ApplicationManager.Machine.Guid).Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToListAsync(); - TotalMachineWorkTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToString(@"hh\:mm\:ss"); + TotalMachineWorkTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); TotalMachineMeters = $"{meters.ToString("N0")} meters"; -- cgit v1.3.1 From af0cef3da965c7cf6f58faad51788816f001490e Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 1 Aug 2020 14:58:33 +0300 Subject: Fixed issue with wrong color catalog output due to liquid volumes not resetting. --- .../MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs | 3 ++- Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs index 0691ca6bd..464599452 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs @@ -13,7 +13,8 @@ namespace Tango.MachineStudio.UI.TFS { public IEnumerable GetSuggestions(string filter) { - return TangoIOC.Default.GetInstance().Project.Members.Where(x => x.AssignName.ToLower().Contains(filter.ToLower())); + var members = TangoIOC.Default.GetInstance().Project.Members; + return members.Where(x => x.AssignName.ToLower().Contains(filter.ToLower())); } } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 68bba48e6..0ae2086d3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2223,7 +2223,6 @@ namespace Tango.Integration.Operation { stop.SetLiquidVolumes(job.Machine.Configuration, job.Rml, processParameters); - if (stop.ColorCatalogsItem.Cyan > 0) { var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.LiquidType == LiquidTypes.Cyan); @@ -2235,7 +2234,6 @@ namespace Tango.Integration.Operation liquidVolume.Volume = stop.ColorCatalogsItem.Cyan; } - if (stop.ColorCatalogsItem.Magenta > 0) { var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.LiquidType == LiquidTypes.Magenta); @@ -2247,7 +2245,6 @@ namespace Tango.Integration.Operation liquidVolume.Volume = stop.ColorCatalogsItem.Magenta; } - if (stop.ColorCatalogsItem.Yellow > 0) { var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.LiquidType == LiquidTypes.Yellow); @@ -2259,7 +2256,6 @@ namespace Tango.Integration.Operation liquidVolume.Volume = stop.ColorCatalogsItem.Yellow; } - if (stop.ColorCatalogsItem.Black > 0) { var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.LiquidType == LiquidTypes.Black); -- cgit v1.3.1 From 10861ebf4891d02894a9cf6e8f94354067663765 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 2 Aug 2020 15:48:14 +0300 Subject: Fixed volumes out of range on RML module color conversion test. --- .../ViewModels/ColorConversionViewVM.cs | 5 +++-- .../Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs | 13 +++++++++++++ .../Visual_Studio/Tango.BL/Dispensing/DispensingCalcBase.cs | 5 +++++ 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs index d9ba419e0..95de19f42 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -111,6 +111,7 @@ namespace Tango.MachineStudio.RML.ViewModels Color = x.LiquidType.Color, Name = x.LiquidType.Name, LiquidType = x.LiquidType, + MaxNanoliterPerCentimeter = x.MaxNlPerCm, }).ToObservableCollection(); } @@ -309,7 +310,7 @@ namespace Tango.MachineStudio.RML.ViewModels } } - private double GetTotalMaximumLiquidVolumeLimit() + private double GetTotalMaximumLiquidNlPerCMLimit() { try { @@ -329,7 +330,7 @@ namespace Tango.MachineStudio.RML.ViewModels if (LiquidsCalibrationData == null || _prevent_inverse_conversion) return; //TODO: This is temporary because of out of range volumes. - if (LiquidVolumes.Where(x => x.LiquidType.HasPigment).Sum(x => x.Volume) > GetTotalMaximumLiquidVolumeLimit()) + if (LiquidVolumes.Where(x => x.LiquidType.HasPigment).Sum(x => x.NanoliterPerCentimeter) > GetTotalMaximumLiquidNlPerCMLimit()) { IsVolumesOutOfRange = true; return; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs index 7399d62af..27b811bb6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Dispensing; using Tango.BL.Entities; using Tango.Core; using Tango.SharedUI; @@ -47,5 +48,17 @@ namespace Tango.MachineStudio.RML.ViewModels get { return _liquidType; } set { _liquidType = value; RaisePropertyChangedAuto(); } } + + public double MaxNanoliterPerCentimeter { get; set; } + + public double NanoliterPerCentimeter + { + get + { + StandardColorDispensingCalc calc = new StandardColorDispensingCalc(); + return calc.CalculateNanoliterPerCentimeter(Volume, MaxNanoliterPerCentimeter); + } + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Dispensing/DispensingCalcBase.cs b/Software/Visual_Studio/Tango.BL/Dispensing/DispensingCalcBase.cs index dcca5817c..879f31619 100644 --- a/Software/Visual_Studio/Tango.BL/Dispensing/DispensingCalcBase.cs +++ b/Software/Visual_Studio/Tango.BL/Dispensing/DispensingCalcBase.cs @@ -29,6 +29,11 @@ namespace Tango.BL.Dispensing } } + public virtual double CalculateNanoliterPerCentimeter(double volume, double maxNanoliterPerCentimeter) + { + return (volume / 100d) * maxNanoliterPerCentimeter; + } + /// /// Calculates the required nanoliter per second. /// -- cgit v1.3.1 From 91d5be468e28266a4ae18ee3845f0cb3433dd898 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 4 Aug 2020 14:18:28 +0300 Subject: Reset Application & Firmware "Logs" tab even when machine connection is the same. Fixed issue on FileSystem download. Ignored issue with procedure error highlighting caused application error. Fixed issue when logout/login with different environment did not refreshed the list of available machines for connection. --- .../Tango.FSE.Firmware/ViewModels/LogsViewVM.cs | 11 +++---- .../Tango.FSE.PPCConsole/ViewModels/LogsViewVM.cs | 11 +++---- .../FileSystem/FileSystemHandler.cs | 27 ++++++++++++---- .../DefaultAuthenticationProvider.cs | 2 ++ .../ViewModels/MainViewVM.cs | 14 ++++---- .../Tango.Scripting.Editors/ScriptEditor.cs | 13 ++++++-- Software/Visual_Studio/Tango.Logging/FileLogger.cs | 2 ++ .../Visual_Studio/Tango.Logging/LogItemBase.cs | 12 +++++++ Software/Visual_Studio/Tango.Logging/LogManager.cs | 37 ++++++---------------- .../Tango.Logging/SessionFileLogger.cs | 2 ++ 10 files changed, 73 insertions(+), 58 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs index 2860f8c63..0195d24c1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs @@ -145,14 +145,11 @@ namespace Tango.FSE.Firmware.ViewModels private void MachineProvider_MachineConnected(object sender, MachineConnectedEventArgs e) { - if (e.DifferentFromPrevious) - { - _loaded = false; + _loaded = false; - if (MachineProvider.IsPPCAvailable && IsVisible) - { - LoadLogFiles(); - } + if (MachineProvider.IsPPCAvailable && IsVisible) + { + LoadLogFiles(); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/LogsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/LogsViewVM.cs index 30946ba0f..66270df7e 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/LogsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/LogsViewVM.cs @@ -147,14 +147,11 @@ namespace Tango.FSE.PPCConsole.ViewModels private void MachineProvider_MachineConnected(object sender, MachineConnectedEventArgs e) { - if (e.DifferentFromPrevious) - { - _loaded = false; + _loaded = false; - if (MachineProvider.ConnectionType.IsRemote() && IsVisible) - { - LoadLogFiles(); - } + if (MachineProvider.IsPPCAvailable && IsVisible) + { + LoadLogFiles(); } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs index b1f4446d2..ab6a788f2 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs @@ -15,6 +15,7 @@ namespace Tango.FSE.Common.FileSystem private System.Timers.Timer _transferRateTimer; private double _lastPosition; private TaskCompletionSource _completionSource; + private bool _completed; public event EventHandler StatusChanged; public event EventHandler> ProgressChanged; @@ -134,21 +135,33 @@ namespace Tango.FSE.Common.FileSystem internal void RaiseFailed(Exception exception) { - Status = FileSystemHandlerStatus.Failed; - FailedException = exception; - _completionSource.SetException(exception); + if (!_completed) + { + _completed = true; + Status = FileSystemHandlerStatus.Failed; + FailedException = exception; + _completionSource.SetException(exception); + } } internal void RaiseAborted() { - Status = FileSystemHandlerStatus.Aborted; - _completionSource.SetException(new OperationCanceledException("File system operation aborted.")); + if (!_completed) + { + _completed = true; + Status = FileSystemHandlerStatus.Aborted; + _completionSource.SetException(new OperationCanceledException("File system operation aborted.")); + } } internal void RaiseCompleted() { - Status = FileSystemHandlerStatus.Completed; - _completionSource.SetResult(Status); + if (!_completed) + { + _completed = true; + Status = FileSystemHandlerStatus.Completed; + _completionSource.SetResult(Status); + } } public void Abort() diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Authentication/DefaultAuthenticationProvider.cs index 14997cd32..309839831 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Authentication/DefaultAuthenticationProvider.cs @@ -237,6 +237,8 @@ namespace Tango.FSE.UI.Authentication _tokenRefreshTimer.Stop(); + MemoryCacheManager.Default.ClearAll(); + await NavigationManager.NavigateWithObject(NavigationView.LoginView, new LoginViewVM.NavigationObject() { IsLoggingOut = true, 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 01def8679..40710ea21 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 @@ -1709,12 +1709,12 @@ namespace Tango.MachineStudio.Developer.ViewModels { try { - LogManager.Log(String.Format("Uploading process parameters table {0}...", SelectedProcessParametersTable.Name)); + LogManager.Log($"Uploading process parameters table {SelectedProcessParametersTable.Name}..."); await MachineOperator.UploadProcessParameters(SelectedProcessParametersTable); } catch (Exception ex) { - LogManager.LogFormat(ex, "Failed to upload process parameters table {0}", SelectedProcessParametersTable.Name); + LogManager.Log(ex, $"Failed to upload process parameters table {SelectedProcessParametersTable.Name}"); _notification.ShowError("Failed to upload the selected process parameters." + Environment.NewLine + ex.Message); } } @@ -2189,7 +2189,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (ActiveJob != null) { - LogManager.LogFormat("Adding new segment to job {0}...", ActiveJob.Name); + LogManager.Log($"Adding new segment to job {ActiveJob.Name}..."); Segment seg = new Segment(); seg.Job = ActiveJob; seg.Name = "SEGMENT"; @@ -2342,7 +2342,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (SelectedSegment != null) { - LogManager.LogFormat("Adding new brush stop to segment...", SelectedSegment.SegmentIndex.ToString()); + LogManager.Log($"Adding new brush stop to segment '{SelectedSegment.SegmentIndex}'..."); var stop = new BrushStop(); @@ -2373,7 +2373,7 @@ namespace Tango.MachineStudio.Developer.ViewModels /// private void DuplicateSelectedBrushStops() { - LogManager.LogFormat("Duplicating {0} brush stops...", SelectedBrushStops.Count); + LogManager.Log($"Duplicating {SelectedBrushStops.Count} brush stops..."); foreach (var stop in SelectedBrushStops.OrderBy(x => x.StopIndex)) { @@ -2391,7 +2391,7 @@ namespace Tango.MachineStudio.Developer.ViewModels /// private void DuplicateSelectedSegments() { - LogManager.LogFormat("Duplicating {0} segments...", SelectedSegments.Count); + LogManager.Log($"Duplicating {SelectedSegments.Count} segments..."); int start_index = SelectedSegments.Max(x => x.SegmentIndex); @@ -2419,7 +2419,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { CanWork = false; - LogManager.LogFormat("Duplicating {0} jobs...", SelectedJobs.Count); + LogManager.Log($"Duplicating {SelectedJobs.Count} jobs..."); int index = SelectedMachine.Jobs.Max(x => x.JobIndex); diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs index 0e32af6ed..a3a682833 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs @@ -2458,9 +2458,16 @@ namespace Tango.Scripting.Editors public void HighlighError(int position, int length) { - ITextMarker marker = errorMarkerService.Create(position, length); - marker.MarkerTypes = TextMarkerTypes.SquigglyUnderline; - marker.MarkerColor = Colors.Red; + try + { + ITextMarker marker = errorMarkerService.Create(position, length); + marker.MarkerTypes = TextMarkerTypes.SquigglyUnderline; + marker.MarkerColor = Colors.Red; + } + catch (Exception ex) + { + Debug.WriteLine($"Error highlighting script error.\n{ex.ToString()}"); + } } public void ClearErrors() diff --git a/Software/Visual_Studio/Tango.Logging/FileLogger.cs b/Software/Visual_Studio/Tango.Logging/FileLogger.cs index 0839a5ee7..041b56be4 100644 --- a/Software/Visual_Studio/Tango.Logging/FileLogger.cs +++ b/Software/Visual_Studio/Tango.Logging/FileLogger.cs @@ -138,6 +138,8 @@ namespace Tango.Logging /// The output. public void OnLog(LogItemBase output) { + if (output.SkipFileLogging) return; + try { if (DateTime.Now.Date > _logFileTimeDate.Date) diff --git a/Software/Visual_Studio/Tango.Logging/LogItemBase.cs b/Software/Visual_Studio/Tango.Logging/LogItemBase.cs index 01d520f6a..944f61130 100644 --- a/Software/Visual_Studio/Tango.Logging/LogItemBase.cs +++ b/Software/Visual_Studio/Tango.Logging/LogItemBase.cs @@ -24,10 +24,22 @@ namespace Tango.Logging /// public Object LogObject { + get { return _logObject; } set { _logObject = value; } } + [NonSerialized] + private bool _skipFileLogging; + /// + /// Gets or sets a value indicating whether this log should not be written to a file. + /// + public bool SkipFileLogging + { + get { return _skipFileLogging; } + set { _skipFileLogging = value; } + } + /// /// Gets or sets the caller method adding the exception. /// diff --git a/Software/Visual_Studio/Tango.Logging/LogManager.cs b/Software/Visual_Studio/Tango.Logging/LogManager.cs index bbc6baf57..55264164a 100644 --- a/Software/Visual_Studio/Tango.Logging/LogManager.cs +++ b/Software/Visual_Studio/Tango.Logging/LogManager.cs @@ -102,9 +102,9 @@ namespace Tango.Logging /// /// Exception. /// Error description. - public Exception Log(Exception e, String description = null, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) + public Exception Log(Exception e, String description = null, bool skipFileLogging = false, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) { - return Log(e, LogCategory.Error, description, caller, file, lineNumber); + return Log(e, LogCategory.Error, description, skipFileLogging, caller, file, lineNumber); } /// @@ -112,7 +112,7 @@ namespace Tango.Logging /// /// Exception. /// Error description. - public Exception Log(Exception e, LogCategory category, String description = null, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) + public Exception Log(Exception e, LogCategory category, String description = null, bool skipFileLogging = false, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) { if (!Categories.Contains(category)) return e; @@ -125,54 +125,36 @@ namespace Tango.Logging log.Category = category; log.Description = description; log.Message = log.Description + Environment.NewLine + log.Exception.FlattenException(); + log.SkipFileLogging = skipFileLogging; AppendLog(log); return e; } - /// - /// Add new exception log item. - /// - /// Exception. - /// Error description. - public Exception LogFormat(Exception e, String description, object argument, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) - { - return Log(e, LogCategory.Error, String.Format(description, argument), caller, file, lineNumber); - } - - /// - /// Add new message log item. - /// - /// Message. - public String LogFormat(String message, object argument, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) - { - return Log(String.Format(message, argument), LogCategory.Info, null, caller, file, lineNumber); - } - /// /// Add new message log item. /// /// Message. - public String Log(String message, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) + public String Log(String message, bool skipFileLogging = false, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) { - return Log(message, LogCategory.Info, null, caller, file, lineNumber); + return Log(message, LogCategory.Info, null, skipFileLogging, caller, file, lineNumber); } /// /// Add new message log item. /// /// Message. - public String Log(String message, LogCategory category, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) + public String Log(String message, LogCategory category, bool skipFileLogging = false, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) { - return Log(message, category, null, caller, file, lineNumber); + return Log(message, category, null, skipFileLogging, caller, file, lineNumber); } /// /// Add new message log item. /// /// Message. - public String Log(String message, LogCategory category, Object logObject, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) + public String Log(String message, LogCategory category, Object logObject, bool skipFileLogging = false, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0) { if (!Categories.Contains(category)) return message; @@ -184,6 +166,7 @@ namespace Tango.Logging log.Category = category; log.Message = message; log.LogObject = logObject; + log.SkipFileLogging = skipFileLogging; AppendLog(log); diff --git a/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs b/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs index 4e378bfbf..efe74c899 100644 --- a/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs +++ b/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs @@ -102,6 +102,8 @@ namespace Tango.Logging /// The output. public void OnLog(LogItemBase output) { + if (output.SkipFileLogging) return; + if (_inInSession) { try -- cgit v1.3.1