Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/08/14 15:08:22 (11 years ago)
Author:
pfleck
Message:

Started saving Problem from Preprocessor.
Saving actual changed values not yet implemented.

Location:
branches/DataPreprocessing
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataPreprocessorStarter.cs

    r10251 r10307  
    3434    public void Start(IDataAnalysisProblemData problemData, View currentView) {
    3535      IAlgorithm algorithm;
    36       IItem parentItem = GetMostOuterContent(currentView, out algorithm);
    37       var context = new PreprocessingContext(problemData, parentItem, algorithm);
     36      IProblem problem;
     37      IItem parentItem = GetMostOuterContent(currentView, out algorithm, out problem);
     38      var context = new PreprocessingContext(problemData, parentItem, algorithm, problem);
    3839      MainFormManager.MainForm.ShowContent(context);
    3940    }
    4041
    41     private IItem GetMostOuterContent(Control control, out IAlgorithm algorithm) {
     42    private IItem GetMostOuterContent(Control control, out IAlgorithm algorithm, out IProblem problem) {
    4243      algorithm = null;
     44      problem = null;
    4345      ItemView itemView = null;
    4446      do {
     
    4951            algorithm = (IAlgorithm)itemView.Content;
    5052          }
     53          if (itemView.Content is IProblem) {
     54            problem = (IProblem)itemView.Content;
     55          }
    5156        }
    5257      } while (control != null);
     
    5459      return itemView.Content;
    5560    }
    56 
    5761  }
    58 
    5962}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingContext.cs

    r10250 r10307  
    2828  [Item("PreprocessingContext", "PreprocessingContext")]
    2929  public class PreprocessingContext : Item, IPreprocessingContext {
    30     public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IItem parentItem, IAlgorithm algorithm) {
     30    public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IItem parentItem, IAlgorithm algorithm, IProblem problem) {
    3131      Data = new PreprocessingData(dataAnalysisProblemData);
    3232      ParentItem = parentItem;
    3333      DataAnalysisProblemData = dataAnalysisProblemData;
    3434      Algorithm = algorithm;
     35      Problem = problem;
    3536    }
    3637
     
    4142      DataAnalysisProblemData = original.DataAnalysisProblemData;
    4243      Algorithm = original.Algorithm;
     44      Problem = original.Problem;
    4345    }
    4446
     
    5456    public IAlgorithm Algorithm { get; private set; }
    5557
     58    public IProblem Problem { get; private set; }
     59
    5660    public override IDeepCloneable Clone(Cloner cloner) {
    5761      return new PreprocessingContext(this, cloner);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingContext.cs

    r10240 r10307  
    2323using HeuristicLab.Optimization;
    2424using HeuristicLab.Problems.DataAnalysis;
     25
    2526namespace HeuristicLab.DataPreprocessing {
    2627  public interface IPreprocessingContext : IItem {
     
    3536
    3637    IAlgorithm Algorithm { get; }
     38
     39    IProblem Problem { get; }
    3740  }
    3841}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs

    r10304 r10307  
    105105
    106106    private void exportProblemButton_Click(object sender, EventArgs e) {
    107       // TODO
     107      var saveFileDialog = new SaveFileDialog {
     108        Title = "Save Item",
     109        DefaultExt = "hl",
     110        Filter = "Uncompressed HeuristicLab Files|*.hl|HeuristicLab Files|*.hl|All Files|*.*",
     111        FilterIndex = 2
     112      };
     113
     114      var content = Content.Problem as IStorableContent;
     115      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
     116        bool compressed = saveFileDialog.FilterIndex != 1;
     117        ContentManager.Save(content, saveFileDialog.FileName, compressed);
     118      }
    108119    }
    109120
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.designer.cs

    r10304 r10307  
    123123    #endregion
    124124
    125     private System.Windows.Forms.SplitContainer splitContainer1;
    126125    private System.Windows.Forms.ListView contentListView;
    127126    private System.Windows.Forms.Button exportProblemButton;
    128127    private System.Windows.Forms.Button applyInNewTabButton;
    129128    private MainForm.WindowsForms.ViewHost viewHost;
     129    private System.Windows.Forms.SplitContainer splitContainer1;
    130130
    131131  }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDataPreprocessorStarter.cs

    r10250 r10307  
    2020#endregion
    2121
    22 
    2322using HeuristicLab.MainForm.WindowsForms;
    2423
Note: See TracChangeset for help on using the changeset viewer.