当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseEntityTA类代码示例

本文整理汇总了C++中CBaseEntityTA的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntityTA类的具体用法?C++ CBaseEntityTA怎么用?C++ CBaseEntityTA使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CBaseEntityTA类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Input

/******************************************************************************
Function Name  :  RepositionSubEntity
Input(s)       :  CBaseEntityTA* pouRefSubEntity
                  CBaseEntityTA* pouCurrSubEntity
Output         :  HRESULT - returns the New Entity ID
Functionality  :  Reposition pouRefSubEntity after pouCurrSubEntity
Member of      :  CTestCaseEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :  
Codetag        :  CS021
******************************************************************************/
HRESULT CTestCaseEntity::RepositionSubEntity(CBaseEntityTA* pouRefSubEntity, CBaseEntityTA* pouCurrSubEntity)
{
    //DESIGN:: First Take copy of Data and delete it from current position and add at required place 
    UINT unCount = (UINT)m_ouData.m_odTAEntityList.GetCount();
    for(UINT i=0; i<unCount; i++)
    {
        POSITION pos = m_ouData.m_odTAEntityList.FindIndex(i);
        CBaseEntityTA* pEntity = m_ouData.m_odTAEntityList.GetAt(pos);
        if(pEntity->GetID() == pouRefSubEntity->GetID())
        {
            m_ouData.m_odTAEntityList.RemoveAt(pos);
            break;
        }
    }
    if(pouCurrSubEntity == NULL)        //Insert At First Index;
    {
        m_ouData.m_odTAEntityList.AddHead(pouRefSubEntity);
    }
    
    else
    {
        for(UINT i=0; i<unCount; i++)
        {
            POSITION pos = m_ouData.m_odTAEntityList.FindIndex(i);
            CBaseEntityTA* pEntity = m_ouData.m_odTAEntityList.GetAt(pos);
            if(pEntity->GetID() == pouCurrSubEntity->GetID())
            {
                m_ouData.m_odTAEntityList.InsertAfter(pos, pouRefSubEntity);
                break;
            }
        }
    }
    return pouRefSubEntity->GetID();
}
开发者ID:Conti-Meissner,项目名称:busmaster,代码行数:47,代码来源:TestCaseEntity.cpp

示例2: Input

/******************************************************************************
Function Name  :  EnableTestCase
Input(s)       :  DWORD dwID, UINT unIndex, BOOL bEnable
Output         :  HRESULT
Functionality  :  Enables or disable the Testcase with index unIndex in
                  test setup with id dwID
Member of      :  CTSExecutorLIB
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  07/04/2011
Modifications  :
Code Tag       :
******************************************************************************/
HRESULT CTSExecutorLIB::EnableTestCase( DWORD dwID, UINT unIndex, BOOL bEnable)
{
    BOOL bValidID = FALSE;
    HRESULT hResult = ERR_WRONG_ID;
    INT nCount = (INT)m_ouTestSetupEntityList.GetCount();
    CBaseEntityTA* pTCInfo;
    for(int i = 0; i < nCount; i++)
    {
        POSITION pos = m_ouTestSetupEntityList.FindIndex(i);
        CTestSetupEntity& ouTempTestSetup = m_ouTestSetupEntityList.GetAt(pos);
        if(ouTempTestSetup.GetID() == dwID)
        {
            hResult = S_OK;
            if(ouTempTestSetup.GetSubEntityObj(unIndex, &pTCInfo) == S_OK)
            {
                pTCInfo->vEnableEntity(bEnable);
                break;
            }
            else
            {
                hResult = ERR_WRONG_INDEX;
                break;
            }
        }
    }
    return hResult;
}
开发者ID:bagge,项目名称:busmaster,代码行数:40,代码来源:TSExecutorLIB.cpp

示例3: Input

