private void ExQuery() { InvalidTmlList.Clear(); int index = 1; foreach (var t in EquipmentDataInfoHold.InfoItems) { bool add = false; string faultType = string.Empty; if (t.Value.EquipmentType == WjParaBase.EquType.Rtu) { if (MNLSelect == true) { var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu; if (tt != null) { List <int> MoniliangID = new List <int>(); foreach (var ttt in tt.WjLoops.Values) { if (ttt.VectorMoniliang != 0) { foreach (var m in MoniliangID) { if (m == ttt.VectorMoniliang) { add = true; faultType += "模拟量缺省,"; break; } } if (add) { break; } else { MoniliangID.Add(ttt.VectorMoniliang); } } } foreach (var m in MoniliangID) { if ((m < 1) || (m > MoniliangID.Count)) { add = true; faultType += "模拟量缺省,"; break; } } } } if (KGLSelect == true) { var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu; bool fault = false; if (tt != null) { foreach (var ttt in tt.WjSwitchOuts.Values) { if (ttt.SwitchVecotr != ttt.SwitchId) { add = true; faultType += "开关量缺省,"; fault = true; break; } } int[] loopNum = new int[6]; if (fault == false) { foreach (var ttt in tt.WjLoops.Values) { if (ttt.SwitchOutputId != 0) { loopNum[ttt.SwitchOutputId - 1]++; if (ttt.SwitchOutputId != ttt.VectorSwitchIn) { add = true; faultType += "开关量缺省,"; fault = true; break; } } } } if (fault == false) { for (int i = 1; i < 6; i++) { if ((loopNum[i] != 0) && (loopNum[i - 1] == 0)) { add = true; faultType += "开关量缺省,"; break; } } } } } if (TYSelect == true) { if (t.Value.RtuStateCode == 1) { add = true; faultType += "状态停运,"; } } if (BYSelect == true) { if (t.Value.RtuStateCode == 0) { add = true; faultType += "状态不用,"; } } if (ZBZQSelect == true) { var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu; if (tt != null) { if (tt.WjGprs.RtuReportCycle < ZBZQThres) { add = true; faultType += "主报周期过小,"; } } } if (PBYDLSelect == true) { var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu; if (tt != null) { foreach (var ttt in tt.WjLoops.Values) { if (ttt.IsShieldLoop != 0) { } } } } if (add == true) { var tmp = ServicesGrpSingleInfoHold.GetRtuBelongGrp(t.Value.RtuId); var grpName = "未分组"; if (tmp != null) { grpName = (ServicesGrpSingleInfoHold.InfoGroups[new Tuple <int, int>(tmp.Item1, tmp.Item2)]). GroupName; } InvalidTmlList.Add(new InvalidTmlModel { Index = index, RtuId = t.Value.RtuId, PhyId = t.Value.RtuPhyId, RtuName = t.Value.RtuName, GrpName = grpName, FaultType = faultType.Substring(0, faultType.Length - 1) }); index++; } else { } } } if (InvalidTmlList.Count != 0) { ShowMsg = "共查询到" + InvalidTmlList.Count + "个记录"; } else { ShowMsg = string.Empty; } }
public void NavOnLoad(params object[] parsObjects) { SendOrderList.Clear(); int m = 0; CurrentOrderID = Convert.ToUInt64(GetOrderId()); foreach (var ttt in FaultRecord) { var tmp = ServicesGrpSingleInfoHold.GetRtuBelongGrp(ttt.RtuId); var grpName = "特殊分组"; if (tmp != null) { grpName = (ServicesGrpSingleInfoHold.InfoGroups[new Tuple <int, int>(tmp.Item1, tmp.Item2)]).GroupName; } var str = ttt.RtuName + " " + ttt.FaultName; if (ttt.LoopID > 0) { str = ttt.RtuName + " 回路" + ttt.LoopID + " " + ttt.FaultName; var hld = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(ttt.RtuId); if (hld != null) { var tmpsdfsd = hld as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu; if (tmpsdfsd != null) { if (tmpsdfsd.WjLoops.ContainsKey(ttt.LoopID)) { str = ttt.RtuName + " " + tmpsdfsd.WjLoops[ttt.LoopID].LoopName + " " + ttt.FaultName + "\r\n" + ttt.Remarks; } } } } var orderInfo = new SendOrderItems { Id = m++, RtuId = ttt.RtuId, AdminName = UserInfo.UserLoginInfo.UserName, MergencyLocation = string.Empty, MergencyLocationEnable = Return_PriorityLevel_Enable(ttt.PriorityLevel), OrderId = ttt.OrderID, FaultId = ttt.FaultID, FaultName = ttt.FaultName, OrderTime = string.Empty, PriorityLevel = Return_PriorityLevel_Desc(ttt.PriorityLevel), RepairContent = str, RtuGroup = grpName, RtuName = ttt.RtuName, LoopId = ttt.LoopID, Status = ReturnStatusDesc(ttt.OrderID) }; SendOrderList.Add(orderInfo); } if (SendOrderList.Count != 0) { CurrentSendOrderItem = SendOrderList[0]; MessageShow = string.Empty; } }