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 agcInfoDic = new Dictionary(); public void GetAgcInfo(string stationId) { if (stationId != "SBQ_FDC") { string[] uniformCode = new string[] { "YGSDZ", "SSZGL", "ZLLGL", "ZZSGL", "FCFGCDQ0001", "FCFGCDQ0002", "FCFGCDQ0004", "FCFGCDQ0016" }; Dictionary dicResult = RestfulClient.findLatestByThingCodes("station", stationId, uniformCode); agcInfoDic = dicResult; } else { string[] uniformCode = new string[] { "SSZGL", "ZLLGL", "ZZSGL", "FCFGCDQ0001", "FCFGCDQ0002", "FCFGCDQ0004", "FCFGCDQ0016" }; Dictionary 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 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; } } } }