Пример #1
0
        protected override TreeViewItem BuildRoot()
        {
            int idForhiddenRoot      = -1;
            int depthForHiddenRoot   = -1;
            ProfileTreeViewItem root = new ProfileTreeViewItem(idForhiddenRoot, depthForHiddenRoot, "root", null);

            m_maxMedian = 0.0f;
            int index = 0;

            foreach (var marker in m_model.GetMarkers())
            {
                if (m_profileAnalyserWindow.CheckMarkerValid(marker))
                {
                    var item = new ProfileTreeViewItem(index, 0, marker.name, marker);
                    root.AddChild(item);
                    float ms = item.data.msMedian;
                    if (ms > m_maxMedian)
                    {
                        m_maxMedian = ms;
                    }
                }
                // Maintain index to map to main markers
                index += 1;
            }

            return(root);
        }
Пример #2
0
        protected override TreeViewItem BuildRoot()
        {
            int idForhiddenRoot      = -1;
            int depthForHiddenRoot   = -1;
            ProfileTreeViewItem root = new ProfileTreeViewItem(idForhiddenRoot, depthForHiddenRoot, "root", null);

            int depthFilter = m_profileAnalyserWindow.GetDepthFilter();

            int index = 0;

            m_minDiff = float.MaxValue;
            m_maxDiff = 0.0f;
            foreach (var pairing in m_pairings)
            {
                if (depthFilter >= 0)
                {
                    if (pairing.leftIndex >= 0 && m_left.GetMarkers()[pairing.leftIndex].minDepth != depthFilter)
                    {
                        index += 1; // Keep index mapping to main pairing list
                        continue;
                    }
                    if (pairing.rightIndex >= 0 && m_right.GetMarkers()[pairing.rightIndex].minDepth != depthFilter)
                    {
                        index += 1; // Keep index mapping to main pairing list
                        continue;
                    }
                }
                var item = new ComparisonTreeViewItem(index, 0, pairing.name, pairing);
                root.AddChild(item);
                float diff = Diff(item);
                if (diff < m_minDiff)
                {
                    m_minDiff = diff;
                }
                if (diff > m_maxDiff && diff < float.MaxValue)
                {
                    m_maxDiff = diff;
                }
                index += 1;
            }

            return(root);
        }