Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();
            TestCode();

            /*var a = yimaEncCtrl.YimaEnc.GetGeoCoorMultiFactor();
             * Target t, t2, t3, t4;
             * int aisID = 0, mergeID = 0, radarID = 0, fileID = 1;
             * string filename = "target{0}.txt";
             * TargetType[] typeList = new TargetType[] { TargetType.WorkBoat, TargetType.WorkBoat,
             * TargetType.Unknow, TargetType.MerChantBoat, TargetType.MerChantBoat, TargetType.Yacht,
             * TargetType.FishingBoat, TargetType.FishingBoat, TargetType.VietnamFishingBoat};
             * for (int i =0; i < 9; i++)
             * {
             *  t = new Target(aisID++, 0, 0);
             *  t.Source = TargetSource.AIS;
             *  t.Type = typeList[i];
             *  yimaEncCtrl.AISTargetDic.Add(t.ID, t);
             *  t2 = new Target(mergeID++, 0, 0);
             *  t2.Source = TargetSource.Merge;
             *  t2.Type = typeList[i];
             *  yimaEncCtrl.MergeTargetDic.Add(t2.ID, t2);
             *  t3 = new Target(radarID++, 0, 0);
             *  t3.Source = TargetSource.Radar;
             *  t3.Type = typeList[i];
             *  yimaEncCtrl.RadarTargetDic.Add(t3.ID, t3);
             *  t4 = new Target(radarID++, 0, 0);
             *  t4.Source = TargetSource.Radar;
             *  t4.Type = typeList[i];
             *  yimaEncCtrl.RadarTargetDic.Add(t4.ID, t4);
             *  dataSimulationList.Add(new MultDataSimluation(t, t2, t3, t4, string.Format(filename, fileID++), a, true));
             * }
             * /*t = new Target(aisID++, 0, 0);
             * t.Source = TargetSource.AIS;
             * t.Type = TargetType.WorkBoat;
             * yimaEncCtrl.AISTargetDic.Add(t.ID, t);
             * t2 = new Target(mergeID++, 0, 0);
             * t2.Source = TargetSource.Merge;
             * t2.Type = TargetType.WorkBoat;
             * yimaEncCtrl.MergeTargetDic.Add(t2.ID, t2);
             * t3 = new Target(radarID++, 0, 0);
             * t3.Source = TargetSource.Radar;
             * t3.Type = TargetType.WorkBoat;
             * yimaEncCtrl.RadarTargetDic.Add(t3.ID, t3);
             * t4 = new Target(radarID++, 0, 0);
             * t4.Source = TargetSource.Radar;
             * t4.Type = TargetType.WorkBoat;
             * yimaEncCtrl.RadarTargetDic.Add(t4.ID, t4);
             * dataSimulationList.Add(new MultDataSimluation(t, t2, t3, t4, "target1.txt", a, true));*/

            /*//4个渔船
             * var t5 = new Target(3, 10, 13);
             * t5.Source = TargetSource.AIS;
             * t5.Type = TargetType.MerChantBoat;
             * //t5.Track.Add(new GeoPoint(1077099500, 204688160));
             * yimaEncCtrl.AISTargetDic.Add(t5.ID, t5);
             * //dataSimluation3 = new DataSimluation(t5, t5, "target3.txt", a);
             * t5 = new Target(4, 30, 10);
             * t5.Source = TargetSource.AIS;
             * t5.Type = TargetType.MerChantBoat;
             * //t5.Track.Add(new GeoPoint(1070598330, 201956860));
             * yimaEncCtrl.AISTargetDic.Add(t5.ID, t5);
             * //dataSimluation4 = new DataSimluation(t5, t5, "target4.txt", a);
             * t5 = new Target(5, 90, 10);
             * t5.Source = TargetSource.AIS;
             * t5.Type = TargetType.Yacht;
             * //t5.Track.Add(new TrackPoint(new GeoPoint(1084959660, 195031930)));
             * yimaEncCtrl.AISTargetDic.Add(t5.ID, t5);
             * //dataSimluation5 = new DataSimluation(t5, t5, "target5.txt", a);
             * t5 = new Target(6, 10, 10);
             * t5.Source = TargetSource.AIS;
             * t5.Type = TargetType.FishingBoat;
             * //t5.Track.Add(new TrackPoint(new GeoPoint(1088672300, 198088120)));
             * yimaEncCtrl.AISTargetDic.Add(t5.ID, t5);
             * //dataSimluation6 = new DataSimluation(t5, t5, "target6.txt", a);
             * //商船
             * t5 = new Target(7, 50, 10);
             * t5.Source = TargetSource.Merge;
             * t5.Type = TargetType.MerChantBoat;
             * t5.Track.Add(new TrackPoint(new GeoPoint(1067007760, 183531030)));
             * yimaEncCtrl.MergeTargetDic.Add(t5.ID, t5);
             * //可疑目标
             * t5 = new Target(8, 180, 10);
             * t5.Source = TargetSource.Radar;
             * t5.Type = TargetType.Unknow;
             * t5.Track.Add(new TrackPoint(new GeoPoint(1086115210, 182400920)));
             * yimaEncCtrl.RadarTargetDic.Add(t5.ID, t5);
             * t5 = new Target(9, 50, 10);
             * t5.Source = TargetSource.Radar;
             * t5.Type = TargetType.Unknow;
             * t5.Track.Add(new TrackPoint(new GeoPoint(1086625510, 182381150)));
             * yimaEncCtrl.RadarTargetDic.Add(t5.ID, t5);
             * //
             * //游艇
             * t5 = new Target(10, 100, 10);
             * t5.Source = TargetSource.Radar;
             * t5.Type = TargetType.Yacht;
             * t5.Track.Add(new TrackPoint(new GeoPoint(1078781670, 175257410)));
             * yimaEncCtrl.RadarTargetDic.Add(t5.ID, t5);*/


            /*var z = new ProtectZone(new GeoPoint(1122886720, 182840461), 500, Color.Red);
             * //yimaEncCtrl.ProtectZoneList.Add(z);
             * z = new ProtectZone(new GeoPoint(1122886720, 182840461), 1000, Color.Blue);
             * //yimaEncCtrl.ProtectZoneList.Add(z);
             * z = new ProtectZone(new GeoPoint(1122886720, 182840461), 10000, Color.Orange);
             * yimaEncCtrl.ProtectZoneList.Add(z);
             * z = new ProtectZone(new GeoPoint(1122886720, 182840461), 20000, Color.YellowGreen);
             * yimaEncCtrl.ProtectZoneList.Add(z);*/
            yimaEncCtrl.AddProtectZone(null, 500, Color.Red, "1");
            yimaEncCtrl.AddProtectZone(null, 1000, Color.Blue, "2");
            yimaEncCtrl.AddProtectZone(null, 10000, Color.Orange, "3");
            yimaEncCtrl.AddProtectZone(null, 20000, Color.YellowGreen, "4");
            ForbiddenZone fz = new ForbiddenZone();

            fz.PointList.Add(new GeoPoint(1079536200, 189854000));
            fz.PointList.Add(new GeoPoint(1079068250, 189285000));
            fz.PointList.Add(new GeoPoint(1079068250, 188523000));
            fz.PointList.Add(new GeoPoint(1080074240, 188523000));
            fz.PointList.Add(new GeoPoint(1080074240, 189285000));
            //yimaEncCtrl.ForbiddenZoneList.Add(fz);
            fz.Name = "123";
            var ret = yimaEncCtrl.AddForbiddenZone(fz);

            //管道
            Pipeline p = new Pipeline();

            p.PointList.Add(new GeoPoint(1072580759, 189722608));
            p.PointList.Add(new GeoPoint(1073537840, 189916000));
            p.PointList.Add(new GeoPoint(1074358100, 189261630));
            p.PointList.Add(new GeoPoint(1074519520, 189272200));
            p.Name  = "123";
            p.width = 20;
            yimaEncCtrl.AddPipeline(p);


            updateTargetTimer.AutoReset = true;
            updateTargetTimer.Elapsed  += UpdateTargetTimer_Elapsed;
            //updateTargetTimer.Enabled = true;
            yimaEncCtrl.TargetSelect       += YimaEncCtrl_TargetSelect;
            yimaEncCtrl.AddedForbiddenZone += YimaEncCtrl_AddedForbiddenZone;
            //yimaEncCtrl.ShowTargetTrack(t2);
        }
Esempio n. 2
0
 public void CreateForbiddenZone(ForbiddenZone incoming)
 {
     ForbiddenZones.Add(new ForbiddenZone(incoming));
 }
Esempio n. 3
0
 private void YimaEncCtrl_AddedForbiddenZone(ForbiddenZone f)
 {
     f.Name = "test";
     //send
 }