|
@@ -4,8 +4,6 @@
|
|
// 2023-03-25
|
|
// 2023-03-25
|
|
|
|
|
|
#include "../../includes/includes.h"
|
|
#include "../../includes/includes.h"
|
|
-// #include "../../sysdefine/struct.h"
|
|
|
|
-// #include "./lct_public.h"
|
|
|
|
|
|
|
|
// 导入全局变量
|
|
// 导入全局变量
|
|
extern COORD_T gLct_astLocationRefPoint[LCT_REF_POINT_MATRIX_LEN * LCT_REF_POINT_MATRIX_LEN]; // 定位参考点
|
|
extern COORD_T gLct_astLocationRefPoint[LCT_REF_POINT_MATRIX_LEN * LCT_REF_POINT_MATRIX_LEN]; // 定位参考点
|
|
@@ -78,7 +76,7 @@ void lct_coordcal_two_dimension_location(PUB_LCT_BTS_LIST_T *pstLctBtsList, LCT_
|
|
}
|
|
}
|
|
|
|
|
|
// 二次校验坐标
|
|
// 二次校验坐标
|
|
- lct_coordcal_dbcheck_minimum_value(byFirstPathFlag, astValidPathBtsList, byValidPathBtsListLen, pstMinmumValueList);
|
|
|
|
|
|
+ lct_coordcal_dbcheck_minimum_value(byFirstPathFlag, pstLctBtsList, pstMinmumValueList);
|
|
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -648,9 +646,10 @@ void lct_coordcal_sel_minimum_value(flt32 *pfDelayDeviationSumMatrix, uint16 wMa
|
|
}
|
|
}
|
|
|
|
|
|
// 二次校验极小值
|
|
// 二次校验极小值
|
|
-// pstBtsFirstPathList:第一径队列
|
|
|
|
|
|
+// byFirstPathFlag:第一径标识符
|
|
|
|
+// pstLctBtsList:定额我i基站队列
|
|
// pstMinimumValueList://极小值队列
|
|
// pstMinimumValueList://极小值队列
|
|
-void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueList)
|
|
|
|
|
|
+void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, PUB_LCT_BTS_LIST_T *pstLctBtsList, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueList)
|
|
{
|
|
{
|
|
uint8 byMinimumNum = 0;
|
|
uint8 byMinimumNum = 0;
|
|
LCT_MINIMUM_VALUE_T *pstMiminumValueData = NULL;
|
|
LCT_MINIMUM_VALUE_T *pstMiminumValueData = NULL;
|
|
@@ -672,9 +671,9 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *
|
|
uint8 byYflag = 0;
|
|
uint8 byYflag = 0;
|
|
|
|
|
|
////计算端点坐标的最大值与最小值
|
|
////计算端点坐标的最大值与最小值
|
|
- for (uint8 i = 0; i < byFirstPathListLen; i++)
|
|
|
|
|
|
+ for (uint8 i = 0; i < pstLctBtsList->byBtsNum; i++)
|
|
{
|
|
{
|
|
- dwTemp = pstFirstPathList[i].dwCoordX;
|
|
|
|
|
|
+ dwTemp = pstLctBtsList->astLocationBts[i].dwCoordX;
|
|
if (dwTemp > dwMaxValueX)
|
|
if (dwTemp > dwMaxValueX)
|
|
{
|
|
{
|
|
dwMaxValueX = dwTemp;
|
|
dwMaxValueX = dwTemp;
|
|
@@ -685,7 +684,7 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *
|
|
dwMinValueX = dwTemp;
|
|
dwMinValueX = dwTemp;
|
|
}
|
|
}
|
|
|
|
|
|
- dwTemp = pstFirstPathList[i].dwCoordY;
|
|
|
|
|
|
+ dwTemp = pstLctBtsList->astLocationBts[i].dwCoordY;
|
|
if (dwTemp > dwMaxValueY)
|
|
if (dwTemp > dwMaxValueY)
|
|
{
|
|
{
|
|
dwMaxValueY = dwTemp;
|
|
dwMaxValueY = dwTemp;
|
|
@@ -711,7 +710,7 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *
|
|
}
|
|
}
|
|
|
|
|
|
// 二次校验极小值坐标
|
|
// 二次校验极小值坐标
|
|
- pstMinimumValueList->byTwoDimensionInsideFlag = 0;
|
|
|
|
|
|
+ pstMinimumValueList->byTwoDimensionInsideFlag = 0; // 极小值点不在二维空间内
|
|
for (uint8 j = 0; j < byMinimumNum; j++)
|
|
for (uint8 j = 0; j < byMinimumNum; j++)
|
|
{
|
|
{
|
|
if (byFirstPathFlag == CAL_PATH)
|
|
if (byFirstPathFlag == CAL_PATH)
|
|
@@ -755,8 +754,12 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *
|
|
}
|
|
}
|
|
pstMiminumValueData->stCoord.dwY = dwY;
|
|
pstMiminumValueData->stCoord.dwY = dwY;
|
|
|
|
|
|
- // 再次检查坐标是否合法
|
|
|
|
- if ((dwX >= (dwMinValueX - 300)) && (dwX <= (dwMaxValueX + 300)) && (dwY >= (dwMinValueY - 300)) && (dwY <= (dwMaxValueY + 300)))
|
|
|
|
|
|
+ // 再次检查坐标是否合法,极小值点要在基站围成的矩形框内部
|
|
|
|
+ dwMinValueX -= 300;
|
|
|
|
+ dwMaxValueX += 300;
|
|
|
|
+ dwMinValueY -= 300;
|
|
|
|
+ dwMaxValueY += 300;
|
|
|
|
+ if ((dwX >= dwMinValueX) && (dwX <= dwMaxValueX) && (dwY >= dwMinValueY) && (dwY <= dwMaxValueY))
|
|
{
|
|
{
|
|
if (byFirstPathFlag == CAL_PATH)
|
|
if (byFirstPathFlag == CAL_PATH)
|
|
{
|
|
{
|
|
@@ -771,7 +774,7 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *
|
|
|
|
|
|
if (!pstMinimumValueList->byTwoDimensionInsideFlag)
|
|
if (!pstMinimumValueList->byTwoDimensionInsideFlag)
|
|
{
|
|
{
|
|
- pstMinimumValueList->byTwoDimensionInsideFlag = 1;
|
|
|
|
|
|
+ pstMinimumValueList->byTwoDimensionInsideFlag = 1; // 极小值点在二维空间内
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -811,16 +814,16 @@ void lct_coordcal_two_dimension_check(LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueG
|
|
dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX - pstAheadCoord->dwX;
|
|
dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX - pstAheadCoord->dwX;
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX = pstPredictionCoord->dwX;
|
|
|
|
|
|
+ pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX = 0.5 * pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX + 0.5 * pstPredictionCoord->dwX;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// x轴向左移动
|
|
// x轴向左移动
|
|
else if (byDirectionX == -1)
|
|
else if (byDirectionX == -1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX > pstAheadCoord->dwX;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX - pstAheadCoord->dwX;
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX = pstPredictionCoord->dwX;
|
|
|
|
|
|
+ pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX = 0.5 * pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwX + 0.5 * pstPredictionCoord->dwX;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -829,19 +832,19 @@ void lct_coordcal_two_dimension_check(LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueG
|
|
// y轴向上移动
|
|
// y轴向上移动
|
|
if (byDirectionY == 1)
|
|
if (byDirectionY == 1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY < pstAheadCoord->dwY;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY - pstAheadCoord->dwY;
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY = pstPredictionCoord->dwY;
|
|
|
|
|
|
+ pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY = 0.5 * pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY + 0.5 * pstPredictionCoord->dwY;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// y轴向下移动
|
|
// y轴向下移动
|
|
else if (byDirectionY == -1)
|
|
else if (byDirectionY == -1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY > pstAheadCoord->dwY;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY - pstAheadCoord->dwY;
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY = pstPredictionCoord->dwY;
|
|
|
|
|
|
+ pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY = 0.5 * pstMinmumValueGroup->astCalMinimumList[i].stCoord.dwY + 0.5 * pstPredictionCoord->dwY;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -855,19 +858,19 @@ void lct_coordcal_two_dimension_check(LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueG
|
|
// x轴向右移动
|
|
// x轴向右移动
|
|
if (byDirectionX == 1)
|
|
if (byDirectionX == 1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX < pstAheadCoord->dwX;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX - pstAheadCoord->dwX;
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX = pstPredictionCoord->dwX;
|
|
|
|
|
|
+ pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX = 0.5 * pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX + 0.5 * pstPredictionCoord->dwX;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// x轴向左移动
|
|
// x轴向左移动
|
|
else if (byDirectionX == -1)
|
|
else if (byDirectionX == -1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX > pstAheadCoord->dwX;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX - pstAheadCoord->dwX;
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX = pstPredictionCoord->dwX;
|
|
|
|
|
|
+ pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX = 0.5 * pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwX + 0.5 * pstPredictionCoord->dwX;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -876,19 +879,19 @@ void lct_coordcal_two_dimension_check(LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueG
|
|
// y轴向上移动
|
|
// y轴向上移动
|
|
if (byDirectionY == 1)
|
|
if (byDirectionY == 1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY < pstAheadCoord->dwY;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY - pstAheadCoord->dwY;
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap < -LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY = pstPredictionCoord->dwY;
|
|
|
|
|
|
+ pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY = 0.5 * pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY + 0.5 * pstPredictionCoord->dwY;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// y轴向下移动
|
|
// y轴向下移动
|
|
else if (byDirectionY == -1)
|
|
else if (byDirectionY == -1)
|
|
{
|
|
{
|
|
- dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY > pstAheadCoord->dwY;
|
|
|
|
|
|
+ dwGap = pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY - pstAheadCoord->dwY;
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
if (dwGap > LCT_COORDCAL_MINIMUM_VALUE_ADJUST_THRES)
|
|
{
|
|
{
|
|
- pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY = pstPredictionCoord->dwY;
|
|
|
|
|
|
+ pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY = 0.5 * pstMinmumValueGroup->astTrackMinimumList[i].stCoord.dwY + 0.5 * pstPredictionCoord->dwY;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|