RawDataChartDataItem.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using SciChart.Charting.Visuals.Axes;
  7. using SciChart.Data.Model;
  8. using SciChart.Charting.Model.DataSeries;
  9. namespace Aitex.Core.UI.ControlDataContext
  10. {
  11. public class RawDataChartDataItem : INotifyPropertyChanged
  12. {
  13. public event PropertyChangedEventHandler PropertyChanged;
  14. public void InvokePropertyChanged(string propertyName)
  15. {
  16. if (PropertyChanged != null)
  17. {
  18. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  19. }
  20. }
  21. private AutoRange _AutoRange;
  22. public AutoRange AutoRange
  23. {
  24. get { return _AutoRange; }
  25. set
  26. {
  27. _AutoRange = value;
  28. InvokePropertyChanged("AutoRange");
  29. }
  30. }
  31. private DoubleRange _visibleRange;
  32. public DoubleRange VisibleRange
  33. {
  34. get
  35. {
  36. return _visibleRange;
  37. }
  38. set
  39. {
  40. _visibleRange = value;
  41. InvokePropertyChanged("VisibleRange");
  42. }
  43. }
  44. private bool _temperatureVisible = true;
  45. public bool TemperatureVisible
  46. {
  47. get { return _temperatureVisible; }
  48. set
  49. {
  50. _temperatureVisible = value;
  51. InvokePropertyChanged("TemperatureVisible");
  52. }
  53. }
  54. private bool _reflectVisible = true;
  55. public bool ReflectVisible
  56. {
  57. get { return _reflectVisible; }
  58. set
  59. {
  60. _reflectVisible = value;
  61. InvokePropertyChanged("ReflectVisible");
  62. }
  63. }
  64. private bool _curvatureVisible = true;
  65. public bool CurvatureVisible
  66. {
  67. get { return _curvatureVisible; }
  68. set
  69. {
  70. _curvatureVisible = value;
  71. InvokePropertyChanged("CurvatureVisible");
  72. }
  73. }
  74. private IDataSeries _reflectData;
  75. public IDataSeries ReflectData
  76. {
  77. get { return _reflectData; }
  78. set
  79. {
  80. _reflectData = value;
  81. InvokePropertyChanged("ReflectData");
  82. }
  83. }
  84. private IDataSeries _temperatureData;
  85. public IDataSeries TemperatureData
  86. {
  87. get { return _temperatureData; }
  88. set
  89. {
  90. _temperatureData = value;
  91. InvokePropertyChanged("TemperatureData");
  92. }
  93. }
  94. private IDataSeries _curvatureData;
  95. public IDataSeries CurvatureData
  96. {
  97. get { return _curvatureData; }
  98. set
  99. {
  100. _curvatureData = value;
  101. InvokePropertyChanged("CurvatureData");
  102. }
  103. }
  104. public RawDataChartDataItem()
  105. {
  106. AutoRange = SciChart.Charting.Visuals.Axes.AutoRange.Always;
  107. VisibleRange = new DoubleRange(0, 10);
  108. _temperatureData = GetSeries();
  109. _reflectData = GetSeries();
  110. _curvatureData = GetSeries();
  111. }
  112. XyDataSeries<double, double> GetSeries()
  113. {
  114. Random rd = new Random();
  115. XyDataSeries<double, double> series = new XyDataSeries<double, double>();
  116. for (int j = 0; j < 1000; j++)
  117. {
  118. series.Append(j + 1, j+rd.Next(0,100));
  119. }
  120. return series;
  121. }
  122. }
  123. }