MatrixFormService.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using EntityDataSet;
  7. using IntelligentControlForsx.Common;
  8. namespace IntelligentControlForsx.Service
  9. {
  10. public class MatrixFormService
  11. {
  12. public static String[] GetDeviceIdArrayByStationId(string stationId)
  13. {
  14. string[] ret = CacheService.Instance.GetWindturbineListByStationId(stationId).Select(q => q.ID).ToArray();
  15. string[] result = new string[ret.Length];
  16. for (int i=0;i<ret.Length;i++)
  17. {
  18. result[i] = CommonMethod.GetShortWindturbineId(ret[i]);
  19. }
  20. return result;
  21. }
  22. public static IList<windpowerstation> GetStationList(string stationId)
  23. {
  24. if ("all".Equals(stationId))
  25. {
  26. return CacheService.Instance.GetFDCList();
  27. }
  28. else
  29. {
  30. return CacheService.Instance.GetFDCList().Where(q => q.ID == stationId).ToList();
  31. }
  32. }
  33. }
  34. }