Free cookie consent management tool by TermsFeed Policy Generator

Changeset 992


Ignore:
Timestamp:
12/15/08 10:48:49 (16 years ago)
Author:
gkronber
Message:

Added basic design for ProblemView #419 (Refactor CEDMA plugins)

Location:
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSet.cs

    r988 r992  
    3030
    3131namespace HeuristicLab.CEDMA.Core {
    32   public class DataSet {
     32  public class DataSet : IViewable {
    3333    public IStore Store { get; set; }
    3434
     
    5151      : base() {
    5252      guid = Guid.NewGuid();
     53      name = "Data set";
    5354      problem = new Problem();
    5455    }
     
    5960      guid = new Guid(dataSetEntity.Uri.Remove(0, Ontology.CedmaNameSpace.Length));
    6061      IList<Statement> names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity));
    61       if (names.Count > 0) name = (string)((Literal)names[0].Property).Value;
     62      if(names.Count > 0) name = (string)((Literal)names[0].Property).Value;
    6263      else name = guid.ToString();
    6364    }
    6465
    6566    public void Activate() {
    66       Entity myEntity = new Entity (Ontology.CedmaNameSpace + Guid);
     67      Entity myEntity = new Entity(Ontology.CedmaNameSpace + Guid);
    6768      Store.Add(new Statement(myEntity, Ontology.PredicateInstanceOf, Ontology.TypeDataSet));
    6869      Store.Add(new Statement(myEntity, Ontology.PredicateSerializedData, new Literal(PersistenceManager.SaveToGZip(problem))));
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetList.cs

    r989 r992  
    5959    private void ReloadList() {
    6060      IList<Statement> statements = store.Select(new Statement(Ontology.AnyEntity, Ontology.PredicateInstanceOf, Ontology.TypeDataSet));
    61 
    6261      foreach(Statement s in statements) {
    6362        DataSet d = new DataSet(store, s.Subject);
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetListView.Designer.cs

    r989 r992  
    4848    /// </summary>
    4949    private void InitializeComponent() {
     50      this.refreshButton = new System.Windows.Forms.Button();
     51      this.addButton = new System.Windows.Forms.Button();
    5052      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    5153      this.dataSetsGroupBox = new System.Windows.Forms.GroupBox();
    52       this.dataSetsTreeView = new System.Windows.Forms.TreeView();
     54      this.dataSetsListView = new System.Windows.Forms.ListView();
    5355      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
    54       this.addButton = new System.Windows.Forms.Button();
    55       this.refreshButton = new System.Windows.Forms.Button();
    5656      this.splitContainer1.Panel1.SuspendLayout();
    5757      this.splitContainer1.Panel2.SuspendLayout();
     
    5959      this.dataSetsGroupBox.SuspendLayout();
    6060      this.SuspendLayout();
     61      //
     62      // refreshButton
     63      //
     64      this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     65      this.refreshButton.Location = new System.Drawing.Point(81, 161);
     66      this.refreshButton.Name = "refreshButton";
     67      this.refreshButton.Size = new System.Drawing.Size(75, 23);
     68      this.refreshButton.TabIndex = 2;
     69      this.refreshButton.Text = "&Refresh";
     70      this.refreshButton.UseVisualStyleBackColor = true;
     71      this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
     72      //
     73      // addButton
     74      //
     75      this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     76      this.addButton.Location = new System.Drawing.Point(0, 161);
     77      this.addButton.Name = "addButton";
     78      this.addButton.Size = new System.Drawing.Size(75, 23);
     79      this.addButton.TabIndex = 1;
     80      this.addButton.Text = "&Add...";
     81      this.addButton.UseVisualStyleBackColor = true;
     82      this.addButton.Click += new System.EventHandler(this.addButton_Click);
    6183      //
    6284      // splitContainer1
     
    82104      // dataSetsGroupBox
    83105      //
    84       this.dataSetsGroupBox.Controls.Add(this.dataSetsTreeView);
     106      this.dataSetsGroupBox.Controls.Add(this.dataSetsListView);
    85107      this.dataSetsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    86108      this.dataSetsGroupBox.Location = new System.Drawing.Point(0, 0);
     
    91113      this.dataSetsGroupBox.Text = "&Data Sets";
    92114      //
    93       // agentTreeView
     115      // dataSetsListView
    94116      //
    95       this.dataSetsTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
    96       this.dataSetsTreeView.Location = new System.Drawing.Point(3, 16);
    97       this.dataSetsTreeView.Name = "agentTreeView";
    98       this.dataSetsTreeView.Size = new System.Drawing.Size(129, 136);
    99       this.dataSetsTreeView.TabIndex = 0;
    100       this.dataSetsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.dataSetsTreeView_AfterSelect);
     117      this.dataSetsListView.Dock = System.Windows.Forms.DockStyle.Fill;
     118      this.dataSetsListView.Location = new System.Drawing.Point(3, 16);
     119      this.dataSetsListView.MultiSelect = false;
     120      this.dataSetsListView.Name = "dataSetsListView";
     121      this.dataSetsListView.Size = new System.Drawing.Size(129, 136);
     122      this.dataSetsListView.TabIndex = 0;
     123      this.dataSetsListView.UseCompatibleStateImageBehavior = false;
     124      this.dataSetsListView.View = System.Windows.Forms.View.List;
     125      this.dataSetsListView.SelectedIndexChanged += new System.EventHandler(this.dataSetsListView_SelectedIndexChanged);
    101126      //
    102127      // detailsGroupBox
     
    109134      this.detailsGroupBox.TabStop = false;
    110135      this.detailsGroupBox.Text = "&Details";
    111       //
    112       // addButton
    113       //
    114       this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    115       this.addButton.Location = new System.Drawing.Point(0, 161);
    116       this.addButton.Name = "addButton";
    117       this.addButton.Size = new System.Drawing.Size(75, 23);
    118       this.addButton.TabIndex = 1;
    119       this.addButton.Text = "&Add...";
    120       this.addButton.UseVisualStyleBackColor = true;
    121       this.addButton.Click += new System.EventHandler(this.addButton_Click);
    122       //
    123       // refreshButton
    124       //
    125       this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    126       this.refreshButton.Location = new System.Drawing.Point(81, 161);
    127       this.refreshButton.Name = "refreshButton";
    128       this.refreshButton.Size = new System.Drawing.Size(75, 23);
    129       this.refreshButton.TabIndex = 2;
    130       this.refreshButton.Text = "&Refresh";
    131       this.refreshButton.UseVisualStyleBackColor = true;
    132       this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
    133136      //
    134137      // DataSetListView
     
    154157    private System.Windows.Forms.GroupBox detailsGroupBox;
    155158    private System.Windows.Forms.Button addButton;
    156     private TreeView dataSetsTreeView;
    157159    private Button refreshButton;
     160    private ListView dataSetsListView;
    158161  }
    159162}
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetListView.cs

    r989 r992  
    3131namespace HeuristicLab.CEDMA.Core {
    3232  public partial class DataSetListView : ViewBase {
    33     public DataSetList DataSetList{
     33    public DataSetList DataSetList {
    3434      get { return (DataSetList)Item; }
    3535      set { base.Item = value; }
     
    5656      if(DataSetList == null) {
    5757        Caption = "Data Sets View";
    58         dataSetsTreeView.Enabled = false;
     58        dataSetsListView.Enabled = false;
    5959      } else {
    60         dataSetsTreeView.Enabled = true;
    61         dataSetsTreeView.Nodes.Clear();
     60        dataSetsListView.Enabled = true;
     61        dataSetsListView.Items.Clear();
    6262        foreach(DataSet dataSet in DataSetList) {
    63           TreeNode node = new TreeNode();
     63          ListViewItem node = new ListViewItem();
    6464          node.Text = dataSet.Name;
    6565          node.Tag = dataSet;
    66           node.Nodes.Add("dummy");
    67           dataSetsTreeView.Nodes.Add(node);
     66          dataSetsListView.Items.Add(node);
    6867        }
    6968      }
     
    7372    private void addButton_Click(object sender, EventArgs e) {
    7473      DataSet dataSet = new DataSet();
     74      dataSet.Store = DataSetList.Store;
    7575      DataSetList.Add(dataSet);
    7676      UpdateControls();
    7777    }
    78     #endregion
    79 
    80     private void dataSetsTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
    81       if(detailsGroupBox.Controls.Count > 0)
    82         detailsGroupBox.Controls[0].Dispose();
    83       detailsGroupBox.Controls.Clear();
    84       detailsGroupBox.Enabled = false;
    85       if(dataSetsTreeView.SelectedNode != null) {
    86         IViewable viewable = (IViewable)dataSetsTreeView.SelectedNode.Tag;
     78    private void dataSetsListView_SelectedIndexChanged(object sender, EventArgs e) {
     79      if(dataSetsListView.SelectedItems.Count > 0) {
     80        if(detailsGroupBox.Controls.Count > 0)
     81          detailsGroupBox.Controls[0].Dispose();
     82        detailsGroupBox.Controls.Clear();
     83        detailsGroupBox.Enabled = false;
     84        IViewable viewable = (IViewable)dataSetsListView.SelectedItems[0].Tag;
    8785        Control control = (Control)viewable.CreateView();
    8886        detailsGroupBox.Controls.Add(control);
     
    9189      }
    9290    }
     91    #endregion
     92
    9393
    9494    private void refreshButton_Click(object sender, EventArgs e) {
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/HeuristicLab.CEDMA.Core.csproj

    r957 r992  
    9292    </Compile>
    9393    <Compile Include="HeuristicLabCedmaCorePlugin.cs" />
     94    <Compile Include="ProblemView.cs">
     95      <SubType>UserControl</SubType>
     96    </Compile>
     97    <Compile Include="ProblemView.Designer.cs">
     98      <DependentUpon>ProblemView.cs</DependentUpon>
     99    </Compile>
    94100    <Compile Include="Properties\AssemblyInfo.cs" />
    95101  </ItemGroup>
     
    109115      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
    110116      <Name>HeuristicLab.Core</Name>
     117    </ProjectReference>
     118    <ProjectReference Include="..\HeuristicLab.DataAnalysis\HeuristicLab.DataAnalysis.csproj">
     119      <Project>{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}</Project>
     120      <Name>HeuristicLab.DataAnalysis</Name>
    111121    </ProjectReference>
    112122    <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
     
    130140      <DependentUpon>DataSetView.cs</DependentUpon>
    131141    </EmbeddedResource>
     142    <EmbeddedResource Include="ProblemView.resx">
     143      <DependentUpon>ProblemView.cs</DependentUpon>
     144    </EmbeddedResource>
    132145  </ItemGroup>
    133146  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Problem.cs

    r988 r992  
    4141      get { return name; }
    4242    }
     43    private HeuristicLab.DataAnalysis.Dataset dataset;
     44    public HeuristicLab.DataAnalysis.Dataset DataSet {
     45      get { return dataset; }
     46    }
     47
     48    private int trainingSamplesStart;
     49    public int TrainingSamplesStart {
     50      get { return trainingSamplesStart; }
     51    }
     52
     53    private int trainingSamplesEnd;
     54    public int TrainingSamplesEnd {
     55      get { return trainingSamplesEnd; }
     56    }
     57
     58    private int validationSamplesStart;
     59
     60    public int ValidationSamplesStart {
     61      get { return validationSamplesStart; }
     62      set { validationSamplesStart = value; }
     63    }
     64    private int validationSamplesEnd;
     65
     66    public int ValidationSamplesEnd {
     67      get { return validationSamplesEnd; }
     68      set { validationSamplesEnd = value; }
     69    }
     70
     71    private int testSamplesStart;
     72
     73    public int TestSamplesStart {
     74      get { return testSamplesStart; }
     75      set { testSamplesStart = value; }
     76    }
     77    private int testSamplesEnd;
     78
     79    public int TestSamplesEnd {
     80      get { return testSamplesEnd; }
     81      set { testSamplesEnd = value; }
     82    }
     83
     84    private List<int> allowedInputVariables;
     85    private List<int> allowedTargetVariables;
     86
     87    private List<int> minTimeOffsets;
     88    private List<int> maxTimeOffsets;
     89
     90    private bool autoRegressive;
     91
     92    public bool AutoRegressive {
     93      get { return autoRegressive; }
     94      set { autoRegressive = value; }
     95    }
     96
     97    private bool timeSeries;
     98
     99    public bool TimeSeries {
     100      get { return timeSeries; }
     101      set { timeSeries = value; }
     102    }
     103
    43104    public Problem()
    44105      : base() {
Note: See TracChangeset for help on using the changeset viewer.