void UpdateLabelLocation()
 {
     RDI.LabelLocation = leftLabelSideRadioButton.Checked ?
                         TargetLineRDI.ELabelLocation.ELL_Left :
                         TargetLineRDI.ELabelLocation.ELL_Right;
     LogControl.InvalidateGraphControl();
 }
示例#2
0
        protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
        {
            base.OnNodeMouseClick(e);

            if (e.Button == MouseButtons.Left)
            {
                if (StatoscopeForm.m_shiftIsBeingPressed)
                {
                    ProfilerRDI prdi = (ProfilerRDI)e.Node.Tag;
                    prdi.IsCollapsed = !prdi.IsCollapsed;
                    e.Node.ForeColor = prdi.IsCollapsed ? System.Drawing.Color.White : System.Drawing.Color.Empty;
                    e.Node.BackColor = prdi.IsCollapsed ? System.Drawing.Color.DarkGray : System.Drawing.Color.Empty;

                    LogControl.InvalidateGraphControl();
                }

                if (StatoscopeForm.m_ctrlIsBeingPressed)
                {
                    LogControl.PRDIsInvalidated();
                }
            }
            else if (e.Button == MouseButtons.Right)
            {
                LogControl.PRDIsInvalidated();
            }
        }
示例#3
0
 public EditableRDICheckboxTreeView(LogControl logControl, T rdiTree)
     : base(logControl, rdiTree)
 {
     LabelEdit          = true;
     TreeViewNodeSorter = new NaturalNodeComparer();
     Sorted             = true;
 }
        public TreeNode CreateLogControlTabPage(List <LogRange> logRanges, string name, TreeNode sessionParentTabNode)
        {
            LogControl logControl      = new LogControl(logRanges, this);
            TabPage    tabPage         = new TabPage(name);
            TreeNode   sessionTabsNode = new TreeNode(tabPage.Text);

            sessionTabsNode.Tag = tabPage;

            TreeNode tabsTreeNode = sessionTreeView.Nodes["Tabs"];

            if (sessionParentTabNode == null)
            {
                sessionParentTabNode = tabsTreeNode;
            }
            else if (!tabsTreeNode.Nodes.Contains(sessionParentTabNode))
            {
                tabsTreeNode.Nodes.Add(sessionParentTabNode);
            }

            sessionParentTabNode.Nodes.Add(sessionTabsNode);
            tabsTreeNode.Expand();

            tabPage.Tag = sessionTabsNode;
            tabPage.Controls.Add(logControl);                   // see GetLogControlFromTabPage()

            tabControl1.TabPages.Add(tabPage);
            tabControl1.SelectTab(tabPage);             // need to select it so the target labels set their initial positions correctly

            logControl.InvalidateGraphControl();

            return(sessionTabsNode);
        }
