예제 #1
0
 private static void UpdateNearestCell(ISimUser user, ref ISimCellBase nearestCell, ref float minDistance, ISimCellBase cellBase)
 {
     GeoXYPoint trancXY = new GeoXYPoint(cellBase.X, cellBase.Y);
     GeoXYPoint userXY = new GeoXYPoint(user.X, user.Y);
     GeoXYLine trancToUser = new GeoXYLine(trancXY, userXY);
     FindNearestCell(ref nearestCell, ref minDistance, cellBase, trancToUser);
 }
예제 #2
0
 private int getMatrixIndex(GeoXYPoint gPoint, double resolution, double northwestY, double northwestX, int colCount)
 {
     int num = 0;
     int num2 = (int) ((northwestY - gPoint.Y) / resolution);
     num = colCount * num2;
     return (num + ((int) ((gPoint.X - northwestX) / resolution)));
 }
예제 #3
0
 private List<User> CreateBlankUser(int userNumber, List<GeoXYRect> rects, CellServiceContext ctx)
 {
     List<User> list = new List<User>();
     while (true)
     {
         double num;
         double num2;
         if (userNumber <= 0)
         {
             return list;
         }
         User user = new User();
         ClutterInfo info = new ClutterInfo(-1);
         int num3 = this.m_Random.Next(0, rects.Count);
         this.GenUserXY(user, out num, out num2, rects[num3]);
         GeoXYPoint geoXYPoint = new GeoXYPoint(num, num2);
         if (this.m_CellRectHelper.IsPoiontIsPolyRegion(geoXYPoint))
         {
             user.Clutter = info;
             user.Service = ctx.Service;
             user.LinkType = ctx.LinkType;
             user.Priority = 1;
             list.Add(user);
             if (userNumber == list.Count)
             {
                 return list;
             }
         }
     }
 }
예제 #4
0
 public static List<GeoXYPoint> CoverageDistributePoint(GeoPolygon polygonPeak, double r)
 {
     List<GeoXYPoint> list = new List<GeoXYPoint>();
     GeoXYPoint centerPoint = new GeoXYPoint((polygonPeak.Right + polygonPeak.Left) / 2.0, (polygonPeak.Top + polygonPeak.Bottom) / 2.0);
     GeoXYPoint southwest = GetSouthWestPoint(polygonPeak.Left, polygonPeak.Right, polygonPeak.Top, polygonPeak.Bottom, centerPoint, r);
     GeoXYPoint northeast = GetNorthEastClutterPoint(polygonPeak.Left, polygonPeak.Right, polygonPeak.Top, polygonPeak.Bottom, centerPoint, r);
     list = InitialDistribute(southwest, northeast, r);
     int index = 0;
     while (index < list.Count)
     {
         if (!polygonPeak.IsPointInPolygon(list[index]))
         {
             list.RemoveAt(index);
             index--;
         }
         index++;
     }
     for (int i = 0; list.Count == 0; i++)
     {
         if (i >= polygonPeak.Points.Count)
         {
             return list;
         }
         list = InitialDistribute(polygonPeak.Points[i], northeast, r);
         for (index = 0; index < list.Count; index++)
         {
             if (!polygonPeak.IsPointInPolygon(list[index]))
             {
                 list.RemoveAt(index);
                 index--;
             }
         }
     }
     return list;
 }
예제 #5
0
파일: GeoXYLine.cs 프로젝트: xiaoyj/Space
 public void AddPoint(GeoXYPoint point)
 {
     if (point != null)
     {
         this.m_Points.Add(point);
     }
 }
예제 #6
0
 private GeoXYPoint CreatPoint(Transceiver tranceiver)
 {
     GeoXYPoint pointCell = new GeoXYPoint();
     pointCell.X = tranceiver.X;
     pointCell.Y = tranceiver.Y;
     return pointCell;
 }
