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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.