123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using EntityDataSet;
- using IntelligentControlForsx.Model;
- using IntelligentControlForsx.Common;
- using WisdomClient.data;
- using WisdomClient;
- using log4net;
- namespace IntelligentControlForsx.Service
- {
- public class PredictService
- {
-
- public static Random random = new Random();
- public static StationPredict GetStationPredict(String stationId)
- {
- StationPredict sp = new StationPredict(stationId);
- try
- {
- StationStatus ss = CacheService.Instance.StationStatusDictionary[stationId];
- ss.RefreshBasicWindturbineStatus();
- var wsDict = ss.WindturbineStatusDictionary;
- foreach(var ws in wsDict.Values)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (ws.GetStatus() == 4 || ws.GetStatus() == 3)
- {
- if (sp.StopList.Count < 10)
- {
- sp.StopList.Add(ws);
- }
- } else if (ws.GetStatus() == 2)
- {
- if (sp.StartupList.Count < 10)
- {
- sp.StartupList.Add(ws);
- }
- if (sp.MaintainList.Count < 10)
- {
- sp.MaintainList.Add(ws);
- }
- } else if (ws.GetStatus() == 5) {
- sp.ResetList.Add(ws);
- } else if (ws.GetStatus() == 6)
- {
- if (sp.CancelMaintainList.Count < 10)
- {
- sp.CancelMaintainList.Add(ws);
- }
- }
- else
- {
- }
- }
- } catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
-
- }
- return sp;
- }
- public static IList<WindturbineStatus> GetWindturbineStatus(IList<string> wtIds, string stationId)
- {
- IList<WindturbineStatus> result = new List<WindturbineStatus>();
- try
- {
- StationStatus ss = CacheService.Instance.StationStatusDictionary[stationId];
- ss.RefreshBasicWindturbineStatus();
- var wsDict = ss.WindturbineStatusDictionary;
- foreach (var ws in wsDict.Values)
- {
- if (wtIds.Contains(ws.WindturbineId))
- {
- result.Add(ws);
- }
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- return result;
- }
- }
- }
|