Esempio n. 1
0
 public DiffractedRay(NodeInfo nodeInfo, List <Point> polygonPoints)
 {
     this.nodeInfo      = nodeInfo;
     this.polygonPoints = polygonPoints;
     this.pPoints       = this.polygonPoints.ToArray();
 }
        // Pwr0  发射功率,单位w
        // Pwr1  接收功率,单位w
        // isT   是否穿过建筑物
        // ci    小区标识
        public void mergeGridStrength(int gxid, int gyid, int gzid, Point p, List <NodeInfo> rays, double Pwr0, double Pwr1, bool isT, bool ground)
        {
            GridStrength gs;

            ////将入地射线的栅格高度统一为0
            //if (ground)
            //{
            //    gzid = 0;
            //}
            string key = String.Format("{0},{1},{2}", gxid, gyid, gzid);

            if (this.gridStrengths.ContainsKey(key))
            {
                gs = this.gridStrengths[key];

                // 当前射线存在绕射和反射
                //if (rays.Count > 0)
                if (rays.Count > 1)
                {
                    updateBuildingID(ref gs, rays);
                    NodeInfo ray = rays[rays.Count - 1];
                    if (ray.rayType == RayType.HReflection || ray.rayType == RayType.VReflection)
                    {
                        gs.RefNum    += 1;
                        gs.RefPwrW   += Pwr1;
                        gs.MaxRefPwrW = Math.Max(gs.MaxRefPwrW, Pwr1);
                    }
                    else if (ray.rayType == RayType.HDiffraction || ray.rayType == RayType.VDiffraction)
                    {
                        gs.DiffNum    += 1;
                        gs.DiffPwrW   += Pwr1;
                        gs.MaxDiffPwrW = Math.Max(gs.MaxDiffPwrW, Pwr1);
                    }

                    //反射、绕射建筑物id去重
                    gs.RefBuildingID  = DistinctStringArray(gs.RefBuildingID.Split(';'));
                    gs.DiffBuildingID = DistinctStringArray(gs.DiffBuildingID.Split(';'));
                }
                else if (rays.Count == 1)
                {
                    //当前射线是直射
                    gs.DirectNum    += 1;
                    gs.DirectPwrW   += Pwr1;
                    gs.MaxDirectPwrW = Math.Max(gs.MaxDirectPwrW, Pwr1);
                }
                gs.ground = ground;
                this.gridStrengths[key] = gs;  // 更新
            }
            else
            {
                gs                    = new GridStrength();
                gs.GXID               = gxid;
                gs.GYID               = gyid;
                gs.Level              = gzid;
                gs.eNodeB             = this.cellInfo.eNodeB;
                gs.CI                 = this.cellInfo.CI;
                gs.RefBuildingID      = "";
                gs.DiffBuildingID     = "";
                gs.TransmitBuildingID = "";
                gs.GCenter            = p;
                gs.TransPwrW          = gs.RefPwrW = gs.DiffPwrW = gs.DirectPwrW = gs.ReceivedPowerW = 0;
                gs.TransNum           = gs.RefNum = gs.DiffNum = gs.DirectNum = 0;

                //当前射线存在绕射和反射
                if (rays.Count > 1)
                {
                    updateBuildingID(ref gs, rays);

                    NodeInfo ray = rays[rays.Count - 1];
                    if (ray.rayType == RayType.HReflection || ray.rayType == RayType.VReflection)
                    {
                        gs.RefNum         = 1;
                        gs.ReceivedPowerW = gs.MaxRefPwrW = gs.RefPwrW = Pwr1;
                    }
                    else if (ray.rayType == RayType.HDiffraction || ray.rayType == RayType.VDiffraction)
                    {
                        gs.DiffNum        = 1;
                        gs.ReceivedPowerW = gs.MaxDiffPwrW = gs.DiffPwrW = Pwr1;
                    }
                }
                else if (rays.Count == 1)
                {
                    //当前射线是直射
                    gs.DirectNum      = 1;
                    gs.ReceivedPowerW = gs.MaxDirectPwrW = gs.DirectPwrW = Pwr1;
                }
                gs.ground = ground;
                this.gridStrengths.Add(key, gs);
            }
        }