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); } }
public void UpdateValidIdxs(int toIdx) { FrameRecordRange frr = GetFrameRecordRange(); m_maxValidIdx = Math.Max(0, Math.Min(toIdx - frr.StartIdx, frr.EndIdx - frr.StartIdx)); m_maxValidBaseIdx = toIdx; m_logListItem.Invalidate(); }
public LogData(SessionInfo sessionInfo) { Name = sessionInfo.Summary; FrameRecords = new List <FrameRecord>(); ItemMetaData = new Dictionary <string, ItemMetaData>(); FrameRecordRange = new FrameRecordRange(); BuildInfo = new BuildInfo(Name); SessionInfo = sessionInfo; m_paths = new FrameRecordPathCollection(); }
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); } }
void SerializeInLogViewStates(SerializeState serializeState) { if (serializeState.LogViewStates == null) { return; } for (int i = 0; i < m_logViews.Count; i++) { LogView logView = m_logViews[i]; LogViewSerializeState lvss; lock (logView.m_logData) { if (i < serializeState.LogViewStates.Length) { lvss = serializeState.LogViewStates[i]; if ((m_logViews.Count > 1) && (lvss.SingleORDIColour != null)) { logView.m_singleOrdiColour = lvss.SingleORDIColour; } } else { lvss = serializeState.LogViewStates.Last(); } if (!(logView.m_logData is SocketLogData)) // this is only a temporary quick fix - fixing this properly will take some time { UserMarkerRDI startURDI = GetFirstURDIMatching(lvss.StartUM, logView); UserMarkerRDI endURDI = GetFirstURDIMatching(lvss.EndUM, logView); FrameRecordRange frr = logView.GetFrameRecordRange(); int startIdx = (startURDI != null) ? startURDI.m_uml.m_fr.Index : frr.StartIdx; int endIdx = (endURDI != null) ? endURDI.m_uml.m_fr.Index : frr.EndIdx; logView.SetFrameRecordRange(Math.Min(startIdx, endIdx), Math.Max(startIdx, endIdx)); logView.m_startUM = (startURDI != null) ? startURDI.DisplayUserMarker : null; logView.m_endUM = (endURDI != null) ? endURDI.DisplayUserMarker : null; } foreach (Control lliControl in logListTableLayoutPanel.Controls) { LogListItem lli = (LogListItem)lliControl; lli.UpdateContents(); } SetUMTreeViewNodeColours(); } } }
void SetFrameNumericUpDowns() { m_bUpdateLogFRR = false; FrameRecordRange frr = m_logView.GetFrameRecordRange(); int maxValue = Math.Max(frr.EndIdx, m_logView.m_baseLogData.FrameRecords.Count - 1); startFrameNumericUpDown.Maximum = maxValue; endFrameNumericUpDown.Maximum = maxValue; startFrameNumericUpDown.Value = frr.StartIdx; endFrameNumericUpDown.Value = frr.EndIdx; m_bUpdateLogFRR = true; }
public LogData(LogData logData, FrameRecordRange frr) { int startIdx = frr.StartIdx; int endIdx = frr.EndIdx; int numFrames = endIdx - startIdx + 1; Name = frr.Name; FrameRecords = new List <FrameRecord>(logData.FrameRecords.GetRange(startIdx, numFrames)); ItemMetaData = new Dictionary <string, ItemMetaData>(logData.ItemMetaData); // this may not need to be copied, MT a problem though? FrameRecordRange = new FrameRecordRange(Name, logData.FrameRecordRange.StartIdx + startIdx, logData.FrameRecordRange.StartIdx + endIdx); m_paths = logData.m_paths; BuildInfo = logData.BuildInfo; SessionInfo = logData.SessionInfo; }
public LogRange(LogData logData, FrameRecordRange frr) { m_logData = logData; m_frr = frr; }
public LogView(LogControl logControl, LogRange logRange) { m_logControl = logControl; m_baseLogData = logRange.m_logData; m_baseViewFRs = new List <ViewFrameRecord>(m_baseLogData.FrameRecords.Count); m_viewPaths = new FrameRecordPathCollection(); ExpandBaseVFRs(m_baseLogData.FrameRecords.Count - 1); SocketLogData socketLogData = m_baseLogData as SocketLogData; if (socketLogData != null) { socketLogData.AddListeningLogView(this); } if (logRange.m_frr != null) { FrameRecordRange frr = logRange.m_frr; m_logData = new LogData(m_baseLogData, frr); m_viewFRs = new List <ViewFrameRecord>(m_baseViewFRs.GetRange(frr.StartIdx, frr.EndIdx - frr.StartIdx + 1)); } else { m_logData = m_baseLogData; m_viewFRs = m_baseViewFRs; } string logName = m_logData.Name; int idx = logName.LastIndexOf('\\') + 1; if (idx != -1) { logName = logName.Substring(idx); // get the filename without the path } idx = logName.IndexOf(".bin"); if (idx != -1) { logName = logName.Substring(0, idx); // remove .bin } m_name = logName; // these are searched in order m_graphDescs = new IGraphDesc[] { new CProfileGraphDesc("/Threads/", new ProfileGraphLeafDesc("selfTimeInMS", EItemType.Float)), new CProfileGraphDesc("/ParticlesColliding/", new ProfileGraphLeafDesc("count", EItemType.Int)), new CProfileGraphDesc("/PhysEntities/", new ProfileGraphLeafDesc("time", EItemType.Float)), new CProfileGraphDesc("/DrawCalls/", new ProfileGraphLeafDesc("totalDrawCallCount", EItemType.Int)), new CProfileGraphDesc("/NetworkProfile/", new ProfileGraphLeafDesc("totalBits", EItemType.Int)), new CProfileGraphDesc("/TexStrm/", new ProfileGraphLeafDesc("requiredMB", EItemType.Float), new ProfileGraphLeafDesc("mip", EItemType.Float)), new CProfileGraphDesc("/TexPools/", new ProfileGraphLeafDesc("n", EItemType.Int)), new CProfileGraphDesc("/SoundInfo/", new ProfileGraphLeafDesc("count", EItemType.Int)), new CProfileGraphDesc("/ObjMan/", new ProfileGraphLeafDesc("sizeKB", EItemType.Float)), new COverviewGraphDesc("/**") }; m_viewPaths.AddPath(logControl.m_prdiTree.LeafPath); }