Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/30/10 14:35:21 (14 years ago)
Author:
mkommend
Message:

Added persistence, cloning to CrossValidation (ticket #1199)

Location:
branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.Designer.cs

    r4536 r4542  
    7373      this.openAlgorithmButton = new System.Windows.Forms.Button();
    7474      this.newAlgorithmButton = new System.Windows.Forms.Button();
    75       this.workerTabPage = new System.Windows.Forms.TabPage();
     75      this.foldsTabPage = new System.Windows.Forms.TabPage();
    7676      this.algorithmResultsCollectionView = new HeuristicLab.Algorithms.DataAnalysis.Views.AlgorithmResultsCollectionView();
    7777      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     
    8484      this.algorithmProblemTabPage.SuspendLayout();
    8585      this.algorithmParametersTabPage.SuspendLayout();
    86       this.workerTabPage.SuspendLayout();
     86      this.foldsTabPage.SuspendLayout();
    8787      this.SuspendLayout();
    8888      //
     
    284284                  | System.Windows.Forms.AnchorStyles.Right)));
    285285      this.tabControl.Controls.Add(this.algorithmTabPage);
    286       this.tabControl.Controls.Add(this.workerTabPage);
     286      this.tabControl.Controls.Add(this.foldsTabPage);
    287287      this.tabControl.Location = new System.Drawing.Point(0, 157);
    288288      this.tabControl.Name = "tabControl";
     
    431431      this.newAlgorithmButton.Click += new System.EventHandler(this.newAlgorithmButton_Click);
    432432      //
    433       // workerTabPage
    434       //
    435       this.workerTabPage.Controls.Add(this.algorithmResultsCollectionView);
    436       this.workerTabPage.Location = new System.Drawing.Point(4, 22);
    437       this.workerTabPage.Name = "workerTabPage";
    438       this.workerTabPage.Padding = new System.Windows.Forms.Padding(3);
    439       this.workerTabPage.Size = new System.Drawing.Size(649, 325);
    440       this.workerTabPage.TabIndex = 1;
    441       this.workerTabPage.Text = "Worker";
    442       this.workerTabPage.UseVisualStyleBackColor = true;
     433      // foldsTabPage
     434      //
     435      this.foldsTabPage.Controls.Add(this.algorithmResultsCollectionView);
     436      this.foldsTabPage.Location = new System.Drawing.Point(4, 22);
     437      this.foldsTabPage.Name = "foldsTabPage";
     438      this.foldsTabPage.Padding = new System.Windows.Forms.Padding(3);
     439      this.foldsTabPage.Size = new System.Drawing.Size(649, 325);
     440      this.foldsTabPage.TabIndex = 1;
     441      this.foldsTabPage.Text = "Folds";
     442      this.foldsTabPage.UseVisualStyleBackColor = true;
    443443      //
    444444      // algorithmResultsCollectionView
     
    508508      this.algorithmProblemTabPage.ResumeLayout(false);
    509509      this.algorithmParametersTabPage.ResumeLayout(false);
    510       this.workerTabPage.ResumeLayout(false);
     510      this.foldsTabPage.ResumeLayout(false);
    511511      this.ResumeLayout(false);
    512512      this.PerformLayout();
     
    533533    private System.Windows.Forms.TabControl tabControl;
    534534    private System.Windows.Forms.TabPage algorithmTabPage;
    535     private System.Windows.Forms.TabPage workerTabPage;
     535    private System.Windows.Forms.TabPage foldsTabPage;
    536536    private System.Windows.Forms.Button openAlgorithmButton;
    537537    private System.Windows.Forms.Button newAlgorithmButton;
  • branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.cs

    r4536 r4542  
    3131
    3232namespace HeuristicLab.Algorithms.DataAnalysis.Views {
     33  [View("Cross Validation View")]
    3334  [Content(typeof(CrossValidation), true)]
    34   public partial class CrossValidationView : NamedItemView {
     35  public sealed partial class CrossValidationView : NamedItemView {
    3536    private TypeSelectorDialog algorithmTypeSelectorDialog;
    3637    private TypeSelectorDialog problemTypeSelectorDialog;
     
    3839    public CrossValidationView() {
    3940      InitializeComponent();
     41      workersNumericUpDown.Maximum = Environment.ProcessorCount * 2;
    4042    }
    4143
     
    5759        algorithmResultsCollectionView.Content = null;
    5860      } else {
     61        Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;
    5962        workersNumericUpDown.Value = Content.NumberOfWorkers.Value;
    6063        foldsNumericUpDown.Value = Content.Folds.Value;
     
    7881      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
    7982      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    80       Content.Prepared += new EventHandler(Content_Prepared);
    81       Content.Started += new EventHandler(Content_Started);
    82       Content.Paused += new EventHandler(Content_Paused);
    83       Content.Stopped += new EventHandler(Content_Stopped);
    8483    }
    8584
     
    9392      Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);
    9493      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
    95       Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    96       Content.Prepared -= new EventHandler(Content_Prepared);
    97       Content.Started -= new EventHandler(Content_Started);
    98       Content.Paused -= new EventHandler(Content_Paused);
    99       Content.Stopped -= new EventHandler(Content_Stopped);
     94      Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
    10095    }
    10196
     
    111106          samplesEndStringConvertibleValueView.Enabled = Content.Problem != null;
    112107        }
     108        SetEnabledStateOfExecutableButtons();
     109      }
     110    }
     111    private void SetEnabledStateOfExecutableButtons() {
     112      if (Content == null) {
     113        startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
     114        foldsNumericUpDown.Enabled = workersNumericUpDown.Enabled = false;
     115        samplesStartStringConvertibleValueView.Enabled = samplesEndStringConvertibleValueView.Enabled = false;
     116      } else {
     117        startButton.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);
     118        pauseButton.Enabled = Content.ExecutionState == ExecutionState.Started;
     119        stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);
     120        resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;
     121        foldsNumericUpDown.Enabled = Content.ExecutionState == ExecutionState.Prepared;
     122        samplesStartStringConvertibleValueView.Enabled = Content.ExecutionState == ExecutionState.Prepared;
     123        samplesEndStringConvertibleValueView.Enabled = Content.ExecutionState == ExecutionState.Prepared;
     124        workersNumericUpDown.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);
    113125      }
    114126    }
     
    145157      if (InvokeRequired)
    146158        Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);
    147       else
    148         startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
    149     }
    150     private void Content_Prepared(object sender, EventArgs e) {
    151       if (InvokeRequired)
    152         Invoke(new EventHandler(Content_Prepared), sender, e);
    153159      else {
    154         ReadOnly = Locked = false;
     160        Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;
    155161        SetEnabledStateOfExecutableButtons();
    156162      }
    157163    }
    158     private void Content_Started(object sender, EventArgs e) {
    159       if (InvokeRequired)
    160         Invoke(new EventHandler(Content_Started), sender, e);
    161       else {
    162         ReadOnly = Locked = true;
    163         SetEnabledStateOfExecutableButtons();
    164       }
    165     }
    166     private void Content_Paused(object sender, EventArgs e) {
    167       if (InvokeRequired)
    168         Invoke(new EventHandler(Content_Paused), sender, e);
    169       else {
    170         ReadOnly = Locked = false;
    171         SetEnabledStateOfExecutableButtons();
    172       }
    173     }
    174     private void Content_Stopped(object sender, EventArgs e) {
    175       if (InvokeRequired)
    176         Invoke(new EventHandler(Content_Stopped), sender, e);
    177       else {
    178         ReadOnly = Locked = false;
    179         SetEnabledStateOfExecutableButtons();
    180       }
    181     }
     164
    182165    private void Content_ExecutionTimeChanged(object sender, EventArgs e) {
    183166      if (InvokeRequired)
     
    296279            if (error != null) throw error;
    297280            IDataAnalysisProblem problem = content as IDataAnalysisProblem;
    298             if (problem == null)
     281            if (problem == null && (Content.Algorithm.ProblemType.IsAssignableFrom(content.GetType())))
    299282              Invoke(new Action(() =>
    300283                MessageBox.Show(this, "The selected file does not contain a DataAnalysisProblem problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error)));
     
    336319    }
    337320
    338     protected virtual void algorithmProblemTabPage_DragEnterOver(object sender, DragEventArgs e) {
     321    private void algorithmProblemTabPage_DragEnterOver(object sender, DragEventArgs e) {
    339322      e.Effect = DragDropEffects.None;
    340323      Type type = e.Data.GetData("Type") as Type;
    341       if ((type != null) && (typeof(IDataAnalysisProblem).IsAssignableFrom(type))) {
     324      if ((type != null) && (typeof(IDataAnalysisProblem).IsAssignableFrom(type)) &&
     325        (Content.Algorithm.ProblemType.IsAssignableFrom(type))) {
    342326        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    343327        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     
    347331      }
    348332    }
    349     protected virtual void algorithmProblemTabPage_DragDrop(object sender, DragEventArgs e) {
     333    private void algorithmProblemTabPage_DragDrop(object sender, DragEventArgs e) {
    350334      if (e.Effect != DragDropEffects.None) {
    351335        IDataAnalysisProblem problem = e.Data.GetData("Value") as IDataAnalysisProblem;
     
    355339    }
    356340    #endregion
    357 
    358     #region Helpers
    359     private void SetEnabledStateOfExecutableButtons() {
    360       if (Content == null) {
    361         startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
    362       } else {
    363         startButton.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);
    364         pauseButton.Enabled = Content.ExecutionState == ExecutionState.Started;
    365         stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);
    366         resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;
    367       }
    368     }
    369     #endregion
    370341  }
    371342}
  • branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.resx

    r4536 r4542  
    121121    <value>107, 17</value>
    122122  </metadata>
    123   <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124     <value>107, 17</value>
    125   </metadata>
    126123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    127124    <value>17, 17</value>
  • branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/HeuristicLabAlgorithmsDataAnalysisViewsPlugin.cs.frame

    r4472 r4542  
    2626  /// Plugin class for HeuristicLab.Algorithms.DataAnalysis.Views plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Algorithms.DataAnalysis.Views", "3.3.0.$WCREV$")]
     28  [Plugin("HeuristicLab.Algorithms.DataAnalysis.Views", "3.3.1.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Algorithms.DataAnalysis.Views-3.3.dll", PluginFileType.Assembly)]
    3030  public class HeuristicLabAlgorithmsDataAnalysisViewsPlugin : PluginBase {
  • branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/Properties/AssemblyInfo.frame

    r4472 r4542  
    5252// You can specify all the values or you can default the Revision and Build Numbers
    5353// by using the '*' as shown below:
    54 [assembly: AssemblyVersion("3.3.0.0")]
    55 [assembly: AssemblyFileVersion("3.3.0.$WCREV$")]
     54[assembly: AssemblyVersion("3.3.1.0")]
     55[assembly: AssemblyFileVersion("3.3.1.$WCREV$")]
Note: See TracChangeset for help on using the changeset viewer.