/******************************************************************************
Function Name  :  ValidateEntity
Input(s)       :  
Output         :  HRESULT
Functionality  :   
Member of      :  CTestSetupEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  13/04/2011
Modifications  :  
Code Tag       :  CS026
******************************************************************************/
HRESULT CTestSetupEntity::ValidateEntity(CString& omStrResult)
{
    UINT unCount;
    GetSubEntryCount(unCount);
    CString omStrHeaderResult;
    HRESULT hResult = ERR_VALID_SUCCESS;

    if(m_ouTestSetupHeader.ValidateEntity(omStrHeaderResult) == ERR_VALID_ERROR)
    {
        omStrResult += omStrHeaderResult;
        hResult = ERR_VALID_ERROR;
    }

    if(unCount <=0 )
    {
        omStrResult += _T("No TestCases Are Defined\r\n");
        hResult = ERR_VALID_ERROR;
    }
    else
    {
        for(UINT i=0; i<unCount; i++)
        {
            CString omStrTcResult;
            CBaseEntityTA* pTcEntity;
            GetSubEntityObj(i, &pTcEntity);
            if(pTcEntity->ValidateEntity(omStrTcResult) == ERR_VALID_ERROR) 
            {
                hResult = ERR_VALID_ERROR;
            }
            omStrResult += omStrTcResult;
        }
    }
    return hResult;
}
开发者ID:Conti-Meissner,项目名称:busmaster,代码行数:46,代码来源:TestSetupEntity.cpp

示例4: Input

/******************************************************************************
Function Name  :  bParseTestSetup
Input(s)       :  INT nIndex
Output         :  BOOL
Functionality  :  Loads The
Member of      :  CTSExecutorChildFrame
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  07/04/2011
Modifications  :
Code Tag       :
******************************************************************************/
BOOL CTSExecutorChildFrame::bParseTestSetup(INT nIndex)
{
    BOOL bResult = FALSE;
    STestSetupInfo sTSInfo;

    if( m_ouTSExecutor.GetTestSetupInfo(nIndex, sTSInfo) == S_OK)
    {
        HTREEITEM hTSItem = m_odTreeView->InsertTreeItem(m_hParentTreeItem, sTSInfo.m_omstrName, NULL, def_INDEX_TESTSETUPIMAGE,
                            def_INDEX_TESTSETUPIMAGE, sTSInfo.m_dwID);
        m_odTreeView->GetTreeCtrl().SetCheck(hTSItem, sTSInfo.m_bEnable);

        for(INT i = 0; i < sTSInfo.m_nTCCount; i++)
        {
            CBaseEntityTA* pouTCData;
            CTestCaseData ouTCData;

            if(m_ouTSExecutor.GetTestCaseInfo(sTSInfo.m_dwID, i, &pouTCData) == S_OK)
            {
                pouTCData->GetEntityData(TEST_CASE, &ouTCData);
                HTREEITEM hTCItem =  m_odTreeView->InsertTreeItem(hTSItem, ouTCData.m_omTitle, NULL, def_INDEX_TESTCASEIMAGE,
                                     def_INDEX_TESTCASEIMAGE, pouTCData->GetID());
                m_odTreeView->GetTreeCtrl().SetCheck(hTCItem, pouTCData->bGetEnableStatus());
            }
        }

        bResult = TRUE;
    }

    return bResult;
}
开发者ID:Ferrere,项目名称:busmaster,代码行数:42,代码来源:TSExecutorGUI_ChildFrame.cpp

示例5: vDeleteAllSubMessages

void CTestSetupEntity::vDeleteAllSubMessages()
{
    INT lCount = (INT)m_odTestCaseEntityList.GetCount();
    for(int i=0; i<lCount; i++)
    {
        POSITION pos = m_odTestCaseEntityList.FindIndex(i);
        CTestCaseEntity& odTestCaseEntity = m_odTestCaseEntityList.GetAt(pos);

        UINT nSubCount = 0;
        odTestCaseEntity.GetSubEntryCount(nSubCount);

        for( int j = 0; j < nSubCount; j++ )
        {
            CBaseEntityTA* pEntity;
            odTestCaseEntity.GetSubEntityObj(j, &pEntity);
            if( nullptr != pEntity )
            {
                UINT nSubChildCount = 0;
                pEntity->GetSubEntryCount(nSubChildCount);
                for ( int k = 0; k < nSubChildCount; k++ )
                {
                    pEntity->DeleteSubEntry(0);
                }
            }
        }
    }
}
开发者ID:GT-Derka,项目名称:busmaster,代码行数:27,代码来源:TestSetupEntity.cpp

