WindturbineCFTSpeed.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. using System;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. using System.Drawing;
  5. using System.Runtime.CompilerServices;
  6. using System.Runtime.Serialization;
  7. namespace GDNXFD.Data
  8. {
  9. [DataContract]
  10. [Table("WINDTURBINECFTSPEED")]
  11. public class WindturbineCFTSpeed : INotifyPropertyChanged
  12. {
  13. [DataMember]
  14. [Column("ID")]
  15. public string Id { get; set; }
  16. [DataMember]
  17. [Column("WINDPOWERSTATIONID")]
  18. public string StationId { get; set; }
  19. [DataMember]
  20. [Column("PROJECTID")]
  21. public string ProjectId { get; set; }
  22. [DataMember]
  23. [Column("LINEID")]
  24. public string LineId { get; set; }
  25. [DataMember]
  26. [Column("WINDTURBINEID")]
  27. public string WindturbineId { get; set; }
  28. [DataMember]
  29. [Column("E")]
  30. public double E { get; set; }
  31. [DataMember]
  32. [Column("ESE")]
  33. public double ESE { get; set; }
  34. [DataMember]
  35. [Column("SE")]
  36. public double SE { get; set; }
  37. [DataMember]
  38. [Column("SSE")]
  39. public double SSE { get; set; }
  40. [DataMember]
  41. [Column("S")]
  42. public double S { get; set; }
  43. [DataMember]
  44. [Column("SSW")]
  45. public double SSW { get; set; }
  46. [DataMember]
  47. [Column("SW")]
  48. public double SW { get; set; }
  49. [DataMember]
  50. [Column("WSW")]
  51. public double WSW { get; set; }
  52. [DataMember]
  53. [Column("W")]
  54. public double W { get; set; }
  55. [DataMember]
  56. [Column("WNW")]
  57. public double WNW { get; set; }
  58. [DataMember]
  59. [Column("NW")]
  60. public double NW { get; set; }
  61. [DataMember]
  62. [Column("NNW")]
  63. public double NNW { get; set; }
  64. [DataMember]
  65. [Column("N")]
  66. public double NNE { get; set; }
  67. [DataMember]
  68. [Column("NE")]
  69. public double NE { get; set; }
  70. [DataMember]
  71. [Column("ENE")]
  72. public double ENE { get; set; }
  73. [DataMember]
  74. [Column("SPEED")]
  75. public double Speed { get; set; }
  76. /// <summary>
  77. /// Property changed event
  78. /// </summary>
  79. public event PropertyChangedEventHandler PropertyChanged;
  80. private void RaisePropertyChanged([CallerMemberName] string caller = "")
  81. {
  82. if (PropertyChanged != null)
  83. {
  84. PropertyChanged(this, new PropertyChangedEventArgs(caller));
  85. }
  86. }
  87. public double GetDirectionValue(String direction)
  88. {
  89. switch(direction)
  90. {
  91. case "E":
  92. return E;
  93. case "ESE":
  94. return ESE;
  95. case "SE":
  96. return SE;
  97. case "SSE":
  98. return SSE;
  99. case "S":
  100. return S;
  101. case "SSW":
  102. return SSW;
  103. case "SW":
  104. return SW;
  105. case "WSW":
  106. return WSW;
  107. case "W":
  108. return W;
  109. case "WNW":
  110. return WNW;
  111. case "NW":
  112. return NW;
  113. case "NNW":
  114. return NNW;
  115. case "N":
  116. return NNE;
  117. case "NE":
  118. return NE;
  119. case "ENE":
  120. return ENE;
  121. }
  122. return 0;
  123. }
  124. }
  125. }