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); } } }
protected override void Dispose(bool disposing) { SocketLogData socketLogData = m_baseLogData as SocketLogData; if (socketLogData != null) { socketLogData.RemoveListeningLogView(this); } foreach (List <uint> displayListList in m_displayLists.Values) { foreach (uint displayList in displayListList) { // this crashes on exit sometimes, dunno why //OpenGL.glDeleteLists(displayList, 1); } } base.Dispose(disposing); }
public SSocketParseArgs(SocketLogData logData, string logWriteFilename, TcpClient client) { m_logData = logData; m_logData.m_logWriteFilename = logWriteFilename; m_client = client; }
public LogData ProcessLog(StatoscopeForm ssForm) { TcpClient client = null; bool bShouldLogToFile = false; string connectionName = ""; using (ConnectMessageBox connectMsgBox = new ConnectMessageBox()) { bool successful = false; while (!successful) { if (connectMsgBox.ShowDialog() == DialogResult.OK) { try { client = new TcpClient(connectMsgBox.IpAddress, connectMsgBox.Port); bShouldLogToFile = connectMsgBox.logToFileCheckBox.Checked; connectionName = connectMsgBox.ConnectionName; successful = true; } catch (Exception ex) { ex.ToString(); ConnectionErrorDialog ced = new ConnectionErrorDialog(); ced.errorLabel.Text += connectMsgBox.IpAddress + ":" + connectMsgBox.Port; ced.ShowDialog(); } } else { return(null); } } } string logWriteFilename = ""; if (bShouldLogToFile) { 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) { logWriteFilename = fd.FileName; } } SocketSessionInfo sessionInfo = new SocketSessionInfo(connectionName, logWriteFilename); SocketLogData logData = new SocketLogData(sessionInfo); logData.ProcessRecords(); List <LogRange> logRanges = new List <LogRange>(); LogRange logRange = new LogRange(logData, null); logRanges.Add(logRange); ssForm.AddToLogRangeList(logRange); ssForm.CreateLogControlTabPage(logRanges, connectionName, null); ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessSocketDataStreamCB), new SSocketParseArgs(logData, logWriteFilename, client)); return(logData); }
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); }