Beispiel #1
0
        internal void UpdateBenchmarkData(UnitInfoModel currentUnitInfo, UnitInfoModel[] parsedUnits, int currentUnitIndex)
        {
            var foundCurrent   = false;
            var processUpdates = false;

            foreach (int index in UnitIndexIterator(currentUnitIndex, parsedUnits.Length))
            {
                var unitInfoModel = parsedUnits[index];

                // If Current has not been found, check the nextUnitIndex
                // or try to match the Current Project and Raw Download Time
                if (unitInfoModel != null && processUpdates == false && (index == currentUnitIndex || currentUnitInfo.UnitInfoData.IsSameUnitAs(unitInfoModel.UnitInfoData)))
                {
                    foundCurrent   = true;
                    processUpdates = true;
                }

                if (processUpdates)
                {
                    int previousFramesComplete = 0;
                    if (foundCurrent)
                    {
                        // current frame has already been recorded, increment to the next frame
                        previousFramesComplete = currentUnitInfo.FramesComplete + 1;
                        foundCurrent           = false;
                    }

                    // Even though the current UnitInfoLogic has been found in the parsed UnitInfoLogic array doesn't
                    // mean that all entries in the array will be present.  See TestFiles\SMP_12\FAHlog.txt.
                    if (unitInfoModel != null)
                    {
                        // Update benchmarks
                        BenchmarkService.UpdateData(unitInfoModel.UnitInfoData, previousFramesComplete, unitInfoModel.FramesComplete);
                        // Update history database
                        UpdateUnitInfoDatabase(unitInfoModel);
                    }
                }
            }
        }
 internal void UpdateBenchmarkData(UnitInfoModel currentUnitInfo, IEnumerable <UnitInfoModel> parsedUnits, int currentUnitIndex)
 {
     foreach (var unitInfoModel in parsedUnits.Where(x => x != null))
     {
         if (currentUnitInfo.UnitInfoData.IsSameUnitAs(unitInfoModel.UnitInfoData))
         {
             // found the current unit
             // current frame has already been recorded, increment to the next frame
             int previousFramesComplete = currentUnitInfo.FramesComplete + 1;
             // Update benchmarks
             BenchmarkService.UpdateData(unitInfoModel.UnitInfoData, previousFramesComplete, unitInfoModel.FramesComplete);
         }
         // Update history database
         if (unitInfoModel.UnitInfoData.UnitResult != WorkUnitResult.Unknown)
         {
             UpdateUnitInfoDatabase(unitInfoModel);
         }
         //// used when there is no currentUnitInfo
         //else if (unitInfoLogic.UnitInfoData.QueueIndex == currentUnitIndex)
         //{
         //   BenchmarkCollection.UpdateData(unitInfoLogic.UnitInfoData, 0, unitInfoLogic.FramesComplete);
         //}
     }
 }