//曲线报表默认加载设备参数 public string SelectSinglePoint(int tagid) { string res = ""; string strsql = "select * from V_DeviceInfoState_PDR1 where tagid=" + tagid + " and DataTypeID!=23 order by DataTypeID"; List <V_DeviceInfoState_PDR1> list = bll.ExecuteStoreQuery <V_DeviceInfoState_PDR1>(strsql).ToList(); //设备温度 if (list.Count > 0) { V_DeviceInfoState_PDR1 jo = list[0]; res += jo.DataTypeID + "_" + jo.TagID + ","; } return(res.TrimEnd(',')); }
//电缆最高温楼层的实时图示 // 20160321 by public string GetMaxTempViewByDID() { StringBuilder sbtitle = new StringBuilder(); //StringBuilder nbtitle = new StringBuilder(); string strsql = "select top 1 AlarmAddress,AlarmArea,AlarmValue,ALarmType,AlarmState from t_AlarmTable_en where AlarmState>0 and (did >= 422 and did <= 437 or did = 397) order by AlarmState desc,AlarmValue desc"; string alarmAreas = ""; List <AlarmInfo> alist = bll.ExecuteStoreQuery <AlarmInfo>(strsql).ToList(); if (alist.Count > 0) { //如果有报警,则取报警的设备 strsql = "select * from V_DeviceInfoState_PDR1 where did in (select top 1 DID from t_AlarmTable_en where (did >= 422 and did <= 437 or did = 397) and DataTypeID=1 order by PV desc,TagID)";//选择报警表中报警值最高的设备 foreach (AlarmInfo AI in alist) { alarmAreas += AI.AlarmArea + ","; } } else { //如果无报警,获取最高温度的竖井楼层的测点信息,并动态生成示意图 strsql = "select * from V_DeviceInfoState_PDR1 where did in (select top 1 DID from V_DeviceInfoState_PDR1 where (did >= 422 and did <= 437 or did = 397) and DataTypeID=1 order by PV desc,TagID)";//选择设备表中报警值最高的设备 } //配置对应状态的电缆贴图 sbtitle.Append("<div class=\"ShowIt\"><div class=\"sjcontent\">"); List <V_DeviceInfoState_PDR1> Plist = bll.ExecuteStoreQuery <V_DeviceInfoState_PDR1>(strsql).ToList(); string[] Dlcss = new string[] { "a", "b", "c", "n" }; int i = 0; //string[] As = new string[]{}; foreach (V_DeviceInfoState_PDR1 P in Plist) { if (P.AlarmStatus == "关注") { sbtitle.Append("<div class=\"sjdl" + Dlcss[i] + "_1\"></div>"); i++; } else if (P.AlarmStatus == "预警") { sbtitle.Append("<div class=\"sjdl" + Dlcss[i] + "_2\"></div>"); i++; } else if (P.AlarmStatus == "报警") { sbtitle.Append("<div class=\"sjdl" + Dlcss[i] + "_3\"></div>"); i++; } else { sbtitle.Append("<div class=\"sjdl" + Dlcss[i] + "\"></div>"); i++; } } sbtitle.Append("</div></div>"); //配置对应的设备参数 string[] Al = new string[] { "A", "B", "C", "N" }; V_DeviceInfoState_PDR1 Po = Plist.First(); sbtitle.Append("<div id = \"RealTimeInfo\"><span style=\"font-weight:bold;font-size:20px;\">" + Po.DeviceName + "</span> "); //string[] As = new string[]{}; int j = 0; foreach (V_DeviceInfoState_PDR1 P in Plist) { if (P.AlarmStatus == "正常") { sbtitle.Append("<span style=\"color:black\">" + Al[j] + ":" + P.PV + P.Units + " </span> "); j++; } else if (P.AlarmStatus == "关注") { sbtitle.Append("<span style=\"color:yellow\">" + Al[j] + ":" + P.PV + P.Units + " </span> "); j++; } else if (P.AlarmStatus == "预警") { sbtitle.Append("<span style=\"color:origin\">" + Al[j] + ":" + P.PV + P.Units + " </span> "); j++; } else if (P.AlarmStatus == "报警") { sbtitle.Append("<span style=\"color:red\">" + Al[j] + ":" + P.PV + P.Units + " </span> "); j++; } else { sbtitle.Append("<span>" + Al[j] + ":" + P.PV + P.Units + " </span> "); j++; } } sbtitle.Append("</div>"); return(sbtitle.ToString()); }
public ItemNode(V_DeviceInfoState_PDR1 info) { this.cid = (int)info.CID; this.cname = info.CName; }