Changeset 992
- Timestamp:
- 12/15/08 10:48:49 (16 years ago)
- 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 30 30 31 31 namespace HeuristicLab.CEDMA.Core { 32 public class DataSet {32 public class DataSet : IViewable { 33 33 public IStore Store { get; set; } 34 34 … … 51 51 : base() { 52 52 guid = Guid.NewGuid(); 53 name = "Data set"; 53 54 problem = new Problem(); 54 55 } … … 59 60 guid = new Guid(dataSetEntity.Uri.Remove(0, Ontology.CedmaNameSpace.Length)); 60 61 IList<Statement> names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity)); 61 if 62 if(names.Count > 0) name = (string)((Literal)names[0].Property).Value; 62 63 else name = guid.ToString(); 63 64 } 64 65 65 66 public void Activate() { 66 Entity myEntity = new Entity 67 Entity myEntity = new Entity(Ontology.CedmaNameSpace + Guid); 67 68 Store.Add(new Statement(myEntity, Ontology.PredicateInstanceOf, Ontology.TypeDataSet)); 68 69 Store.Add(new Statement(myEntity, Ontology.PredicateSerializedData, new Literal(PersistenceManager.SaveToGZip(problem)))); -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetList.cs
r989 r992 59 59 private void ReloadList() { 60 60 IList<Statement> statements = store.Select(new Statement(Ontology.AnyEntity, Ontology.PredicateInstanceOf, Ontology.TypeDataSet)); 61 62 61 foreach(Statement s in statements) { 63 62 DataSet d = new DataSet(store, s.Subject); -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetListView.Designer.cs
r989 r992 48 48 /// </summary> 49 49 private void InitializeComponent() { 50 this.refreshButton = new System.Windows.Forms.Button(); 51 this.addButton = new System.Windows.Forms.Button(); 50 52 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 51 53 this.dataSetsGroupBox = new System.Windows.Forms.GroupBox(); 52 this.dataSets TreeView = new System.Windows.Forms.TreeView();54 this.dataSetsListView = new System.Windows.Forms.ListView(); 53 55 this.detailsGroupBox = new System.Windows.Forms.GroupBox(); 54 this.addButton = new System.Windows.Forms.Button();55 this.refreshButton = new System.Windows.Forms.Button();56 56 this.splitContainer1.Panel1.SuspendLayout(); 57 57 this.splitContainer1.Panel2.SuspendLayout(); … … 59 59 this.dataSetsGroupBox.SuspendLayout(); 60 60 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); 61 83 // 62 84 // splitContainer1 … … 82 104 // dataSetsGroupBox 83 105 // 84 this.dataSetsGroupBox.Controls.Add(this.dataSets TreeView);106 this.dataSetsGroupBox.Controls.Add(this.dataSetsListView); 85 107 this.dataSetsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 86 108 this.dataSetsGroupBox.Location = new System.Drawing.Point(0, 0); … … 91 113 this.dataSetsGroupBox.Text = "&Data Sets"; 92 114 // 93 // agentTreeView115 // dataSetsListView 94 116 // 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); 101 126 // 102 127 // detailsGroupBox … … 109 134 this.detailsGroupBox.TabStop = false; 110 135 this.detailsGroupBox.Text = "&Details"; 111 //112 // addButton113 //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 // refreshButton124 //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);133 136 // 134 137 // DataSetListView … … 154 157 private System.Windows.Forms.GroupBox detailsGroupBox; 155 158 private System.Windows.Forms.Button addButton; 156 private TreeView dataSetsTreeView;157 159 private Button refreshButton; 160 private ListView dataSetsListView; 158 161 } 159 162 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetListView.cs
r989 r992 31 31 namespace HeuristicLab.CEDMA.Core { 32 32 public partial class DataSetListView : ViewBase { 33 public DataSetList DataSetList {33 public DataSetList DataSetList { 34 34 get { return (DataSetList)Item; } 35 35 set { base.Item = value; } … … 56 56 if(DataSetList == null) { 57 57 Caption = "Data Sets View"; 58 dataSets TreeView.Enabled = false;58 dataSetsListView.Enabled = false; 59 59 } else { 60 dataSets TreeView.Enabled = true;61 dataSets TreeView.Nodes.Clear();60 dataSetsListView.Enabled = true; 61 dataSetsListView.Items.Clear(); 62 62 foreach(DataSet dataSet in DataSetList) { 63 TreeNode node = new TreeNode();63 ListViewItem node = new ListViewItem(); 64 64 node.Text = dataSet.Name; 65 65 node.Tag = dataSet; 66 node.Nodes.Add("dummy"); 67 dataSetsTreeView.Nodes.Add(node); 66 dataSetsListView.Items.Add(node); 68 67 } 69 68 } … … 73 72 private void addButton_Click(object sender, EventArgs e) { 74 73 DataSet dataSet = new DataSet(); 74 dataSet.Store = DataSetList.Store; 75 75 DataSetList.Add(dataSet); 76 76 UpdateControls(); 77 77 } 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; 87 85 Control control = (Control)viewable.CreateView(); 88 86 detailsGroupBox.Controls.Add(control); … … 91 89 } 92 90 } 91 #endregion 92 93 93 94 94 private void refreshButton_Click(object sender, EventArgs e) { -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/HeuristicLab.CEDMA.Core.csproj
r957 r992 92 92 </Compile> 93 93 <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> 94 100 <Compile Include="Properties\AssemblyInfo.cs" /> 95 101 </ItemGroup> … … 109 115 <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project> 110 116 <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> 111 121 </ProjectReference> 112 122 <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj"> … … 130 140 <DependentUpon>DataSetView.cs</DependentUpon> 131 141 </EmbeddedResource> 142 <EmbeddedResource Include="ProblemView.resx"> 143 <DependentUpon>ProblemView.cs</DependentUpon> 144 </EmbeddedResource> 132 145 </ItemGroup> 133 146 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Problem.cs
r988 r992 41 41 get { return name; } 42 42 } 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 43 104 public Problem() 44 105 : base() {
Note: See TracChangeset
for help on using the changeset viewer.