예제 #7
0
 private static void CalcStartEndPoint(float resolution, GeoXYPoint pointLeftTop, GeoXYPoint pointRightBottom, GeoXYPoint pointCell, float radius, out Point startP, out Point endP)
 {
     GetCalcRetangleForCell recTool = new GetCalcRetangleForCell(pointLeftTop, pointRightBottom, resolution, pointCell, radius);
     startP = new Point();
     endP = new Point();
     recTool.GetVirtualRetangle(ref startP, ref endP);
 }
예제 #8
0
 public static GeoXYPoint MockGeoXYPoint()
 {
     GeoXYPoint point = new GeoXYPoint();
     point.X = 11000;
     point.Y = -13240;
     return point;
 }
예제 #9
0
 public void Init()
 {
     m_ModelList = GSMPointAnalysisMock.MockModelList();
     m_Point = GSMPointAnalysisMock.MockGeoXYPoint();
     m_GSMCellCalculator = new GSMCellCalculator();
     
 }
예제 #10
0
 public void Init()
 {
     m_ModelList = GSMPointAnalysisMock.MockModelList();
     RxPowerAndLinkLossModel modelimage = new RxPowerAndLinkLossModel();
     modelimage.RxPower = -90;
     Site site = GSMMock.MockSite();
     Transceiver transceiver = new Transceiver();
     transceiver.Parent = site;
     modelimage.Cell = new GSMTRX();
     modelimage.Cell.Parent = transceiver;
     modelimage.Cell.ID = 2;
     modelimage.DownLinkLoss = 112;
     modelimage.UpLinkLoss = 112;
     m_ModelList.Add(modelimage);
     m_Point = GSMPointAnalysisMock.MockGeoXYPoint();
     m_TargetPara = new TargetPara();
     m_TargetPara.TargetCIR = 9;
     m_TargetPara.TargetRxPower = -110;
     m_TargetPara.TargetThroughput = 12;
     m_Terminal = new Terminal();
     GSMTerminal gsmTerminal = new GSMTerminal();
     gsmTerminal.NetType = NetWorkType.GSM;
     m_Terminal.NetTerminalList.Add(gsmTerminal);
     m_Service = new UnionCsService();
     m_Service.CommonType = CommonServiceType.CSService;
     //modify by lyt 6.23
     GSMService gsmservice = new GSMService();
     ((UnionCsService)m_Service).CSServiceDic.Add(NetWorkType.GSM, gsmservice);
     m_ULDetail = (GSMULDetail)(cellCalc.CalculateUpLinkDetail(m_ModelList, point, m_Service, m_Terminal, m_mobility));
     //m_ULDetail = new GSMULDetail(m_ModelList, m_TargetPara, m_Service, m_Terminal);
 }
예제 #11
0
파일: CellFilter.cs 프로젝트: xiaoyj/Space
 public CellFilter()
 {
     this.m_polygonLeftTop = new GeoXYPoint();
     this.m_polygonRightBottom = new GeoXYPoint();
     this.m_cellLeftTop = new GeoXYPoint();
     this.m_cellRightBottom = new GeoXYPoint();
     this.m_cellPoint = new GeoXYPoint();
 }
예제 #12
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="pointLT">计算区域外接矩形的左上角坐标</param>
 /// <param name="pointRB">计算区域外接矩形的右下角坐标</param>
 /// <param name="resolution">计算精度</param>
 /// <param name="cellPosition">小区的位置XY坐标</param>
 /// <param name="calcRadius">计算半径</param>
 public GetCalcRetangleForCell(GeoXYPoint pointLT, GeoXYPoint pointRB, float resolution, GeoXYPoint cellPosition, float calcRadius)
 {
     m_pointLT = pointLT;
     m_pointRB = pointRB;
     m_resolution = resolution;
     m_cellPosition = cellPosition;
     m_calcRadius = calcRadius;
 }
예제 #13
0
 private GraphicsPath BuildArcPath(GeoXYPoint position, GeoPointStyle pointStyle)
 {
     Point point = this.m_Helper.PlaneToScreen(position);
     Point location = new Point(point.X - (pointStyle.IconSize.Width / 2), point.Y - (pointStyle.IconSize.Height / 2));
     Rectangle rect = new Rectangle(location, pointStyle.IconSize);
     GraphicsPath path = new GraphicsPath();
     path.AddArc(rect, 0f, 360f);
     return path;
 }
