123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- using GDNXFD.Data.Model;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace GDNXFD.WcfService
- {
- public class HelpperMethod
- {
-
-
-
-
-
- public static WStatus GetWindturbineStatus(double statusValue)
- {
- WStatus status = WStatus.UnKnow;
- int st = Convert.ToInt32(statusValue);
- switch (st)
- {
-
- case 0:
- status = WStatus.Stop;
- break;
- case 1:
- status = WStatus.OnPower;
- break;
- case 2:
- status = WStatus.Standby;
- break;
- case 3:
- status = WStatus.Start;
- break;
- case 4:
- status = WStatus.Online;
- break;
- case 5:
- status = WStatus.Fault;
- break;
- case 6:
- status = WStatus.Maintain;
- break;
- case 7:
- status = WStatus.Offline;
- break;
- default:
- status = WStatus.UnKnow;
- break;
- }
- return status;
- }
- public static HungType GetHungType(double lockValue) {
- HungType hung = HungType.UnKnow;
- int st = Convert.ToInt32(lockValue);
- switch (st)
- {
- case 0:
- hung = HungType.UnLock;
- break;
- case 2:
- hung = HungType.StationCheckLock;
- break;
- case 3:
- hung = HungType.StationFaulLock;
- break;
- case 4:
- hung = HungType.StationPowerLineLock;
- break;
- case 5:
- hung = HungType.StationWeatherLock;
- break;
- case 7:
- hung = HungType.FaultLock;
- break;
- case 8:
- hung = HungType.CheckLock;
- break;
- default:
- hung = HungType.UnKnow;
- break;
- }
- return hung;
- }
- public static string GetWindDirection(double value)
- {
- if (value >= 11.25 && value < 33.75)
- return "NNE";
- else if (value >= 33.75 && value < 56.25)
- return "NE";
- else if (value >= 56.25 && value < 78.75)
- return "ENE";
- else if (value >= 78.75 && value < 101.25)
- return "E";
- else if (value >= 101.25 && value < 123.75)
- return "ESE";
- else if (value >= 123.75 && value < 146.25)
- return "SE";
- else if (value >= 146.25 && value < 168.75)
- return "SSE";
- else if (value >= 168.75 && value < 191.25)
- return "S";
- else if (value >= 191.25 && value < 213.75)
- return "SSW";
- else if (value >= 213.75 && value < 236.25)
- return "SW";
- else if (value >= 236.25 && value < 258.75)
- return "WSW";
- else if (value >= 258.75 && value < 281.25)
- return "W";
- else if (value >= 281.25 && value < 303.75)
- return "WNW";
- else if (value >= 303.75 && value < 326.25)
- return "NW";
- else if (value >= 326.25 && value < 348.75)
- return "NNW";
- else if (value >= 348.75 || value < 11.25)
- return "N";
- return "UNKNOW";
- }
- }
- }
|