示例6: Input

/******************************************************************************
Function Name  :  TSX_VerifyMessage
Input(s)       :
Output         :  HRESULT
Functionality  :
Member of      :  CTSExecutionCAN
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  01/04/2011
Modifications  :
******************************************************************************/
HRESULT CTSExecutionCAN::TSX_VerifyMessage(CBaseEntityTA* pEntity, CResultVerify& ouVerifyResult)
{
    //TODO::Proper Handling Required
    UCHAR* pucData;
    STCANDATA sCanData;
    UINT unVerifyCount;
    HRESULT hResult = S_OK;
    CBaseEntityTA* pVerifyEntity;
    CVerify_MessageData ouVerifyData;
    CString omResult;
    sMESSAGE sMsg;
    CSignalInfoArray ouSignalInfo;
    pEntity->GetSubEntryCount(unVerifyCount);
    ouVerifyResult.m_MessageResultList.RemoveAll();

    //Loop For all Messages
    for(UINT j=0; j<unVerifyCount; j++)
    {
        pEntity->GetSubEntityObj(j, &pVerifyEntity);
        pVerifyEntity->GetEntityData(VERIFY_MESSAGE, &ouVerifyData);

        if(m_ouCanBufVFSE.ReadFromBuffer(&sCanData, (__int64)ouVerifyData.m_dwMessageID)==0)
        {
            pucData = new UCHAR[sCanData.m_uDataInfo.m_sCANMsg.m_ucDataLen];
            memcpy(pucData, &sCanData.m_uDataInfo.m_sCANMsg.m_ucData, sCanData.m_uDataInfo.m_sCANMsg.m_ucDataLen);
        }
        else
        {
            pucData = new UCHAR[8];
            memset(pucData, 0, 8);
        }

        //Interprete The Messages
        SMSGENTRY* sMsgEntry = new SMSGENTRY;
        pEntity->m_ouDataBaseManager.nGetMessageInfo(ouVerifyData.m_omMessageName, sMsg);
        sMsgEntry->m_psMsg = &sMsg;
        sMsgEntry->m_psNext = NULL;
        m_ouMsgInterpret.vSetMessageList(sMsgEntry);
        m_ouMsgInterpret.bInterpretMsgs(ouVerifyData.m_dwMessageID, pucData, ouSignalInfo);
        CString strVerDisplay = "Verifying Message "+ouVerifyData.m_omMessageName;
        TSX_DisplayMessage(strVerDisplay);
        //Verify The Signals
        CMessageResult ouMsgResult;
        omResult = "SUCCESS";

        if( bVerifyCanMessage(ouVerifyData, ouSignalInfo, ouMsgResult) == FALSE)
        {
            omResult = "FAIL";
            hResult = S_FALSE;
        }

        ouVerifyResult.m_MessageResultList.AddTail(ouMsgResult);
        TSX_DisplayResult(omResult);
        delete []pucData;
    }

    return hResult;
}
开发者ID:vschander,项目名称:busmaster,代码行数:69,代码来源:TSExecutionCAN.cpp

示例7: Input

