Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/12 20:44:53 (13 years ago)
Author:
ascheibe
Message:

#1174 values of returned runs can now be limited

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

Legend:

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

    r7331 r7589  
    5050      this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView();
    5151      this.splitContainer = new System.Windows.Forms.SplitContainer();
     52      this.filterTabControl = new System.Windows.Forms.TabControl();
     53      this.filterTabPage = new System.Windows.Forms.TabPage();
    5254      this.filtersGroupBox = new System.Windows.Forms.GroupBox();
    5355      this.filterPanel = new System.Windows.Forms.Panel();
    5456      this.refreshFiltersButton = new System.Windows.Forms.Button();
     57      this.constraintsTabPage = new System.Windows.Forms.TabPage();
    5558      this.resultsGroupBox = new System.Windows.Forms.GroupBox();
    5659      this.includeBinaryValuesCheckBox = new System.Windows.Forms.CheckBox();
     
    6164      this.filtersInfoPanel = new System.Windows.Forms.Panel();
    6265      this.filtersInfoLabel = new System.Windows.Forms.Label();
     66      this.constraintsCheckedListBox = new System.Windows.Forms.CheckedListBox();
     67      this.selectAllButton = new System.Windows.Forms.Button();
     68      this.deselectAllButton = new System.Windows.Forms.Button();
    6369      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    6470      this.splitContainer.Panel1.SuspendLayout();
    6571      this.splitContainer.Panel2.SuspendLayout();
    6672      this.splitContainer.SuspendLayout();
     73      this.filterTabControl.SuspendLayout();
     74      this.filterTabPage.SuspendLayout();
    6775      this.filtersGroupBox.SuspendLayout();
     76      this.constraintsTabPage.SuspendLayout();
    6877      this.resultsGroupBox.SuspendLayout();
    6978      this.resultsInfoPanel.SuspendLayout();
     
    106115      // splitContainer.Panel1
    107116      //
    108       this.splitContainer.Panel1.Controls.Add(this.filtersGroupBox);
     117      this.splitContainer.Panel1.Controls.Add(this.filterTabControl);
    109118      //
    110119      // splitContainer.Panel2
     
    115124      this.splitContainer.TabIndex = 0;
    116125      //
     126      // filterTabControl
     127      //
     128      this.filterTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     129                  | System.Windows.Forms.AnchorStyles.Left)
     130                  | System.Windows.Forms.AnchorStyles.Right)));
     131      this.filterTabControl.Controls.Add(this.filterTabPage);
     132      this.filterTabControl.Controls.Add(this.constraintsTabPage);
     133      this.filterTabControl.Location = new System.Drawing.Point(3, 3);
     134      this.filterTabControl.Name = "filterTabControl";
     135      this.filterTabControl.SelectedIndex = 0;
     136      this.filterTabControl.Size = new System.Drawing.Size(832, 276);
     137      this.filterTabControl.TabIndex = 1;
     138      //
     139      // filterTabPage
     140      //
     141      this.filterTabPage.Controls.Add(this.filtersGroupBox);
     142      this.filterTabPage.Location = new System.Drawing.Point(4, 22);
     143      this.filterTabPage.Name = "filterTabPage";
     144      this.filterTabPage.Padding = new System.Windows.Forms.Padding(3);
     145      this.filterTabPage.Size = new System.Drawing.Size(824, 250);
     146      this.filterTabPage.TabIndex = 0;
     147      this.filterTabPage.Text = "Filter";
     148      this.filterTabPage.UseVisualStyleBackColor = true;
     149      //
    117150      // filtersGroupBox
    118151      //
     
    122155      this.filtersGroupBox.Controls.Add(this.filterPanel);
    123156      this.filtersGroupBox.Controls.Add(this.refreshFiltersButton);
    124       this.filtersGroupBox.Location = new System.Drawing.Point(0, 0);
     157      this.filtersGroupBox.Location = new System.Drawing.Point(6, 6);
    125158      this.filtersGroupBox.Name = "filtersGroupBox";
    126       this.filtersGroupBox.Size = new System.Drawing.Size(838, 279);
     159      this.filtersGroupBox.Size = new System.Drawing.Size(812, 238);
    127160      this.filtersGroupBox.TabIndex = 0;
    128161      this.filtersGroupBox.TabStop = false;
     
    136169      this.filterPanel.Location = new System.Drawing.Point(6, 19);
    137170      this.filterPanel.Name = "filterPanel";
    138       this.filterPanel.Size = new System.Drawing.Size(796, 254);
     171      this.filterPanel.Size = new System.Drawing.Size(770, 213);
    139172      this.filterPanel.TabIndex = 1;
    140173      //
     
    143176      this.refreshFiltersButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    144177      this.refreshFiltersButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
    145       this.refreshFiltersButton.Location = new System.Drawing.Point(808, 21);
     178      this.refreshFiltersButton.Location = new System.Drawing.Point(782, 21);
    146179      this.refreshFiltersButton.Name = "refreshFiltersButton";
    147180      this.refreshFiltersButton.Size = new System.Drawing.Size(24, 24);
     
    149182      this.refreshFiltersButton.UseVisualStyleBackColor = true;
    150183      this.refreshFiltersButton.Click += new System.EventHandler(this.refreshFiltersButton_Click);
     184      //
     185      // constraintsTabPage
     186      //
     187      this.constraintsTabPage.Controls.Add(this.deselectAllButton);
     188      this.constraintsTabPage.Controls.Add(this.selectAllButton);
     189      this.constraintsTabPage.Controls.Add(this.constraintsCheckedListBox);
     190      this.constraintsTabPage.Location = new System.Drawing.Point(4, 22);
     191      this.constraintsTabPage.Name = "constraintsTabPage";
     192      this.constraintsTabPage.Padding = new System.Windows.Forms.Padding(3);
     193      this.constraintsTabPage.Size = new System.Drawing.Size(824, 250);
     194      this.constraintsTabPage.TabIndex = 1;
     195      this.constraintsTabPage.Text = "Downloaded Values";
     196      this.constraintsTabPage.UseVisualStyleBackColor = true;
    151197      //
    152198      // resultsGroupBox
     
    245291      this.filtersInfoLabel.Text = "Loading Filters ...";
    246292      this.filtersInfoLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     293      //
     294      // constraintsCheckedListBox
     295      //
     296      this.constraintsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     297                  | System.Windows.Forms.AnchorStyles.Left)
     298                  | System.Windows.Forms.AnchorStyles.Right)));
     299      this.constraintsCheckedListBox.CheckOnClick = true;
     300      this.constraintsCheckedListBox.FormattingEnabled = true;
     301      this.constraintsCheckedListBox.Location = new System.Drawing.Point(6, 6);
     302      this.constraintsCheckedListBox.Name = "constraintsCheckedListBox";
     303      this.constraintsCheckedListBox.Size = new System.Drawing.Size(812, 214);
     304      this.constraintsCheckedListBox.Sorted = true;
     305      this.constraintsCheckedListBox.TabIndex = 0;
     306      //
     307      // selectAllButton
     308      //
     309      this.selectAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     310      this.selectAllButton.Location = new System.Drawing.Point(6, 221);
     311      this.selectAllButton.Name = "selectAllButton";
     312      this.selectAllButton.Size = new System.Drawing.Size(75, 23);
     313      this.selectAllButton.TabIndex = 1;
     314      this.selectAllButton.Text = "Select all";
     315      this.selectAllButton.UseVisualStyleBackColor = true;
     316      this.selectAllButton.Click += new System.EventHandler(this.selectAllButton_Click);
     317      //
     318      // deselectAllButton
     319      //
     320      this.deselectAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     321      this.deselectAllButton.Location = new System.Drawing.Point(88, 221);
     322      this.deselectAllButton.Name = "deselectAllButton";
     323      this.deselectAllButton.Size = new System.Drawing.Size(75, 23);
     324      this.deselectAllButton.TabIndex = 2;
     325      this.deselectAllButton.Text = "Deselect all";
     326      this.deselectAllButton.UseVisualStyleBackColor = true;
     327      this.deselectAllButton.Click += new System.EventHandler(this.deselectAllButton_Click);
    247328      //
    248329      // QueryView
     
    259340      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    260341      this.splitContainer.ResumeLayout(false);
     342      this.filterTabControl.ResumeLayout(false);
     343      this.filterTabPage.ResumeLayout(false);
    261344      this.filtersGroupBox.ResumeLayout(false);
     345      this.constraintsTabPage.ResumeLayout(false);
    262346      this.resultsGroupBox.ResumeLayout(false);
    263347      this.resultsGroupBox.PerformLayout();
     
    285369    private System.Windows.Forms.Button refreshFiltersButton;
    286370    private System.Windows.Forms.CheckBox includeBinaryValuesCheckBox;
     371    private System.Windows.Forms.TabControl filterTabControl;
     372    private System.Windows.Forms.TabPage filterTabPage;
     373    private System.Windows.Forms.TabPage constraintsTabPage;
     374    private System.Windows.Forms.Button deselectAllButton;
     375    private System.Windows.Forms.Button selectAllButton;
     376    private System.Windows.Forms.CheckedListBox constraintsCheckedListBox;
    287377
    288378  }
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs

    r7573 r7589  
    2121
    2222using System;
     23using System.Collections;
     24using System.Collections.Generic;
    2325using System.IO;
    2426using System.Linq;
     
    7577    private void LoadResultsAsync(int batchSize) {
    7678      bool includeBinaryValues = includeBinaryValuesCheckBox.Checked;
     79      IEnumerable<ValueName> valueNames = constraintsCheckedListBox.CheckedItems.Cast<ValueName>();
    7780
    7881      Cursor = Cursors.AppStarting;
     
    99102        while (ids.Count() > 0) {
    100103          cancellationToken.ThrowIfCancellationRequested();
    101           runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x)));
     104          if (AllValueNamesChecked()) {
     105            runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x)));
     106          } else {
     107            runs.AddRange(QueryClient.Instance.GetRunsWithValues(ids.Take(batchSize), includeBinaryValues, valueNames).Select(x => ConvertToOptimizationRun(x)));
     108          }
    102109          ids = ids.Skip(batchSize);
    103110          Invoke(new Action(() => {
     
    146153      } else {
    147154        CreateFilterView();
     155        CreateConstraintsView();
    148156        filtersInfoPanel.Visible = false;
    149157        splitContainer.Enabled = true;
     
    179187        }
    180188      }
     189    }
     190
     191    private void CreateConstraintsView() {
     192      constraintsCheckedListBox.Items.Clear();
     193      constraintsCheckedListBox.Items.AddRange(QueryClient.Instance.ValueNames.ToArray());
     194      SetCheckedState(true);
    181195    }
    182196
     
    221235      return null;
    222236    }
     237
     238    private void SetCheckedState(bool val) {
     239      for (int i = 0; i < constraintsCheckedListBox.Items.Count; i++) {
     240        constraintsCheckedListBox.SetItemChecked(i, val);
     241      }
     242    }
     243
     244    private bool AllValueNamesChecked() {
     245      return constraintsCheckedListBox.Items.Count == constraintsCheckedListBox.CheckedItems.Count;
     246    }
     247
     248    private void selectAllButton_Click(object sender, EventArgs e) {
     249      SetCheckedState(true);
     250    }
     251
     252    private void deselectAllButton_Click(object sender, EventArgs e) {
     253      SetCheckedState(false);
     254    }
    223255  }
    224256}
Note: See TracChangeset for help on using the changeset viewer.