Changeset 1961
- Timestamp:
- 05/29/09 17:20:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/FloatingAvgAggregator.cs
r1818 r1961 35 35 break; 36 36 case Action.Deleted: 37 refreshLastValues(row); 37 //refreshLastValues(row); 38 refreshValue(); 38 39 break; 39 40 default: … … 51 52 52 53 private int area = 5; 54 55 public int Area{ 56 get { return area; } 57 set { area = value; } 58 } 59 53 60 private void refreshValue() { 54 61 … … 81 88 } 82 89 83 #pragma warning disable 168 90 84 91 private void refreshLastValues(IDataRow row) { 85 #pragma warning restore 168 86 refreshValue(); 92 if (dataRowWatches.Count >= 1) { 93 IDataRow watchedRow = dataRowWatches[0]; 94 95 dataRow.Clear(); 96 97 for (int i = 0; i < watchedRow.Count; i++) { 98 99 double avgVal = 0; 100 int count = 0; 101 for (int j = Math.Max(0, i - area); j < Math.Min(watchedRow.Count, i + area); j++) { 102 avgVal += watchedRow[j]; 103 count++; 104 } 105 106 if (count >= 1) 107 avgVal /= count; 108 109 dataRow.Add(avgVal); 110 111 112 } 113 } 114 //OnValueChanged(avgVal, dataRow.Count - 1, Action.Added); 115 OnValueChanged(dataRow[dataRow.Count-1], dataRow.Count - 1, Action.Added); 116 117 double[] changeVals = new double[Math.Min(area, dataRow.Count-1)]; 118 for (int i = 0; i < Math.Min(area, dataRow.Count-1); i++) 119 { 120 changeVals[i] = dataRow[Math.Max(0, dataRow.Count - area - 1 + i)]; 121 } 122 OnValuesChanged(changeVals, Math.Max(dataRow.Count-area-1, 0), Action.Modified); 123 //OnDataRowChanged(this); 124 87 125 } 88 126
Note: See TracChangeset
for help on using the changeset viewer.