/******************************************************************************
Function Name  :  bExecuteTestSetup
Input(s)       :  CTestSetupEntity& ouTestSetupEntity
Output         :  BOOL
Functionality  :  Executes the TestSetup
Member of      :  CTSExecutorLIB
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  07/04/2011
Modifications  :
Code Tag       :
******************************************************************************/
BOOL CTSExecutorLIB::bExecuteTestSetup(CTestSetupEntity& ouTestSetupEntity)
{
    CBaseEntityTA* pouTestCase;
    UINT unTCCount;
    //Initialise Result Information
    ouTestSetupEntity.GetSubEntryCount(unTCCount);
    ouTestSetupEntity.GetHeaderData(m_ouResult.m_ouHeaderInfo);

    ouTestSetupEntity.m_ouDataBaseManager.bFillDataStructureFromDatabaseFile(m_ouResult.m_ouHeaderInfo.m_omDatabasePath);

	//pfand: Insert hardcoded testcase here
    
	m_ouResult.m_omStrTestSetupFile = ouTestSetupEntity.m_omstrTestSetupTitle;
    m_ouResult.m_odTcResultList.RemoveAll();
    for(UINT nTCIndex=0; nTCIndex<unTCCount; ++nTCIndex)
    {

        ouTestSetupEntity.GetSubEntityObj(nTCIndex, &pouTestCase);
        if(pouTestCase->bGetEnableStatus() == TRUE)
        {
            //Start Result Update
            CTestCaseData ouTestCaseData;
            pouTestCase->GetEntityData(TEST_CASE, &ouTestCaseData);

            CResultTc ouTestCaseResult;
            ouTestCaseResult.m_omTestCase = ouTestCaseData.m_omTitle;
            ouTestCaseResult.m_omTestDescripter = "";
            GetLocalTime(&ouTestCaseResult.m_sStartTime);
            //Now Execute;
            ouTestCaseResult.m_eResult = SUCCESS;
            BOOL bResult = bExecuteTestCase(pouTestCase, ouTestCaseResult);
            if(bResult == FALSE)
            {
                //TODO:: ProperHandling Required
                ouTestCaseResult.m_eResult = ERRORS;
            }
            GetLocalTime(&ouTestCaseResult.m_sEndTime);
            m_ouResult.m_odTcResultList.AddTail(ouTestCaseResult);
        }
    }
    m_ouResult.GenerateReport();
    return TRUE;
}
开发者ID:GT-Pfand,项目名称:busmaster,代码行数:55,代码来源:TSExecutorLIB.cpp

示例8: Input

/******************************************************************************
Function Name  :  TSX_SendMessage
Input(s)       :
Output         :  HRESULT
Functionality  :
Member of      :  CTSExecutionCAN
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  01/04/2011
Modifications  :
******************************************************************************/
HRESULT CTSExecutionCAN::TSX_SendMessage(CBaseEntityTA* pEntity)
{
    UCHAR aucData[8];
    CBaseEntityTA* pSendEntity;
    UINT unSendCount;
    pEntity->GetSubEntryCount(unSendCount);
    for(UINT j=0; j<unSendCount; j++)
    {

        STCAN_MSG stCanData;
        CSend_MessageData ouSendData;
        pEntity->GetSubEntityObj(j, &pSendEntity);
        pSendEntity->GetEntityData(SEND_MESSAGE, &ouSendData);
        sMESSAGE* pMsg = pEntity->m_ouDataBaseManager.unGetMsg(ouSendData.m_dwMessageID);
        bMakeCanMessage(pMsg, ouSendData, aucData, stCanData);
        CString strSendDisplay = _("Sending Message ")+ouSendData.m_omMessageName;
        TSX_DisplayMessage(strSendDisplay);
        m_pouDIL_CAN->DILC_SendMsg(m_dwClientId, stCanData);
    }
    return S_OK;
}
开发者ID:GT-Derka,项目名称:busmaster,代码行数:32,代码来源:TSExecutionCAN.cpp

示例9: Input

/******************************************************************************
Function Name  :  SearchEntityObject
Input(s)       :  DWORD dwId - ID of the Entity
                  CBaseEntityTA** pEnityObject - entity object
Output         :  HRESULT - S_OK if the ID is Found
Functionality  :  Retrives the entity of the Given ID.
Member of      :  CBaseEntityTA
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :
******************************************************************************/
HRESULT CBaseEntityTA::SearchEntityObject(DWORD dwId, CBaseEntityTA** pEnityObject)
{
    *pEnityObject = NULL;

    if( GetID() == dwId)
    {
        *pEnityObject = this;
    }
    else
    {
        UINT unSubEntities = 0;
        GetSubEntryCount(unSubEntities);
        for( UINT i = 0; (i < unSubEntities)&&(*pEnityObject == NULL); i++)
        {
            CBaseEntityTA* pouSubEntityObj = NULL;
            GetSubEntityObj(i, &pouSubEntityObj);
            pouSubEntityObj->SearchEntityObject(dwId, pEnityObject);
        }
    }
    return S_OK;
}
开发者ID:Mariale13,项目名称:UDS_Protocol,代码行数:33,代码来源:BaseEntityTA.cpp

