MTConnectDataModel MTConnectDeviceParser::ReadDeviceDescription(std::string filename)
{
	MTConnectDataModel dataItems;
	dataItems.clear();
	if(GetFileAttributesA(filename.c_str())== INVALID_FILE_ATTRIBUTES)
	{
		filename= ::ExeDirectory() + filename;
	}
	if(GetFileAttributesA(filename.c_str())== INVALID_FILE_ATTRIBUTES)
		throw std::exception("MTConnectDeviceParser::ReadDeviceDescription invalid devices file");

	_devicesfilename = filename;

	try{
		ParseXMLDocument(_devicesfilename.c_str());

		MSXML2::IXMLDOMNodePtr root = m_pXMLDoc->GetdocumentElement();
		MSXML2::IXMLDOMNodeListPtr nodes = root->selectNodes(_bstr_t("//DataItem"));
		for(int i=0; i< nodes->length; i++)
		{
			MSXML2::IXMLDOMNodePtr pNode = NULL;	
			CDataItem dataItem;
			nodes->get_item(i, &pNode);

			dataItem.name = (LPCSTR)  GetAttribute(pNode, "name");
			dataItem.category = (LPCSTR) GetAttribute(pNode, "category");
			dataItem.id = (LPCSTR) GetAttribute(pNode, "id");
			dataItem.type = (LPCSTR) GetAttribute(pNode, "type");
			dataItem.subType = (LPCSTR) GetAttribute(pNode, "subType");
			dataItem.units = (LPCSTR) GetAttribute(pNode, "units");
			dataItem.nativeUnits = (LPCSTR) GetAttribute(pNode, "nativeUnits");
			if(dataItem.type == "ASSET_CHANGED")
			{
				dataItem.category = "ASSET_CHANGED";
			}

			dataItem.category=MakeLower(dataItem.category);
			
			if(!dataItem.name.empty())
			{
				dataItems[dataItem.name]=dataItem;
			}
			// Could get name or id via SHDR
			else if(!dataItem.id.empty())
			{
				dataItems[dataItem.id]=dataItem;
			}
			else
			{
				continue;
			}
		}
	}
	catch(_com_error error)
	{
		std::cout << "MTConnectDeviceParser::ReadDeviceDescription" << error.ErrorMessage();
	}
	return dataItems;

}
Exemple #2
0
	void readVerticesNormalsTexcoords(MSXML2::IXMLDOMNodePtr mesh, geometry_t &geometry)
	{
		MSXML2::IXMLDOMNodeListPtr sourceList = mesh->selectNodes("r:source");
		vector<float> vertices;
		vector<float> normals;
		vector<float> texcoords;

		for (int i = 0; i < sourceList->length; i++)
		{
			MSXML2::IXMLDOMNodePtr source = sourceList->Getitem(i);
			MSXML2::IXMLDOMNamedNodeMapPtr attributes = source->attributes;

			for (int j = 0; j < attributes->length; j++)
			{
				_bstr_t attributeName = attributes->getNamedItem("id")->text;

				if (wcsstr(_wcslwr(attributeName), L"position"))
				{
					geometry.vertices = readArray<float>(source);
				} else if (wcsstr(_wcslwr(attributeName), L"normal"))
				{
					geometry.normals = readArray<float>(source);
				} else if (wcsstr(_wcslwr(attributeName), L"map") ||	// belnder
						   wcsstr(_wcslwr(attributeName), L"-uv"))		// 3dsmax
				{
					geometry.texcoords = readArray<float>(source);
				}
			}
		}
	}
