Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.5 KiB

  1. #ifdef _DEBUG
  2. #define new DEBUG_NEW
  3. #endif
  4. //////////////////////////////////////////////////////////////////////
  5. // CompareTo
  6. //////////////////////////////////////////////////////////////////////
  7. inline int CHMStatistics::CompareTo(CStatistics* pStat)
  8. {
  9. CHMStatistics* pHMStat = (CHMStatistics*)pStat;
  10. CTime time1 = m_st;
  11. CTime time2 = pHMStat->m_st;
  12. return time1 == time2 &&
  13. m_iNumberNormals == pHMStat->m_iNumberNormals &&
  14. m_iNumberWarnings == pHMStat->m_iNumberWarnings &&
  15. m_iNumberCriticals == pHMStat->m_iNumberCriticals &&
  16. m_iNumberUnknowns == pHMStat->m_iNumberUnknowns;
  17. }
  18. //////////////////////////////////////////////////////////////////////
  19. // Result Pane Item Members
  20. //////////////////////////////////////////////////////////////////////
  21. inline CHMEventResultsPaneItem* CHMStatistics::CreateResultsPaneItem(CResultsPaneView* pView)
  22. {
  23. ASSERT(pView);
  24. if( ! pView )
  25. {
  26. return NULL;
  27. }
  28. CHMEventResultsPaneItem* pItem = new CHMEventResultsPaneItem;
  29. pItem->SetDateTimeColumn(HMLV_STATS_DTIME_INDEX);
  30. CStringArray saNames;
  31. CUIntArray uiaIconResIds;
  32. CString sValue;
  33. saNames.Add(GetStatLocalTime());
  34. sValue.Format(_T("%d"),m_iNumberNormals);
  35. saNames.Add(sValue);
  36. sValue.Format(_T("%d"),m_iNumberWarnings);
  37. saNames.Add(sValue);
  38. sValue.Format(_T("%d"),m_iNumberCriticals);
  39. saNames.Add(sValue);
  40. sValue.Format(_T("%d"),m_iNumberUnknowns);
  41. saNames.Add(sValue);
  42. pItem->m_st = m_st;
  43. pItem->SetDisplayNames(saNames);
  44. pItem->SetToStatsPane();
  45. pItem->Create(pView);
  46. return pItem;
  47. }
  48. //////////////////////////////////////////////////////////////////////
  49. // Graph Members
  50. //////////////////////////////////////////////////////////////////////
  51. inline void CHMStatistics::UpdateGraph(_DHMGraphView* pGraphView)
  52. {
  53. // v-marfin : As long as there is no graph view remove the assert
  54. // since it is getting in the way of debugging.
  55. //ASSERT(pGraphView);
  56. if( ! pGraphView )
  57. {
  58. return;
  59. }
  60. long lStyle = pGraphView->GetStyle();
  61. if( lStyle & HMGVS_CURRENT )
  62. {
  63. pGraphView->InsertCurrentGroupStats(m_sName,m_iNumberNormals,m_iNumberWarnings,m_iNumberCriticals,m_iNumberUnknowns);
  64. }
  65. if( lStyle & HMGVS_HISTORIC )
  66. {
  67. CString sLocalTime = GetStatLocalTime();
  68. int iIndex = sLocalTime.Find(_T(" "));
  69. if( iIndex != -1 )
  70. {
  71. sLocalTime = sLocalTime.Right(sLocalTime.GetLength()-iIndex-1);
  72. }
  73. pGraphView->InsertHistoricGroupStats(m_sName,sLocalTime,m_iNumberNormals,m_iNumberWarnings,m_iNumberCriticals,m_iNumberUnknowns);
  74. }
  75. }