using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using System.Drawing; using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace GDNXFD.Data { [DataContract] [Table("WINDTURBINECFTSPEED")] public class WindturbineCFTSpeed : INotifyPropertyChanged { [DataMember] [Column("ID")] public string Id { get; set; } [DataMember] [Column("WINDPOWERSTATIONID")] public string StationId { get; set; } [DataMember] [Column("PROJECTID")] public string ProjectId { get; set; } [DataMember] [Column("LINEID")] public string LineId { get; set; } [DataMember] [Column("WINDTURBINEID")] public string WindturbineId { get; set; } [DataMember] [Column("E")] public double E { get; set; } [DataMember] [Column("ESE")] public double ESE { get; set; } [DataMember] [Column("SE")] public double SE { get; set; } [DataMember] [Column("SSE")] public double SSE { get; set; } [DataMember] [Column("S")] public double S { get; set; } [DataMember] [Column("SSW")] public double SSW { get; set; } [DataMember] [Column("SW")] public double SW { get; set; } [DataMember] [Column("WSW")] public double WSW { get; set; } [DataMember] [Column("W")] public double W { get; set; } [DataMember] [Column("WNW")] public double WNW { get; set; } [DataMember] [Column("NW")] public double NW { get; set; } [DataMember] [Column("NNW")] public double NNW { get; set; } [DataMember] [Column("N")] public double NNE { get; set; } [DataMember] [Column("NE")] public double NE { get; set; } [DataMember] [Column("ENE")] public double ENE { get; set; } [DataMember] [Column("SPEED")] public double Speed { get; set; } /// /// Property changed event /// public event PropertyChangedEventHandler PropertyChanged; private void RaisePropertyChanged([CallerMemberName] string caller = "") { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(caller)); } } public double GetDirectionValue(String direction) { switch(direction) { case "E": return E; case "ESE": return ESE; case "SE": return SE; case "SSE": return SSE; case "S": return S; case "SSW": return SSW; case "SW": return SW; case "WSW": return WSW; case "W": return W; case "WNW": return WNW; case "NW": return NW; case "NNW": return NNW; case "N": return NNE; case "NE": return NE; case "ENE": return ENE; } return 0; } } }