Changeset 7844


Ignore:
Timestamp:
05/18/12 11:50:59 (7 years ago)
Author:
ascheibe
Message:

#1174 worked on upload view

Location:
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBExperimentUploadView.Designer.cs

    r7839 r7844  
    3636      this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
    3737      this.setColumnToThisValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     38      this.clearButton = new System.Windows.Forms.Button();
    3839      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
    3940      this.contextMenu.SuspendLayout();
     
    7172            this.ProblemTypeColumn,
    7273            this.OKBProblemColumn});
     74      this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
    7375      this.dataGridView.Location = new System.Drawing.Point(3, 3);
    7476      this.dataGridView.Name = "dataGridView";
     
    137139      this.setColumnToThisValueToolStripMenuItem.Click += new System.EventHandler(this.setColumnToThisValueToolStripMenuItem_Click);
    138140      //
     141      // clearButton
     142      //
     143      this.clearButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     144      this.clearButton.Location = new System.Drawing.Point(387, 199);
     145      this.clearButton.Name = "clearButton";
     146      this.clearButton.Size = new System.Drawing.Size(75, 23);
     147      this.clearButton.TabIndex = 3;
     148      this.clearButton.Text = "Clear Runs";
     149      this.clearButton.UseVisualStyleBackColor = true;
     150      this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
     151      //
    139152      // OKBExperimentUploadView
    140153      //
     
    142155      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    143156      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     157      this.Controls.Add(this.clearButton);
    144158      this.Controls.Add(this.dataGridView);
    145159      this.Controls.Add(this.btnUpload);
     
    165179    private System.Windows.Forms.ContextMenuStrip contextMenu;
    166180    private System.Windows.Forms.ToolStripMenuItem setColumnToThisValueToolStripMenuItem;
     181    private System.Windows.Forms.Button clearButton;
    167182  }
    168183}
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBExperimentUploadView.cs

    r7839 r7844  
    6969      } else {
    7070        AddRuns(Content);
    71         DisplayRuns();
    7271      }
    7372    }
     
    7675      if (item is Experiment) {
    7776        runs.AddRange((item as Experiment).Runs);
     77        DisplayRuns((item as Experiment).Runs);
    7878      } else if (item is RunCollection) {
    7979        runs.AddRange((item as RunCollection));
     80        DisplayRuns((item as RunCollection));
    8081      } else if (item is IOptimizer) {
    8182        runs.AddRange((item as IOptimizer).Runs);
     83        DisplayRuns((item as IOptimizer).Runs);
    8284      } else if (item is IRun) {
    8385        runs.Add(item as IRun);
     86        RunCollection tmp = new RunCollection();
     87        tmp.Add(item as IRun);
     88        DisplayRuns(tmp);
    8489      }
    8590    }
     
    101106    }
    102107
    103     private void DisplayRuns() {
     108    private void DisplayRuns(RunCollection runs) {
    104109      if (RunCreationClient.Instance.Algorithms == null || RunCreationClient.Instance.Algorithms.Count() == 0) {
    105110        RunCreationClient.Instance.RefreshAsync(DisplayError);
    106111      } else {
    107         CreateUI();
    108       }
    109     }
    110 
    111     private void CreateUI() {
     112        CreateUI(runs);
     113      }
     114    }
     115
     116    private void CreateUI(RunCollection runs) {
    112117      if (problems.Count == 0)
    113118        problems.AddRange(RunCreationClient.Instance.Problems);
     
    128133      cmbProblem.DisplayMember = "Name";
    129134
    130       dataGridView.Rows.Clear();
    131135      foreach (IRun run in runs) {
    132136        int idx = dataGridView.Rows.Add(run.Name);
     
    184188      } else {
    185189        FinishProgressView();
    186 
    187         CreateUI();
    188190        SetEnabledStateOfControls();
    189191      }
     
    241243          progressView = null;
    242244          SetEnabledStateOfControls();
     245          ClearRuns();
    243246        }
    244247      }
     
    291294        if (e.Effect.HasFlag(DragDropEffects.Copy)) optimizer = (IItem)optimizer.Clone();
    292295        AddRuns(optimizer);
    293         DisplayRuns();
    294       }
     296      }
     297    }
     298
     299    private void clearButton_Click(object sender, EventArgs e) {
     300      ClearRuns();
    295301    }
    296302  }
Note: See TracChangeset for help on using the changeset viewer.