Example #1
0
        MarkerData GetRightMarker(ComparisonTreeViewItem item)
        {
            if (item.data.rightIndex < 0)
            {
                return(null);
            }

            List <MarkerData> markers = m_Right.GetMarkers();

            if (item.data.rightIndex >= markers.Count)
            {
                return(null);
            }

            return(markers[item.data.rightIndex]);
        }
Example #2
0
 float Diff(ComparisonTreeViewItem item)
 {
     return(RightMedian(item) - LeftMedian(item));
 }
Example #3
0
 int RightMedianFrameIndex(ComparisonTreeViewItem item)
 {
     return(MarkerData.GetMedianFrameIndex(GetRightMarker(item)));
 }
Example #4
0
 float LeftMedian(ComparisonTreeViewItem item)
 {
     return(MarkerData.GetMsMedian(GetLeftMarker(item)));
 }
Example #5
0
        protected override TreeViewItem BuildRoot()
        {
            int idForhiddenRoot      = -1;
            int depthForHiddenRoot   = -1;
            ProfileTreeViewItem root = new ProfileTreeViewItem(idForhiddenRoot, depthForHiddenRoot, "root", null);

            List <string> nameFilters  = m_ProfileAnalyzerWindow.GetNameFilters();
            List <string> nameExcludes = m_ProfileAnalyzerWindow.GetNameExcludes();

            float  minDiff          = float.MaxValue;
            float  maxDiff          = 0.0f;
            double totalMinDiff     = float.MaxValue;
            double totalMaxDiff     = 0.0f;
            float  countMinDiff     = float.MaxValue;
            float  countMaxDiff     = 0.0f;
            float  countMeanMinDiff = float.MaxValue;
            float  countMeanMaxDiff = 0.0f;

            for (int index = 0; index < m_Pairings.Count; ++index)
            {
                var pairing = m_Pairings[index];
                if (nameFilters.Count > 0)
                {
                    if (!m_ProfileAnalyzerWindow.NameInFilterList(pairing.name, nameFilters))
                    {
                        continue;
                    }
                }
                if (nameExcludes.Count > 0)
                {
                    if (m_ProfileAnalyzerWindow.NameInExcludeList(pairing.name, nameExcludes))
                    {
                        continue;
                    }
                }

                var item = new ComparisonTreeViewItem(index, 0, pairing.name, pairing);
                root.AddChild(item);

                float diff = Diff(item);
                if (diff < minDiff)
                {
                    minDiff = diff;
                }
                if (diff > maxDiff && diff < float.MaxValue)
                {
                    maxDiff = diff;
                }

                double totalDiff = TotalDiff(item);
                if (totalDiff < totalMinDiff)
                {
                    totalMinDiff = totalDiff;
                }
                if (totalDiff > totalMaxDiff && totalDiff < float.MaxValue)
                {
                    totalMaxDiff = totalDiff;
                }

                float countDiff = CountDiff(item);
                if (countDiff < countMinDiff)
                {
                    countMinDiff = countDiff;
                }
                if (countDiff > countMaxDiff && countDiff < float.MaxValue)
                {
                    countMaxDiff = countDiff;
                }

                float countMeanDiff = CountMeanDiff(item);
                if (countMeanDiff < countMeanMinDiff)
                {
                    countMeanMinDiff = countMeanDiff;
                }
                if (countMeanDiff > countMeanMaxDiff && countMeanDiff < float.MaxValue)
                {
                    countMeanMaxDiff = countMeanDiff;
                }
            }

            m_DiffRange          = Math.Max(Math.Abs(minDiff), Math.Abs(maxDiff));
            m_TotalDiffRange     = Math.Max(Math.Abs(totalMinDiff), Math.Abs(totalMaxDiff));
            m_CountDiffRange     = Math.Max(Math.Abs(countMinDiff), Math.Abs(countMaxDiff));
            m_CountMeanDiffRange = Math.Max(Math.Abs(countMeanMinDiff), Math.Abs(countMeanMaxDiff));

            return(root);
        }