/// <summary> /// Get a list of Log Lines that correspond to the given Queue Index and ProjectInfo. /// </summary> /// <param name="queueIndex">The Queue Index</param> /// <param name="projectInfo">Project (R/C/G) to Match</param> public IList <LogLine> GetLogLinesForQueueIndex(int queueIndex, IProjectInfo projectInfo) { // walk backwards through the ClientRunList and then backward // through the UnitIndexes list. Find the first (really last // because we're itterating in reverse) UnitIndex that matches // the given queueIndex. for (int i = ClientRunList.Count - 1; i >= 0; i--) { for (int j = ClientRunList[i].UnitIndexes.Count - 1; j >= 0; j--) { // if a match is found if (ClientRunList[i].UnitIndexes[j].QueueIndex == queueIndex) { int start = ClientRunList[i].UnitIndexes[j].StartIndex; int end = ClientRunList[i].UnitIndexes[j].EndIndex; var logLines = LogLineList.WhereLineIndex(start, end); var logLinesIndexOnly = logLines.Filter(LogFilterType.UnitIndex, queueIndex); var info = logLinesIndexOnly.FirstProjectInfoOrDefault(); if (info != null && info.EqualsProject(projectInfo)) { return(logLinesIndexOnly.ToList().AsReadOnly()); } continue; } } } return(null); }
/// <summary> /// Get a list of Log Lines that correspond to the given Queue Index. /// </summary> /// <param name="queueIndex">The Queue Index (0-9)</param> public IList <LogLine> GetLogLinesForQueueIndex(int queueIndex) { // walk backwards through the ClientRunList and then backward // through the UnitQueueIndex list. Find the first (really last // because we're itterating in reverse) UnitQueueIndex that matches // the given queueIndex. for (int i = ClientRunList.Count - 1; i >= 0; i--) { for (int j = ClientRunList[i].UnitIndexes.Count - 1; j >= 0; j--) { // if a match is found if (ClientRunList[i].UnitIndexes[j].QueueIndex == queueIndex) { int start = ClientRunList[i].UnitIndexes[j].StartIndex; int end = DetermineEndPosition(i, j) - 1; return(LogLineList.WhereLineIndex(start, end).ToList().AsReadOnly()); } } } return(null); }