public BatchExperiment GetConfiguredBatchExperiment() { BatchExperiment result = new BatchExperiment(GetSelectedBatchMode()); result.AddExperiments(GetConfiguredExperiments()); return(result); }
private void LoadBatchExperimentTemplateButtonClick(object sender, EventArgs e) { BatchExperiment be = BatchExperimentSetupWindow.LoadBatchExperiment(); if (be == null) { return; } SetBatchExperiment(be); }
public void SetBatchExperiment(BatchExperiment batchExperiment) { this.experimentListBox.Items.Clear(); this.batchModeComboBox.SelectedIndex = 0; RefreshLabels(null); if (batchExperiment == null) { return; } this.batchModeComboBox.SelectedIndex = (int)batchExperiment.BatchMode; foreach (ExperimentBase e in batchExperiment.Experiments) { AddExperiment(e); } }
public void SetBatchExperiment(BatchExperiment batchExperiment) { this.batchExperiment = batchExperiment; this.experimentImageList.Images.Clear(); this.progressChangedSemaphore = new SemaphoreSlim(1, 1); this.progressBarBitmapBounds = Rectangle.Empty; this.progressBarBitmapBounds.Size = this.experimentImageList.ImageSize; int totalProgress = 0; int experimentIndex = 0; foreach (ExperimentBase e in batchExperiment.Experiments) { Bitmap progressBarBitmap = new Bitmap( this.experimentImageList.ImageSize.Width, this.experimentImageList.ImageSize.Height); this.experimentImageList.Images.Add(progressBarBitmap); ProgressBar progressBar = new ProgressBar(); progressBar.MinimumSize = this.experimentImageList.ImageSize; progressBar.MaximumSize = this.experimentImageList.ImageSize; progressBar.Size = this.experimentImageList.ImageSize; ExperimentInfo ei = new ExperimentInfo() { Experiment = e, ExperimentWorker = new ExperimentWorker(e), ProgressBar = progressBar, ProgressBarBitmap = progressBarBitmap, Status = Status.Waiting }; ei.ExperimentWorker.ConfigureProgressBar(ei.ProgressBar); ListViewItem lvi = new ListViewItem(GetExperimentDescription(ei), this.experimentListView.Items.Count); lvi.UseItemStyleForSubItems = true; this.experimentListView.Items.Add(lvi); lvi.Tag = ei; ei.ExperimentWorker.Tag = lvi; ei.ExperimentWorker.ExperimentFinished += new System.EventHandler(ExperimentFinished); totalProgress += progressBar.Maximum; ei.Experiment.Reporter.SetBatchModeIndex(experimentIndex); experimentIndex++; } this.totalProgressBar.Maximum = totalProgress; if (totalProgress == 0) { this.totalProgressBar.Style = ProgressBarStyle.Marquee; this.totalProgressBar.MarqueeAnimationSpeed = 500; } this.experimentListView.Refresh(); ResizeColumns(); this.inhibitBatchModeChangedEvent = true; this.batchModeComboBox.SelectedIndex = (int)(this.batchExperiment.BatchMode); this.inhibitBatchModeChangedEvent = false; this.startAllButton.Enabled = true; this.batchModeComboBox.Enabled = true; }