TCHAR Buff[MAX_PATH];
GetModuleFileName(AfxGetInstanceHandle(), Buff, MAX_PATH);
CString strPath(Buff);
strPath = strPath.Left(strPath.ReverseFind('\\'));
strPath += _T("\\config\\BTSRepeater场强区.xml");
TiXmlDocument docXML(strPath);
if(docXML.LoadFile())
{
TiXmlHandle docHandle(&docXML);
TiXmlElement* pParameter = docHandle.FirstChildElement("性能参数").Element();
TiXmlElement* pModel = pParameter->FirstChildElement("实体模型");
while(pModel)
{
CString strModelType = pModel->Attribute("型号");
if (m_strFindSatellite != _T("") && m_strFindSatellite == strModelType)
{
TiXmlElement* pFieldArea = pModel->FirstChildElement("场强区");
int nAreaIndex = 0;
while(pFieldArea)
{
CString strSerial = pFieldArea->Attribute("序号");
CString strWaveBand = pFieldArea->Attribute("波段");
CString strFieldValues = pFieldArea->Attribute("场强值");
CString strNum = pFieldArea->Attribute("点数");
if (ReturnInfo.nRegionNum < 10)
{
ReturnInfo.nRegionNum++;
ReturnInfo.RegionList[nAreaIndex].nCKu = 0;
if (strWaveBand == _T("Ku"))
{
ReturnInfo.RegionList[nAreaIndex].nCKu = 1;
}
ReturnInfo.RegionList[nAreaIndex].nPtNum = 0;
ReturnInfo.RegionList[nAreaIndex].dFieldStrength=atof(strFieldValues);
int nPtIndex = 0;
TiXmlElement* pPt = pFieldArea->FirstChildElement("边界点");
while (pPt)
{
CString strLon = pPt->Attribute("经度");
CString strLat = pPt->Attribute("纬度");
if (ReturnInfo.RegionList[nAreaIndex].nPtNum < 100)
{
ReturnInfo.RegionList[nAreaIndex].nPtNum++;
ReturnInfo.RegionList[nAreaIndex].PtList[nPtIndex].dLon=atof(strLon);
ReturnInfo.RegionList[nAreaIndex].PtList[nPtIndex].dLat=atof(strLat);
ReturnInfo.RegionList[nAreaIndex].PtList[nPtIndex].dHeight= 0;
nPtIndex++;
}
pPt = pPt->NextSiblingElement("边界点");
}
nAreaIndex++;
}
pFieldArea = pFieldArea->NextSiblingElement("场强区");
}
return TRUE;
break;
}
pModel = pModel->NextSiblingElement("实体模型");
}