/// <summary> /// 获取backhaul单点路损 /// </summary> /// <param name="trans"></param> /// <param name="cellID"></param> /// <param name="sectorID"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="resolution"></param> /// <param name="isGetAntGain"></param> /// <returns></returns> private float[][] GetOnePointBackhaulPathLoss(Transceiver trans, short cellID, int sectorID, double x, double y, float resolution, bool isGetAntGain) { float[][] pathLossMatrix = new float[][] { new float[2] }; if (this.m_PathLossCellData.TransBackhaulPathLossMatrixList.Count != 0) { TransceiverPathLossMatrix transceiverPathLossMatrix = FindBackhaulMatrix(sectorID, cellID); if ((transceiverPathLossMatrix == null) || this.RangeXY(x, y, transceiverPathLossMatrix)) { pathLossMatrix[0][0] = float.MinValue; pathLossMatrix[0][1] = float.MinValue; return pathLossMatrix; } double distance = this.GetDistance(trans, sectorID, x, y); int xIndex = (int)((x - transceiverPathLossMatrix.LeftTopX) / ((double)transceiverPathLossMatrix.Resolution)); int yIndex = (int)((transceiverPathLossMatrix.LeftTopY - y) / ((double)transceiverPathLossMatrix.Resolution)); int delayIndex = this.GetDelayIndex(xIndex, yIndex, transceiverPathLossMatrix); if (this.IsMatixInvalid(transceiverPathLossMatrix, delayIndex)) { pathLossMatrix[0][1] = float.MinValue; pathLossMatrix[0][0] = float.MinValue; } else if (this.IsUsingMatrixs(x, y, resolution, transceiverPathLossMatrix)) { float deltaLoss = GetBackhaulDeltaLoss(trans, x, y, distance); GetExistsPLMatrix(isGetAntGain, pathLossMatrix, transceiverPathLossMatrix, delayIndex, deltaLoss); } else { StructAntennaParam calAntennaParam = new StructAntennaParam(); calAntennaParam.CellX = trans.Parent.X + trans.GetAntConfig(sectorID).DX; calAntennaParam.CellY = trans.Parent.Y + trans.GetAntConfig(sectorID).DY; calAntennaParam.IsSimple = false; calAntennaParam.AntHeight = this.m_IGeoInfo.GetValueByGeoXYPoint(calAntennaParam.CellX, calAntennaParam.CellY, DemDataType.Height); //用户的坐标 calAntennaParam.MsX = x; calAntennaParam.MsY = y; calAntennaParam.MsHeight = this.m_IGeoInfo.GetValueByGeoXYPoint(x, y, DemDataType.Height); float num6 = transceiverPathLossMatrix.LeftTopX + (xIndex * transceiverPathLossMatrix.Resolution); float dX = (float)((x - num6) / ((double)transceiverPathLossMatrix.Resolution)); float num8 = transceiverPathLossMatrix.LeftTopY - (yIndex * transceiverPathLossMatrix.Resolution); float dY = (float)((num8 - y) / ((double)transceiverPathLossMatrix.Resolution)); pathLossMatrix[0][1] = this.getPathLossByWeight(xIndex, yIndex, dX, dY, transceiverPathLossMatrix); float antGain = 0f; if (isGetAntGain) { calAntennaParam.AntConfigSetUp = trans.GetAntConfig(sectorID); antGain = this.m_AntennaGainCalculator.Calculate3DGain(calAntennaParam); } this.SetBackhaulMatrix(pathLossMatrix, x, y, trans, antGain, distance); } } return pathLossMatrix; }
private double GetDistance(Transceiver trans, int sectorID, double x, double y) { GeoXYPoint point = new GeoXYPoint(trans.Parent.X + trans.GetAntConfig(sectorID).DX, trans.Parent.Y + trans.GetAntConfig(sectorID).DY); GeoXYPoint point2 = new GeoXYPoint(x, y); return point.Distance(point2); }