| | |
| | | item.second->release(); |
| | | } |
| | | m_mapAlarming.clear(); |
| | | |
| | | for (auto item : m_alarms) { |
| | | item->release(); |
| | | } |
| | | m_alarms.clear(); |
| | | } |
| | | |
| | | std::string& CAlarmMonitor::getClassName() |
| | |
| | | if (!findAlarm(alarmIds, iter->first)) { |
| | | // 消除警告, 同时将信息发出,以使界面显示和历史记录保存 |
| | | iter->second->alarmOff(); |
| | | addAlarmToHistoryRecord(iter->second); |
| | | LOGE("消除了警告:%s", iter->second->toString().c_str()); |
| | | SendBroadcast(&CIntent(BC_CODE_ALARM_OFF, "", iter->second)); |
| | | |
| | |
| | | |
| | | void CAlarmMonitor::Serialize(CArchive& ar) |
| | | { |
| | | /* |
| | | if (ar.IsStoring()) |
| | | { |
| | | Lock(); |
| | |
| | | ar >> count; |
| | | for (int i = 0; i < count; i++) { |
| | | CAlarm* pAlarm = new CAlarm(); |
| | | pAlarm->addRef(); |
| | | pAlarm->Serialize(ar); |
| | | AddAlarm(pAlarm); |
| | | pAlarm->release(); |
| | | |
| | | addAlarmToHistoryRecord(pAlarm); |
| | | LOGE("历史警告:%s", pAlarm->toString().c_str()); |
| | | } |
| | | Unlock(); |
| | | } |
| | | */ |
| | | } |
| | | |
| | | void CAlarmMonitor::getAlarmingMap(std::map<int, CAlarm*>& alarms) |
| | |
| | | |
| | | return FALSE; |
| | | } |
| | | |
| | | void CAlarmMonitor::addAlarmToHistoryRecord(CAlarm* pAlarm) |
| | | { |
| | | pAlarm->addRef(); |
| | | m_alarms.push_back(pAlarm); |
| | | if (m_alarms.size() > 1000) { |
| | | CAlarm* pTemp = m_alarms.front(); |
| | | pTemp->release(); |
| | | m_alarms.pop_front(); |
| | | } |
| | | } |