示例#5
0
 protected RDIInfoControl(LogControl logControl, T rdiTree, RDICheckboxTreeView <T> ctv)
     : base(logControl)
 {
     RDITree = rdiTree;
     CTV     = ctv;
     ItemPathCMS.Items.Add("Copy path", null, itemPathCMS_CopyPathClicked);
 }
        private void cropLogRangeFromViewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LogControl logControl = GetActiveLogControl();

            if (logControl != null)
            {
                int maxStartIdxChange = int.MinValue;

                foreach (LogView logView in logControl.m_logViews)
                {
                    int leftIdx  = logControl.m_OGLGraphingControl.LeftIndex(logView);
                    int rightIdx = logControl.m_OGLGraphingControl.RightIndex(logView);

                    FrameRecordRange frr = logView.GetFrameRecordRange();
                    int newStartIdx      = Math.Min(Math.Max(0, leftIdx + frr.StartIdx), logView.m_maxValidBaseIdx);
                    int newEndIdx        = Math.Min(Math.Max(0, rightIdx + frr.StartIdx), logView.m_maxValidBaseIdx);
                    int startIdxChange   = newStartIdx - frr.StartIdx;

                    logView.SetFrameRecordRange(newStartIdx, newEndIdx);

                    if (startIdxChange > maxStartIdxChange)
                    {
                        maxStartIdxChange = startIdxChange;
                    }
                }

                logControl.m_OGLGraphingControl.AdjustCentreX(-maxStartIdxChange);
            }
        }
        private void saveLogToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LogControl logControl = GetActiveLogControl();

            if (logControl == null)
            {
                MessageBox.Show("No Log open", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            foreach (LogView logView in logControl.m_logViews)
            {
                SocketLogData socketLogData = logView.m_baseLogData as SocketLogData;

                if (socketLogData != null)
                {
                    SaveFileDialog fd = new SaveFileDialog();
                    fd.CheckFileExists = false;
                    fd.FileName        = "log.bin";
                    fd.Filter          = "Binary log files (*.bin)|*.bin|All files (*.*)|*.*";
                    fd.FilterIndex     = 0;

                    if (fd.ShowDialog() == DialogResult.OK)
                    {
                        socketLogData.SaveToFile(fd.FileName);
                    }
                }
                else
                {
                    MessageBox.Show("Selected log is not a socket logging session (probably a file opened from disk)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#8
0
        public SpikeFinder(LogControl logControl)
        {
            InitializeComponent();

            m_logControl = logControl;

            m_pathCMS = new ContextMenuStrip();
            m_pathCMS.Items.Add("Copy path", null, m_pathCMS_CopyPathClicked);

            m_listView                  = new ListView();
            m_listView.Dock             = DockStyle.Fill;
            m_listView.ContextMenuStrip = m_pathCMS;

            m_listView.View          = View.Details;
            m_listView.HideSelection = false;
            m_listView.MultiSelect   = false;
            m_listView.CheckBoxes    = true;
            m_listView.Columns.Add("Function");
            m_listView.Columns.Add("Max");
            m_listView.Columns.Add("Total");
            m_listView.Columns.Add("# Spikes");
            m_listView.ColumnClick          += new ColumnClickEventHandler(listViewColumnClickEvent);
            m_listView.MouseClick           += new MouseEventHandler(m_listView_MouseClick);
            m_listView.MouseDoubleClick     += new MouseEventHandler(m_listView_MouseDoubleClick);
            m_listView.SelectedIndexChanged += new EventHandler(m_listView_SelectedIndexChanged);
            m_listView.ItemCheck            += new ItemCheckEventHandler(m_listView_ItemCheck);

            m_spikeDataComparer           = new SpikeDataComparer();
            m_listView.ListViewItemSorter = m_spikeDataComparer;

            tableLayoutPanel3.Controls.Add(m_listView);
        }
示例#9
0
        public ProfilerTreemapControl(LogControl logControl)
        {
            m_logControl = logControl;
            m_logViews   = logControl.m_logViews;

            XmlDocument doc = new XmlDocument();

            try
            {
                doc.Load("TextureP4Config.xml");

                XmlNodeList connNodes = doc.GetElementsByTagName("connection");
                foreach (XmlNode n in connNodes)
                {
                    m_fileFetcher.Username  = n.Attributes["username"].Value;
                    m_fileFetcher.Workspace = n.Attributes["workspace"].Value;
                    m_fileFetcher.Server    = n.Attributes["server"].Value;
                    m_fileFetcher.Port      = int.Parse(n.Attributes["port"].Value);
                }

                XmlNodeList gameNodes = doc.GetElementsByTagName("game");
                foreach (XmlNode n in gameNodes)
                {
                    m_thumbSearchDirectory = n.Attributes["root"].Value;
                }
            }
            catch (System.Exception)
            {
            }

            m_thumbSearchDirectory = m_thumbSearchDirectory.TrimEnd('/');
        }
示例#10
0
 public PRDICheckboxTreeView(LogControl logControl, ProfilerRDI prdiTree)
     : base(logControl, prdiTree)
 {
     m_toolTip.SetToolTip(this,
                          "Right-click: toggle subtree" + Environment.NewLine +
                          "Ctrl-left-click: isolate subtree" + Environment.NewLine +
                          "Shift-left-click: collapse subtree");
 }
        public override void RemoveRDIFromTree(ZoneHighlighterRDI zrdi)
        {
            base.RemoveRDIFromTree(zrdi);

            if (!zrdi.CanHaveChildren)
            {
                LogControl.RemoveZoneHighlighter(zrdi);
            }
        }
        private void screenshotGraphToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LogControl logControl = GetActiveLogControl();

            if (logControl != null)
            {
                logControl.ScreenshotGraphToClipboard();
            }
        }
        protected void ResetZHIs()
        {
            if (!ZHIResetEnabled)
            {
                return;
            }

            LogControl.ResetZoneHighlighter(ZRDI);
        }
        public override void AddRDIToTree(ZoneHighlighterRDI zrdi)
        {
            base.AddRDIToTree(zrdi);

            if (!zrdi.CanHaveChildren)
            {
                LogControl.AddZoneHighlighter(zrdi);
            }
        }
        private void fitToFrameRecordsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LogControl logControl = GetActiveLogControl();

            if (logControl != null)
            {
                logControl.m_OGLGraphingControl.FitViewToFrameRecords();
            }
        }
        private void frameOffsetNumericUpDown_ValueChanged(object sender, EventArgs e)
        {
            RDI.FrameOffset = (int)frameOffsetNumericUpDown.Value;

            foreach (LogView logView in LogControl.m_logViews)
            {
                logView.DeleteDisplayLists(RDI.ValuesPath);
                LogControl.InvalidateGraphControl();
            }
        }
示例#17
0
        protected override void OnAfterCheck(TreeViewEventArgs e)
        {
            base.OnAfterCheck(e);

            LogControl.m_spikeFinder.UpdateCheckState(e.Node.FullPath);

            if (m_refreshOnTreeNodeChecked)
            {
                LogControl.PRDIsInvalidated();
            }
        }
        void ProfileMenuItemClick(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi       = (ToolStripMenuItem)sender;
            FileInfo          fi         = (FileInfo)tsmi.Tag;
            LogControl        logControl = GetActiveLogControl();

            if (logControl != null)
            {
                logControl.LoadProfile(fi.FullName);
            }
        }
示例#19
0
 private void CreateHeaders(BucketSet bucketSet, int colHeaderWidth)
 {
     m_columnProperties = new List <PropertyInfo>();
     foreach (var pi in EnumColumns(bucketSet))
     {
         var    descAttr = GetFirstAttribute(pi, typeof(DescriptionAttribute), true);
         string desc     = descAttr != null ? ((DescriptionAttribute)descAttr).Description : pi.Name;
         Columns.Add(LogControl.CreateColumnHeader(desc, colHeaderWidth));
         m_columnProperties.Add(pi);
     }
 }
        public void SetSessionInfoList(LogControl logControl)
        {
            LogData[] logDatas = new LogData[logControl.m_logViews.Count];

            for (int i = 0; i < logControl.m_logViews.Count; i++)
            {
                logDatas[i] = logControl.m_logViews[i].m_logData;
            }

            SetSessionInfoList(logDatas);
        }
示例#21
0
        public void LogControl_DragDrop(object sender, DragEventArgs e)
        {
            LogControl sourceLogControl = GetDragEventSourceLogControl(e);
            LogRange   sourceLogRange   = GetDragEventSourceLogRange(e);

            if (sourceLogControl != null || sourceLogRange != null)
            {
                foreach (LogView logView in m_logViews)
                {
                    logView.SetSingleOrdiColour(RGB.RandomHueRGB());
                }

                foreach (Control lliControl in logListTableLayoutPanel.Controls)
                {
                    LogListItem lli = (LogListItem)lliControl;
                    lli.UpdateContents();
                }

                logListTableLayoutPanel.SuspendLayout();
                {
                    if (sourceLogControl != null)
                    {
                        foreach (LogView logView in sourceLogControl.m_logViews)
                        {
                            FrameRecordRange frr      = logView.m_logData == logView.m_baseLogData ? null : logView.m_logData.FrameRecordRange;
                            LogRange         logRange = new LogRange(logView.m_baseLogData, frr);
                            AddNewLogRange(logRange);
                        }
                    }
                    else if (sourceLogRange != null)
                    {
                        AddNewLogRange(sourceLogRange);
                    }
                }
                logListTableLayoutPanel.ResumeLayout();

                m_statoscopeForm.SetSessionInfoList(this);

                RefreshItemInfoPanel();
                UpdateControls(0);
                SetUMTreeViewNodeColours();

                foreach (LogView logView in m_logViews)
                {
                    // this is required as in calculating value stats in UpdateControls(), an OnPaint could happen and use invalid data
                    logView.DeleteDisplayListsEndingIn(".MA");
                    logView.DeleteDisplayListsEndingIn(".LM");
                }
            }
            else
            {
                m_statoscopeForm.StatoscopeForm_DragDrop(sender, e);
            }
        }
        private void resetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LogControl logControl = GetActiveLogControl();

            if (logControl != null)
            {
                foreach (LogView logView in logControl.m_logViews)
                {
                    logView.SetFrameRecordRange(0, logView.m_maxValidBaseIdx);
                }
            }
        }
 private void tabControl1_Selected(object sender, TabControlEventArgs e)
 {
     if (e.TabPage != null)
     {
         LogControl logControl = GetLogControlFromTabPage(e.TabPage);
         SetSessionInfoList(logControl);
     }
     else
     {
         ClearSessionInfoList();
     }
 }
        private void noneFilteringRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (noneFilteringRadioButton.Checked)
            {
                RDI.Filtering = OverviewRDI.EFiltering.None;

                maUpDown.Enabled = false;
                lmUpDown.Enabled = false;

                LogControl.InvalidateGraphControl();
            }
        }
        private void CustomDisplayScaleUpDown_ValueChanged(object sender, EventArgs e)
        {
            float scale = (float)CustomDisplayScaleUpDown.Value;

            LogControl.SetDisplayScale(itemPathLabel.Text, scale);
            LogControl.UpdateDisplayScale(itemPathLabel.Text);

            foreach (LogView logView in LogControl.m_logViews)
            {
                logView.DeleteDisplayLists(RDI.ValuesPath);
                LogControl.InvalidateGraphControl();
            }
        }
示例#26
0
        public virtual void RenameNode(TreeNode node, string newName)
        {
            node.Name = newName;
            node.Text = newName;
            BeginInvoke((Action)(() => Sort()));

            T rdi = (T)node.Tag;

            rdi.Name        = newName;
            rdi.DisplayName = newName;

            LogControl.RefreshItemInfoPanel();
        }
        private void lmUpDown_ValueChanged(object sender, EventArgs e)
        {
            RDI.LMNumFrames = (int)lmUpDown.Value;

            if (RDI.Filtering == OverviewRDI.EFiltering.LocalMax)
            {
                foreach (LogView logView in LogControl.m_logViews)
                {
                    logView.CalculateLocalMax(RDI, 0);
                    logView.DeleteDisplayLists(RDI.ValuesPath);
                    LogControl.InvalidateGraphControl();
                }
            }
        }
        void Application_Idle(object sender, EventArgs e)
        {
            m_updateControlsRequested = false;

            foreach (TabPage tp in tabControl1.TabPages)
            {
                LogControl lc = GetLogControlFromTabPage(tp);

                if (lc != null)
                {
                    lc.UpdateControls();
                }
            }
        }
示例#29
0
        public void LogControl_DragEnter(object sender, DragEventArgs e)
        {
            LogControl sourceLogControl = GetDragEventSourceLogControl(e);
            LogRange   sourceLogRange   = GetDragEventSourceLogRange(e);

            if ((sourceLogControl != null && sourceLogControl != this) || sourceLogRange != null)
            {
                e.Effect = DragDropEffects.Copy;
            }
            else
            {
                m_statoscopeForm.StatoscopeForm_DragEnter(sender, e);
            }
        }
        void tabControl1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                for (int i = 0; i < tabControl1.TabPages.Count; i++)
                {
                    System.Drawing.Rectangle tabRect = tabControl1.GetTabRect(i);

                    if (tabRect.Contains(e.Location))
                    {
                        LogControl logControl = GetLogControlFromTabPage(tabControl1.TabPages[i]);
                        SetSessionInfoList(logControl);
                        break;
                    }
                }
            }
            else if (e.Button == MouseButtons.Middle)
            {
                for (int i = 0; i < tabControl1.TabPages.Count; i++)
                {
                    System.Drawing.Rectangle tabRect = tabControl1.GetTabRect(i);

                    if (tabRect.Contains(e.Location))
                    {
                        TreeNode sessionTabsNode = (TreeNode)tabControl1.TabPages[i].Tag;

                        if (sessionTabsNode.Nodes.Count == 0)
                        {
                            TreeNode parentNode    = sessionTabsNode.Parent;                            // this will be the node corresponding to the file
                            TabPage  parentTabPage = (TabPage)parentNode.Tag;

                            if (parentNode.Nodes.Count == 1 && (parentTabPage != null) && !tabControl1.TabPages.Contains(parentTabPage))
                            {
                                parentNode.Nodes.Remove(sessionTabsNode);
                                sessionTabsNode.Nodes.Remove(parentNode);
                            }
                            else
                            {
                                sessionTreeView.Nodes.Remove(sessionTabsNode);
                            }
                        }

                        tabControl1.TabPages.RemoveAt(i);
                        break;
                    }
                }
            }
        }