本文整理汇总了C++中SFILTERAPPLIED_CAN类的典型用法代码示例。如果您正苦于以下问题:C++ SFILTERAPPLIED_CAN类的具体用法?C++ SFILTERAPPLIED_CAN怎么用?C++ SFILTERAPPLIED_CAN使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SFILTERAPPLIED_CAN类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Der_SetConfigData
int CLogObjectCAN::Der_SetConfigData(xmlNodePtr pNodePtr)
{
int nResult = S_OK;
SFILTERAPPLIED_CAN sFilterApplied;
CStringArray omStrFilters;
if (S_OK == sFilterApplied.nSetXMLConfigData(pNodePtr->doc))
{
while(pNodePtr != NULL) //TODO:Move To Utils
{
if ( pNodePtr->xmlChildrenNode != NULL )
{
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Filter")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
omStrFilters.Add((char*)key);
xmlFree(key);
}
}
}
pNodePtr = pNodePtr->next;
}
sFilterApplied.nGetFiltersFromName(m_sFilterApplied, omStrFilters);
}
return nResult;
}
示例2: Filter_ShowConfigDlg
USAGEMODE HRESULT Filter_ShowConfigDlg(void* pExistingFilter, const void* psMsgEntry,
ETYPE_BUS eType, UINT nHardware, CWnd* pParent)
{
//Place this code at the beginning of the export function.
//Save previous resource handle and switch to current one.
HINSTANCE hInst = AfxGetResourceHandle();
AfxSetResourceHandle(FilterDLL.hResource);
HRESULT hResult = S_FALSE;
switch (eType)
{
case CAN:
{
if (pExistingFilter != NULL)
{
SFILTERAPPLIED_CAN* pAppliedFilterCan = (SFILTERAPPLIED_CAN*)pExistingFilter;
SFILTERAPPLIED_CAN sTempObj;
sTempObj.bClone(*pAppliedFilterCan);
CFilterConfigDlg omDlg(&sTempObj, (SMSGENTRY *)psMsgEntry, nHardware, pParent);
if (omDlg.DoModal() == IDOK)
{
pAppliedFilterCan->bClone(sTempObj);
hResult = S_OK;
}
//delete omDlg;
}
}
break;
case LIN:
if (pExistingFilter != NULL)
{
SFILTERAPPLIED_LIN* pAppliedFilterLin = (SFILTERAPPLIED_LIN*)pExistingFilter;
SFILTERAPPLIED_LIN sTempObj;
sTempObj.bClone(*pAppliedFilterLin);
CFilterConfigDlg omDlg(&sTempObj,(ClusterConfig *) psMsgEntry, nHardware, pParent);
if (omDlg.DoModal() == IDOK)
{
pAppliedFilterLin->bClone(sTempObj);
hResult = S_OK;
}
//delete omDlg;
}
break;
default:
{
}
break;
}
//Place this at the end of the export function.
//switch back to previous resource handle.
AfxSetResourceHandle(hInst);
return hResult;
}
示例3: GetFilterScheme
HRESULT CMsgContainerCAN::GetFilterScheme(void* pvFilterApplied)
{
HRESULT hResult = S_FALSE;
SFILTERAPPLIED_CAN* psFilterCAN = (SFILTERAPPLIED_CAN*)pvFilterApplied;
if (psFilterCAN != NULL)
{
if (psFilterCAN->bClone(m_sFilterCAN) == TRUE)
{
hResult = TRUE;
}
}
return hResult;
}
示例4: GetFilterScheme
HRESULT CMsgContainerCAN::GetFilterScheme(void* pvFilterApplied)
{
HRESULT hResult = S_FALSE;
SFILTERAPPLIED_CAN* psFilterCAN = (SFILTERAPPLIED_CAN*)pvFilterApplied;
if (psFilterCAN != nullptr)
{
// if (psFilterCAN->bClone(m_sFilterCAN) == TRUE)
if (psFilterCAN->bClone(m_sFilterCAN) == true)
{
//hResult = TRUE;
hResult = S_OK;
}
}
return hResult;
}
示例5: Der_SetConfigData
int CLogObjectCAN::Der_SetConfigData(xmlNodePtr pNodePtr)
{
int nResult = S_OK;
SFILTERAPPLIED_CAN sFilterApplied;
CStringArray omStrFilters;
map<string, int> mapFilters;
if (S_OK == sFilterApplied.nSetXMLConfigData(pNodePtr->doc, CAN))
{
while(pNodePtr != NULL) //TODO:Move To Utils
{
if ( pNodePtr->xmlChildrenNode != NULL )
{
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Filter")))
{
int nEnabled = 1;
xmlAttrPtr pAttr = pNodePtr->properties;
while (pAttr)
{
// walk through all the attributes and find the required one
if (pAttr->type == XML_ATTRIBUTE_NODE)
{
std::string strAttrName((char*)pAttr->name);
if ((strAttrName == "IsEnabled") )
{
nEnabled = atoi((char*)pAttr->children->content);
break; // found
}
}
pAttr = pAttr->next;
}
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
mapFilters[(char*)key] = nEnabled;
xmlFree(key);
}
}
}
pNodePtr = pNodePtr->next;
}
//sFilterApplied.nGetFiltersFromName(m_sFilterApplied, omStrFilters);
sFilterApplied.nGetFiltersFromName(m_sFilterApplied, mapFilters);
}
return nResult;
}
示例6: vPopulateFilterApplied
static void vPopulateFilterApplied(const SFILTERAPPLIED_CAN* psFilterConfigured, SFILTERAPPLIED_CAN& sFilterApplied, CMainEntryList& SrcList)
{
if ( psFilterConfigured == nullptr )
{
return;
}
const SMAINENTRY& sMainEntry = SrcList.GetHead();
int nCount = sMainEntry.m_odSelEntryList.GetCount();
SFILTERAPPLIED_CAN sTempAppliedFilter;
sTempAppliedFilter.bClone(sFilterApplied);
sFilterApplied.vClear();
sFilterApplied.m_psFilters = new SFILTERSET[nCount];
POSITION pos = sMainEntry.m_odSelEntryList.GetHeadPosition();
while (pos)
{
SSUBENTRY sSubEntry = sMainEntry.m_odSelEntryList.GetNext(pos);
const PSFILTERSET psTemp = SFILTERSET::psGetFilterSetPointer(psFilterConfigured->m_psFilters,
psFilterConfigured->m_ushTotal, sSubEntry.m_omSubEntryName.GetBuffer(MAX_PATH));
if (psTemp != nullptr)
{
sFilterApplied.m_psFilters[sFilterApplied.m_ushTotal].bClone(*psTemp);
sFilterApplied.m_ushTotal++;
}
}
//restore the enable flag for all filters
for(int nAppFilterCnt = 0; nAppFilterCnt < sFilterApplied.m_ushTotal; nAppFilterCnt++)
{
for(int nTempFilCnt = 0; nTempFilCnt < sTempAppliedFilter.m_ushTotal; nTempFilCnt++ )
{
if((&sTempAppliedFilter.m_psFilters[nTempFilCnt]) != nullptr)
{
if(sFilterApplied.m_psFilters[nAppFilterCnt].m_sFilterName.m_acFilterName ==
sTempAppliedFilter.m_psFilters[nTempFilCnt].m_sFilterName.m_acFilterName)
{
((sFilterApplied.m_psFilters)+ nAppFilterCnt) ->m_bEnabled
= ((sTempAppliedFilter.m_psFilters)+ nTempFilCnt) ->m_bEnabled;
}
}
}
}
}
示例7: pbyGetFilterConfig
BYTE* pbyGetFilterConfig(BYTE* pbyTrgBuffer,
CModuleFilterArray* pouModuleFilterArray,
const SFILTERAPPLIED_CAN* SrcFilter)
{
BYTE* pbyTemp = pbyTrgBuffer;
USHORT ushFilterCount = 0;
if (pouModuleFilterArray != NULL && (SrcFilter != NULL))
{
ushFilterCount = (USHORT)pouModuleFilterArray->GetSize();
}
SFILTERAPPLIED_CAN sFilterApplied;
sFilterApplied.vClear();
sFilterApplied.m_bEnabled = TRUE;
sFilterApplied.m_ushTotal = ushFilterCount;
sFilterApplied.m_psFilters = new SFILTERSET[sFilterApplied.m_ushTotal];
for (INT i = 0; i < ushFilterCount; i++)
{
//update filter applied
SMODULEFILTER sModuleFilter = pouModuleFilterArray->GetAt(i);
SFILTERSET* psFilterSet =
SFILTERSET::psGetFilterSetPointer(SrcFilter->m_psFilters,
SrcFilter->m_ushTotal,
sModuleFilter.m_omFilterName);
if (psFilterSet != NULL)
{
sFilterApplied.m_psFilters[i].bClone(*psFilterSet);
}
}
pbyTemp = sFilterApplied.pbGetConfigData(pbyTemp);
sFilterApplied.vClear();
return pbyTemp;
}
示例8: vPopulateFilterApplied
static void vPopulateFilterApplied(const SFILTERAPPLIED_CAN* psFilterConfigured, SFILTERAPPLIED_CAN& sFilterApplied, CMainEntryList& SrcList)
{
const SMAINENTRY& sMainEntry = SrcList.GetHead();
int nCount = (int)sMainEntry.m_odSelEntryList.GetCount();
sFilterApplied.vClear();
sFilterApplied.m_psFilters = new SFILTERSET[nCount];
POSITION pos = sMainEntry.m_odSelEntryList.GetHeadPosition();
while (pos)
{
SSUBENTRY sSubEntry = sMainEntry.m_odSelEntryList.GetNext(pos);
const PSFILTERSET psTemp = SFILTERSET::psGetFilterSetPointer(psFilterConfigured->m_psFilters,
psFilterConfigured->m_ushTotal, sSubEntry.m_omSubEntryName.GetBuffer(MAX_PATH));
ASSERT (psTemp != NULL);
sFilterApplied.m_psFilters[sFilterApplied.m_ushTotal].bClone(*psTemp);
sFilterApplied.m_ushTotal++;
}
}
示例9: GetFilterInfo
void CLogObjectCAN::GetFilterInfo(SFILTERAPPLIED_CAN& sFilterInfo) const
{
sFilterInfo.bClone(m_sFilterApplied);
}
示例10: while
//.........这里部分代码省略.........
}
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Message_Delay")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
m_unMsgTimeDelay = atoi((char*)key);
xmlFree(key);
}
}
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Is_Cyclic_Mode")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
m_nReplayMode = (int)xmlUtils::getBooleanValue((char*)key);
xmlFree(key);
}
}
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Cyclic_Delay")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
m_unCycleTimeDelay = atoi((char*)key);
xmlFree(key);
}
}
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"IsInteractive")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
m_bInteractive = (int)xmlUtils::getBooleanValue((char*)key);
xmlFree(key);
}
}
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Replay_Message_Direction")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
this->m_ouReplayMsgType = xmlUtils::bGetDirection((char*)key);
xmlFree(key);
}
}
if ((!xmlStrcmp(pNodePtr->name, (const xmlChar*)"Filter")))
{
xmlChar* key = xmlNodeListGetString(pNodePtr->doc, pNodePtr->xmlChildrenNode, 1);
if(NULL != key)
{
omStrFilters.Add((char*)key);
xmlFree(key);
}
}
pNodePtr = pNodePtr->next;
}
//Filters
if( omStrFilters.GetSize() > 0 && pTempNode != NULL)
{
SFILTERAPPLIED_CAN sFilterApplied;
if( sFilterApplied.nSetXMLConfigData(pTempNode->doc) == S_OK)
{
sFilterApplied.nGetFiltersFromName(m_sFilterApplied, omStrFilters);
/*
int nRealFilters = 0;
for(int i = 0; i < omStrFilters.GetSize(); i++)
{
int nIndex = GetFilterNameIndex((LPCSTR)omStrFilters.GetAt(i), sFilterApplied);
if(nIndex >= 0)
{
nRealFilters++;
}
else
{
omStrFilters.RemoveAt(i);
}
}
m_sFilterApplied.m_bEnabled = sFilterApplied.m_bEnabled;
m_sFilterApplied.m_ushTotal = omStrFilters.GetSize();
m_sFilterApplied.m_psFilters = new SFILTERSET[m_sFilterApplied.m_ushTotal];
for(int i = 0; i < omStrFilters.GetSize(); i++)
{
int nIndex = GetFilterNameIndex((LPCSTR)omStrFilters.GetAt(i), sFilterApplied);
if(nIndex >= 0)
{
m_sFilterApplied.m_psFilters[i].bClone(sFilterApplied.m_psFilters[nIndex]);
}
}*/
}
}
return nRetValue;
}
示例11: switch
BOOL CConfigAdapter::bGetConfigData(BYTE*& lpData, int& nStreamLength, eSECTION_ID eSectionId)
{
BOOL bReturn = TRUE;
switch (eSectionId)
{
case MAINFRAME_SECTION_ID:
{
UINT unSize = 0;
BYTE* pbyConfigData = NULL;
//FIRST CALC SIZE REQUIRED
unSize += sizeof(BYTE); //Configuration version
unSize += (sizeof(char) * MAX_PATH);
unSize += sizeof(STOOLBARINFO);
//ALLOCATE THE MEMORY
pbyConfigData = new BYTE[unSize];
BYTE* pbyTemp = pbyConfigData;
//UPDATE THE DATA
BYTE byVersion = 0x1;
COPY_DATA(pbyTemp, &byVersion, sizeof(BYTE));
CString* pomMRU_C_FILE_NAME = NULL;
m_ouConfigDetails.bGetData(MRU_C_FILE_NAME, (void**)(&pomMRU_C_FILE_NAME));
char acName[MAX_PATH] = {_T('0')};
ASSERT(pomMRU_C_FILE_NAME != NULL);
strcpy_s(acName, pomMRU_C_FILE_NAME->GetBuffer(MAX_PATH));
delete pomMRU_C_FILE_NAME;
COPY_DATA(pbyTemp, acName, (sizeof(char) * MAX_PATH));
PSTOOLBARINFO psToolBarInfo = NULL;
m_ouConfigDetails.bGetData(TOOLBAR_DETAILS, (void**)(&psToolBarInfo));
ASSERT(psToolBarInfo != NULL);
COPY_DATA(pbyTemp, psToolBarInfo, sizeof(STOOLBARINFO));
delete psToolBarInfo;
lpData = pbyConfigData;
nStreamLength = unSize;
}
break;
case LOG_SECTION_ID:
{
UINT unSize = 0;
BYTE* pbyConfigData = NULL;
SLOGCONFIGDETS* psLogConfigDets = NULL;
m_ouConfigDetails.bGetData(LOG_CONFIG_DETS, (void**)(&psLogConfigDets));
//FIRST CALCULATE SIZE REQUIRED
unSize += sizeof(BYTE);//Configuration version
if (psLogConfigDets != NULL)
{
//Filter info size
SFILTERAPPLIED_CAN* psFilterConfigured = NULL;
m_ouConfigDetails.bGetData(FILTER_CONFIG_DETS, (void**)(&psFilterConfigured));
unSize += sizeof (USHORT); // Log file count
for (UINT i = 0; i < psLogConfigDets->m_unCount; i++)
{
//log info size
SLOGINFO sLogInfo;
unSize += sLogInfo.unGetSize();
CModuleFilterArray* pModuleFilterArray =
(&(psLogConfigDets->m_asLogFileDets[i].m_omFilter));
unSize += unGetFilterSize(pModuleFilterArray, psFilterConfigured);
}
//CALCULATING SIZE ENDS
//NOW UPDATE THE VALUES
pbyConfigData = new BYTE[unSize];
BYTE* pbyTemp = pbyConfigData;
BYTE byVersion = 0x1;
COPY_DATA(pbyTemp, &byVersion, sizeof(BYTE));
memcpy(pbyTemp, &(psLogConfigDets->m_unCount), sizeof (USHORT));
pbyTemp += sizeof (USHORT);
for (UINT i = 0; i < psLogConfigDets->m_unCount; i++)
{
//log info
SLOGINFO sLogInfo;
vPopulateLogInfo(sLogInfo, psLogConfigDets->m_asLogFileDets[i]);
pbyTemp = sLogInfo.pbGetConfigData(pbyTemp);
//Filter info size
CModuleFilterArray* pomFilterArray = &(psLogConfigDets->m_asLogFileDets[i].m_omFilter);
pbyTemp = pbyGetFilterConfig(pbyTemp, pomFilterArray, psFilterConfigured);
}
//Now update the parameter out pointer
lpData = pbyConfigData;
nStreamLength = unSize;
}
}
break;
case SIMSYS_SECTION_ID:
{
PSSIMSYSARRAY psSimSysArray;
UINT unSize = 0;
//FIRST CALCULATE THE SIZE REQUIRED MEANWHILE RETRIEVE THE DATA
unSize += sizeof(BYTE);//Configuration version
WINDOWPLACEMENT WndPlacement;
//retrieve the window placement
m_ouConfigDetails.bGetDefaultValue(SIMSYS_WND_PLACEMENT,WndPlacement);
unSize += sizeof(WINDOWPLACEMENT);
//.........这里部分代码省略.........