예제 #14
0
파일: CellFilter.cs 프로젝트: xiaoyj/Space
 public CellFilter(IGeoInfo iGeoInfo)
 {
     this.m_polygonLeftTop = new GeoXYPoint();
     this.m_polygonRightBottom = new GeoXYPoint();
     this.m_cellLeftTop = new GeoXYPoint();
     this.m_cellRightBottom = new GeoXYPoint();
     this.m_cellPoint = new GeoXYPoint();
     this.m_GeoInfo = iGeoInfo;
 }
예제 #15
0
 private TranceiverCalcInfo ConstructCalcInfo(IACell cell, float resolution, GeoXYPoint pointLeftTop, GeoXYPoint pointRightBottom, GeoXYPoint pointCell, Transceiver tranceiver)
 {
     float radius = GetMaxCalcRadius(tranceiver);
     Point startP;
     Point endP;
     CalcStartEndPoint(resolution, pointLeftTop, pointRightBottom, pointCell, radius, out startP, out endP);
     TranceiverCalcInfo calcInfo = new TranceiverCalcInfo(tranceiver, startP, endP, cell);
     return calcInfo;
 }
예제 #16
0
        //public double CalculateAsRxPower(IACell cell, GeoXYPoint point, float Linkloss)
        //{
            //double m_TRXPower = ((GSMTRX)cell).MaxPower;
            //GSMTRX isGSMCell = cell as GSMTRX;
            //if (isGSMCell != null)
            //{
            //GSMTerminal gsmTerminal = (GSMTerminal)terminal.GetNetWorkTerminal(NetWorkType.GSM);
            //double terminalGain = gsmTerminal.Gain;
            //double serviceLoss = ((GSMService)service).BodyLoss;
            //return m_TRXPower + terminalGain - serviceLoss - linkloss;
            //}
            //else
            //{
            //    return double.NegativeInfinity;
            //}
        //    return CalculateRxPower(cell, point, Linkloss);
        //}

        public IDetail CalculateDownLinkDetail(List<RxPowerAndLinkLossModel> ModelList, GeoXYPoint point, Service service, Mobility mobility, Terminal terminal)
        {
            TargetPara target = new TargetPara();
            InitData(ModelList, service, terminal, target);
            m_DlBestCell = FindDlBestServer();
            m_IInterf = InitInterfCalc();
            DlResultImage();
            DlJudgeAccess(target);
            return dlDetail;
        }
예제 #17
0
        /// <summary>
        /// 读取用户的坐标与显示方式
        /// </summary>
        /// <param name="pointsList"></param>
        /// <param name="pointStylesList"></param>
        public void GetPointStyleDict(List<GeoXYPoint> pointsList, List<GeoPointStyle> pointStylesList)
        {
            foreach (TDSimUser user in m_PreSimUsers)
            {
                GeoXYPoint geoPoint = new GeoXYPoint(user.X, user.Y);
                pointsList.Add(geoPoint);

                FindGeoStyleByUserDelegate findGS = FindAccessSituByUser;
                pointStylesList.Add(findGS(user));
            }
        }
예제 #18
0
 public void GetPointStyleDict_Test()
 {
     GeoXYPoint point = new GeoXYPoint();
     List<GeoXYPoint> pl = new List<GeoXYPoint>();
     pl.Add(point);
     GeoPointStyle pointStyle = new GeoPointStyle();
     List<GeoPointStyle> psl = new List<GeoPointStyle>();
     psl.Add(pointStyle);
     m_ss.Styles = psl;
     m_VecData.GetPointStyleDict(pl, psl);
 }
예제 #19
0
 private string GetDistanceStr(GeoXYPoint endPoint)
 {
     double distance = this.m_ScreenLine.GetDistance();
     double num2 = this.m_ScreenLine[this.m_ScreenLine.PointsCount - 1].Distance(endPoint);
     double num3 = distance + num2;
     num3 /= 1000.0;
     num2 /= 1000.0;
     num3 = Math.Round(num3, 3);
     num2 = Math.Round(num2, 3);
     return this.GetDistanceStr(num3, num2);
 }