示例10: xmlXPathFreeObject

HRESULT CTSExecutorLIB::SetConfigurationData(xmlNodePtr pXmlNode)
{
    xmlXPathObjectPtr pObjectPtr = NULL;
    xmlNodePtr pTempNode;
    //Test Suite Name
    m_omstrTestSuiteName = def_STR_TESTSUITENAME;

    pObjectPtr = xmlUtils::pGetChildNodes(pXmlNode, (xmlChar*)"Test_Suite_Name");
    if( NULL != pObjectPtr)
    {
        pTempNode = pObjectPtr->nodesetval->nodeTab[0];
        m_omstrTestSuiteName = (char*)xmlNodeListGetString(pTempNode->doc, pTempNode->children, 1);

        xmlXPathFreeObject(pObjectPtr);
        pObjectPtr = NULL;
    }
    //Test Suite Enable
    pObjectPtr = xmlUtils::pGetChildNodes(pXmlNode, (xmlChar*)"IsEnable");
    m_bTestSuiteStatus = TRUE;
    if( NULL != pObjectPtr)
    {
        pTempNode = pObjectPtr->nodesetval->nodeTab[0];
        char* pchKey = (char*)xmlNodeListGetString(pTempNode->doc, pTempNode->children, 1);
        if(pchKey != NULL)
        {
            m_bTestSuiteStatus = xmlUtils::bGetBooleanValue(pchKey);
            xmlFree(pchKey);
        }
        xmlXPathFreeObject(pObjectPtr);
        pObjectPtr = NULL;
    }

    //Test Suite FileCount
    int nFileCount = 0;
    pObjectPtr = xmlUtils::pGetChildNodes(pXmlNode, (xmlChar*)"TEST_SUITE");

    if( NULL != pObjectPtr)
    {
        nFileCount = pObjectPtr->nodesetval->nodeNr;
        INT nFileIndex = 0;
        for( int i = 0; i < nFileCount; i++ )
        {
            sTestSuiteConfigInfo sConfigInfo;
            if ( S_OK == nParseTestSuite(pObjectPtr->nodesetval->nodeTab[i], sConfigInfo) )
            {
                DWORD dwID;
                UINT unCount;
                if(AddTestSetup(sConfigInfo.m_strFileName.c_str(), dwID) == S_OK)
                {
                    //Selection Status
                    BOOL bStatus;
                    POSITION pos = m_ouTestSetupEntityList.FindIndex(nFileIndex++);
                    if(pos != NULL)
                    {
                        CTestSetupEntity& ouTestSetupEntity = m_ouTestSetupEntityList.GetAt(pos);
                        ouTestSetupEntity.vEnableEntity(sConfigInfo.m_bEnable);

                        //TestCase Count
                        ouTestSetupEntity.GetSubEntryCount(unCount);

                        for(UINT j=0; j<unCount; j++)
                        {
                            CBaseEntityTA* pTCEntity;
                            ouTestSetupEntity.GetSubEntityObj(j, &pTCEntity);
                            if(pTCEntity != NULL)
                            {
                                pTCEntity->vEnableEntity(FALSE);
                            }
                        }

                        //TestCase Selection Status

                        list<int>::iterator listIterator = sConfigInfo.m_nListSelctedCases.begin();

                        for(listIterator = sConfigInfo.m_nListSelctedCases.begin();
                                listIterator != sConfigInfo.m_nListSelctedCases.end(); listIterator++)
                        {
                            //MVN::Crash Issue
                            CBaseEntityTA* pTCEntity = NULL;
                            int nIndex = *listIterator;
                            HRESULT hValue = ouTestSetupEntity.GetSubEntityObj(nIndex, &pTCEntity);
                            if(pTCEntity != NULL && hValue == S_OK)
                            {
                                pTCEntity->vEnableEntity(TRUE);
                            }
                            //~MVN::Crash Issue
                        }
                    }
                }
            }
        }
    }
    return S_OK;
}
开发者ID:bagge,项目名称:busmaster,代码行数:94,代码来源:TSExecutorLIB.cpp

