|
|
@@ -172,21 +172,33 @@ bool CResistAlarmMng::AckAlarm(int alarm_id, string& name, CTime& time)
|
|
|
{
|
|
|
lock_guard<mutex> lock(m_mtxAlarm);
|
|
|
auto it = m_lstUnConfirmAlarm.begin();
|
|
|
+ auto pInfo = *it;
|
|
|
+ bool result = false;
|
|
|
for (it; it != m_lstUnConfirmAlarm.end(); ++it)
|
|
|
{
|
|
|
- auto& pInfo = *it;
|
|
|
+ pInfo = *it;
|
|
|
if (alarm_id == pInfo->id)
|
|
|
{
|
|
|
- pInfo->ack_result = 1;
|
|
|
- pInfo->ack_name = name;
|
|
|
- pInfo->ack_time = time;
|
|
|
-
|
|
|
- //g_p315ClientManager->GetTcpClient()->SendAlarmData(pInfo->no, 2, CTime(pInfo->time).GetTime(), time.GetTime(), (WORD)pInfo->type, pInfo->val, 0, 0);
|
|
|
-
|
|
|
- return true;
|
|
|
+ result = true;
|
|
|
+ break;
|
|
|
+ //g_p315ClientManager->GetTcpClient()->SendAlarmData(pInfo->no, 2, CTime(pInfo->time).GetTime(), time.GetTime(), (WORD)pInfo->type, pInfo->val, 0, 0);
|
|
|
}
|
|
|
}
|
|
|
- return false;
|
|
|
+ if (!result) return false;
|
|
|
+ auto itNew = m_lstUnConfirmAlarm.begin();
|
|
|
+ for (itNew;itNew != m_lstUnConfirmAlarm.end();++itNew) {
|
|
|
+ auto& pInfoNew = *itNew;
|
|
|
+ if (pInfo->mo == pInfoNew->mo
|
|
|
+ && pInfo->mp == pInfoNew->mp
|
|
|
+ && pInfo->no == pInfoNew->no
|
|
|
+ && pInfo->type == pInfoNew->type) {
|
|
|
+
|
|
|
+ pInfoNew->ack_result = 1;
|
|
|
+ pInfoNew->ack_name = name;
|
|
|
+ pInfoNew->ack_time = time;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
bool CResistAlarmMng::HandleAlarm(int alarm_id)
|