예제 #20
0
 public void MouseDown(object sender, GeoOperatorMouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         this.m_SelectionPolygon.Points.Clear();
         this.m_GlassPanel.AddPolygonRegion(this.m_SelectionRegion, this.m_RectangleStyle);
         this.m_StartScreenPoint = e.Location;
         this.m_StartPlanePoint = this.m_Helper.ScreenToPlanet(e.Location);
         e.Handled = true;
     }
 }
예제 #21
0
파일: GeoXYLine.cs 프로젝트: xiaoyj/Space
        //modified this(list) to this(new List<GeoXYPoint>())
        public GeoXYLine(GeoXYPoint geoXYPointStart, GeoXYPoint geoXYPointEnd)
        {
            List<GeoXYPoint> list = new List<GeoXYPoint>();
            list.Add(geoXYPointStart);
            list.Add(geoXYPointEnd);

            //Added by wj 2010-11-10
            this.m_ID = -1;
            this.m_Points = list;
            this.m_ID = IDCreator.GetExclusiveID();           

        }
예제 #22
0
 public ZoomInRegionOperator(IApplicationContext appContext, GeoEventManager eventMgr, GeoMapMgr geoMapMgr)
 {
     this.m_Helper = ServiceHelper.Lookup<IGeoSelectionHelper>(appContext);
     this.m_Cursor = new Cursor(Huawei.UNet.Common.GlobalResource.GlobalResource.ZoomIn.GetHicon());
     this.m_EventMgr = eventMgr;
     this.m_GeoMapMgr = geoMapMgr;
     this.InitDrawingStyle();
     this.m_StartPlanePoint = new GeoXYPoint();
     this.m_SelectionPolygon = new GeoPolygon();
     this.m_SelectionRegion = new GeoPolygonRegion();
     this.m_SelectionRegion.AddGeoPolygon(this.m_SelectionPolygon);
 }
예제 #23
0
 public double CalculateRxPower(IACell cell, GeoXYPoint point, float linkloss)
 {
     GSMTRX isGSMCell = cell as GSMTRX;
     if (isGSMCell != null)
     {
         double m_TRXPower = ((GSMTRX)cell).MaxPower;
         return m_TRXPower - linkloss;
     }
     else
     {
         return double.NegativeInfinity;
     }
 }
예제 #24
0
 /// <summary>
 /// 生成Case计算时需要的数据类型
 /// </summary>
 /// <param name="polygon">计算区域</param>
 /// <param name="cell">当前小区</param>
 /// <param name="resolution">精度</param>
 /// <returns>构造的数据类型</returns>
 public TranceiverCalcInfo GenTranceiverCalcInfo(GeoPolygonRegion polygon, IACell cell, float resolution)
 {      
     double bottom, left, right, top;          
     GetPolygonParameters(polygon, resolution, out bottom, out left, out right, out top);
     GeoXYPoint pointLeftTop = new GeoXYPoint(left, top);
     GeoXYPoint pointRightBottom = new GeoXYPoint(right, bottom);
     GeoXYPoint pointCell = CreatPoint(cell.Parent);
     //Tranceiver tranceiver = CreatPoint(cell.Parent);
     //pointCell.X = tranceiver.X;
     //pointCell.Y = tranceiver.Y;
     TranceiverCalcInfo calcInfo = ConstructCalcInfo(cell, resolution, pointLeftTop, pointRightBottom, pointCell, cell.Parent);
     return calcInfo;
 }
예제 #25
0
파일: GeoXYLine.cs 프로젝트: xiaoyj/Space
 public void AddPoint(GeoXYPoint[] points)
 {
     if (points.GetLength(0) > 0)
     {
         foreach (GeoXYPoint point in points)
         {
             if (point != null)
             {
                 this.m_Points.Add(point);
             }
         }
     }
 }
예제 #26
0
 public bool TryGetPointInfo(GeoXYPoint point, out string info)
 {
     info = null;
     foreach (TDSimUser user in m_PreSimUsers)
     {
         if (user.X == point.X && user.Y == point.Y)
         {
             info = user.TrafficUser.Id.ToString();
             return true;
         }
     }
     return false;
 }