示例11: xmlNewChild

HRESULT CTSExecutorLIB::GetConfigurationData(xmlNodePtr pxmlNodePtr)
{
    const char* omcVarChar ;

    //<Test_Suite_Name />

    omcVarChar = m_omstrTestSuiteName.GetBuffer(MAX_PATH);

    xmlNodePtr pTSName = xmlNewChild(pxmlNodePtr, NULL, BAD_CAST DEF_TS_NAME, BAD_CAST omcVarChar);
    xmlAddChild(pxmlNodePtr, pTSName);

    // <IsEnable />
    CString csIsEnabled;
    csIsEnabled.Format("%d", m_bTestSuiteStatus);
    omcVarChar = csIsEnabled;
    xmlNodePtr pIsEnabled = xmlNewChild(pxmlNodePtr, NULL, BAD_CAST DEF_IS_ENABLE, BAD_CAST omcVarChar);
    xmlAddChild(pxmlNodePtr, pIsEnabled);

    INT nFileCount = (INT)m_ouTestSetupEntityList.GetCount();

    for(int iCnt = 0; iCnt < nFileCount; iCnt++)
    {
        //<TEST_SUITE>
        xmlNodePtr pTestSuite = xmlNewNode(NULL, BAD_CAST DEF_TEST_SUITE);
        xmlAddChild(pxmlNodePtr, pTestSuite);

        //<Test_Suite_Name />
        POSITION pos = m_ouTestSetupEntityList.FindIndex(iCnt);
        CTestSetupEntity& ouTestSetupEntity = m_ouTestSetupEntityList.GetAt(pos);

        string omPath, omStrConfigFolder;
        char configPath[MAX_PATH];
        AfxGetMainWnd()->SendMessage(MSG_GET_CONFIGPATH, (WPARAM)configPath, 0);
        CUtilFunctions::nGetBaseFolder(configPath, omStrConfigFolder );
        CUtilFunctions::MakeRelativePath(omStrConfigFolder.c_str(), (char*)ouTestSetupEntity.m_omstrCurrentTSFile.GetBuffer(MAX_PATH), omPath);
        omcVarChar = omPath.c_str();

        xmlNodePtr pFilePath = xmlNewChild(pTestSuite, NULL, BAD_CAST DEF_FILE_PATH, BAD_CAST omcVarChar);
        xmlAddChild(pTestSuite, pFilePath);

        //<IsEnable />
        CString csIsEnabled;
        csIsEnabled.Format("%d", ouTestSetupEntity.bGetEnableStatus());
        omcVarChar = csIsEnabled;
        xmlNodePtr pIsEnabled = xmlNewChild(pTestSuite, NULL, BAD_CAST DEF_IS_ENABLE, BAD_CAST omcVarChar);
        xmlAddChild(pTestSuite, pIsEnabled);

        //<Testcases_Selected>
        xmlNodePtr pTestCasesSel = xmlNewNode(NULL, BAD_CAST DEF_TEST_CASES_SEL);
        xmlAddChild(pTestSuite, pTestCasesSel);

        // <Index>1</Index>
        CString csIndex;
        bool    bStatus;
        UINT    unCount;
        ouTestSetupEntity.GetSubEntryCount(unCount);
        for(UINT j=0; j<unCount; j++)
        {
            CBaseEntityTA* pTCEntity;
            ouTestSetupEntity.GetSubEntityObj(j, &pTCEntity);
            bStatus = FALSE;
            if(pTCEntity != NULL)
            {
                bStatus = pTCEntity->bGetEnableStatus();
            }
            if( bStatus == true )
            {
                csIndex.Format("%d", j);
                omcVarChar = csIndex;
                xmlNodePtr pIndex = xmlNewChild(pTestCasesSel, NULL, BAD_CAST DEF_INDEX, BAD_CAST omcVarChar);
                xmlAddChild(pTestCasesSel, pIndex);
            }
        }
    }
    return true;
}
开发者ID:bagge,项目名称:busmaster,代码行数:76,代码来源:TSExecutorLIB.cpp

