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.

170 lines
4.1 KiB

  1. // 04/09/00 v-marfin 63119 : converted m_iCurrent to string
  2. #ifdef _DEBUG
  3. #define new DEBUG_NEW
  4. #endif
  5. //////////////////////////////////////////////////////////////////////
  6. // Equivalency operator
  7. //////////////////////////////////////////////////////////////////////
  8. inline int CDataPointStatistics::CompareTo(CStatistics* pStat)
  9. {
  10. CDataPointStatistics* pDPStat = (CDataPointStatistics*)pStat;
  11. CTime time1 = m_st;
  12. CTime time2 = pDPStat->m_st;
  13. return time1 == time2 &&
  14. m_sPropertyName == pDPStat->m_sPropertyName &&
  15. m_sInstanceName == pDPStat->m_sInstanceName &&
  16. // 63119 m_iCurrent == pDPStat->m_iCurrent &&
  17. m_strCurrent == pDPStat->m_strCurrent && // 63119
  18. m_iMin == pDPStat->m_iMin &&
  19. m_iMax == pDPStat->m_iMax &&
  20. m_iAvg == pDPStat->m_iAvg;
  21. }
  22. //////////////////////////////////////////////////////////////////////
  23. // Copy
  24. //////////////////////////////////////////////////////////////////////
  25. inline CStatistics* CDataPointStatistics::Copy()
  26. {
  27. CDataPointStatistics* pCopy = new CDataPointStatistics;
  28. CopyMemory(&(pCopy->m_st),&m_st,sizeof(SYSTEMTIME));
  29. pCopy->m_sPropertyName = m_sPropertyName;
  30. pCopy->m_sInstanceName = m_sInstanceName;
  31. // 63119 pCopy->m_iCurrent = m_iCurrent;
  32. pCopy->m_strCurrent = m_strCurrent; // 63119
  33. pCopy->m_iMin = m_iMin;
  34. pCopy->m_iMax = m_iMax;
  35. pCopy->m_iAvg = m_iAvg;
  36. return pCopy;
  37. }
  38. //////////////////////////////////////////////////////////////////////
  39. // Result Pane Item Members
  40. //////////////////////////////////////////////////////////////////////
  41. inline CHMEventResultsPaneItem* CDataPointStatistics::CreateResultsPaneItem(CResultsPaneView* pView)
  42. {
  43. ASSERT(pView);
  44. if( ! pView )
  45. {
  46. return NULL;
  47. }
  48. CHMEventResultsPaneItem* pItem = new CHMEventResultsPaneItem;
  49. pItem->SetDateTimeColumn(7);
  50. CStringArray saNames;
  51. CUIntArray uiaIconResIds;
  52. CString sValue;
  53. saNames.Add(m_sPropertyName);
  54. saNames.Add(m_sInstanceName);
  55. /* 63119 sValue.Format(_T("%d"),m_iCurrent);
  56. saNames.Add(sValue);*/
  57. saNames.Add(m_strCurrent); // 63119
  58. sValue.Format(_T("%d"),m_iMin);
  59. saNames.Add(sValue);
  60. sValue.Format(_T("%d"),m_iMax);
  61. saNames.Add(sValue);
  62. sValue.Format(_T("%d"),m_iAvg);
  63. saNames.Add(sValue);
  64. saNames.Add(GetStatLocalTime());
  65. pItem->m_st = m_st;
  66. pItem->SetDisplayNames(saNames);
  67. pItem->SetToStatsPane();
  68. pItem->Create(pView);
  69. return pItem;
  70. }
  71. inline void CDataPointStatistics::SetResultsPaneItem(CHMEventResultsPaneItem* pItem)
  72. {
  73. CStringArray saNames;
  74. CUIntArray uiaIconResIds;
  75. CString sValue;
  76. saNames.Add(m_sPropertyName);
  77. saNames.Add(m_sInstanceName);
  78. /* 63119 sValue.Format(_T("%d"),m_iCurrent);
  79. saNames.Add(sValue);*/
  80. saNames.Add(m_strCurrent); // 63119
  81. sValue.Format(_T("%d"),m_iMin);
  82. saNames.Add(sValue);
  83. sValue.Format(_T("%d"),m_iMax);
  84. saNames.Add(sValue);
  85. sValue.Format(_T("%d"),m_iAvg);
  86. saNames.Add(sValue);
  87. saNames.Add(GetStatLocalTime());
  88. pItem->m_st = m_st;
  89. pItem->SetDisplayNames(saNames);
  90. }
  91. //////////////////////////////////////////////////////////////////////
  92. // Graph Members
  93. //////////////////////////////////////////////////////////////////////
  94. inline void CDataPointStatistics::UpdateGraph(_DHMGraphView* pGraphView)
  95. {
  96. // v-marfin : Graph view is removed so comment this out to assist
  97. // in debugging without having to deal with the assert all the time
  98. //ASSERT(pGraphView);
  99. /* 63119 if( ! pGraphView )
  100. {
  101. return;
  102. }
  103. long lStyle = pGraphView->GetStyle();
  104. ASSERT(lStyle & HMGVS_ELEMENT);
  105. if( lStyle & HMGVS_CURRENT )
  106. {
  107. pGraphView->InsertCurrentElementStats(m_sPropertyName,
  108. m_sInstanceName,
  109. m_iCurrent,
  110. m_iMin,
  111. m_iMax,
  112. m_iAvg);
  113. }
  114. if( lStyle & HMGVS_HISTORIC )
  115. {
  116. CString sLocalTime = GetStatLocalTime();
  117. int iIndex = sLocalTime.Find(_T(" "));
  118. if( iIndex != -1 )
  119. {
  120. sLocalTime = sLocalTime.Right(sLocalTime.GetLength()-iIndex-1);
  121. }
  122. pGraphView->InsertHistoricElementStats( m_sPropertyName,
  123. m_sInstanceName,
  124. sLocalTime,
  125. m_iCurrent);
  126. }*/
  127. }