Exemplo n.º 1
0
        public TextTargetView(Target target, TextDisplayer displayer, Point2F drawPoint) : base(target)
        {
            _displayer   = displayer;
            leftTop      = drawPoint;
            _columnWidth = displayer.ColumnWidth;
            _rects       = CalculateRects();
            activeRect   = CalculateActiveRect();
            _texts       = new List <string>();
            TargetTrack track = (TargetTrack)target;

            _texts.Add(track.TrackId.ToString());
            _texts.Add(track.Az.ToString("0.0"));
            _texts.Add(track.El.ToString("0.0"));
            _texts.Add(track.Dis.ToString("0.0"));
            _texts.Add(track.Speed.ToString("0.0"));

            _borderBrush = displayer.Canvas.CreateSolidColorBrush(new ColorF(1, 1, 1));
            DWriteFactory dw = DWriteFactory.CreateFactory();

            _inactiveTextFormat = dw.CreateTextFormat("宋体", 20);
            _inactiveTextFormat.TextAlignment = TextAlignment.Center;
            _inactiveBrush = displayer.Canvas.CreateSolidColorBrush(new ColorF(0, 1, 1));

            _activeBrush = displayer.Canvas.CreateSolidColorBrush(new ColorF(0, 0, 1));
        }
Exemplo n.º 2
0
        //public override void Corelate(Sector center, Sector left, Sector right)
        //{
        //    foreach(TargetDot oldDot in center.OldDots)
        //    {
        //        if (CorelateDot(oldDot, center)) continue;
        //        if (CorelateDot(oldDot, right)) continue;
        //        CorelateDot(oldDot, left);
        //    }

        //    NotifyDeleteSectorTrack(center);
        //}

        private bool CorelateDot(TargetDot oldDot, Sector center)
        {
            bool ret = false;

            foreach (TargetDot newDot in center.NewDots)
            {
                if (newDot.Adopted) //已经被航迹相关
                {
                    continue;
                }
                float distance = oldDot.DistanceTo(newDot);

                if (distance < threshold)
                {
                    TargetTrack track = TargetTrack.CreateTargetTrack(newDot, oldDot, 3);
                    if (track == null)   //创建航迹失败
                    {
                        continue;
                    }

                    //newDot.Adopted = true;
                    oldDot.Adopted = true;
                    center.AddTrack(track);
                    ret = true;
                    break;  //相关成功,返回上层循环
                }
            }

            return(ret);
        }
Exemplo n.º 3
0
        public CoordinateTargetTrackView(Target target, RenderTarget rt, D2DFactory factory, CoordinateSystem cs)
            : base(target, rt, factory, cs)
        {
            drawer       = CreateDrawer();
            PreLocations = new List <Ellipse>();
            TargetTrack t = (TargetTrack)target;

            foreach (PolarCoordinate c in t.Locations)
            {
                Point2F p;
                p = CoordinateSystem.CoordinateToPoint(c);
                Ellipse e = new Ellipse(p, preLocationRadius, preLocationRadius);
                PreLocations.Add(e);
            }
            targetViewRadius = 4;
        }
 private void RendVideoScreen(bool condition, TargetTrack target)
 {
     target.EnableComponents(condition);
     if (condition)
     {
         _trackedVideoPlayer = target.GetComponentInChildren <VideoPlayer>();
         FullScreenPlayer.transform.GetChild(0).GetComponent <RawImage>().texture = _trackedVideoPlayer.targetTexture;
         _trackedVideoPlayer.loopPointReached += EndPlayer;
         _trackedVideoPlayer.prepareCompleted += EndLoadingAnimation;
         ShowPlayerButtons(true);
     }
     else
     {
         if (_videoTargetContainer.Count == 0 && !_isInFullScreenMod)
         {
             ShowPlayerButtons(false);
         }
     }
 }
Exemplo n.º 5
0
        protected override void LoadTargetViews(List <Target> tracks)
        {
            if (tracks == null)
            {
                return;
            }

            lock (_locker)
            {
                foreach (List <TargetTrack> targetTrack in targetTracks)
                {
                    targetTrack.Clear();
                }

                foreach (Target target in tracks)
                {
                    TargetTrack track = (TargetTrack)target;
                    targetTracks[track.TrackId].Add(track);
                }
            }
        }
Exemplo n.º 6
0
 internal static void UnregisterTrackObserver(TargetTrack track) => CreateTrackObserver().UnregisterTrack(track);