示例12: Input

/******************************************************************************
Function Name  :  TSX_VerifyMessage
Input(s)       :
Output         :  HRESULT
Functionality  :
Member of      :  CTSExecutionCAN
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  01/04/2011
Modifications  :
******************************************************************************/
HRESULT CTSExecutionCAN::TSX_VerifyMessage(CBaseEntityTA* pEntity, CResultVerify& ouVerifyResult)
{
    //TODO::Proper Handling Required
    UCHAR pucData[8];
    INT dataSize = 8;
    STCANDATA sCanData;
    UINT unVerifyCount;
    HRESULT hResult = S_OK;
    CBaseEntityTA* pVerifyEntity;
    CVerify_MessageData ouVerifyData;
    CString omResult;
    IFrame* sMsg;
    CVerifyData ouVerify;


    pEntity->GetSubEntryCount(unVerifyCount);
    ouVerifyResult.m_MessageResultList.RemoveAll();

    pEntity->GetEntityData(VERIFY, &ouVerify);
    ouVerifyResult.m_eResult = ouVerify.m_eAttributeError;
    //Loop For all Messages
    for(UINT j=0; j<unVerifyCount; j++)
    {
        pEntity->GetSubEntityObj(j, &pVerifyEntity);
        pVerifyEntity->GetEntityData(VERIFY_MESSAGE, &ouVerifyData);

        if(m_ouCanBufVFSE.ReadFromBuffer(&sCanData, (__int64)ouVerifyData.m_dwMessageID)==0)
        {
            dataSize = sCanData.m_uDataInfo.m_sCANMsg.m_ucDataLen;
            memcpy(pucData, &sCanData.m_uDataInfo.m_sCANMsg.m_ucData, sCanData.m_uDataInfo.m_sCANMsg.m_ucDataLen);
        }
        else
        {
            dataSize = 8;
            memset(pucData, 0, 8);
        }

        //Interprete The Messages
        SMSGENTRY* sMsgEntry = new SMSGENTRY;
        pEntity->m_ouDataBaseManager.nGetMessageInfo(ouVerifyData.m_omMessageName, &sMsg);
        if ( nullptr == sMsg )
        {
            return S_FALSE;
        }

        std::list<InterpreteSignals> interPretedSignalList;
        sMsg->InterpretSignals( pucData, dataSize, interPretedSignalList, false );
        CString strVerDisplay = _("Verifying Message ")+ouVerifyData.m_omMessageName;
        TSX_DisplayMessage(strVerDisplay);
        //Verify The Signals
        CMessageResult ouMsgResult;
        omResult = _("SUCCESS");
        if( ouVerifyData.m_byChannelNumber == sCanData.m_uDataInfo.m_sCANMsg.m_ucChannel )    // solves issue #711, 4th bullet point
        {
            if ( bVerifyCanMessage( ouVerifyData, interPretedSignalList, ouMsgResult ) == FALSE )
            {

                omResult = _("FAIL");
                hResult = S_FALSE;
            }
        }
        else
        {
            omResult = _("FAIL");
            hResult = S_FALSE;
        }
        ouVerifyResult.m_MessageResultList.AddTail(ouMsgResult);
        TSX_DisplayResult(omResult);
        //delete []pucData;
    }
    if( S_FALSE != hResult )
    {
        ouVerifyResult.m_eResult = SUCCESS;
    }
    return hResult;
}
开发者ID:IXXAT-wucherer,项目名称:busmaster,代码行数:87,代码来源:TSExecutionCAN.cpp


注:本文中的CBaseEntityTA类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。