|
|
@@ -12,14 +12,12 @@ void CAlarmEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,con
|
|
|
const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo)
|
|
|
{
|
|
|
- //Dbg("receive log,pszEntityName=%s,eLogType=%d,pszMessage=%s",pszEntityName,(int)eLogType,pszMessage);
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
-
|
|
|
-#else
|
|
|
+#ifdef RVC_OS_LINUX
|
|
|
CSimpleStringA strMessage(true);
|
|
|
if (!(pszMessage == NULL || strlen(pszMessage) == 0))
|
|
|
strMessage = pszMessage;
|
|
|
|
|
|
+ //TODO: 现在还有旧模式吗?没有请进行相关逻辑的移除 [Gifur@2025630]
|
|
|
//如果是旧模式则转GBK码
|
|
|
if (m_fsm.m_CenterModel == 0) {
|
|
|
if (!strMessage.IsNullOrEmpty()) {
|
|
|
@@ -27,7 +25,7 @@ void CAlarmEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,con
|
|
|
strMessage = tmpStr.c_str();
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif //RVC_OS_LINUX
|
|
|
|
|
|
alarm_t*Alarm = new alarm_t();
|
|
|
char cEntityName[32]={0};
|
|
|
@@ -58,20 +56,21 @@ void CAlarmEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,con
|
|
|
char cDescription[512]={0};
|
|
|
//char clogTime[32]={0};//2020-20-20 12:12:12.100 日志时间,记得释放
|
|
|
char warnTime[20]={0};//2020-20-20 12:12:12 告警时间,记得释放
|
|
|
+
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
SYSTEMTIME st;
|
|
|
GetLocalTime(&st);
|
|
|
- //sprintf(clogTime, "%04d-%02d-%02d %02d:%02d:%02d.%03d ", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
|
|
|
sprintf(warnTime, "%04d-%02d-%02d %02d:%02d:%02d", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
|
|
|
#else
|
|
|
struct timeb stime = { 0, 0 };
|
|
|
tm nowTm = { 0 };
|
|
|
ftime(&stime);
|
|
|
localtime_r(&stime.time, &nowTm);
|
|
|
- //sprintf(clogTime, "%04d-%02d-%02d %02d:%02d:%02d.%03d ", nowTm.tm_year + 1900, nowTm.tm_mon + 1, nowTm.tm_mday, nowTm.tm_hour, nowTm.tm_min, nowTm.tm_sec, stime.millitm);
|
|
|
sprintf(warnTime, "%04d-%02d-%02d %02d:%02d:%02d", nowTm.tm_year + 1900, nowTm.tm_mon + 1, nowTm.tm_mday, nowTm.tm_hour, nowTm.tm_min, nowTm.tm_sec);
|
|
|
#endif
|
|
|
- //strncpy(cDescription, clogTime, 32);
|
|
|
+
|
|
|
+ //TODO: CrossPlaform 减少宏的使用 [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
strncat(cDescription, pszMessage, 512 - 1);
|
|
|
#else
|