/******************************************************************************
Function Name  :  nLoadTestCases
Input(s)       :  MSXML2::IXMLDOMNodePtr& pTSDOM
Output         :  INT
Functionality  :
Member of      :  CTestSetupEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam, GT-Derka
Date Created   :  06/04/2011
Modifications  :
Codetag        :  CS004
******************************************************************************/
INT CTestSetupEntity::nLoadTestCases(MSXML2::IXMLDOMNodePtr& pTSDOM)
{
    LONG lDefaultChannelUsed = 0;
    LONG lCount;
    _bstr_t bstrNodeName(def_STR_TESTCASE_NODE);

    MSXML2::IXMLDOMNodeListPtr pDOMTCNodeList;
    MSXML2::IXMLDOMNodePtr pIXMLDOMTestCase;
    pDOMTCNodeList = pTSDOM->selectNodes(bstrNodeName);
    pDOMTCNodeList->get_length(&lCount);
    for(int i=0; i<lCount; i++)
    {
        CTestCaseEntity odTestCaseEntity;

        pIXMLDOMTestCase = pDOMTCNodeList->Getitem(i);
        odTestCaseEntity.GetData(pIXMLDOMTestCase);
        m_odTestCaseEntityList.AddTail(odTestCaseEntity);
        lDefaultChannelUsed += odTestCaseEntity.m_lDefaultChannelUsed;
    }
    if(lDefaultChannelUsed == 1)
    {
        AfxMessageBox(_("1 entity without channel-information loaded.\nCAN-Channel 1 selected."), MB_OK | MB_ICONINFORMATION );
    }
    else if(lDefaultChannelUsed > 1)
    {
        CString str;
        str.Format("%d", lDefaultChannelUsed);
        AfxMessageBox(str + _(" entities without channel-information loaded.\nCAN-Channel 1 selected in each case."), MB_OK | MB_ICONINFORMATION );
    }
    return S_OK;

}
Exemple #4
0
/******************************************************************************
Function Name  :  GetData
Input(s)       :
Output         :  HRESULT
Functionality  :
Member of      :  CVerifyEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :
******************************************************************************/
HRESULT CVerifyEntity::GetCommonVerifyData(MSXML2::IXMLDOMNodePtr& pIDomNode, CVerifyData *verifyData)
{
	m_ouData = verifyData;
    _bstr_t bstrNodeName = def_STR_VERIFYMSG_NODE;
    CComVariant NodeValue;
    MSXML2::IXMLDOMNamedNodeMapPtr pDOMVerifyAtrributes;
    MSXML2::IXMLDOMNodePtr pIDOMChildNode;

    pDOMVerifyAtrributes = pIDomNode->Getattributes();
    //bstrNodeName = L"failure";
    bstrNodeName.Assign(SysAllocString(CT2W("failure")));
    pIDOMChildNode = pDOMVerifyAtrributes->getNamedItem(bstrNodeName);
    pIDOMChildNode->get_nodeTypedValue(&NodeValue);
    CString strTemp;
    strTemp = strCopyBSTRToCString(NodeValue);

	//m_ouData = new CVerifyData();
    if(strTemp == "SUCCESS")
    {
        m_ouData->m_eAttributeError = SUCCESS;
    }
    else if(strTemp == "WARNING")
    {
        m_ouData->m_eAttributeError = WARNING;
    }
    else if(strTemp == "ERRORS")
    {
        m_ouData->m_eAttributeError = ERRORS;
    }
    else
    {
        m_ouData->m_eAttributeError = FATAL;
    }
    MSXML2::IXMLDOMNodeListPtr pIDOMSendList;

    LONG lCount;
    //bstrNodeName = def_STR_VERIFYMSG_NODE;
    bstrNodeName.Assign(SysAllocString(CT2W(def_STR_VERIFYMSG_NODE)));
    pIDOMSendList = pIDomNode->selectNodes(bstrNodeName);
    pIDOMSendList->get_length(&lCount);

    for(int i = 0; i < lCount; i++)
    {
        CVerifySubEntity *odVerifySubEntity;
        MSXML2::IXMLDOMNodePtr pIXMLDOMVerifyMsgEntity;
        pIXMLDOMVerifyMsgEntity = pIDOMSendList->Getitem(i);
		//if(CVerifySubEntity::GetData(&odVerifySubEntity, pIXMLDOMVerifyMsgEntity) == S_OK)
		if(this->GetSubEntityData(&odVerifySubEntity, pIXMLDOMVerifyMsgEntity) == S_OK)
        {
            m_ouData->m_odVerifySubEntityList.push_back(odVerifySubEntity);
        }
    }
    return S_OK;
}
Exemple #5
0
	void readTriangles(MSXML2::IXMLDOMNodePtr mesh, geometry_t &geometry)
	{
		MSXML2::IXMLDOMNodeListPtr polyLists = mesh->selectNodes("r:polylist"); // blender
		MSXML2::IXMLDOMNodePtr p;

		if (polyLists->length == 0)
			polyLists = mesh->selectNodes("r:triangles"); // 3dsmax

		for (int i = 0; i < polyLists->length; i++)
		{
			MSXML2::IXMLDOMNodePtr polylist = polyLists->item[i];
			MSXML2::IXMLDOMNodePtr p = polylist->selectSingleNode("r:p");
			if (p == NULL) continue;

			geometry.vertexOffset.push_back(-1);
			geometry.normalOffset.push_back(-1);
			geometry.texcoordOffset.push_back(-1);

			MSXML2::IXMLDOMNodeListPtr inputList = polylist->selectNodes("r:input");
			for (int j = 0; j < inputList->length; j++)
			{
				MSXML2::IXMLDOMNodePtr input = inputList->Getitem(j);
				MSXML2::IXMLDOMNamedNodeMapPtr attributes = input->attributes;

				string semantic = (_bstr_t)_wcslwr((wchar_t *)attributes->getNamedItem("semantic")->text);
				int offset = _wtoi(attributes->getNamedItem("offset")->text);

				if (semantic == "vertex")
					geometry.vertexOffset[geometry.vertexOffset.size() - 1] = offset;
				else if (semantic == "normal")
					geometry.normalOffset[geometry.normalOffset.size() - 1] = offset;
				else if (semantic == "texcoord")
					geometry.texcoordOffset[geometry.texcoordOffset.size() - 1] = offset;
			}

			vector<int> v = readValues<int>(p);
			geometry.triangles.push_back(v);
		}
	}
