public void drivaceDeal(string drivaceID, WarnType wType) //处理设备 { DrivaceWarnMessage drevaceMsg = null; if (wType == WarnType.CARD_LOW_ELECTRICITY) { if (cardLowEleWarnMsgs.ContainsKey(drivaceID)) { drevaceMsg = cardLowEleWarnMsgs[drivaceID]; } } else if (wType == WarnType.CARD_UNANSWERED) { if (cardUnanswerWranMsgs.ContainsKey(drivaceID)) { drevaceMsg = cardUnanswerWranMsgs[drivaceID]; //.DealWarnTime = XwDataUtils.GetTimeStamp(); } } else if (wType == WarnType.NODE_UNANSWERED) { if (nODEUnanswerWranMsgs.ContainsKey(drivaceID)) { drevaceMsg = nODEUnanswerWranMsgs[drivaceID]; //.DealWarnTime = XwDataUtils.GetTimeStamp(); } } if (drevaceMsg != null) { drevaceMsg.DealWarnTime = XwDataUtils.GetTimeStamp(); drevaceMsg.IsDeal = true; } }
public void addNODEUnanswerWranMsgs(string NODEId, uint sleepTime, string quYuID, string canKaoDianID, long drivaceUpTime) { createNODEUnanswerWranMsgs(); DrivaceWarnMessage dreMsg = new DrivaceWarnMessage(); dreMsg.setNODEUnanswer(NODEId, sleepTime, quYuID, canKaoDianID, drivaceUpTime); addDrivaceWrimMsg(NODEId, nODEUnanswerWranMsgs, nODEUnanswerWranHisMsgs, dreMsg); }
public void addcardLowEleMessage(string cardId, int currentElectricity, string quYuID, string canKaoDianID, long drivaceUpTime) { createCardLowEleWarnMsgs(); DrivaceWarnMessage dreMsg = new DrivaceWarnMessage(); dreMsg.setLowEle(cardId, currentElectricity, quYuID, canKaoDianID, drivaceUpTime); addDrivaceWrimMsg(cardId, cardLowEleWarnMsgs, cardLowEleWarnHisMsgs, dreMsg); }
public void addCardUnanswerMessage(string cardId, uint sleepTime, string quYuID, string canKaoDianID, long drivaceUpTime) { lock (cardLock) { createCardUnanswerWranMsgs(); DrivaceWarnMessage dreMsg = new DrivaceWarnMessage(); dreMsg.setCardUnanswer(cardId, sleepTime, quYuID, canKaoDianID, drivaceUpTime); addDrivaceWrimMsg(cardId, cardUnanswerWranMsgs, cardUnanswerWranHisMsgs, dreMsg); } }
/// <summary> /// 将报警信息添加相应的信息中存储 /// </summary> /// <param name="drivaceID"></param> /// <param name="msgs"></param> /// <param name="dreMsg"></param> private void addDrivaceWrimMsg(string drivaceID, Dictionary <string, DrivaceWarnMessage> msgs, Dictionary <string, DrivaceWarnMessage> hisMsgs, DrivaceWarnMessage dreMsg) { if (drivaceID == null || "".Equals(drivaceID)) { return; } if (hisMsgs.ContainsKey(drivaceID)) { if (dreMsg.DrivaceUpTime <= hisMsgs[drivaceID].DrivaceUpTime) { return; } } if (msgs.ContainsKey(drivaceID)) { if (dreMsg.WarnTp != WarnType.CARD_LOW_ELECTRICITY) { msgs[drivaceID].WarnTime = XwDataUtils.GetTimeStamp(); } msgs[drivaceID].IsClear = false; msgs[drivaceID].IsDeal = false; } else { msgs.Add(drivaceID, dreMsg); warnMsgCallBack(nODEUnanswerWranMsgs.Count + cardLowEleWarnMsgs.Count + cardUnanswerWranMsgs.Count); } if (dreMsg.WarnTp == WarnType.CARD_LOW_ELECTRICITY && msgs[drivaceID].CurrentElectricity > dreMsg.CurrentElectricity + 9) { msgs[drivaceID].CurrentElectricity = dreMsg.CurrentElectricity; msgs[drivaceID].WarnTime = XwDataUtils.GetTimeStamp(); warnMsgCallBack(nODEUnanswerWranMsgs.Count + cardLowEleWarnMsgs.Count + cardUnanswerWranMsgs.Count); } }