本人想利用AXC_SetFilter函数对报警进行一个简单的过滤,此代码可以查询任意日期之间的报警信息,具体如下:
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
#pragma option(mbcs)
BOOL ret;
MSG_FILTER_STRUCT Filter;
CMN_ERROR Error;
SYSTEMTIME StartTime;
SYSTEMTIME StopTime;
//Reset the filter struct
memset( &Filter, 0, sizeof( MSG_FILTER_STRUCT ) );
//Set the filter name
strcpy( Filter.szFilterName, "Control1");
// Choose selection elements
Filter.dwFilter = MSG_FILTER_DATE_FROM MSG_FILTER_DATE_TO;
StartTime.wDay = GetTagWord("start_day");
StartTime.wMonth = GetTagWord("start_month");
StartTime.wYear = GetTagWord("start_year");
StopTime.wDay = GetTagWord("stop_day");
StopTime.wMonth = GetTagWord("stop_month");
StopTime.wYear = GetTagWord("stop_year");
// Message date from
Filter.st[0] = StartTime;
// Message date to
Filter.st[1] = StopTime;
ret = AXC_SetFilter("画面1","Control1",&Filter,&Error);//画面1=画面名,control1=报警控件名,可对照自己项目做相应修改
}