Changeset 10736 for branches/DataPreprocessing
- Timestamp:
- 04/09/14 13:05:38 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.Designer.cs
r10658 r10736 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.optionsBox = new System.Windows.Forms.GroupBox(); 27 this.allInOneCheckBox = new System.Windows.Forms.CheckBox(); 28 this.optionsBox.SuspendLayout(); 26 29 this.SuspendLayout(); 30 // 31 // optionsBox 32 // 33 this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 34 this.optionsBox.Controls.Add(this.allInOneCheckBox); 35 this.optionsBox.Location = new System.Drawing.Point(4, 263); 36 this.optionsBox.Name = "optionsBox"; 37 this.optionsBox.Size = new System.Drawing.Size(152, 134); 38 this.optionsBox.TabIndex = 7; 39 this.optionsBox.TabStop = false; 40 this.optionsBox.Text = "Options"; 41 // 42 // allInOneCheckBox 43 // 44 this.allInOneCheckBox.AutoSize = true; 45 this.allInOneCheckBox.Checked = true; 46 this.allInOneCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 47 this.allInOneCheckBox.Location = new System.Drawing.Point(6, 19); 48 this.allInOneCheckBox.Name = "allInOneCheckBox"; 49 this.allInOneCheckBox.Size = new System.Drawing.Size(69, 17); 50 this.allInOneCheckBox.TabIndex = 0; 51 this.allInOneCheckBox.Text = "All in one"; 52 this.allInOneCheckBox.UseVisualStyleBackColor = true; 53 this.allInOneCheckBox.CheckedChanged += new System.EventHandler(this.allInOneCheckBox_CheckedChanged); 27 54 // 28 55 // HistogramView … … 30 57 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 31 58 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 59 this.Controls.Add(this.optionsBox); 32 60 this.Name = "HistogramView"; 61 this.Controls.SetChildIndex(this.optionsBox, 0); 62 this.optionsBox.ResumeLayout(false); 63 this.optionsBox.PerformLayout(); 33 64 this.ResumeLayout(false); 34 65 … … 37 68 #endregion 38 69 70 private System.Windows.Forms.GroupBox optionsBox; 71 private System.Windows.Forms.CheckBox allInOneCheckBox; 72 39 73 } 40 74 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs
r10712 r10736 1 using System.Windows.Forms; 1 using System; 2 using System.Windows.Forms; 2 3 using HeuristicLab.Analysis; 3 4 using HeuristicLab.MainForm; … … 22 23 } 23 24 25 private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) { 26 if (allInOneMode == false) 27 allInOneMode = true; 28 else 29 allInOneMode = false; 30 GenerateChart(); 31 } 32 24 33 } 25 34 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/LineChartView.Designer.cs
r10717 r10736 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this. groupBox1= new System.Windows.Forms.GroupBox();27 this. checkBox1= new System.Windows.Forms.CheckBox();28 this. groupBox1.SuspendLayout();26 this.optionsBox = new System.Windows.Forms.GroupBox(); 27 this.allInOneCheckBox = new System.Windows.Forms.CheckBox(); 28 this.optionsBox.SuspendLayout(); 29 29 this.SuspendLayout(); 30 30 // 31 // groupBox131 // optionsBox 32 32 // 33 this. groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));34 this. groupBox1.Controls.Add(this.checkBox1);35 this. groupBox1.Location = new System.Drawing.Point(4, 262);36 this. groupBox1.Name = "groupBox1";37 this. groupBox1.Size = new System.Drawing.Size(151, 134);38 this. groupBox1.TabIndex = 7;39 this. groupBox1.TabStop = false;40 this. groupBox1.Text = "Options";33 this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 34 this.optionsBox.Controls.Add(this.allInOneCheckBox); 35 this.optionsBox.Location = new System.Drawing.Point(4, 262); 36 this.optionsBox.Name = "optionsBox"; 37 this.optionsBox.Size = new System.Drawing.Size(151, 134); 38 this.optionsBox.TabIndex = 7; 39 this.optionsBox.TabStop = false; 40 this.optionsBox.Text = "Options"; 41 41 // 42 // checkBox142 // allInOneCheckBox 43 43 // 44 this.checkBox1.AutoSize = true; 45 this.checkBox1.Location = new System.Drawing.Point(7, 20); 46 this.checkBox1.Name = "checkBox1"; 47 this.checkBox1.Size = new System.Drawing.Size(66, 17); 48 this.checkBox1.TabIndex = 0; 49 this.checkBox1.Text = "AllInOne"; 50 this.checkBox1.UseVisualStyleBackColor = true; 51 this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); 44 this.allInOneCheckBox.AutoSize = true; 45 this.allInOneCheckBox.Checked = true; 46 this.allInOneCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 47 this.allInOneCheckBox.Location = new System.Drawing.Point(6, 19); 48 this.allInOneCheckBox.Name = "allInOneCheckBox"; 49 this.allInOneCheckBox.Size = new System.Drawing.Size(69, 17); 50 this.allInOneCheckBox.TabIndex = 0; 51 this.allInOneCheckBox.Text = "All in one"; 52 this.allInOneCheckBox.UseVisualStyleBackColor = true; 53 this.allInOneCheckBox.CheckedChanged += new System.EventHandler(this.allInOneCheckBox_CheckedChanged); 52 54 // 53 55 // LineChartView … … 55 57 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 56 58 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 57 this.Controls.Add(this. groupBox1);59 this.Controls.Add(this.optionsBox); 58 60 this.Name = "LineChartView"; 59 this.Controls.SetChildIndex(this. groupBox1, 0);60 this. groupBox1.ResumeLayout(false);61 this. groupBox1.PerformLayout();61 this.Controls.SetChildIndex(this.optionsBox, 0); 62 this.optionsBox.ResumeLayout(false); 63 this.optionsBox.PerformLayout(); 62 64 this.ResumeLayout(false); 63 65 … … 66 68 #endregion 67 69 68 private System.Windows.Forms.GroupBox groupBox1;69 private System.Windows.Forms.CheckBox checkBox1;70 private System.Windows.Forms.GroupBox optionsBox; 71 private System.Windows.Forms.CheckBox allInOneCheckBox; 70 72 } 71 73 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/LineChartView.cs
r10717 r10736 44 44 } 45 45 46 private void checkBox1_CheckedChanged(object sender, EventArgs e) {46 private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) { 47 47 if (allInOneMode == false) 48 48 allInOneMode = true; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs
r10717 r10736 46 46 protected DataRowVisualProperties.DataRowChartType chartType; 47 47 protected string chartTitle; 48 protected bool allInOneMode = true;48 protected bool allInOneMode; 49 49 50 50 private const string DEFAULT_CHART_TITLE = "Chart"; … … 55 55 chartType = DataRowVisualProperties.DataRowChartType.Line; 56 56 chartTitle = DEFAULT_CHART_TITLE; 57 allInOneMode = true; 57 58 } 58 59 … … 97 98 protected override void RegisterContentEvents() { 98 99 base.RegisterContentEvents(); 99 Content.Changed += Content_Changed; 100 Content.ChartLogic.Changed += PreprocessingData_Changed; 101 100 102 } 101 103 102 104 protected override void DeregisterContentEvents() { 103 105 base.DeregisterContentEvents(); 104 Content.Changed -= Content_Changed; 105 } 106 107 void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) { 108 dataTableView.Refresh(); 106 Content.ChartLogic.Changed -= PreprocessingData_Changed; 109 107 } 110 108 … … 116 114 private void InitData() { 117 115 variableItemList = logic.CreateVariableItemList(); 116 checkedItemList.Content = variableItemList; 118 117 dataRows = logic.CreateAllDataRows(chartType); 119 118 … … 147 146 if (Content != null) { 148 147 logic = Content.ChartLogic; 149 InitData(); 150 checkedItemList.Content = variableItemList; 151 GenerateChart(); 148 InitData(); 152 149 variableItemList.CheckedItemsChanged += CheckedItemsChanged; 153 logic.Changed += PreprocessingData_Changed;150 GenerateChart(); 154 151 } 155 152 } … … 166 163 case DataPreprocessingChangedEventType.ChangeColumn: 167 164 case DataPreprocessingChangedEventType.ChangeItem: 168 //UpdateDataForVariable(logic.GetVariableNameByIndex(e.Column)); 169 165 UpdateDataForVariable(logic.GetVariableNameByIndex(e.Column)); 170 166 break; 171 167 case DataPreprocessingChangedEventType.DeleteRow: 172 168 case DataPreprocessingChangedEventType.AddRow: 169 case DataPreprocessingChangedEventType.Any: 170 InitData(); 171 GenerateChart(); 172 173 173 break; 174 174 } … … 179 179 dataTable.Rows.Remove(variableName); 180 180 dataTable.Rows.Add(newRow); 181 DataTable dt = dataTablePerVariable.Find(x => (x.Rows.ItemName == variableName)); 182 dt.Rows.Remove(variableName); 183 dt.Rows.Add(newRow); 181 DataTable dt = dataTablePerVariable.Find(x => x.Rows.Find(y => y.Name == variableName) != null); 182 if (dt != null) { 183 dt.Rows.Remove(variableName); 184 dt.Rows.Add(newRow); 185 } 184 186 } 185 187 … … 210 212 protected void GenerateChart() { 211 213 214 ClearTableLayout(); 215 216 if (allInOneMode) { 217 GenerateSingleChartLayout(); 218 } else 219 GenerateMultiChartLayout(); 220 } 221 222 private void ClearTableLayout() { 212 223 //Clear out the existing controls 213 224 tableLayoutPanel.Controls.Clear(); … … 217 228 tableLayoutPanel.RowStyles.Clear(); 218 229 tableLayoutPanel.AutoScroll = false; 219 tableLayoutPanel.AutoScroll = true; 220 221 if (allInOneMode) { 222 GenerateSingleChartLayout(); 223 } else 224 GenerateMultiChartLayout(); 225 } 230 tableLayoutPanel.AutoScroll = true; 231 } 226 232 227 233 private void GenerateSingleChartLayout() { -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
r10733 r10736 38 38 public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) { 39 39 IList<double> values = preprocessingData.GetValues<double>(variableName); 40 41 //TODO: handle NAN values correctly 42 // CalculateHistogram in DataTableView fails with NAN values ( Min(), Max() returns NAN) 43 ReplayNANwithZero(values); 40 44 DataRow row = new DataRow(variableName, "", values); 41 45 row.VisualProperties.ChartType = chartType; 42 46 return row; 43 47 } 48 49 private void ReplayNANwithZero(IList<double> values) { 50 for (int i = 0; i < values.Count; i++) { 51 if (Double.IsNaN(values[i])) 52 values[i] = 0; 53 } 54 } 55 56 44 57 45 58 private IEnumerable<string> GetVariableNames() {
Note: See TracChangeset
for help on using the changeset viewer.