Major upgrade
This commit is contained in:
@@ -16,9 +16,9 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using Raytheon.Common;
|
||||
using System.Threading;
|
||||
using NLog;
|
||||
|
||||
namespace BitMeasurementManagerLib
|
||||
{
|
||||
@@ -34,6 +34,7 @@ namespace BitMeasurementManagerLib
|
||||
private BitMessageIDs _messageIds;
|
||||
private Dictionary<uint, List<BitConfigurableMessage>> _msgList;
|
||||
private Dictionary<uint, AutoResetEvent> _receivedMsgEvents;
|
||||
private readonly ILogger _logger;
|
||||
#endregion
|
||||
|
||||
#region PrivateFuctions
|
||||
@@ -43,6 +44,8 @@ namespace BitMeasurementManagerLib
|
||||
/// </summary>
|
||||
private BitMsgRxBuffer(BitMessageIDs messageIds)
|
||||
{
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
_messageIds = messageIds;
|
||||
|
||||
_msgList = new Dictionary<uint, List<BitConfigurableMessage>>();
|
||||
@@ -88,17 +91,17 @@ namespace BitMeasurementManagerLib
|
||||
|
||||
if (shouldWeDeleteOthers == true)
|
||||
{
|
||||
ErrorLogger.Instance().Write("BitMsgRxBuffer::AddMsg() - clearing list for " + msgId.ToString(), ErrorLogger.LogLevel.INFO);
|
||||
_logger.Debug("clearing list for " + msgId.ToString());
|
||||
ClearList(msgId);
|
||||
}
|
||||
|
||||
if (_msgList.ContainsKey(msgId) == false)
|
||||
{
|
||||
ErrorLogger.Instance().Write("BitMsgRxBuffer::AddMsg() - creating new list for " + msgId.ToString(), ErrorLogger.LogLevel.INFO);
|
||||
_logger.Debug("creating new list for " + msgId.ToString());
|
||||
_msgList[msgId] = new List<BitConfigurableMessage>();
|
||||
}
|
||||
|
||||
ErrorLogger.Instance().Write("BitMsgRxBuffer::AddMsg() - Adding " + msgId.ToString() + " to the list", ErrorLogger.LogLevel.INFO);
|
||||
_logger.Debug("Adding " + msgId.ToString() + " to the list");
|
||||
_msgList[msgId].Add(msg);
|
||||
|
||||
_receivedMsgEvents[msgId].Set();
|
||||
|
||||
Reference in New Issue
Block a user