12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WisdomClient;
- using WisdomClient.data;
- namespace IntelligentControlForsx.Service.WindturbineControl
- {
- public class CleverInfoSvc
- {
- public static CleverInfoSvc Instance
- {
- get { return SingletonCreator.instance; }
- }
- class SingletonCreator
- {
- internal static readonly CleverInfoSvc instance = new CleverInfoSvc();
- }
- public static Dictionary<string, TsData> agcInfoDic = new Dictionary<string, TsData>();
- public void GetAgcInfo(string stationId)
- {
- if (stationId != "SBQ_FDC")
- {
- string[] uniformCode = new string[]
- {
- "YGSDZ",
- "SSZGL",
- "ZLLGL",
- "ZZSGL",
- "FCFGCDQ0001",
- "FCFGCDQ0002",
- "FCFGCDQ0004",
- "FCFGCDQ0016"
- };
- Dictionary<string, TsData> dicResult = RestfulClient.findLatestByThingCodes("station", stationId,
- uniformCode);
- agcInfoDic = dicResult;
- }
- else
- {
- string[] uniformCode = new string[]
- {
- "SSZGL",
- "ZLLGL",
- "ZZSGL",
- "FCFGCDQ0001",
- "FCFGCDQ0002",
- "FCFGCDQ0004",
- "FCFGCDQ0016"
- };
- Dictionary<string, TsData> dicResult = RestfulClient.findLatestByThingCodes("station", stationId,
- uniformCode);
- string[] pointArr = { "SBQDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0818", "SBQDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0827" };
- Dictionary<string, TsData> agcPowerSetDic = RestfulClient.findLatestByTagNames(pointArr);
- if (agcPowerSetDic.Count == 2)
- {
- if (agcPowerSetDic.ContainsKey("SBQDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0827") &&
- agcPowerSetDic.ContainsKey("SBQDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0818"))
- {
- TsData d1 = agcPowerSetDic["SBQDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0818"];
- TsData d2 = agcPowerSetDic["SBQDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0827"];
- TsData resultData = new TsData();
- resultData.ts = d1.ts;
- resultData.doubleValue = d1.doubleValue + d2.doubleValue;
- if (!dicResult.ContainsKey("YGSDZ"))
- {
- dicResult.Add("YGSDZ", resultData);
- }
- }
- }
- agcInfoDic = dicResult;
- }
- }
- }
- }
|