|
|
@@ -2889,14 +2889,12 @@ static void AlarmToShm(char* strData)
|
|
|
if (_globalDeviceManager->g_shm_Data->nTypeCtrlType[i] == 0||_globalDeviceManager->g_shm_Data->nTypeCtrlType[i] == 2)
|
|
|
{
|
|
|
isLastIndex = i;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
- if (isLastIndex != -1)//全部被占满则使用全局记录的位置进行添加
|
|
|
+ if (isLastIndex == -1)//全部被占满则使用全局记录的位置进行添加
|
|
|
{
|
|
|
- _globalDeviceManager->g_shm_Data->nTypeCtrlType[_globalDeviceManager->g_lastAlarmIndex]=1;//设置更新了一个报警
|
|
|
- memset(_globalDeviceManager->g_shm_Data->strMSG[_globalDeviceManager->g_lastAlarmIndex],0,nMAXLens);
|
|
|
- strcpy(_globalDeviceManager->g_shm_Data->strMSG[_globalDeviceManager->g_lastAlarmIndex], strSave);
|
|
|
- if (_globalDeviceManager->g_lastAlarmIndex < 10 && _globalDeviceManager->g_lastAlarmIndex >= 0)
|
|
|
+ if (_globalDeviceManager->g_lastAlarmIndex < 9 && _globalDeviceManager->g_lastAlarmIndex >= 0)
|
|
|
{
|
|
|
_globalDeviceManager->g_lastAlarmIndex++;
|
|
|
}
|
|
|
@@ -2904,12 +2902,21 @@ static void AlarmToShm(char* strData)
|
|
|
{
|
|
|
_globalDeviceManager->g_lastAlarmIndex = 0;
|
|
|
}
|
|
|
- }else//未被全部占满则使用空闲位置添加
|
|
|
+
|
|
|
+ _globalDeviceManager->g_shm_Data->nTypeCtrlType[_globalDeviceManager->g_lastAlarmIndex]=1;//设置更新了一个报警
|
|
|
+ memset(_globalDeviceManager->g_shm_Data->strMSG[_globalDeviceManager->g_lastAlarmIndex],0,nMAXLens);
|
|
|
+ strcpy(_globalDeviceManager->g_shm_Data->strMSG[_globalDeviceManager->g_lastAlarmIndex], strSave);
|
|
|
+
|
|
|
+ }
|
|
|
+ else // 未被全部占满则使用空闲位置添加
|
|
|
{
|
|
|
- _globalDeviceManager->g_shm_Data->nTypeCtrlType[isLastIndex]=1;//设置更新了一个报警
|
|
|
- strcpy(_globalDeviceManager->g_shm_Data->strMSG[isLastIndex], strSave);
|
|
|
- _globalDeviceManager->g_lastAlarmIndex=isLastIndex;
|
|
|
- }
|
|
|
+ if (isLastIndex >= 0 && isLastIndex < 10)
|
|
|
+ {
|
|
|
+ _globalDeviceManager->g_shm_Data->nTypeCtrlType[isLastIndex] = 1; // 设置更新了一个报警
|
|
|
+ strcpy(_globalDeviceManager->g_shm_Data->strMSG[isLastIndex], strSave);
|
|
|
+ _globalDeviceManager->g_lastAlarmIndex = isLastIndex;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|