ParameterFormInfoSvc.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Security;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Threading.Tasks;
  9. using System.Windows.Controls;
  10. using EntityDataSet;
  11. using IntelligentControlForsx.ChildForms;
  12. using IntelligentControlForsx.Model;
  13. using IntelligentControlForsx.Service.ParameterFormInfo.Domain;
  14. using log4net.Util;
  15. using WisdomClient;
  16. using WisdomClient.data;
  17. namespace IntelligentControlForsx.Service.ParameterFormInfo
  18. {
  19. public class ParameterFormInfoSvc
  20. {
  21. private ParameterFormInfoSvc()
  22. {
  23. BuilDicUnifromCodeList();
  24. }
  25. public static ParameterFormInfoSvc Instance
  26. {
  27. get { return SingletonCreator.instance; }
  28. }
  29. class SingletonCreator
  30. {
  31. internal static readonly ParameterFormInfoSvc instance = new ParameterFormInfoSvc();
  32. }
  33. private static Dictionary<string, IList<PointMapModel>> dicGridPointData = new Dictionary<string, IList<PointMapModel>>();//key1--风场编号
  34. private static Dictionary<string, IList<PointMapModel>> dicTopPointData = new Dictionary<string, IList<PointMapModel>>(); //key1--风场编号
  35. private static Dictionary<string, Dictionary<string, string>> dicUniformCodeListByWindturbineId = new Dictionary<string, Dictionary<string, string>>();//key1--风机编号,key2为统一编码
  36. private static Dictionary<string, Dictionary<string, string>> dicUniformCodeListByStation = new Dictionary<string, Dictionary<string, string>>();//key1--风场编号,key2为统一编码
  37. private static string stationNameNow = "";
  38. /// <summary>
  39. /// 获取实时数据
  40. /// </summary>
  41. /// <param name="stationName"></param>
  42. public void RefreshDataList(object stationName)
  43. {
  44. IList<PointMapModel> topPointList = new List<PointMapModel>();
  45. IList<PointMapModel> gridPointList = GetDicByStationName((string)stationName, out topPointList);
  46. //gridPointList 长度超过1000条则进行分段查询
  47. Dictionary<string, TsData> resultGridDic = RestfulClient.findLatestByTagNames(gridPointList.Select(s => s.PointId).ToArray());
  48. Console.WriteLine("================================================================================================================================");
  49. foreach (KeyValuePair<string, TsData> kv in resultGridDic)
  50. {
  51. PointMapModel data = gridPointList.Where(s => s.PointId == kv.Key).FirstOrDefault();
  52. if (data != null)
  53. {
  54. data.Value = Convert.ToDouble(kv.Value.getValue());
  55. Console.WriteLine(kv.Key + "---" + kv.Value.getValue());
  56. }
  57. }
  58. Console.WriteLine("================================================================================================================================");
  59. dicGridPointData.Remove((string)stationName);
  60. dicGridPointData.Add((string)stationName, gridPointList);
  61. Dictionary<string, TsData> resultTopDic = RestfulClient.findLatestByTagNames(topPointList.Select(s => s.PointId).ToArray());
  62. foreach (KeyValuePair<string, TsData> kv in resultTopDic)
  63. {
  64. PointMapModel data = topPointList.Where(s => s.PointId == kv.Key).FirstOrDefault();
  65. if (data != null)
  66. data.Value = Convert.ToDouble(kv.Value.getValue());
  67. }
  68. dicTopPointData.Remove((string)stationName);
  69. dicTopPointData.Add((string)stationName, topPointList);
  70. }
  71. private IList<PointMapModel> GetDicByStationName(string stationName, out IList<PointMapModel> topPointList)
  72. {
  73. if (dicGridPointData == null)
  74. {
  75. dicGridPointData = new Dictionary<string, IList<PointMapModel>>();
  76. }
  77. if (dicTopPointData == null)
  78. {
  79. dicTopPointData = new Dictionary<string, IList<PointMapModel>>();
  80. }
  81. IList<PointMapModel> gridPointList = null;
  82. topPointList = null;
  83. if (dicGridPointData.ContainsKey(stationName))
  84. {
  85. gridPointList = dicGridPointData[stationName];
  86. }
  87. if (dicTopPointData.ContainsKey(stationName))
  88. {
  89. topPointList = dicTopPointData[stationName];
  90. }
  91. if (gridPointList == null || gridPointList.Count <= 0)
  92. {
  93. gridPointList = GetGridPoint(stationName);
  94. dicGridPointData.Add(stationName, gridPointList);
  95. }
  96. if (topPointList == null || topPointList.Count <= 0)
  97. {
  98. topPointList = GetTopPoint(stationName);
  99. // dicTopPointData.Add(stationName, topPointList);
  100. }
  101. return gridPointList;
  102. }
  103. /// <summary>
  104. /// 根据风场编号获取风机测点,字典key为风机编号,value为每台风机测点集合
  105. /// </summary>
  106. /// <param name="stationName"></param>
  107. /// <returns></returns>
  108. private IList<PointMapModel> GetGridPoint(string stationName)
  109. {
  110. List<PointMapModel> list = new List<PointMapModel>();
  111. DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
  112. long tt = (DateTime.Now.Ticks - startTime.Ticks) / 10000; //除10000调整为13位
  113. using (wisdom_cs_entity ctx = new wisdom_cs_entity())
  114. {
  115. IList<windturbine> windturbineList = ctx.windturbine.Where(s => s.WINDPOWERSTATIONID == stationName).ToList();
  116. for (int i = 0; i < windturbineList.Count; i++)
  117. {
  118. Dictionary<string, string> uniformCodeDic = dicUniformCodeListByWindturbineId[windturbineList[i].ID];
  119. string windturbineId = windturbineList[i].ID;
  120. IList<view_tspoint> pointList = ctx.view_tspoint.Where(s => uniformCodeDic.Keys.Contains(s.uniform_code) && s.thing_id == windturbineId).ToList();
  121. //IList<view_tspoint> pointList = ctx.view_tspoint.Where(s => s.thing_id == "XG01_01").ToList();
  122. for (int j = 0; j < pointList.Count; j++)
  123. {
  124. PointMapModel data = new PointMapModel();
  125. data.ThingId = pointList[j].thing_id;
  126. data.PointId = pointList[j].id;
  127. data.PointName = uniformCodeDic[pointList[j].uniform_code];
  128. list.Add(data);
  129. }
  130. }
  131. }
  132. long ee = (DateTime.Now.Ticks - startTime.Ticks) / 10000; //除10000调整为13位
  133. long re = ee - tt;
  134. Console.WriteLine("========================================时间差为:"+re);
  135. return list;
  136. }
  137. /// <summary>
  138. /// 根据风场获取风场主要参数测点
  139. /// </summary>
  140. /// <param name="stationName"></param>
  141. /// <returns></returns>
  142. private IList<PointMapModel> GetTopPoint(string stationName)
  143. {
  144. return new List<PointMapModel>();
  145. }
  146. /// <summary>
  147. /// 根据风场获取DataTable
  148. /// </summary>
  149. /// <param name="stationName"></param>
  150. /// <returns></returns>
  151. public DataTable GetDataTable(string stationName)
  152. {
  153. IList<GridViewData> list = GetInfoData(stationName).OrderBy(s=>Convert.ToInt32(Regex.Replace(s.WindturbineId,"[a-zA-Z]","").Replace("_",""))).ToList();
  154. DataTable resultTable = GetDataTableHeaders();
  155. for (int i = 0; i < list.Count; i++)
  156. {
  157. #region 生成GridView信息
  158. DataRow row = resultTable.NewRow();
  159. row["风机名称"] = list[i].WindturbineId;
  160. row["冷却风温度"] = list[i].ColdWindTemperature.ToString("f2");
  161. row["有功功率"] = list[i].Power.ToString("f2");
  162. row["液压油温度"] = list[i].OilTemperature.ToString("f2");
  163. row["U1绕组温度"] = list[i].U1CirclingTemperature.ToString("f2");
  164. row["U2绕组温度"] = list[i].U2CirclingTemperature.ToString("f2");
  165. row["V1绕组温度"] = list[i].V1CirclingTemperature.ToString("f2");
  166. row["V2绕组温度"] = list[i].V2CirclingTemperature.ToString("f2");
  167. row["W1绕组温度"] = list[i].W1CirclingTemperature.ToString("f2");
  168. row["W2绕组温度"] = list[i].W2CirclingTemperature.ToString("f2");
  169. row["轴承A温度"] = list[i].AxisATemperature.ToString("f2");
  170. row["轴承B温度"] = list[i].AxisBTemperature.ToString("f2");
  171. row["齿轮箱温度"] = list[i].GearBoxTemperature.ToString("f2");
  172. row["齿轮箱轴1温度"] = list[i].GearAxis1Temperature.ToString("f2");
  173. row["齿轮箱轴2温度"] = list[i].GearAxis2Temperature.ToString("f2");
  174. row["机舱温度"] = list[i].RoomTemperature.ToString("f2");
  175. row["环境温度"] = list[i].RoundTemperature.ToString("f2");
  176. resultTable.Rows.Add(row);
  177. #endregion
  178. }
  179. return resultTable;
  180. }
  181. public DataTable GetDataTableHeaders()
  182. {
  183. DataTable dataTable = new DataTable();
  184. dataTable.Columns.Add("风机名称");
  185. dataTable.Columns.Add("冷却风温度");
  186. dataTable.Columns.Add("有功功率");
  187. dataTable.Columns.Add("液压油温度");
  188. dataTable.Columns.Add("U1绕组温度");
  189. dataTable.Columns.Add("U2绕组温度");
  190. dataTable.Columns.Add("V1绕组温度");
  191. dataTable.Columns.Add("V2绕组温度");
  192. dataTable.Columns.Add("W1绕组温度");
  193. dataTable.Columns.Add("W2绕组温度");
  194. dataTable.Columns.Add("轴承A温度");
  195. dataTable.Columns.Add("轴承B温度");
  196. dataTable.Columns.Add("齿轮箱温度");
  197. dataTable.Columns.Add("齿轮箱轴1温度");
  198. dataTable.Columns.Add("齿轮箱轴2温度");
  199. dataTable.Columns.Add("机舱温度");
  200. dataTable.Columns.Add("环境温度");
  201. return dataTable;
  202. }
  203. /// <summary>
  204. /// 根据风场获取gridview实体信息
  205. /// </summary>
  206. /// <param name="station"></param>
  207. /// <returns></returns>
  208. public IList<GridViewData> GetInfoData(string stationName)
  209. {
  210. IList<GridViewData> dataList = new List<GridViewData>();
  211. // RefreshDataList(stationName);//刷新数据
  212. if (dicGridPointData.ContainsKey(stationName))
  213. {
  214. IList<PointMapModel> stationAllList = dicGridPointData[stationName];
  215. IList<string> windturbineIdList = stationAllList.Select(s => s.ThingId).Distinct().ToList();
  216. for (int i = 0; i < windturbineIdList.Count(); i++)
  217. {
  218. //根据风机编号获取测点值
  219. IList<PointMapModel> pointValueList =
  220. stationAllList.Where(s => s.ThingId == windturbineIdList[i]).ToList();
  221. GridViewData data = new GridViewData();
  222. data.WindturbineId = windturbineIdList[i];
  223. PointMapModel coldWindTemperatureData = pointValueList.Where(s => s.PointName == "冷却风温度").FirstOrDefault();
  224. data.ColdWindTemperature = coldWindTemperatureData != null ? coldWindTemperatureData.Value : 0.0;
  225. PointMapModel powerData = pointValueList.Where(s => s.PointName == "有功功率").FirstOrDefault();
  226. data.Power = powerData != null ? powerData.Value : 0.0;
  227. PointMapModel OilTemperature = pointValueList.Where(s => s.PointName == "液压油温度").FirstOrDefault();
  228. data.OilTemperature = OilTemperature != null ? OilTemperature.Value : 0.0;
  229. PointMapModel U1CirclingTemperature = pointValueList.Where(s => s.PointName == "U1绕组温度").FirstOrDefault();
  230. data.U1CirclingTemperature = U1CirclingTemperature != null ? U1CirclingTemperature.Value : 0.0;
  231. PointMapModel U2CirclingTemperature = pointValueList.Where(s => s.PointName == "U2绕组温度").FirstOrDefault();
  232. data.U2CirclingTemperature = U2CirclingTemperature != null ? U2CirclingTemperature.Value : 0.0;
  233. PointMapModel V1CirclingTemperature = pointValueList.Where(s => s.PointName == "V1绕组温度").FirstOrDefault();
  234. data.V1CirclingTemperature = V1CirclingTemperature != null ? V1CirclingTemperature.Value : 0.0;
  235. PointMapModel V2CirclingTemperature = pointValueList.Where(s => s.PointName == "V2绕组温度").FirstOrDefault();
  236. data.V2CirclingTemperature = V2CirclingTemperature != null ? V2CirclingTemperature.Value : 0.0;
  237. PointMapModel W1CirclingTemperature = pointValueList.Where(s => s.PointName == "W1绕组温度").FirstOrDefault();
  238. data.W1CirclingTemperature = W1CirclingTemperature != null ? W1CirclingTemperature.Value : 0.0;
  239. PointMapModel W2CirclingTemperature = pointValueList.Where(s => s.PointName == "W2绕组温度").FirstOrDefault();
  240. data.W2CirclingTemperature = W2CirclingTemperature != null ? W2CirclingTemperature.Value : 0.0;
  241. PointMapModel poweAxisATemperaturerData = pointValueList.Where(s => s.PointName == "轴承A温度").FirstOrDefault();
  242. data.AxisATemperature = poweAxisATemperaturerData != null ? poweAxisATemperaturerData.Value : 0.0;
  243. PointMapModel AxisBTemperature = pointValueList.Where(s => s.PointName == "轴承B温度").FirstOrDefault();
  244. data.AxisBTemperature = AxisBTemperature != null ? AxisBTemperature.Value : 0.0;
  245. PointMapModel GearBoxTemperature = pointValueList.Where(s => s.PointName == "齿轮箱温度").FirstOrDefault();
  246. data.GearBoxTemperature = GearBoxTemperature != null ? GearBoxTemperature.Value : 0.0;
  247. PointMapModel GearAxis1Temperature = pointValueList.Where(s => s.PointName == "齿轮箱轴1温度").FirstOrDefault();
  248. data.GearAxis1Temperature = GearAxis1Temperature != null ? GearAxis1Temperature.Value : 0.0;
  249. PointMapModel GearAxis2Temperature = pointValueList.Where(s => s.PointName == "齿轮箱轴2温度").FirstOrDefault();
  250. data.GearAxis2Temperature = GearAxis2Temperature != null ? GearAxis2Temperature.Value : 0.0;
  251. PointMapModel RoomTemperature = pointValueList.Where(s => s.PointName == "机舱温度").FirstOrDefault();
  252. data.RoomTemperature = RoomTemperature != null ? RoomTemperature.Value : 0.0;
  253. PointMapModel RoundTemperature = pointValueList.Where(s => s.PointName == "环境温度").FirstOrDefault();
  254. data.RoundTemperature = RoundTemperature != null ? RoundTemperature.Value : 0.0;
  255. dataList.Add(data);
  256. }
  257. }
  258. return dataList;
  259. }
  260. /// <summary>
  261. /// 获取各个风机对应的统一编码及其含义
  262. /// </summary>
  263. public void BuilDicUnifromCodeList()
  264. {
  265. #region 香山
  266. string[] XS_UP105 = { "XG01_01", "XG01_02", "XG01_03", "XG01_04", "XG01_05", "XG01_06", "XG01_07", "XG01_08", "XG01_09", "XG01_10", "XG01_11", "XG01_12", "XG01_13", "XG01_14", "XG01_15", "XG01_16", "XG01_17", "XG01_18", "XG01_19", "XG01_20", "XG01_21", "XG01_22", "XG01_23", "XG01_24", "XG01_25" };
  267. string[] XS_UP97 = { "XG01_26", "XG01_27", "XG01_28", "XG01_29", "XG01_30", "XG01_31", "XG01_32", "XG01_33", "XG01_34", "XG01_35", "XG01_36", "XG01_37", "XG01_38", "XG01_39", "XG01_40", "XG01_41", "XG01_42", "XG01_43", "XG01_44", "XG01_45", "XG01_46", "XG01_47", "XG01_48", "XG01_49", "XG01_50", "XG01_51", "XG01_52", "XG01_53", "XG01_54", "XG01_55", "XG01_56", "XG01_57", "XG01_58", };
  268. Dictionary<string, string> XS_UP105_UniformCode = new Dictionary<string, string>();//UP105机型统一编码映射
  269. Dictionary<string, string> XS_UP97_UniformCode = new Dictionary<string, string>();//UP97机型统一编码映射
  270. Dictionary<string, string> XS_Station_UniformCode = new Dictionary<string, string>();//香山风场相关指标统一 编码映射
  271. XS_UP97_UniformCode.Add("AI054", "冷却风温度");
  272. XS_UP97_UniformCode.Add("AI130", "有功功率");
  273. XS_UP97_UniformCode.Add("AI021", "液压油温度");
  274. XS_UP97_UniformCode.Add("AI045", "U1绕组温度");
  275. XS_UP97_UniformCode.Add("AI046", "U2绕组温度");
  276. XS_UP97_UniformCode.Add("AI047", "V1绕组温度");
  277. XS_UP97_UniformCode.Add("AI048", "V2绕组温度");
  278. XS_UP97_UniformCode.Add("AI049", "W1绕组温度");
  279. XS_UP97_UniformCode.Add("AI050", "W2绕组温度");
  280. XS_UP97_UniformCode.Add("AI052", "轴承A温度");
  281. XS_UP97_UniformCode.Add("AI053", "轴承B温度");
  282. XS_UP97_UniformCode.Add("AI072", "齿轮箱温度");
  283. XS_UP97_UniformCode.Add("AI038", "齿轮箱轴1温度");
  284. XS_UP97_UniformCode.Add("AI039", "齿轮箱轴2温度");
  285. XS_UP97_UniformCode.Add("AI057", "机舱温度");
  286. XS_UP97_UniformCode.Add("AI056", "环境温度");
  287. XS_UP105_UniformCode.Add("AI042", "冷却风温度");
  288. XS_UP105_UniformCode.Add("AI130B", "有功功率");
  289. XS_UP105_UniformCode.Add("AI041", "液压油温度");
  290. XS_UP105_UniformCode.Add("AI045", "U1绕组温度");
  291. XS_UP105_UniformCode.Add("AI046", "U2绕组温度");
  292. XS_UP105_UniformCode.Add("AI047", "V1绕组温度");
  293. XS_UP105_UniformCode.Add("AI048", "V2绕组温度");
  294. XS_UP105_UniformCode.Add("AI049", "W1绕组温度");
  295. XS_UP105_UniformCode.Add("AI050", "W2绕组温度");
  296. XS_UP105_UniformCode.Add("AI052", "轴承A温度");
  297. XS_UP105_UniformCode.Add("AI053", "轴承B温度");
  298. XS_UP105_UniformCode.Add("AI038", "齿轮箱温度");
  299. XS_UP105_UniformCode.Add("AI291", "齿轮箱轴1温度");
  300. XS_UP105_UniformCode.Add("AI292", "齿轮箱轴2温度");
  301. XS_UP105_UniformCode.Add("AI070", "机舱温度");
  302. XS_UP105_UniformCode.Add("AI057", "环境温度");
  303. #endregion
  304. #region 石板泉
  305. string[] SBQ_UP105 = { "SG01_67", "SG01_68", "SG01_69", "SG01_70", "SG01_71", "SG01_72", "SG01_73", "SG01_74", "SG01_75", "SG01_76", "SG01_77", "SG01_78", "SG01_79", "SG01_80", "SG01_81", "SG01_82", "SG01_83", "SG01_84", "SG01_85", "SG01_86", "SG01_87", "SG01_88", "SG01_89", "SG01_90", "SG01_91", "SG01_100", "SG01_101", "SG01_102", "SG01_103", "SG01_104", "SG01_105", "SG01_106", "SG01_107", "SG01_108", "SG01_109", "SG01_110", "SG01_111", "SG01_112", "SG01_113", "SG01_114", "SG01_115", "SG01_116", "SG01_92", "SG01_93", "SG01_94", "SG01_95", "SG01_96", "SG01_97", "SG01_98", "SG01_99" };
  306. string[] SBQ_UP82 = { "SG01_01", "SG01_02", "SG01_03", "SG01_04", "SG01_05", "SG01_06", "SG01_07", "SG01_08", "SG01_09", "SG01_10", "SG01_11", "SG01_12", "SG01_13", "SG01_14", "SG01_15", "SG01_16", "SG01_17", "SG01_18", "SG01_19", "SG01_20", "SG01_21", "SG01_22", "SG01_23", "SG01_24", "SG01_25", "SG01_26", "SG01_27", "SG01_28", "SG01_29", "SG01_30", "SG01_31", "SG01_32", "SG01_33" };
  307. string[] SBQ_UP97 = { "SG01_34", "SG01_35", "SG01_36", "SG01_37", "SG01_38", "SG01_39", "SG01_40", "SG01_41", "SG01_42", "SG01_43", "SG01_44", "SG01_45", "SG01_46", "SG01_47", "SG01_48", "SG01_49", "SG01_50", "SG01_51", "SG01_52", "SG01_53", "SG01_54", "SG01_55", "SG01_56", "SG01_57", "SG01_58", "SG01_59", "SG01_60", "SG01_61", "SG01_62", "SG01_63", "SG01_64", "SG01_65", "SG01_66" };
  308. Dictionary<string, string> SBQ_UP105_UniformCode = new Dictionary<string, string>();//UP105机型统一编码映射
  309. Dictionary<string, string> SBQ_UP82_UniformCode = new Dictionary<string, string>();//UP82机型统一编码映射
  310. Dictionary<string, string> SBQ_UP97_UniformCode = new Dictionary<string, string>();//UP97机型统一编码映射
  311. SBQ_UP105_UniformCode.Add("AI042", "冷却风温度");
  312. SBQ_UP105_UniformCode.Add("AI130", "有功功率");
  313. SBQ_UP105_UniformCode.Add("AI041", "液压油温度");
  314. SBQ_UP105_UniformCode.Add("AI045", "U1绕组温度");
  315. SBQ_UP105_UniformCode.Add("AI046", "U2绕组温度");
  316. SBQ_UP105_UniformCode.Add("AI047", "V1绕组温度");
  317. SBQ_UP105_UniformCode.Add("AI048", "V2绕组温度");
  318. SBQ_UP105_UniformCode.Add("AI049", "W1绕组温度");
  319. SBQ_UP105_UniformCode.Add("AI050", "W2绕组温度");
  320. SBQ_UP105_UniformCode.Add("AI052", "轴承A温度");
  321. SBQ_UP105_UniformCode.Add("AI053", "轴承B温度");
  322. SBQ_UP105_UniformCode.Add("AI071", "齿轮箱温度");
  323. SBQ_UP105_UniformCode.Add("AI038", "齿轮箱轴1温度");
  324. SBQ_UP105_UniformCode.Add("AI039", "齿轮箱轴2温度");
  325. SBQ_UP105_UniformCode.Add("AI070", "机舱温度");
  326. SBQ_UP105_UniformCode.Add("AI056", "环境温度");
  327. SBQ_UP82_UniformCode.Add("AI054", "冷却风温度");
  328. SBQ_UP82_UniformCode.Add("AI130", "有功功率");
  329. SBQ_UP82_UniformCode.Add("AI020", "液压油温度");
  330. SBQ_UP82_UniformCode.Add("AI045", "U1绕组温度");
  331. SBQ_UP82_UniformCode.Add("AI046", "U2绕组温度");
  332. SBQ_UP82_UniformCode.Add("AI047", "V1绕组温度");
  333. SBQ_UP82_UniformCode.Add("AI048", "V2绕组温度");
  334. SBQ_UP82_UniformCode.Add("AI049", "W1绕组温度");
  335. SBQ_UP82_UniformCode.Add("AI050", "W2绕组温度");
  336. SBQ_UP82_UniformCode.Add("AI052", "轴承A温度");
  337. SBQ_UP82_UniformCode.Add("AI053", "轴承B温度");
  338. SBQ_UP82_UniformCode.Add("AI041", "齿轮箱温度");
  339. SBQ_UP82_UniformCode.Add("AI038", "齿轮箱轴1温度");
  340. SBQ_UP82_UniformCode.Add("AI039", "齿轮箱轴2温度");
  341. SBQ_UP82_UniformCode.Add("AI057", "机舱温度");
  342. SBQ_UP82_UniformCode.Add("AI056", "环境温度");
  343. SBQ_UP97_UniformCode.Add("AI054", "冷却风温度");
  344. SBQ_UP97_UniformCode.Add("AI130", "有功功率");
  345. SBQ_UP97_UniformCode.Add("AI020", "液压油温度");
  346. SBQ_UP97_UniformCode.Add("AI045", "U1绕组温度");
  347. SBQ_UP97_UniformCode.Add("AI046", "U2绕组温度");
  348. SBQ_UP97_UniformCode.Add("AI047", "V1绕组温度");
  349. SBQ_UP97_UniformCode.Add("AI048", "V2绕组温度");
  350. SBQ_UP97_UniformCode.Add("AI049", "W1绕组温度");
  351. SBQ_UP97_UniformCode.Add("AI050", "W2绕组温度");
  352. SBQ_UP97_UniformCode.Add("AI052", "轴承A温度");
  353. SBQ_UP97_UniformCode.Add("AI053", "轴承B温度");
  354. SBQ_UP97_UniformCode.Add("AI041", "齿轮箱温度");
  355. SBQ_UP97_UniformCode.Add("AI038", "齿轮箱轴1温度");
  356. SBQ_UP97_UniformCode.Add("AI039", "齿轮箱轴2温度");
  357. SBQ_UP97_UniformCode.Add("AI057", "机舱温度");
  358. SBQ_UP97_UniformCode.Add("AI056", "环境温度");
  359. #endregion
  360. using (wisdom_cs_entity ctx = new wisdom_cs_entity())
  361. {
  362. IList<windturbine> list = ctx.windturbine.Where(s => s.WINDPOWERSTATIONID.Contains("_FDC")).ToList();
  363. for (int i = 0; i < list.Count; i++)
  364. {
  365. //香山
  366. if (list[i].WINDPOWERSTATIONID == "XS_FDC")
  367. {
  368. if (XS_UP105.Contains(list[i].ID))
  369. {
  370. dicUniformCodeListByWindturbineId.Add(list[i].ID, XS_UP105_UniformCode);
  371. }
  372. else
  373. {
  374. dicUniformCodeListByWindturbineId.Add(list[i].ID, XS_UP97_UniformCode);
  375. }
  376. }
  377. //石板泉
  378. if (list[i].WINDPOWERSTATIONID == "SBQ_FDC")
  379. {
  380. if (SBQ_UP105.Contains(list[i].ID))
  381. {
  382. dicUniformCodeListByWindturbineId.Add(list[i].ID, SBQ_UP105_UniformCode);
  383. }
  384. else if (SBQ_UP97.Contains(list[i].ID))
  385. {
  386. dicUniformCodeListByWindturbineId.Add(list[i].ID, SBQ_UP97_UniformCode);
  387. }
  388. else
  389. {
  390. dicUniformCodeListByWindturbineId.Add(list[i].ID, SBQ_UP82_UniformCode);
  391. }
  392. }
  393. //青山
  394. if (list[i].WINDPOWERSTATIONID == "QS_FDC")
  395. {
  396. }
  397. //牛首山
  398. if (list[i].WINDPOWERSTATIONID == "NSS_FDC")
  399. {
  400. }
  401. //麻黄山
  402. if (list[i].WINDPOWERSTATIONID == "MHS_FDC")
  403. {
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }