- Timestamp:
- 01/19/17 19:15:33 (8 years ago)
- Location:
- branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DataBarSetView.Designer.cs
r14547 r14588 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 48 49 System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); … … 53 54 // chart 54 55 // 55 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 56 | System.Windows.Forms.AnchorStyles.Left)57 56 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 57 | System.Windows.Forms.AnchorStyles.Left) 58 | System.Windows.Forms.AnchorStyles.Right))); 58 59 chartArea1.Name = "ChartArea1"; 59 60 this.chart.ChartAreas.Add(chartArea1); … … 74 75 // DataBarSetView 75 76 // 76 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);77 77 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 78 78 this.Controls.Add(this.chart); … … 81 81 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); 82 82 this.ResumeLayout(false); 83 this.PerformLayout(); 83 84 84 } 85 85 #endregion -
branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DataBarSetView.cs
r14547 r14588 32 32 namespace HeuristicLab.DatastreamAnalysis.Views { 33 33 [View("DataBarSet")] 34 [Content(typeof(DataBarSet), false)]34 [Content(typeof(DataBarSet), true)] 35 35 public partial class DataBarSetView : ItemView { 36 36 private bool updateInProgress; 37 private string seriesName = "Ensembles"; 37 38 38 39 public virtual Image ViewImage { … … 53 54 this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; 54 55 this.chart.ChartAreas[0].AxisX.Title = "Ensembles"; 55 this.chart.ChartAreas[0].AxisX.Maximum = 0.0;56 this.chart.ChartAreas[0].AxisX.Maximum = Content.Bars.Count;56 //this.chart.ChartAreas[0].AxisX.Maximum = 0.0; 57 //this.chart.ChartAreas[0].AxisX.Maximum = (Content != null && Content.Bars != null) ? Content.Bars.Count : 0.0; 57 58 //AddCustomLabelsToAxis(this.chart.ChartAreas[0].AxisX); 58 59 59 this.chart.ChartAreas[0].AxisY.Title = "Estimat ed Values";60 this.chart.ChartAreas[0].AxisY.Title = "Estimation Quality"; 60 61 this.chart.ChartAreas[0].AxisY.IsStartedFromZero = true; 61 62 this.chart.ChartAreas[0].AxisY.Minimum = 0.0; … … 69 70 axis.CustomLabels.Clear(); 70 71 72 var bars = Content.Bars.ToList(); 71 73 for(int i = 0; i < Content.Bars.Count; i++) { 72 var bar = Content.Bars.Keys.ToList()[i].Value;73 74 CustomLabel barLabel = new CustomLabel(); 74 barLabel.Text = bar ;75 barLabel.Text = bars[i].Name; 75 76 barLabel.FromPosition = i; 76 77 barLabel.ToPosition = i + 1; … … 82 83 base.RegisterContentEvents(); 83 84 Content.BarsPropertyChanged += new EventHandler(Content_BarsChanged); 84 Content.BarValue sChanged += new EventHandler(Content_BarValuesChanged);85 Content.BarValueChanged += new EventHandler(Content_BarValuesChanged); 85 86 Content.ThresholdsPropertyChanged += new EventHandler(Content_ThresholdsChanged); 86 87 } … … 89 90 base.DeregisterContentEvents(); 90 91 Content.BarsPropertyChanged -= new EventHandler(Content_BarsChanged); 91 Content.BarValue sChanged -= new EventHandler(Content_BarValuesChanged);92 Content.BarValueChanged -= new EventHandler(Content_BarValuesChanged); 92 93 Content.ThresholdsPropertyChanged -= new EventHandler(Content_ThresholdsChanged); 93 94 } … … 110 111 } 111 112 private void UpdateChart() { 112 if ( updateInProgress) {113 if (InvokeRequired) { 113 114 Invoke((Action) UpdateChart); 114 } 115 116 updateInProgress = true; 117 118 // TODO 119 // clear the whole chart and redraw everything 120 121 122 updateInProgress = false; 115 } else if(!updateInProgress) { 116 if (Content == null) return; 117 118 updateInProgress = true; 119 120 chart.Series.Clear(); 121 Series series = chart.Series.Add(seriesName); 122 series.IsVisibleInLegend = false; 123 series.ChartType = SeriesChartType.Column; 124 int i = 0; 125 foreach (var bar in Content.Bars) { 126 series.Points.Add(new DataPoint(i, bar.Value) { AxisLabel = bar.Name, Color = bar.BarColor }); 127 i++; 128 } 129 130 //chart.ChartAreas[0].RecalculateAxesScale(); 131 AddThresholds(); 132 CheckThresholds(); 133 134 chart.Refresh(); 135 updateInProgress = false; 136 } 123 137 } 124 138 125 139 private void UpdateChartValues() { 126 if (updateInProgress) { 127 Invoke((Action)UpdateChart); 128 } 129 130 updateInProgress = true; 131 132 // TODO 133 // simply update the bars' values 134 135 updateInProgress = false; 140 if (InvokeRequired) { 141 Invoke((Action) UpdateChartValues); 142 } else if(!updateInProgress) { 143 if (Content == null) return; 144 145 updateInProgress = true; 146 147 //chart.Series[seriesName].Points.Clear(); 148 //foreach (var bar in Content.Bars) { 149 // chart.Series[seriesName].Points.AddXY(bar.Name, bar.Value); 150 //} 151 152 var bars = Content.Bars.ToList(); 153 154 for (int i = 0; i < bars.Count; i++) { 155 chart.Series[seriesName].Points.ElementAt(i).SetValueY(bars[i].Value); 156 } 157 158 CheckThresholds(); 159 //chart.ChartAreas[0].RecalculateAxesScale(); 160 chart.Refresh(); 161 updateInProgress = false; 162 } 163 } 164 165 private void CheckThresholds() { 166 var bars = Content.Bars.ToList(); 167 for (int i = 0; i < bars.Count; i++) { 168 var bar = bars[i]; 169 if (bar.Value > bar.Threshold) { 170 chart.Series[seriesName].Points[i].Color = Color.Orange; 171 } else { 172 chart.Series[seriesName].Points[i].Color = bar.BarColor; 173 } 174 } 175 } 176 177 private void AddThresholdsOld() { 178 Series series = chart.Series.Add("Thresholds"); 179 series.IsVisibleInLegend = false; 180 series.ChartType = SeriesChartType.StackedColumn; 181 182 int i = 0; 183 foreach (var bar in Content.Bars) { 184 //series.Points.Add(new DataPoint(i, new [] { bar.Threshold, bar.Threshold + 0.05 }) { AxisLabel = bar.Name, Color = Color.Transparent, BorderWidth = 2, BorderColor = bar.ThresholdColor}); 185 series.Points.Add(new DataPoint(i, new[] { bar.Threshold, bar.Threshold + 0.05 }) { AxisLabel = bar.Name, Color = bar.ThresholdColor }); 186 i++; 187 } 136 188 } 137 189 138 190 private void AddThresholds() { 139 140 foreach (var threshold in Content.Thresholds) { 141 // TODO: add threshold as red bold line to each of bars' conlumns 142 } 143 191 chart.Annotations.Clear(); 192 193 var bars = Content.Bars.ToList(); 194 for (int i = 0; i < bars.Count; i++) { 195 HorizontalLineAnnotation annotation = new HorizontalLineAnnotation(); 196 annotation.AllowMoving = false; 197 annotation.AllowResizing = false; 198 annotation.LineWidth = 2; 199 annotation.LineColor = bars[i].ThresholdColor; 200 annotation.IsInfinitive = false; 201 annotation.ClipToChartArea = chart.ChartAreas[0].Name; 202 annotation.AxisX = chart.ChartAreas[0].AxisX; 203 annotation.AxisY = chart.ChartAreas[0].AxisY; 204 annotation.Y = bars[i].Threshold; 205 206 annotation.Alignment = ContentAlignment.MiddleCenter; 207 annotation.AnchorX = i; 208 209 annotation.X = i - 0.4; 210 annotation.Width = 52.0 / bars.Count; 211 annotation.Name = bars[i].Name; 212 annotation.Tag = bars[i].Name; 213 annotation.BringToFront(); 214 215 216 217 chart.Annotations.Add(annotation); 218 } 144 219 } 145 220 -
branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj
r14547 r14588 136 136 </ItemGroup> 137 137 <ItemGroup> 138 <EmbeddedResource Include="DataBarSetView.resx"> 139 <DependentUpon>DataBarSetView.cs</DependentUpon> 140 </EmbeddedResource> 138 141 <EmbeddedResource Include="DatastreamAnalysisOptimizerView.resx"> 139 142 <DependentUpon>DatastreamAnalysisOptimizerView.cs</DependentUpon> -
branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs
r14547 r14588 23 23 24 24 namespace HeuristicLab.DatastreamAnalysis.Views { 25 [Plugin("HeuristicLab.DatastreamAnalysis.Views", "3.4.14.1454 3")]25 [Plugin("HeuristicLab.DatastreamAnalysis.Views", "3.4.14.14547")] 26 26 [PluginFile("HeuristicLab.DatastreamAnalysis.Views-3.4.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs
r14547 r14588 54 54 // [assembly: AssemblyVersion("1.0.*")] 55 55 [assembly: AssemblyVersion("3.4.0.0")] 56 [assembly: AssemblyFileVersion("3.4.14.1454 3")]56 [assembly: AssemblyFileVersion("3.4.14.14547")]
Note: See TracChangeset
for help on using the changeset viewer.