bstr_t CCMSDIntegrator::GetProperty(MSXML2::IXMLDOMNodePtr pNode,bstr_t PropName, bstr_t defaultVal, bstr_t NodeType)
{
	MSXML2::IXMLDOMNodeListPtr properties = pNode->selectNodes(NodeType);
	for(int j=0; j< properties->length; j++)
	{
		MSXML2::IXMLDOMNodePtr pProp = NULL;					
		properties->get_item(j, &pProp);
		MSXML2::IXMLDOMNodePtr pName = pProp->selectSingleNode(bstr_t(".//Name"));
		MSXML2::IXMLDOMNodePtr pValue = pProp->selectSingleNode(bstr_t(".//Value"));
		bstr_t propName =  (pName!=NULL) ? pName->Gettext() : L"None";
		if( propName == PropName)
		{
			return (pValue!=NULL) ? pValue->Gettext() : defaultVal;
		}
	}
	return defaultVal;
}
MappedValues CCMSDIntegrator::GetNameValueProperties(MSXML2::IXMLDOMNodePtr pNode, bstr_t NodeType)
{
	MappedValues namedvalues;
	MSXML2::IXMLDOMNodeListPtr properties= pNode->selectNodes(NodeType);
	for(int j=0; j< properties->length; j++)
	{
		MSXML2::IXMLDOMNodePtr pProp = NULL;					
		properties->get_item(j, &pProp);
		MSXML2::IXMLDOMNodePtr pName = pProp->selectSingleNode(bstr_t(".//Name"));
		MSXML2::IXMLDOMNodePtr pValue = pProp->selectSingleNode(bstr_t(".//Value"));
		bstr_t propName =  (pName!=NULL) ? pName->Gettext() : L"None";
		bstr_t propValue = (pValue!=NULL) ? pValue->Gettext() :  L"None";
		if( propName != bstr_t(L"None") && propValue != bstr_t(L"None"))
		{
			namedvalues[propName]=propValue;
		}
	}
	return namedvalues;
}
/******************************************************************************
Function Name  :  nLoadTestCases
Input(s)       :  MSXML2::IXMLDOMNodePtr& pTSDOM
Output         :  INT
Functionality  :   
Member of      :  CTestSetupEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :  
Codetag        : CS004
******************************************************************************/
INT CTestSetupEntity::nLoadTestCases(MSXML2::IXMLDOMNodePtr& pTSDOM)
{
    LONG lCount;
    _bstr_t bstrNodeName(def_STR_TESTCASE_NODE);
    
    MSXML2::IXMLDOMNodeListPtr pDOMTCNodeList;
    MSXML2::IXMLDOMNodePtr pIXMLDOMTestCase;
    pDOMTCNodeList = pTSDOM->selectNodes(bstrNodeName);
    pDOMTCNodeList->get_length(&lCount);
    for(int i=0; i<lCount;i++)
    {
        CTestCaseEntity odTestCaseEntity;
        pIXMLDOMTestCase = pDOMTCNodeList->Getitem(i);
        odTestCaseEntity.GetData(pIXMLDOMTestCase);
        m_odTestCaseEntityList.AddTail(odTestCaseEntity);
    }
    return S_OK;

}
Exemple #9
0
/******************************************************************************
Function Name  :  GetData
Input(s)       :  MSXML2::IXMLDOMNodePtr& pIDomNode
Output         :  HRESULT
Functionality  :  Reads the XML node and constructs the data structure 
Member of      :  CSendEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :  
******************************************************************************/
HRESULT CSendEntity::GetData(MSXML2::IXMLDOMNodePtr& pIDomNode)
{
    MSXML2::IXMLDOMNodeListPtr pIDOMSendList;
    _bstr_t bstrNodeName = def_STR_SENDMSG_NODE;
    long lCount;
    
    pIDOMSendList = pIDomNode->selectNodes(bstrNodeName);
    pIDOMSendList->get_length(&lCount);
    
    for(int i = 0; i < lCount; i++)
    {
        CSend_MessageEntity odSend_MessageEntity;
        MSXML2::IXMLDOMNodePtr pIXMLDOMSendMsgEntity;
        pIXMLDOMSendMsgEntity = pIDOMSendList->Getitem(i);
        if(odSend_MessageEntity.GetData(pIXMLDOMSendMsgEntity)==S_OK)
        {
            m_ouData.m_odSend_MessageDataList.AddTail(odSend_MessageEntity);
        }
    }
    
    return  S_OK;
}
/******************************************************************************
Function Name  :  nLoadHeader
Input(s)       :  MSXML2::IXMLDOMNodePtr& pHeaderDOMNode
Output         :  INT
Functionality  :  Retrives the Header info 
Member of      :  CTestSetupEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :  
Codetag        :  
******************************************************************************/
INT CTestSetupEntity::nLoadHeader(MSXML2::IXMLDOMNodePtr& pHeaderDOMNode)
{
   // CComPtr<IXMLDOMNode> pHeaderDOMNode;
    MSXML2::IXMLDOMNodeListPtr pXMLDOMInfoList;
    MSXML2::IXMLDOMNodePtr pInfoNode;
    MSXML2::IXMLDOMNodePtr pInfoCategoryNode;
    MSXML2::IXMLDOMNodePtr pInfoValueNode;
    _bstr_t bstrNodeName = "info";
    CComVariant NodeValue;		
    pXMLDOMInfoList = pHeaderDOMNode->selectNodes(bstrNodeName);

    LONG lCount = 0;
    pXMLDOMInfoList->get_length(&lCount);
    SInfo ouTempSInfo;
    for(int i = 0; i<lCount; i++)
    {
        pInfoNode = pXMLDOMInfoList->Getitem(i);

        //bstrNodeName = def_STR_CATEGORY_NODE;
		bstrNodeName.Assign(SysAllocString(CT2W(def_STR_CATEGORY_NODE)));
        pInfoCategoryNode = pInfoNode->selectSingleNode(bstrNodeName);
        pInfoCategoryNode->get_nodeTypedValue(&NodeValue);		
				
		ouTempSInfo.m_omCategory = strCopyBSTRToCString(NodeValue);
		
        pInfoCategoryNode.Release();
        
        //bstrNodeName = def_STR_VALUE_NODE;
		bstrNodeName.Assign(SysAllocString(CT2W(def_STR_VALUE_NODE)));
        pInfoCategoryNode = pInfoNode->selectSingleNode(bstrNodeName);
        pInfoCategoryNode->get_nodeTypedValue(&NodeValue);			
		ouTempSInfo.m_omValue = strCopyBSTRToCString(NodeValue);
        pInfoCategoryNode.Release();
        
        pInfoNode.Release();


        if(ouTempSInfo.m_omCategory == def_STR_MODULENAME)
        {
            m_ouTestSetupHeader.m_sModuleName.m_omCategory = ouTempSInfo.m_omCategory;
            m_ouTestSetupHeader.m_sModuleName.m_omValue = ouTempSInfo.m_omValue;
        }
        if(ouTempSInfo.m_omCategory == def_STR_ENGINEERNAME)
        {
            m_ouTestSetupHeader.m_sEngineerInfo1.m_omCategory = ouTempSInfo.m_omCategory;
            m_ouTestSetupHeader.m_sEngineerInfo1.m_omValue = ouTempSInfo.m_omValue;
        }
        if(ouTempSInfo.m_omCategory == def_STR_ENGINERROLE)
        {
            m_ouTestSetupHeader.m_sEngineerInfo2.m_omCategory = ouTempSInfo.m_omCategory;
            m_ouTestSetupHeader.m_sEngineerInfo2.m_omValue = ouTempSInfo.m_omValue;
        }
        if(ouTempSInfo.m_omCategory == def_STR_VERSION)
        {
            m_ouTestSetupHeader.m_sVersion.m_omCategory = ouTempSInfo.m_omCategory;
            m_ouTestSetupHeader.m_sVersion.m_omValue = ouTempSInfo.m_omValue;
        }
    }
//Taking Database
    
    //bstrNodeName = def_STR_LISTOFDB;
	bstrNodeName.Assign(SysAllocString(CT2W(def_STR_LISTOFDB)));
    pInfoNode = pHeaderDOMNode->selectSingleNode(bstrNodeName);
    pInfoNode->get_nodeTypedValue(&NodeValue);		
	m_ouTestSetupHeader.m_omDatabasePath = strCopyBSTRToCString(NodeValue);
    //Set The Database Path
    SetDatabaseFile(m_ouTestSetupHeader.m_omDatabasePath);
    pInfoNode.Release();

    //bstrNodeName = def_STR_REPORT_FORMAT;
	bstrNodeName.Assign(SysAllocString(CT2W(def_STR_REPORT_FORMAT)));
    pInfoNode = pHeaderDOMNode->selectSingleNode(bstrNodeName);
    pInfoNode->get_nodeTypedValue(&NodeValue);
	CString omStrExt;	
	omStrExt = strCopyBSTRToCString(NodeValue);
    pInfoNode.Release();

    
    if(omStrExt == "HTM")
    {
        m_ouTestSetupHeader.m_sReportFile.m_eType = HTM;
    }
    else
    {
        m_ouTestSetupHeader.m_sReportFile.m_eType = TXT;
    }

    //bstrNodeName = def_STR_REPORT_PATH;
	bstrNodeName.Assign(SysAllocString(CT2W(def_STR_REPORT_PATH)));
    pInfoNode = pHeaderDOMNode->selectSingleNode(bstrNodeName);
    pInfoNode->get_nodeTypedValue(&NodeValue);		
	m_ouTestSetupHeader.m_sReportFile.m_omPath = strCopyBSTRToCString(NodeValue);
    pInfoNode.Release();
    
    


    //bstrNodeName = def_STR_REPORT_TIMEMODE;
	bstrNodeName.Assign(SysAllocString(CT2W(def_STR_REPORT_TIMEMODE)));
    pInfoNode = pHeaderDOMNode->selectSingleNode(bstrNodeName);
    pInfoNode->get_nodeTypedValue(&NodeValue);
	CString strTemp;	
	strTemp = strCopyBSTRToCString(NodeValue);
    if(strTemp == "ABS")
    {
        m_ouTestSetupHeader.m_sReportFile.m_eTimeMode = ABS;
    }
    else                    //Default
    {
        m_ouTestSetupHeader.m_sReportFile.m_eTimeMode = REL;
    }
    pInfoNode.Release();


    //bstrNodeName = def_STR_BUS_TYPE;
	bstrNodeName.Assign(SysAllocString(CT2W(def_STR_BUS_TYPE)));
    pInfoNode= pHeaderDOMNode->selectSingleNode(bstrNodeName);
    pInfoNode->get_nodeTypedValue(&NodeValue);		
	strTemp = strCopyBSTRToCString(NodeValue);

    if(strTemp == "CAN")
    {
        m_ouTestSetupHeader.m_eBus = CAN;
    }

    pInfoNode.Release();
    
    return 0;
}
DataDictionary MTConnectStreamsParser::ParseDataItems()
{
	MSXML2::IXMLDOMNodePtr root = m_pXMLDoc->GetdocumentElement();
	MSXML2::IXMLDOMNodeListPtr nodes = root->selectNodes(_bstr_t("//DeviceStream"));
	DataDictionary data;
	try
	{
		for(int i=0; i< nodes->length; i++)
		{
			MSXML2::IXMLDOMNodePtr pNode = NULL;					
			nodes->get_item(i, &pNode);

			_bstr_t items[3] = {_bstr_t(".//Samples"), _bstr_t(".//Events"), _bstr_t(".//Condition") };
			for(int ii=0; ii<3 ; ii++)
			{
				MSXML2::IXMLDOMNodeListPtr samples = pNode->selectNodes(items[ii]);
				for(int j=0; j< samples->length; j++)
				{
					MSXML2::IXMLDOMNodePtr pSampleHive = NULL;					
					samples->get_item(j, &pSampleHive);

					// Get each child
					MSXML2::IXMLDOMNodeListPtr childs = pSampleHive->childNodes;
					for(int k=0; k< childs->length; k++)
					{
						MSXML2::IXMLDOMNodePtr pSample = NULL;
						ptime datetime;
						std::string name ;
						std::string timestamp;
						std::string sequence;


						childs->get_item(k, &pSample);
						name = (LPCSTR)  GetAttribute(pSample, "name");
						if(name.empty())
							name = (LPCSTR)  GetAttribute(pSample, "dataItemId");
						if(name.empty())
							continue;
						timestamp = (LPCSTR)  GetAttribute(pSample, "timestamp");
						sequence = (LPCSTR)  GetAttribute(pSample, "sequence");

						// Lookup any name remapping to shorten
						if(TagRenames.find(name)!= TagRenames.end())
						{
							name = TagRenames[name];
						}
						if(items[ii] == _bstr_t(".//Samples"))
							data[name]=(LPCSTR) pSample->Gettext();
						else if(items[ii] == _bstr_t(".//Events"))
							data[name]=(LPCSTR) pSample->Gettext();
						else if(items[ii] == _bstr_t(".//Condition"))
						{
							std::string tagname  = (LPCSTR)  GetElement(pSample);
							if(stricmp(tagname.c_str(),"FAULT")==0)
								data[name]="fault";
							else
								data[name]="normal";
						}
					}
				}
			}
		}
	}
	catch(...)
	{
		std::cout<< "MTConnectStreamsParser::ParseDataItems() Exception\n";
	}
	return data;

}
/******************************************************************************
Function Name  :  GetData
Input(s)       :  MSXML2::IXMLDOMNodePtr& pIDomNode
Output         :  HRESULT
Functionality  :  Fill the datastructure from xml node pIDomNode
Member of      :  CVerify_MessageEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam, GT-Derka
Date Created   :  06/04/2011
Modifications  :
******************************************************************************/
HRESULT CVerify_MessageEntity::GetData(MSXML2::IXMLDOMNodePtr& pIDomNode)
{
    IXMLDOMNode* pIDOMChildNode;
    LONG lCount;
    CComBSTR bstrNodeName;
    CComVariant NodeValue;
    CString omstrTemp;
    CSignalCondition ouSignalCondition;
    IXMLDOMNamedNodeMapPtr pIDOMAttributes;
    pIDOMAttributes = pIDomNode->Getattributes();// get_attributes((IXMLDOMNamedNodeMap**)&pIDOMAttributes);

    //Retrieving Message ID
    bstrNodeName = def_STR_TCATTRIB_ID;
    pIDOMAttributes->getNamedItem(bstrNodeName, &pIDOMChildNode);
    pIDOMChildNode->get_nodeTypedValue(&NodeValue);
    omstrTemp = strCopyBSTRToCString(NodeValue);
    m_ouData.m_dwMessageID = atoi((LPCSTR)omstrTemp);
    m_ouData.m_omMessageName = omstrTemp;
    if(m_ouDataBaseManager.bIsValidMessageID(m_ouData.m_dwMessageID)== FALSE)
    {
        //TODO::INVALID MSG POSSIBLE ONLY WHEN THE FILE IS EDITED WITH NOTEPAD.
        return -1;
    }
    pIDOMChildNode->Release();

    //Retrieving Message UNIT
    bstrNodeName = _(def_STR_TCATTRIB_UNIT);
    pIDOMAttributes->getNamedItem(bstrNodeName, &pIDOMChildNode);
    pIDOMChildNode->get_nodeTypedValue(&NodeValue);
    omstrTemp = strCopyBSTRToCString(NodeValue);
    if(omstrTemp == "RAW")
    {
        m_ouData.m_eSignalUnitType = RAW;
    }
    else                                    // else if(omstrTemp == "ENG")
    {
        m_ouData.m_eSignalUnitType = ENG;
    }
    pIDOMChildNode->Release();

    //Retrieving Message Channel
    bstrNodeName = def_STR_TCATTRIB_CHANNEL;
    pIDOMAttributes->getNamedItem(bstrNodeName, &pIDOMChildNode);
    m_ouData.m_byChannelNumber = 0;                 // set default-value for the case, the number is incorrect or the whole argument is missing
    if (NULL != pIDOMChildNode)                     // avoid crash in case XML-file -without channel-information- is loaded
    {
        pIDOMChildNode->get_nodeTypedValue(&NodeValue);
        omstrTemp = strCopyBSTRToCString(NodeValue);
        m_ouData.m_byChannelNumber = atoi((LPCSTR)omstrTemp);
        pIDOMChildNode->Release();
    }
    if(m_ouData.m_byChannelNumber == 0)             // if casting fails (failure in xml)
    {
        m_ouData.m_byChannelNumber = 1; // set default channel */
        m_lDefaultChannelUsed = 1;
    }

    //Retrieving Signals and their Data

    IFrame* sMsg;
    IXMLDOMNodeListPtr pIDOMSignalList;
    IXMLDOMNode* pIDOMSChildSignal;

    bstrNodeName = _(def_STR_SIGNAL_NODE);
    pIDOMSignalList = pIDomNode->selectNodes((_bstr_t)bstrNodeName);
    pIDOMSignalList->get_length(&lCount);


    INT nRetVal;
    nRetVal = m_ouDataBaseManager.nGetMessageName(m_ouData.m_dwMessageID, m_ouData.m_omMessageName);
    if(nRetVal != S_OK)
    {
        return nRetVal;
    }

    nRetVal =  m_ouDataBaseManager.nGetMessageInfo(m_ouData.m_omMessageName, &sMsg);
    if ( sMsg == nullptr )
    {
        return nRetVal;
    }

    UINT unSignalCount = sMsg->GetSignalCount();
    //W4 Removal - Local variable not required
    //UINT unTSSignalCount = lCount;
    std::map<ISignal*, SignalInstanse> signalList;
    sMsg->GetSignalList( signalList);
    std::string signalName;
for (auto signal : signalList )
        //for(UINT i = 0; i < unSignalCount; i++)
    {
        CSignalCondition ouSignalData, ouTSSignalData;
        signal.first->GetName( signalName );
        ouSignalData.m_omSigName = signalName.c_str();
        ouSignalData.m_omCondition = "";
        for(int i = 0; i < lCount; i++)
        {
            pIDOMSignalList->get_item(i, &pIDOMSChildSignal);
            vRetrieveConditionSignalValue(pIDOMSChildSignal, ouTSSignalData);
            if(ouSignalData.m_omSigName == ouTSSignalData.m_omSigName)
            {
                ouSignalData.m_omCondition = ouTSSignalData.m_omCondition;
                break;
            }
        }
        m_ouData.m_odSignalConditionList.AddTail(ouSignalData);
    }
    return S_OK;
}