예제 #27
0
 public void TransformXYToBL(out GeoBLPoint latPoint, GeoXYPoint planePoint)
 {
     if (string.IsNullOrEmpty(this.m_CurrentProjection.ProjectionName) || string.IsNullOrEmpty(this.m_CurrentProjection.SpheroidName))
     {
         latPoint = null;
     }
     else
     {
         double num;
         double num2;
         this.m_CurrentProjection.TransformXYToBL(out num, out num2, planePoint.X, planePoint.Y);
         latPoint = new GeoBLPoint(num, num2);
     }
 }
예제 #28
0
 /// <summary>
 /// XY坐标转换为经纬度坐标
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="latitude"></param>
 /// <param name="longitude"></param>
 public void TransformXYToBL(double x, double y, out double latitude, out double longitude)
 {
     GeoXYPoint geoXYPoint = new GeoXYPoint(x, y);
     GeoBLPoint point2 = this.m_GeoProvider.TransformXYToBL(geoXYPoint);
     if (null == point2)
     {
         latitude = longitude = 0.0;
     }
     else
     {
         latitude = point2.B;
         longitude = point2.L;
     }
 }
예제 #29
0
        public void TryGetPointInfo_Test()
        {
            GeoXYPoint point = new GeoXYPoint();
            point.X = 0;
            point.Y = 0;
            string info;
            bool actual = m_VecData.TryGetPointInfo(point, out info);
            Assert.AreEqual(true, actual);

            point.X = 1;
            point.Y = 1;
            actual = m_VecData.TryGetPointInfo(point, out info);
            Assert.AreEqual(false, actual);
        }
예제 #30
0
 public string CalculateLinkBudget(IACell cell, GeoXYPoint receiverPoint, int distance, ReceptPw rPw)
 {
     string str = "    ";
     StringBuilder builder = new StringBuilder();
     //builder.AppendLine(string.Format("{0}:           {1}{2}", PointAnalyseResource.POINTANALYSE_CELLNAME, str, cell.Name));
     builder.AppendLine(string.Format("{0}:           {1}{2}", PointAnalyseResource.POINTANALYSE_CELLNAME, str, cell.Name));
     builder.AppendLine(string.Format("{0}:              {1}{2}", PointAnalyseResource.POINTANALYSE_RECEIVER_PONIT, str, this.FormatXY2String(receiverPoint)));
     builder.AppendLine(string.Format("{0}:              {1}{2}{3}", PointAnalyseResource.POINTANALYSE_DISTANCE, str, distance, PointAnalyseResource.POINTANALYSE_UNITS_METER));
     builder.AppendLine(string.Format("{0}:             {1}{2}{3}", PointAnalyseResource.POINTANALYSE_MAXPOWER, str, cell.MaxPower, PointAnalyseResource.POINTANALYSE_UNITS_DBM));
     builder.AppendLine(string.Format("{0}:             {1}{2}{3}", PointAnalyseResource.POINTANALYSE_PATHLOSS, str, FormatFloat(rPw.DlPathLoss), PointAnalyseResource.POINTANALYSE_UNITS_DB));
     builder.AppendLine(string.Format("{0}:  {1}{2}{3}", PointAnalyseResource.POINTANALYSE_SHADOWMARGIN, str, rPw.Shadowloss, PointAnalyseResource.POINTANALYSE_UNITS_DB ));
     builder.AppendLine(string.Format("{0}:      {1}{2}{3}", PointAnalyseResource.POINTANALYSE_PENETRATION, str, rPw.IndoorLoss, PointAnalyseResource.POINTANALYSE_UNITS_DB ));
     builder.AppendLine(string.Format("{0}:        {1}{2}{3}", PointAnalyseResource.POINTANALYSE_EQUIPMENTLOSS, str, rPw.MainAntDlTotalLoss, PointAnalyseResource.POINTANALYSE_UNITS_DB ));
     return builder.ToString();
 }