public void SimpleTest() { mCurFrame = new BRetiredProfileSample[2]; uint i = 0; mCurFrame[i].mCPUStartTime = 2000; mCurFrame[i].mCPUEndTime = 3000; mCurFrame[i].mGPUStartTime = 2000; mCurFrame[i].mGPUEndTime = 2000; mCurFrame[i].mLevel = 0; mCurFrame[i].mSectionID = 0; mCurFrame[i].mUserID = 0; i++; mCurFrame[i].mCPUStartTime = 3000 + i; mCurFrame[i].mCPUEndTime = 4000 + i; mCurFrame[i].mGPUStartTime = 2000 + i; mCurFrame[i].mGPUEndTime = 2000 + i; mCurFrame[i].mLevel = 0; mCurFrame[i].mSectionID = 0; mCurFrame[i].mUserID = 0; mSections = new BProfileSection[1]; mSections[0].mCPUOnly = true; compressFrame(); log.Flush(); }
public bool SendSectionInfo(ref BProfileSection[] sections) { try { if (!Connected()) { MessageBox.Show(this, "Error, no connection to game"); return(false); } MemoryStream memStream = new MemoryStream(); ArrayList ids = new ArrayList(); ArrayList values = new ArrayList(); for (int j = 0; j < mNumSections; j++) { BProfileSection section = sections[j]; ids.Add((int)section.mID); values.Add((section.mEnabled)?(byte)1:(byte)0); } TimelineControlPacket timeControl = new TimelineControlPacket(memStream, TimelineControlPacket.TimelineControlValues.cConfigureSections, ids, values); mActiveClient.write(memStream); return(true); } catch (System.Exception ex) { ErrorHandler.Error(ex.ToString()); //todo: log this error MessageBox.Show(this, "Error Sending Message: " + ex.ToString()); return(false); } }
public void SetListBoxData(BProfileSection[] sections) { EnabledSectionListBox.Items.Clear(); for (int i = 0; i < mNumSections; i++) { BProfileSection section = sections[i]; EnabledSectionListBox.Items.Add(section.mName, section.mEnabled); } }
public void GetListBoxData(ref BProfileSection[] sections) { for (int i = 0; i < mNumSections; i++) { string name = (string)(EnabledSectionListBox.Items[i]); bool enabled = EnabledSectionListBox.GetItemChecked(i); for (int j = 0; j < mNumSections; j++) { BProfileSection section = sections[j]; if (name == section.mName) { section.mEnabled = enabled; } } } }