//overviewdisplayer显示器的控制模式切换到波门模式,需要读取targetmannager当前的模式决定切换到自动波门还是半自动波门
        public void SwitchToWaveGateState()
        {
            ITargetDataProvider provider = TargetManagerFactory.CreateTargetDataProvider();
            TargetManagerMode   mode     = provider.GetMode();

            switch (mode)
            {
            case TargetManagerMode.Auto:
                SwitchToAutoWaveGateState();
                break;

            case TargetManagerMode.SemiAuto:
                SwitchToSemiAutoWaveGateSate();
                break;

            case TargetManagerMode.Manual:
                break;

            case TargetManagerMode.Intelligent:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        protected TargetViewManager(TrackDisplayer displayer)
        {
            this.displayer = displayer;

            //获取航迹管理器
            targetProvider = TargetManagerFactory.CreateTargetDataProvider();
            targetProvider.RegisterObserver(this);

            InitializeTargetArray();    //初始化dots和tracks
        }
Esempio n. 3
0
        protected TrackDisplayer(Control holder)
        {
            holder.Controls.Clear();
            DisplayControl = holder;

            timer = new Timer {
                Interval = 30
            };
            timer.Tick += Timer_Tick;
            timer.Start();

            //TrackManager_TestCase_Random该类用于测试绘图程序
            dataProvider = TargetManagerFactory.CreateTargetDataProvider();
        }
Esempio n. 4
0
        public DataGridViewTargetViewManager(DataGridViewDisplayer displayer) : base(displayer)
        {
            _tracks = new List <TargetTrack> [TargetManagerFactory.CreateTargetDataProvider().GetSectorCount()];

            //views = new DataGridViewTargetView[TrackMaximum];   //最大200个航迹

            //for (int i = 0; i < TrackMaximum; i++)
            //{
            //    views[i] = new DataGridViewTargetView(null, displayer, i + 1) {Target = null};
            //    //赋值null,可以隐藏该行
            //    views[i].DisplayTarget();       //向displayer.dgv添加行
            //    views[i].Selected = false;      //默认未被选中
            //}

            LoadTargetViews(targetProvider.GetTargetTracks());
        }
Esempio n. 5
0
        public DataGridViewDisplayer(Control c) : base(c)
        {
            tracks = new List <TargetTrack> [TargetManagerFactory.CreateTargetDataProvider().GetSectorCount()];

            for (int i = 0; i < tracks.Length; i++)
            {
                tracks[i] = new List <TargetTrack>();
            }

            Dgv = new DataGridView();

            SetDataGridViewFormat(Dgv); //设置格式

            c.Controls.Clear();
            c.Controls.Add(Dgv);

            timer.Enabled = false;

            targetsManager = new DataGridViewTargetViewManager(this);

            SetColors();
        }
Esempio n. 6
0
        private static int GetSectorCount()
        {
            ITargetDataProvider provider = TargetManagerFactory.CreateTargetDataProvider();

            return(provider.GetSectorCount());
        }