Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5647


Ignore:
Timestamp:
03/10/11 00:36:46 (13 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

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

Legend:

Unmodified
Added
Removed
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLab.Clients.OKB-3.3.csproj

    r5640 r5647  
    305305      <DependentUpon>OKBAlgorithmView.cs</DependentUpon>
    306306    </Compile>
    307     <Compile Include="RunCreation\Views\OKBProblemView.cs">
    308       <SubType>UserControl</SubType>
    309     </Compile>
    310     <Compile Include="RunCreation\Views\OKBProblemView.Designer.cs">
    311       <DependentUpon>OKBProblemView.cs</DependentUpon>
     307    <Compile Include="RunCreation\Views\ProblemView.cs">
     308      <SubType>UserControl</SubType>
     309    </Compile>
     310    <Compile Include="RunCreation\Views\ProblemView.Designer.cs">
     311      <DependentUpon>ProblemView.cs</DependentUpon>
    312312    </Compile>
    313313    <None Include="app.config" />
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBAlgorithmView.Designer.cs

    r5640 r5647  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using HeuristicLab.Optimization.Views;
    2223namespace HeuristicLab.Clients.OKB.RunCreation {
    2324  partial class OKBAlgorithmView {
     
    2728    private System.ComponentModel.IContainer components = null;
    2829
    29     /// <summary>
    30     /// Clean up any resources being used.
    31     /// </summary>
    32     /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    33     protected override void Dispose(bool disposing) {
    34       if (disposing) {
    35         if (components != null) components.Dispose();
    36       }
    37       base.Dispose(disposing);
    38     }
    39 
    4030    #region Component Designer generated code
    4131
     
    4535    /// </summary>
    4636    private void InitializeComponent() {
    47       this.components = new System.ComponentModel.Container();
     37      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
     38      this.problemTabPage = new System.Windows.Forms.TabPage();
     39      this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     40      this.openProblemButton = new System.Windows.Forms.Button();
     41      this.newProblemButton = new System.Windows.Forms.Button();
     42      this.parametersTabPage = new System.Windows.Forms.TabPage();
     43      this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
     44      this.resultsTabPage = new System.Windows.Forms.TabPage();
     45      this.resultsView = new HeuristicLab.Optimization.Views.ResultCollectionView();
     46      this.runsTabPage = new System.Windows.Forms.TabPage();
     47      this.storeAlgorithmInEachRunCheckBox = new System.Windows.Forms.CheckBox();
     48      this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();
     49      this.startButton = new System.Windows.Forms.Button();
     50      this.pauseButton = new System.Windows.Forms.Button();
     51      this.resetButton = new System.Windows.Forms.Button();
     52      this.executionTimeLabel = new System.Windows.Forms.Label();
     53      this.executionTimeTextBox = new System.Windows.Forms.TextBox();
     54      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     55      this.stopButton = new System.Windows.Forms.Button();
     56      this.algorithmComboBox = new System.Windows.Forms.ComboBox();
    4857      this.algorithmLabel = new System.Windows.Forms.Label();
    49       this.algorithmComboBox = new System.Windows.Forms.ComboBox();
    5058      this.refreshButton = new System.Windows.Forms.Button();
    51       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    52       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     59      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     60      this.tabControl.SuspendLayout();
     61      this.problemTabPage.SuspendLayout();
     62      this.parametersTabPage.SuspendLayout();
     63      this.resultsTabPage.SuspendLayout();
     64      this.runsTabPage.SuspendLayout();
    5365      this.SuspendLayout();
     66      //
     67      // nameTextBox
     68      //
     69      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     70      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
     71      this.nameTextBox.Location = new System.Drawing.Point(72, 29);
     72      this.nameTextBox.Size = new System.Drawing.Size(607, 20);
     73      this.nameTextBox.TabIndex = 4;
     74      //
     75      // nameLabel
     76      //
     77      this.nameLabel.Location = new System.Drawing.Point(3, 32);
     78      this.nameLabel.TabIndex = 3;
     79      //
     80      // descriptionLabel
     81      //
     82      this.descriptionLabel.Location = new System.Drawing.Point(3, 58);
     83      this.descriptionLabel.TabIndex = 5;
     84      //
     85      // descriptionTextBox
     86      //
     87      this.descriptionTextBox.Location = new System.Drawing.Point(72, 55);
     88      this.descriptionTextBox.Size = new System.Drawing.Size(607, 20);
     89      this.descriptionTextBox.TabIndex = 6;
     90      //
     91      // tabControl
     92      //
     93      this.tabControl.AllowDrop = true;
     94      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     95                  | System.Windows.Forms.AnchorStyles.Left)
     96                  | System.Windows.Forms.AnchorStyles.Right)));
     97      this.tabControl.Controls.Add(this.problemTabPage);
     98      this.tabControl.Controls.Add(this.parametersTabPage);
     99      this.tabControl.Controls.Add(this.resultsTabPage);
     100      this.tabControl.Controls.Add(this.runsTabPage);
     101      this.tabControl.Location = new System.Drawing.Point(0, 81);
     102      this.tabControl.Name = "tabControl";
     103      this.tabControl.SelectedIndex = 0;
     104      this.tabControl.Size = new System.Drawing.Size(679, 371);
     105      this.tabControl.TabIndex = 7;
     106      //
     107      // problemTabPage
     108      //
     109      this.problemTabPage.AllowDrop = true;
     110      this.problemTabPage.Controls.Add(this.problemViewHost);
     111      this.problemTabPage.Controls.Add(this.openProblemButton);
     112      this.problemTabPage.Controls.Add(this.newProblemButton);
     113      this.problemTabPage.Location = new System.Drawing.Point(4, 22);
     114      this.problemTabPage.Name = "problemTabPage";
     115      this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);
     116      this.problemTabPage.Size = new System.Drawing.Size(671, 345);
     117      this.problemTabPage.TabIndex = 0;
     118      this.problemTabPage.Text = "Problem";
     119      this.problemTabPage.UseVisualStyleBackColor = true;
     120      this.problemTabPage.DragDrop += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragDrop);
     121      this.problemTabPage.DragEnter += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragEnterOver);
     122      this.problemTabPage.DragOver += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragEnterOver);
     123      //
     124      // problemViewHost
     125      //
     126      this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     127                  | System.Windows.Forms.AnchorStyles.Left)
     128                  | System.Windows.Forms.AnchorStyles.Right)));
     129      this.problemViewHost.Caption = "View";
     130      this.problemViewHost.Content = null;
     131      this.problemViewHost.Enabled = false;
     132      this.problemViewHost.Location = new System.Drawing.Point(6, 36);
     133      this.problemViewHost.Name = "problemViewHost";
     134      this.problemViewHost.ReadOnly = false;
     135      this.problemViewHost.Size = new System.Drawing.Size(659, 303);
     136      this.problemViewHost.TabIndex = 3;
     137      this.problemViewHost.ViewsLabelVisible = true;
     138      this.problemViewHost.ViewType = null;
     139      //
     140      // openProblemButton
     141      //
     142      this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
     143      this.openProblemButton.Location = new System.Drawing.Point(36, 6);
     144      this.openProblemButton.Name = "openProblemButton";
     145      this.openProblemButton.Size = new System.Drawing.Size(24, 24);
     146      this.openProblemButton.TabIndex = 1;
     147      this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");
     148      this.openProblemButton.UseVisualStyleBackColor = true;
     149      this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);
     150      //
     151      // newProblemButton
     152      //
     153      this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
     154      this.newProblemButton.Location = new System.Drawing.Point(6, 6);
     155      this.newProblemButton.Name = "newProblemButton";
     156      this.newProblemButton.Size = new System.Drawing.Size(24, 24);
     157      this.newProblemButton.TabIndex = 0;
     158      this.toolTip.SetToolTip(this.newProblemButton, "New Problem");
     159      this.newProblemButton.UseVisualStyleBackColor = true;
     160      this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);
     161      //
     162      // parametersTabPage
     163      //
     164      this.parametersTabPage.Controls.Add(this.parameterCollectionView);
     165      this.parametersTabPage.Location = new System.Drawing.Point(4, 22);
     166      this.parametersTabPage.Name = "parametersTabPage";
     167      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
     168      this.parametersTabPage.Size = new System.Drawing.Size(671, 345);
     169      this.parametersTabPage.TabIndex = 1;
     170      this.parametersTabPage.Text = "Parameters";
     171      this.parametersTabPage.UseVisualStyleBackColor = true;
     172      //
     173      // parameterCollectionView
     174      //
     175      this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     176                  | System.Windows.Forms.AnchorStyles.Left)
     177                  | System.Windows.Forms.AnchorStyles.Right)));
     178      this.parameterCollectionView.Caption = "ParameterCollection View";
     179      this.parameterCollectionView.Content = null;
     180      this.parameterCollectionView.Location = new System.Drawing.Point(6, 6);
     181      this.parameterCollectionView.Name = "parameterCollectionView";
     182      this.parameterCollectionView.ReadOnly = false;
     183      this.parameterCollectionView.Size = new System.Drawing.Size(659, 333);
     184      this.parameterCollectionView.TabIndex = 0;
     185      //
     186      // resultsTabPage
     187      //
     188      this.resultsTabPage.Controls.Add(this.resultsView);
     189      this.resultsTabPage.Location = new System.Drawing.Point(4, 22);
     190      this.resultsTabPage.Name = "resultsTabPage";
     191      this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3);
     192      this.resultsTabPage.Size = new System.Drawing.Size(671, 345);
     193      this.resultsTabPage.TabIndex = 2;
     194      this.resultsTabPage.Text = "Results";
     195      this.resultsTabPage.UseVisualStyleBackColor = true;
     196      //
     197      // resultsView
     198      //
     199      this.resultsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     200                  | System.Windows.Forms.AnchorStyles.Left)
     201                  | System.Windows.Forms.AnchorStyles.Right)));
     202      this.resultsView.Caption = "ResultCollection View";
     203      this.resultsView.Content = null;
     204      this.resultsView.Location = new System.Drawing.Point(6, 6);
     205      this.resultsView.Name = "resultsView";
     206      this.resultsView.ReadOnly = true;
     207      this.resultsView.Size = new System.Drawing.Size(659, 333);
     208      this.resultsView.TabIndex = 0;
     209      //
     210      // runsTabPage
     211      //
     212      this.runsTabPage.Controls.Add(this.storeAlgorithmInEachRunCheckBox);
     213      this.runsTabPage.Controls.Add(this.runsView);
     214      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
     215      this.runsTabPage.Name = "runsTabPage";
     216      this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
     217      this.runsTabPage.Size = new System.Drawing.Size(671, 345);
     218      this.runsTabPage.TabIndex = 3;
     219      this.runsTabPage.Text = "Runs";
     220      this.runsTabPage.UseVisualStyleBackColor = true;
     221      //
     222      // storeAlgorithmInEachRunCheckBox
     223      //
     224      this.storeAlgorithmInEachRunCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     225      this.storeAlgorithmInEachRunCheckBox.AutoSize = true;
     226      this.storeAlgorithmInEachRunCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
     227      this.storeAlgorithmInEachRunCheckBox.Checked = true;
     228      this.storeAlgorithmInEachRunCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     229      this.storeAlgorithmInEachRunCheckBox.Location = new System.Drawing.Point(503, 6);
     230      this.storeAlgorithmInEachRunCheckBox.Name = "storeAlgorithmInEachRunCheckBox";
     231      this.storeAlgorithmInEachRunCheckBox.Size = new System.Drawing.Size(161, 17);
     232      this.storeAlgorithmInEachRunCheckBox.TabIndex = 1;
     233      this.storeAlgorithmInEachRunCheckBox.Text = "&Store Algorithm in each Run:";
     234      this.toolTip.SetToolTip(this.storeAlgorithmInEachRunCheckBox, "Check to store a copy of the algorithm in each run.");
     235      this.storeAlgorithmInEachRunCheckBox.UseVisualStyleBackColor = true;
     236      this.storeAlgorithmInEachRunCheckBox.CheckedChanged += new System.EventHandler(this.storeAlgorithmInEachRunCheckBox_CheckedChanged);
     237      //
     238      // runsView
     239      //
     240      this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     241                  | System.Windows.Forms.AnchorStyles.Left)
     242                  | System.Windows.Forms.AnchorStyles.Right)));
     243      this.runsView.Caption = "RunCollection View";
     244      this.runsView.Content = null;
     245      this.runsView.Location = new System.Drawing.Point(6, 6);
     246      this.runsView.Name = "runsView";
     247      this.runsView.ReadOnly = false;
     248      this.runsView.Size = new System.Drawing.Size(659, 333);
     249      this.runsView.TabIndex = 0;
     250      //
     251      // startButton
     252      //
     253      this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     254      this.startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;
     255      this.startButton.Location = new System.Drawing.Point(0, 458);
     256      this.startButton.Name = "startButton";
     257      this.startButton.Size = new System.Drawing.Size(24, 24);
     258      this.startButton.TabIndex = 8;
     259      this.toolTip.SetToolTip(this.startButton, "Start/Resume Algorithm");
     260      this.startButton.UseVisualStyleBackColor = true;
     261      this.startButton.Click += new System.EventHandler(this.startButton_Click);
     262      //
     263      // pauseButton
     264      //
     265      this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     266      this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;
     267      this.pauseButton.Location = new System.Drawing.Point(30, 458);
     268      this.pauseButton.Name = "pauseButton";
     269      this.pauseButton.Size = new System.Drawing.Size(24, 24);
     270      this.pauseButton.TabIndex = 9;
     271      this.toolTip.SetToolTip(this.pauseButton, "Pause Algorithm");
     272      this.pauseButton.UseVisualStyleBackColor = true;
     273      this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);
     274      //
     275      // resetButton
     276      //
     277      this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     278      this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;
     279      this.resetButton.Location = new System.Drawing.Point(90, 458);
     280      this.resetButton.Name = "resetButton";
     281      this.resetButton.Size = new System.Drawing.Size(24, 24);
     282      this.resetButton.TabIndex = 11;
     283      this.toolTip.SetToolTip(this.resetButton, "Reset Algorithm");
     284      this.resetButton.UseVisualStyleBackColor = true;
     285      this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
     286      //
     287      // executionTimeLabel
     288      //
     289      this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     290      this.executionTimeLabel.AutoSize = true;
     291      this.executionTimeLabel.Location = new System.Drawing.Point(453, 465);
     292      this.executionTimeLabel.Name = "executionTimeLabel";
     293      this.executionTimeLabel.Size = new System.Drawing.Size(83, 13);
     294      this.executionTimeLabel.TabIndex = 12;
     295      this.executionTimeLabel.Text = "&Execution Time:";
     296      //
     297      // executionTimeTextBox
     298      //
     299      this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     300      this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462);
     301      this.executionTimeTextBox.Name = "executionTimeTextBox";
     302      this.executionTimeTextBox.ReadOnly = true;
     303      this.executionTimeTextBox.Size = new System.Drawing.Size(137, 20);
     304      this.executionTimeTextBox.TabIndex = 13;
     305      //
     306      // openFileDialog
     307      //
     308      this.openFileDialog.DefaultExt = "hl";
     309      this.openFileDialog.FileName = "Problem";
     310      this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";
     311      this.openFileDialog.Title = "Open Problem";
     312      //
     313      // stopButton
     314      //
     315      this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     316      this.stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;
     317      this.stopButton.Location = new System.Drawing.Point(60, 458);
     318      this.stopButton.Name = "stopButton";
     319      this.stopButton.Size = new System.Drawing.Size(24, 24);
     320      this.stopButton.TabIndex = 10;
     321      this.toolTip.SetToolTip(this.stopButton, "Stop Algorithm");
     322      this.stopButton.UseVisualStyleBackColor = true;
     323      this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
     324      //
     325      // algorithmComboBox
     326      //
     327      this.algorithmComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     328                  | System.Windows.Forms.AnchorStyles.Right)));
     329      this.algorithmComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     330      this.algorithmComboBox.FormattingEnabled = true;
     331      this.algorithmComboBox.Location = new System.Drawing.Point(72, 0);
     332      this.algorithmComboBox.Name = "algorithmComboBox";
     333      this.algorithmComboBox.Size = new System.Drawing.Size(577, 21);
     334      this.algorithmComboBox.TabIndex = 1;
     335      this.algorithmComboBox.SelectedValueChanged += new System.EventHandler(this.algorithmComboBox_SelectedValueChanged);
    54336      //
    55337      // algorithmLabel
     
    62344      this.algorithmLabel.Text = "&Algorithm:";
    63345      //
    64       // algorithmComboBox
    65       //
    66       this.algorithmComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    67                   | System.Windows.Forms.AnchorStyles.Right)));
    68       this.algorithmComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    69       this.algorithmComboBox.FormattingEnabled = true;
    70       this.algorithmComboBox.Location = new System.Drawing.Point(62, 1);
    71       this.algorithmComboBox.Name = "algorithmComboBox";
    72       this.algorithmComboBox.Size = new System.Drawing.Size(546, 21);
    73       this.algorithmComboBox.TabIndex = 1;
    74       this.algorithmComboBox.SelectedValueChanged += new System.EventHandler(this.algorithmComboBox_SelectedValueChanged);
    75       //
    76346      // refreshButton
    77347      //
    78348      this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    79       this.refreshButton.Location = new System.Drawing.Point(614, 0);
     349      this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
     350      this.refreshButton.Location = new System.Drawing.Point(655, -1);
    80351      this.refreshButton.Name = "refreshButton";
    81352      this.refreshButton.Size = new System.Drawing.Size(24, 24);
     
    85356      this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
    86357      //
    87       // viewHost
    88       //
    89       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    90                   | System.Windows.Forms.AnchorStyles.Left)
    91                   | System.Windows.Forms.AnchorStyles.Right)));
    92       this.viewHost.Caption = "View";
    93       this.viewHost.Content = null;
    94       this.viewHost.Enabled = false;
    95       this.viewHost.Location = new System.Drawing.Point(0, 30);
    96       this.viewHost.Name = "viewHost";
    97       this.viewHost.ReadOnly = false;
    98       this.viewHost.Size = new System.Drawing.Size(638, 422);
    99       this.viewHost.TabIndex = 3;
    100       this.viewHost.ViewsLabelVisible = true;
    101       this.viewHost.ViewType = null;
    102       //
    103       // OKBAlgorithmView
     358      // AlgorithmView
    104359      //
    105360      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    106361      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    107       this.Controls.Add(this.viewHost);
    108362      this.Controls.Add(this.algorithmComboBox);
    109363      this.Controls.Add(this.algorithmLabel);
    110364      this.Controls.Add(this.refreshButton);
    111       this.Name = "OKBAlgorithmView";
    112       this.Size = new System.Drawing.Size(638, 452);
     365      this.Controls.Add(this.tabControl);
     366      this.Controls.Add(this.startButton);
     367      this.Controls.Add(this.pauseButton);
     368      this.Controls.Add(this.executionTimeTextBox);
     369      this.Controls.Add(this.executionTimeLabel);
     370      this.Controls.Add(this.stopButton);
     371      this.Controls.Add(this.resetButton);
     372      this.Name = "AlgorithmView";
     373      this.Size = new System.Drawing.Size(679, 482);
     374      this.Controls.SetChildIndex(this.resetButton, 0);
     375      this.Controls.SetChildIndex(this.stopButton, 0);
     376      this.Controls.SetChildIndex(this.executionTimeLabel, 0);
     377      this.Controls.SetChildIndex(this.nameLabel, 0);
     378      this.Controls.SetChildIndex(this.descriptionLabel, 0);
     379      this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
     380      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
     381      this.Controls.SetChildIndex(this.pauseButton, 0);
     382      this.Controls.SetChildIndex(this.nameTextBox, 0);
     383      this.Controls.SetChildIndex(this.startButton, 0);
     384      this.Controls.SetChildIndex(this.tabControl, 0);
     385      this.Controls.SetChildIndex(this.refreshButton, 0);
     386      this.Controls.SetChildIndex(this.algorithmLabel, 0);
     387      this.Controls.SetChildIndex(this.algorithmComboBox, 0);
     388      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     389      this.tabControl.ResumeLayout(false);
     390      this.problemTabPage.ResumeLayout(false);
     391      this.parametersTabPage.ResumeLayout(false);
     392      this.resultsTabPage.ResumeLayout(false);
     393      this.runsTabPage.ResumeLayout(false);
     394      this.runsTabPage.PerformLayout();
    113395      this.ResumeLayout(false);
    114396      this.PerformLayout();
     
    118400    #endregion
    119401
     402    protected HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;
     403    protected System.Windows.Forms.TabPage parametersTabPage;
     404    protected System.Windows.Forms.TabPage problemTabPage;
     405    protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
     406    protected HeuristicLab.MainForm.WindowsForms.ViewHost problemViewHost;
     407    protected System.Windows.Forms.Button newProblemButton;
     408    protected System.Windows.Forms.Button openProblemButton;
     409    protected System.Windows.Forms.Button startButton;
     410    protected System.Windows.Forms.Button pauseButton;
     411    protected System.Windows.Forms.Button resetButton;
     412    protected System.Windows.Forms.Label executionTimeLabel;
     413    protected System.Windows.Forms.TextBox executionTimeTextBox;
     414    protected System.Windows.Forms.OpenFileDialog openFileDialog;
     415    protected System.Windows.Forms.TabPage resultsTabPage;
     416    protected HeuristicLab.Optimization.Views.ResultCollectionView resultsView;
     417    protected System.Windows.Forms.Button stopButton;
     418    protected System.Windows.Forms.TabPage runsTabPage;
     419    protected RunCollectionView runsView;
     420    protected System.Windows.Forms.CheckBox storeAlgorithmInEachRunCheckBox;
     421    private System.Windows.Forms.ComboBox algorithmComboBox;
    120422    private System.Windows.Forms.Label algorithmLabel;
    121     private System.Windows.Forms.ComboBox algorithmComboBox;
    122423    private System.Windows.Forms.Button refreshButton;
    123     private System.Windows.Forms.ToolTip toolTip;
    124     private MainForm.WindowsForms.ViewHost viewHost;
    125 
    126 
    127 
    128 
    129424  }
    130425}
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBAlgorithmView.cs

    r5640 r5647  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using System.Windows.Forms;
     26using HeuristicLab.Common;
     27using HeuristicLab.Core;
    2528using HeuristicLab.Core.Views;
    2629using HeuristicLab.MainForm;
    27 using HeuristicLab.MainForm.WindowsForms;
     30using HeuristicLab.Optimization;
     31using HeuristicLab.PluginInfrastructure;
    2832
    2933namespace HeuristicLab.Clients.OKB.RunCreation {
    3034  [View("OKBAlgorithm View")]
    3135  [Content(typeof(OKBAlgorithm), true)]
    32   public sealed partial class OKBAlgorithmView : ItemView {
     36  public partial class OKBAlgorithmView : NamedItemView {
     37    private TypeSelectorDialog problemTypeSelectorDialog;
     38
    3339    public new OKBAlgorithm Content {
    3440      get { return (OKBAlgorithm)base.Content; }
     
    4046    }
    4147
    42     protected override void OnInitialized(System.EventArgs e) {
     48    protected override void Dispose(bool disposing) {
     49      if (disposing) {
     50        if (problemTypeSelectorDialog != null) problemTypeSelectorDialog.Dispose();
     51        if (components != null) components.Dispose();
     52      }
     53      base.Dispose(disposing);
     54    }
     55
     56    protected override void OnInitialized(EventArgs e) {
     57      // Set order of tab pages according to z order.
     58      // NOTE: This is required due to a bug in the VS designer.
     59      List<Control> tabPages = new List<Control>();
     60      for (int i = 0; i < tabControl.Controls.Count; i++) {
     61        tabPages.Add(tabControl.Controls[i]);
     62      }
     63      tabControl.Controls.Clear();
     64      foreach (Control control in tabPages)
     65        tabControl.Controls.Add(control);
     66
    4367      base.OnInitialized(e);
    4468      RunCreationClient.Instance.Refreshing += new EventHandler(RunCreationClient_Refreshing);
     
    4973    protected override void DeregisterContentEvents() {
    5074      Content.AlgorithmChanged -= new EventHandler(Content_AlgorithmChanged);
     75      Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);
     76      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
     77      Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
     78      Content.Prepared -= new EventHandler(Content_Prepared);
     79      Content.Started -= new EventHandler(Content_Started);
     80      Content.Paused -= new EventHandler(Content_Paused);
     81      Content.Stopped -= new EventHandler(Content_Stopped);
     82      Content.ProblemChanged -= new EventHandler(Content_ProblemChanged);
     83      Content.StoreAlgorithmInEachRunChanged -= new EventHandler(Content_StoreAlgorithmInEachRunChanged);
    5184      base.DeregisterContentEvents();
    5285    }
     
    5487      base.RegisterContentEvents();
    5588      Content.AlgorithmChanged += new EventHandler(Content_AlgorithmChanged);
     89      Content.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);
     90      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
     91      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
     92      Content.Prepared += new EventHandler(Content_Prepared);
     93      Content.Started += new EventHandler(Content_Started);
     94      Content.Paused += new EventHandler(Content_Paused);
     95      Content.Stopped += new EventHandler(Content_Stopped);
     96      Content.ProblemChanged += new EventHandler(Content_ProblemChanged);
     97      Content.StoreAlgorithmInEachRunChanged += new EventHandler(Content_StoreAlgorithmInEachRunChanged);
    5698    }
    5799
     
    60102      if (Content == null) {
    61103        algorithmComboBox.SelectedIndex = -1;
    62         viewHost.Content = null;
     104        parameterCollectionView.Content = null;
     105        problemViewHost.Content = null;
     106        resultsView.Content = null;
     107        runsView.Content = null;
     108        storeAlgorithmInEachRunCheckBox.Checked = true;
     109        executionTimeTextBox.Text = "-";
    63110      } else {
    64111        algorithmComboBox.SelectedItem = RunCreationClient.Instance.Algorithms.FirstOrDefault(x => x.Id == Content.AlgorithmId);
    65         viewHost.Content = Content.Algorithm;
    66       }
    67     }
     112        Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;
     113        parameterCollectionView.Content = Content.Parameters;
     114        problemViewHost.ViewType = null;
     115        problemViewHost.Content = Content.Problem;
     116        resultsView.Content = Content.Results.AsReadOnly();
     117        runsView.Content = Content.Runs;
     118        storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun;
     119        executionTimeTextBox.Text = Content.ExecutionTime.ToString();
     120      }
     121    }
     122
    68123    protected override void SetEnabledStateOfControls() {
    69124      base.SetEnabledStateOfControls();
    70125      algorithmComboBox.Enabled = (Content != null) && !ReadOnly && !Locked && (algorithmComboBox.Items.Count > 0);
    71126      refreshButton.Enabled = (Content != null) && !ReadOnly && !Locked;
    72     }
    73 
    74     private void PopulateComboBox() {
    75       algorithmComboBox.DataSource = null;
    76       algorithmComboBox.DataSource = RunCreationClient.Instance.Algorithms.ToList();
    77       algorithmComboBox.DisplayMember = "Name";
     127      parameterCollectionView.Enabled = Content != null;
     128      newProblemButton.Enabled = Content != null && !ReadOnly;
     129      openProblemButton.Enabled = Content != null && !ReadOnly;
     130      problemViewHost.Enabled = Content != null;
     131      resultsView.Enabled = Content != null;
     132      runsView.Enabled = Content != null;
     133      storeAlgorithmInEachRunCheckBox.Enabled = Content != null && !ReadOnly;
     134      executionTimeTextBox.Enabled = Content != null;
     135      SetEnabledStateOfExecutableButtons();
    78136    }
    79137
     
    81139      RunCreationClient.Instance.Refreshing -= new EventHandler(RunCreationClient_Refreshing);
    82140      RunCreationClient.Instance.Refreshed -= new EventHandler(RunCreationClient_Refreshed);
     141      if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) {
     142        //The content must be stopped if no other view showing the content is available
     143        var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IOptimizer>();
     144        if (!optimizers.Contains(Content)) {
     145          var nestedOptimizers = optimizers.SelectMany(opt => opt.NestedOptimizers);
     146          if (!nestedOptimizers.Contains(Content)) Content.Stop();
     147        }
     148      }
    83149      base.OnClosed(e);
    84150    }
     
    89155      } else {
    90156        Cursor = Cursors.AppStarting;
    91         algorithmComboBox.Enabled = refreshButton.Enabled = viewHost.Enabled = false;
     157        Enabled = false;
    92158      }
    93159    }
     
    97163      } else {
    98164        PopulateComboBox();
     165        Enabled = true;
    99166        SetEnabledStateOfControls();
    100167        Cursor = Cursors.Default;
     
    108175      else {
    109176        algorithmComboBox.SelectedItem = RunCreationClient.Instance.Algorithms.FirstOrDefault(x => x.Id == Content.AlgorithmId);
    110         viewHost.Content = Content.Algorithm;
    111       }
     177        OnContentChanged();
     178      }
     179    }
     180    protected virtual void Content_ProblemChanged(object sender, EventArgs e) {
     181      if (InvokeRequired)
     182        Invoke(new EventHandler(Content_ProblemChanged), sender, e);
     183      else {
     184        problemViewHost.ViewType = null;
     185        problemViewHost.Content = Content.Problem;
     186      }
     187    }
     188    protected virtual void Content_ExecutionStateChanged(object sender, EventArgs e) {
     189      if (InvokeRequired)
     190        Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);
     191      else
     192        startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
     193    }
     194    protected virtual void Content_ExecutionTimeChanged(object sender, EventArgs e) {
     195      if (InvokeRequired)
     196        Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);
     197      else
     198        executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();
     199    }
     200    protected virtual void Content_StoreAlgorithmInEachRunChanged(object sender, EventArgs e) {
     201      if (InvokeRequired)
     202        Invoke(new EventHandler(Content_StoreAlgorithmInEachRunChanged), sender, e);
     203      else
     204        storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun;
     205    }
     206    protected virtual void Content_Prepared(object sender, EventArgs e) {
     207      if (InvokeRequired)
     208        Invoke(new EventHandler(Content_Prepared), sender, e);
     209      else {
     210        resultsView.Content = Content.Results.AsReadOnly();
     211        ReadOnly = Locked = false;
     212        SetEnabledStateOfExecutableButtons();
     213      }
     214    }
     215    protected virtual void Content_Started(object sender, EventArgs e) {
     216      if (InvokeRequired)
     217        Invoke(new EventHandler(Content_Started), sender, e);
     218      else {
     219        ReadOnly = Locked = true;
     220        SetEnabledStateOfExecutableButtons();
     221      }
     222    }
     223    protected virtual void Content_Paused(object sender, EventArgs e) {
     224      if (InvokeRequired)
     225        Invoke(new EventHandler(Content_Paused), sender, e);
     226      else {
     227        ReadOnly = Locked = false;
     228        SetEnabledStateOfExecutableButtons();
     229      }
     230    }
     231    protected virtual void Content_Stopped(object sender, EventArgs e) {
     232      if (InvokeRequired)
     233        Invoke(new EventHandler(Content_Stopped), sender, e);
     234      else {
     235        ReadOnly = Locked = false;
     236        SetEnabledStateOfExecutableButtons();
     237      }
     238    }
     239    protected virtual void Content_ExceptionOccurred(object sender, EventArgs<Exception> e) {
     240      if (InvokeRequired)
     241        Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e);
     242      else
     243        ErrorHandling.ShowErrorDialog(this, e.Value);
    112244    }
    113245    #endregion
     
    125257      }
    126258    }
     259    protected virtual void newProblemButton_Click(object sender, EventArgs e) {
     260      if (problemTypeSelectorDialog == null) {
     261        problemTypeSelectorDialog = new TypeSelectorDialog();
     262        problemTypeSelectorDialog.Caption = "Select Problem";
     263        problemTypeSelectorDialog.TypeSelector.Caption = "Available Problems";
     264        problemTypeSelectorDialog.TypeSelector.Configure(Content.ProblemType, false, true);
     265      }
     266      if (problemTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     267        try {
     268          Content.Problem = (IProblem)problemTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     269        }
     270        catch (Exception ex) {
     271          ErrorHandling.ShowErrorDialog(this, ex);
     272        }
     273      }
     274    }
     275    protected virtual void openProblemButton_Click(object sender, EventArgs e) {
     276      openFileDialog.Title = "Open Problem";
     277      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     278        newProblemButton.Enabled = openProblemButton.Enabled = false;
     279        problemViewHost.Enabled = false;
     280
     281        ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {
     282          try {
     283            if (error != null) throw error;
     284            IProblem problem = content as IProblem;
     285            if (problem == null)
     286              Invoke(new Action(() =>
     287                MessageBox.Show(this, "The selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error)));
     288            else if (!Content.ProblemType.IsInstanceOfType(problem))
     289              Invoke(new Action(() =>
     290                MessageBox.Show(this, "The selected file contains a problem type which is not supported by this algorithm.", "Invalid Problem Type", MessageBoxButtons.OK, MessageBoxIcon.Error)));
     291            else
     292              Content.Problem = problem;
     293          }
     294          catch (Exception ex) {
     295            Invoke(new Action(() => ErrorHandling.ShowErrorDialog(this, ex)));
     296          }
     297          finally {
     298            Invoke(new Action(delegate() {
     299              problemViewHost.Enabled = true;
     300              newProblemButton.Enabled = openProblemButton.Enabled = true;
     301            }));
     302          }
     303        });
     304      }
     305    }
     306    protected virtual void storeAlgorithmInEachRunCheckBox_CheckedChanged(object sender, EventArgs e) {
     307      if (Content != null) Content.StoreAlgorithmInEachRun = storeAlgorithmInEachRunCheckBox.Checked;
     308    }
     309    protected virtual void startButton_Click(object sender, EventArgs e) {
     310      Content.Start();
     311    }
     312    protected virtual void pauseButton_Click(object sender, EventArgs e) {
     313      Content.Pause();
     314    }
     315    protected virtual void stopButton_Click(object sender, EventArgs e) {
     316      Content.Stop();
     317    }
     318    protected virtual void resetButton_Click(object sender, EventArgs e) {
     319      Content.Prepare(false);
     320    }
     321    protected virtual void problemTabPage_DragEnterOver(object sender, DragEventArgs e) {
     322      e.Effect = DragDropEffects.None;
     323      Type type = e.Data.GetData("Type") as Type;
     324      if ((type != null) && (Content.ProblemType.IsAssignableFrom(type))) {
     325        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     326        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     327        else if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy;
     328        else if ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move;
     329        else if ((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link;
     330      }
     331    }
     332    protected virtual void problemTabPage_DragDrop(object sender, DragEventArgs e) {
     333      if (e.Effect != DragDropEffects.None) {
     334        IProblem problem = e.Data.GetData("Value") as IProblem;
     335        if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) problem = (IProblem)problem.Clone();
     336        Content.Problem = problem;
     337      }
     338    }
     339    #endregion
     340
     341    #region Helpers
     342    private void PopulateComboBox() {
     343      algorithmComboBox.DataSource = null;
     344      algorithmComboBox.DataSource = RunCreationClient.Instance.Algorithms.ToList();
     345      algorithmComboBox.DisplayMember = "Name";
     346    }
     347    private void SetEnabledStateOfExecutableButtons() {
     348      if (Content == null) {
     349        startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
     350      } else {
     351        startButton.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);
     352        pauseButton.Enabled = Content.ExecutionState == ExecutionState.Started;
     353        stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);
     354        resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;
     355      }
     356    }
    127357    #endregion
    128358  }
Note: See TracChangeset for help on using the changeset viewer.