// 处理实时数据
        public void DealRealData(Model.RealData data)
        {
            var   position = new MapLngLat(data.Longitude, data.Latitude, data.Altitude);
            Plane plane    = CreateStateModel(data, position);

            trackMgr.AddTrackPoint(plane.Name, data.TargetType, position);

            if (!planeMgr.HasModel(plane))
            {
                if (CreatePlane(plane))
                {
                    planeMgr.AddModel(plane);
                }
            }
            else
            {
                planeMgr.UpdataModel(plane);
                UpdatePlanePosition(plane);

                if (trackMgr.IsShowTrack(plane.Name))
                {
                    UpdateTrackPoint(plane);
                }
            }

            // 目标跟踪
            if (trackPicture != null)
            {
                MapLngLat pos = trackPicture.GetLngLat();
                mapLogic.GetToolBox().ZoomToPosition(pos);
                EventPublisher.PublishJumpToGlobeViewEvent(this, new Model.JumpToGlobeViewEventArgs(trackPicture.ElementName, pos));
            }
        }
Beispiel #2
0
        // 处理实时态势数据
        private void DealRealData(RealData data)
        {
            var    point      = new MapLngLat(data.Longitude, data.Latitude, data.Altitude);
            string name       = data.TargetNum.ToString();
            bool   isHaveDraw = elementMgr.IsHaveElement(name);

            trackMgr.AddTrackPoint(name, data.TargetType, point);           // 不管目标是否存在,都要添加航迹

            if (isHaveDraw == false)
            {
                if (AddElement(data))
                {
                    trackMgr.AddShowTrackModel(name, data.TargetType);   // ceshi................
                }
            }
            else
            {
                elementMgr.UpdateElementPosition(name, point);
                UpdateElement(data);
            }
        }