/// <summary> /// Creates a new ProfilerRunner using a ProcessStartInfo and a data writer. /// </summary> public ProfilerRunner(ProcessStartInfo startInfo, bool useTempFileDatabase, IProfilingDataWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } if (startInfo == null) { throw new ArgumentNullException("startInfo"); } if (useTempFileDatabase) { this.database = new TempFileDatabase(); this.writer = writer; this.profiler = new Controller.Profiler(startInfo, this.database.GetWriter(), OptionWrapper.CreateProfilerOptions()); } else { this.database = null; this.writer = writer; this.profiler = new Controller.Profiler(startInfo, writer, OptionWrapper.CreateProfilerOptions()); } PrintProfilerOptions(); this.profiler.RegisterFailed += delegate { MessageService.ShowError("${res:AddIns.Profiler.Messages.RegisterFailed}"); }; this.profiler.DeregisterFailed += delegate { MessageService.ShowError("${res:AddIns.Profiler.Messages.UnregisterFailed}"); }; this.profiler.OutputUpdated += delegate { SetOutputText(profiler.ProfilerOutput); }; this.profiler.SessionEnded += delegate { FinishSession(); }; }
void PrintProfilerOptions() { var options = OptionWrapper.CreateProfilerOptions(); LoggingService.Info("Profiler settings:"); LoggingService.Info("Shared memory size: " + options.SharedMemorySize + " (" + (options.SharedMemorySize / 1024 / 1024) + " MB)"); LoggingService.Info("Combine recursive calls: " + options.CombineRecursiveFunction); LoggingService.Info("Enable DC: " + options.EnableDC); LoggingService.Info("Profile .NET internals: " + (!options.DoNotProfileDotNetInternals)); LoggingService.Info("Track events: " + options.TrackEvents); }
void generateButtons() { for (int i = 0; i < numOptions; i++) { GameObject g = Instantiate(buttonPrefab, transform); //Resize the button appropriately. Somehow it was very difficult to figure out the appropriate code. Maybe there is a better way. RectTransform rt = g.GetComponent <RectTransform>(); rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, i * width / numOptions, width / numOptions); rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, 0, height); g.GetComponent <Button>().onClick.AddListener(generateListener(i)); optionButtons[i] = new OptionWrapper(g.GetComponent <Button>()); optionButtons[i].setState(false); //string reinfStr = ""; //if(options[i].conduit != null) reinfStr = "\n\n Reinforcement " + options[i].conduit.reinforcement; optionButtons[i].setupOption(options[i]); optionsSelected[i] = false; } }
private void button2_Click(object sender, EventArgs e) { OptionWrapper.SetLog(false); WavFileWrapper wav = new WavFileWrapper(@"C:\Users\hungc\Desktop\Project\Binary\Voice Comparasion\Debug\Data\Test\sin100.wav"); bool result = wav.Load(); wav.SelectedWave(0, 20000); MFCCWrapper mfcc = new MFCCWrapper(wav, 0.015f, 0.005f, 18, 0.0f, 4000, 12, 2); mfcc.Process(); MfccChartForm chart = new MfccChartForm(Object.Enum.FormTag.NONE); chart.Text = "MFCC"; chart.Data = mfcc.Mfcc; chart.Show(); /* * MfccChartForm chart2 = new MfccChartForm(Object.Enum.FormTag.NONE); * chart2.Text = "Bank Log"; * chart2.Data = mfcc.BandFilter; * chart2.Show(); * * MfccChartForm chart3 = new MfccChartForm(Object.Enum.FormTag.NONE); * chart3.Text = "FREQ"; * chart3.Data = mfcc.Freq; * chart3.Show(); * * MfccChartForm chart4 = new MfccChartForm(Object.Enum.FormTag.NONE); * chart4.Text = "Delta"; * chart4.Data = mfcc.DetalMfcc; * chart4.Show(); * * MfccChartForm chart5 = new MfccChartForm(Object.Enum.FormTag.NONE); * chart5.Text = "Double"; * chart5.Data = mfcc.DoubleDetalMfcc; * chart5.Show();*/ }
void BuildButtons() { foreach ( ConversationOption option in _convoPlayer.GetOptions() ) { // Instantiate new button, set parent as the button section var button = Instantiate(_optionButtonPrefab); button.transform.SetParent(_buttonSection, false); // Set Text var text = button.GetComponentInChildren<Text>(); text.text = option._option; var button_comp = button.GetComponent<Button>(); // Register to button down event var wrapper = new OptionWrapper { _option = option }; // We have to wrap this guy I hope button_comp.onClick.AddListener( () => OnTopicButtonChosen( wrapper._option ) ); } }
public Form1() { OptionWrapper.SetLog(true); InitializeComponent(); }