Changeset 5829 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views
- Timestamp:
- 03/24/11 23:56:39 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
r5809 r5829 114 114 </ItemGroup> 115 115 <ItemGroup> 116 <Compile Include="SupportVectorMachineModelSupportVectorsView.cs"> 117 <SubType>UserControl</SubType> 118 </Compile> 119 <Compile Include="SupportVectorMachineModelSupportVectorsView.Designer.cs"> 120 <DependentUpon>SupportVectorMachineModelSupportVectorsView.cs</DependentUpon> 121 </Compile> 116 122 <Compile Include="CrossValidationView.cs"> 117 123 <SubType>UserControl</SubType> … … 127 133 <Compile Include="SupportVectorMachineModelView.Designer.cs"> 128 134 <DependentUpon>SupportVectorMachineModelView.cs</DependentUpon> 129 </Compile>130 <Compile Include="SupportVectorRegressionSolutionView.cs">131 <SubType>UserControl</SubType>132 </Compile>133 <Compile Include="SupportVectorRegressionSolutionView.Designer.cs">134 <DependentUpon>SupportVectorRegressionSolutionView.cs</DependentUpon>135 135 </Compile> 136 136 </ItemGroup> -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorMachineModelSupportVectorsView.Designer.cs
r5827 r5829 21 21 22 22 namespace HeuristicLab.Algorithms.DataAnalysis.Views { 23 partial class SupportVectorMachineModel View {23 partial class SupportVectorMachineModelSupportVectorsView { 24 24 /// <summary> 25 25 /// Required designer variable. … … 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this. textBox = new System.Windows.Forms.TextBox();47 this.stringConvertibleMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView(); 48 48 this.SuspendLayout(); 49 49 // 50 // textBox50 // stringConvertibleMatrixView 51 51 // 52 this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | System.Windows.Forms.AnchorStyles.Left) 54 | System.Windows.Forms.AnchorStyles.Right))); 55 this.textBox.Location = new System.Drawing.Point(3, 3); 56 this.textBox.Multiline = true; 57 this.textBox.Name = "textBox"; 58 this.textBox.ReadOnly = true; 59 this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 60 this.textBox.Size = new System.Drawing.Size(247, 245); 61 this.textBox.TabIndex = 0; 52 this.stringConvertibleMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | System.Windows.Forms.AnchorStyles.Left) 54 | System.Windows.Forms.AnchorStyles.Right))); 55 this.stringConvertibleMatrixView.Caption = "StringConvertibleMatrix View"; 56 this.stringConvertibleMatrixView.Content = null; 57 this.stringConvertibleMatrixView.Location = new System.Drawing.Point(3, 3); 58 this.stringConvertibleMatrixView.Name = "stringConvertibleMatrixView"; 59 this.stringConvertibleMatrixView.ReadOnly = false; 60 this.stringConvertibleMatrixView.ShowRowsAndColumnsTextBox = true; 61 this.stringConvertibleMatrixView.ShowStatisticalInformation = false; 62 this.stringConvertibleMatrixView.Size = new System.Drawing.Size(381, 230); 63 this.stringConvertibleMatrixView.TabIndex = 0; 62 64 // 63 // SupportVectorMachineModel View65 // SupportVectorMachineModelSupportVectorsView 64 66 // 65 this.AllowDrop = true;66 67 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 67 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 68 this.Controls.Add(this.textBox); 69 this.Name = "SupportVectorMachineModelView"; 70 this.Size = new System.Drawing.Size(253, 251); 68 this.Controls.Add(this.stringConvertibleMatrixView); 69 this.Name = "SupportVectorMachineModelSupportVectorsView"; 70 this.Size = new System.Drawing.Size(387, 236); 71 71 this.ResumeLayout(false); 72 this.PerformLayout();73 72 74 73 } … … 76 75 #endregion 77 76 78 private System.Windows.Forms.TextBox textBox; 79 80 77 private Data.Views.StringConvertibleMatrixView stringConvertibleMatrixView; 81 78 } 82 79 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorMachineModelSupportVectorsView.cs
r5827 r5829 20 20 #endregion 21 21 using System; 22 using System.IO;23 22 using System.Windows.Forms; 24 23 using HeuristicLab.MainForm; … … 26 25 27 26 namespace HeuristicLab.Algorithms.DataAnalysis.Views { 28 [View("Support vector machine modelview")]29 [Content(typeof(SupportVectorMachineModel), true)]30 public partial class SupportVectorMachineModel View : AsynchronousContentView {27 [View("Support vectors view")] 28 [Content(typeof(SupportVectorMachineModel), false)] 29 public partial class SupportVectorMachineModelSupportVectorsView : AsynchronousContentView { 31 30 32 31 public new SupportVectorMachineModel Content { … … 35 34 } 36 35 37 public SupportVectorMachineModel View()36 public SupportVectorMachineModelSupportVectorsView() 38 37 : base() { 39 38 InitializeComponent(); … … 42 41 protected override void OnContentChanged() { 43 42 base.OnContentChanged(); 44 if (Content == null)45 textBox.Text = string.Empty;43 if (Content != null) 44 stringConvertibleMatrixView.Content = Content.SupportVectors; 46 45 else 47 UpdateTextBox();46 stringConvertibleMatrixView.Content = null; 48 47 } 49 48 … … 57 56 } 58 57 private void Content_Changed(object sender, EventArgs e) { 59 UpdateTextBox(); 60 } 61 62 private void UpdateTextBox() { 63 using (MemoryStream s = new MemoryStream()) { 64 StreamWriter writer = new StreamWriter(s); 65 writer.WriteLine("RangeTransform:"); 66 writer.Flush(); 67 using (MemoryStream memStream = new MemoryStream()) { 68 SVM.RangeTransform.Write(memStream, Content.RangeTransform); 69 memStream.Seek(0, SeekOrigin.Begin); 70 memStream.WriteTo(s); 71 } 72 writer.WriteLine("Model:"); 73 writer.Flush(); 74 using (MemoryStream memStream = new MemoryStream()) { 75 SVM.Model.Write(memStream, Content.Model); 76 memStream.Seek(0, SeekOrigin.Begin); 77 memStream.WriteTo(s); 78 } 79 s.Flush(); 80 s.Seek(0, SeekOrigin.Begin); 81 82 StreamReader reader = new StreamReader(s); 83 textBox.Text = reader.ReadToEnd(); 84 } 58 OnContentChanged(); 85 59 } 86 60 }
Note: See TracChangeset
for help on using the changeset viewer.