//Rectangle rectangle
 public TwoSidesPcb(PartOfPcb partP)
 {
     InitializeComponent();
     partOfPcb = partP;
 }
        double threshold = Convert.ToDouble(ConfigurationManager.AppSettings["MarkerThreshold"]);//0.7;

        public PcbDetails(Main m, PartOfPcb pPcb, TwoSidesPcb tPcb)
        {
            InitializeComponent();

            #region marker点检测区域老版本
            //backMarkerCheckArea.Add(new DRectangle(1031, 3298, 863, 475));
            //backMarkerCheckArea.Add(new DRectangle(2743, 3257, 781, 493));
            //backMarkerCheckArea.Add(new DRectangle(4417, 3245, 724, 502));
            //backMarkerCheckArea.Add(new DRectangle(6022, 3221, 811, 535));
            //backMarkerCheckArea.Add(new DRectangle(7649, 3224, 847, 511));
            //backMarkerCheckArea.Add(new DRectangle(9342, 3242, 823, 467));
            //backMarkerCheckArea.Add(new DRectangle(10981, 3217, 796, 511));
            //backMarkerCheckArea.Add(new DRectangle(12658, 3247, 769, 496));

            //frontMarkerCheckArea.Add(new DRectangle(1254, 3277, 983, 473));
            //frontMarkerCheckArea.Add(new DRectangle(2970, 3251, 887, 511));
            //frontMarkerCheckArea.Add(new DRectangle(4639, 3295, 861, 477));
            //frontMarkerCheckArea.Add(new DRectangle(6287, 3307, 858, 507));
            //frontMarkerCheckArea.Add(new DRectangle(7867, 3319, 995, 517));
            //frontMarkerCheckArea.Add(new DRectangle(9573, 3355, 923, 517));
            //frontMarkerCheckArea.Add(new DRectangle(11215, 3375, 881, 523));
            //frontMarkerCheckArea.Add(new DRectangle(12907, 3403, 869, 521));
            #endregion

            #region marker点检测区域
            backMarkerCheckArea.Add(new DRectangle(766, 151, 401, 187));
            backMarkerCheckArea.Add(new DRectangle(1558, 135, 473, 217));
            backMarkerCheckArea.Add(new DRectangle(2396, 129, 433, 217));
            backMarkerCheckArea.Add(new DRectangle(3200, 121, 449, 211));
            backMarkerCheckArea.Add(new DRectangle(4042, 117, 441, 209));
            backMarkerCheckArea.Add(new DRectangle(4878, 117, 419, 201));
            backMarkerCheckArea.Add(new DRectangle(5680, 113, 449, 201));
            backMarkerCheckArea.Add(new DRectangle(6502, 131, 451, 193));


            frontMarkerCheckArea.Add(new DRectangle(466, 34, 454, 223));
            frontMarkerCheckArea.Add(new DRectangle(1327, 37, 454, 229));
            frontMarkerCheckArea.Add(new DRectangle(2169, 45, 367, 253));
            frontMarkerCheckArea.Add(new DRectangle(2946, 68, 445, 237));
            frontMarkerCheckArea.Add(new DRectangle(3763, 67, 449, 243));
            frontMarkerCheckArea.Add(new DRectangle(4636, 87, 372, 241));
            frontMarkerCheckArea.Add(new DRectangle(5409, 90, 475, 249));
            frontMarkerCheckArea.Add(new DRectangle(6259, 111, 428, 237));
            #endregion

            #region Rtree marker点检测区域,反馈对应的板子区域
            //backTree.Add(new RRectangle(1031, 3298, 1031 + 863, 3298 + 475, 0, 0), new DRectangle(new DPoint(724, 594), new Size(1453, 2664)));
            //backTree.Add(new RRectangle(2743, 3257, 2743 + 781, 3257 + 493, 0, 0), new DRectangle(new DPoint(2389, 585), new Size(1435, 2706)));
            //backTree.Add(new RRectangle(4417, 3245, 4417 + 724, 3245 + 502, 0, 0), new DRectangle(new DPoint(4084, 600), new Size(1402, 2691)));
            //backTree.Add(new RRectangle(6022, 3221, 6022 + 811, 3221 + 535, 0, 0), new DRectangle(new DPoint(5737, 600), new Size(1399, 2654)));
            //backTree.Add(new RRectangle(7649, 3224, 7649 + 847, 3224 + 511, 0, 0), new DRectangle(new DPoint(7364, 568), new Size(1411, 2660)));
            //backTree.Add(new RRectangle(9342, 3242, 9342 + 823, 3242 + 467, 0, 0), new DRectangle(new DPoint(9042, 598), new Size(1359, 2618)));
            //backTree.Add(new RRectangle(10981, 3217, 10981 + 796, 3217 + 511, 0, 0), new DRectangle(new DPoint(10681, 576), new Size(1414, 2675)));
            //backTree.Add(new RRectangle(12658, 3247, 12658 + 769, 3247 + 496, 0, 0), new DRectangle(new DPoint(12358, 570), new Size(1348, 2660)));

            //frontTree.Add(new RRectangle(1254, 3277, 1254 + 983, 3277 + 473, 0, 0), new DRectangle(new DPoint(1096, 592), new Size(1381, 2661)));
            //frontTree.Add(new RRectangle(2970, 3251, 2970 + 887, 3251 + 511, 0, 0), new DRectangle(new DPoint(2734, 607), new Size(1354, 2691)));
            //frontTree.Add(new RRectangle(4639, 3295, 4639 + 861, 3295 + 477, 0, 0), new DRectangle(new DPoint(4387, 643), new Size(1369, 2682)));
            //frontTree.Add(new RRectangle(6287, 3307, 6287 + 858, 3307 + 507, 0, 0), new DRectangle(new DPoint(6022, 703), new Size(1333, 2651)));
            //frontTree.Add(new RRectangle(7867, 3319, 7867 + 995, 3319 + 517, 0, 0), new DRectangle(new DPoint(7668, 718), new Size(1363, 2624)));
            //frontTree.Add(new RRectangle(9573, 3355, 9573 + 923, 3355 + 517, 0, 0), new DRectangle(new DPoint(9324, 706), new Size(1363, 2666)));
            //frontTree.Add(new RRectangle(11215, 3375, 11215 + 881, 3375 + 523, 0, 0), new DRectangle(new DPoint(10995, 775), new Size(1366, 2633)));
            //frontTree.Add(new RRectangle(12907, 3403, 12907 + 869, 3403 + 521, 0, 0), new DRectangle(new DPoint(12630, 748), new Size(1372, 2678)));
            #endregion

            partOfPcb   = pPcb;
            twoSidesPcb = tPcb;
            main        = m;

            this.lvListFront.SelectedIndexChanged += new System.EventHandler(this.lvList_SelectedIndexChanged);
            this.lvListBack.SelectedIndexChanged  += new System.EventHandler(this.lvList_SelectedIndexChanged);

            #region 序列化字符串

            ////List<long> aaaa = new List<long>();
            ////for (int i = 0; i < 1000; i++)
            ////{
            ////    aaaa.Add(snowflake.nextId());
            ////}

            //Snowflake snowflake = new Snowflake(1);
            //List<Result> lst = new List<Result>();
            //Result result = new Result();
            //result.Id = snowflake.nextId();
            //result.Region = "fuckckckckc";
            ////result.PcbId = 1;
            //lst.Add(result);
            //result = new Result();
            //result.Id = snowflake.nextId();
            //result.Region = "我奥数的撒娇";
            ////result.PcbId = 1;
            //lst.Add(result);
            //result = new Result();
            //result.Id = snowflake.nextId();
            ////result.PcbId = 1;
            //result.Region = "空空空空";
            //lst.Add(result);
            ////省略赋值

            //JsonData<Pcb> obj = new JsonData<Pcb>();
            //obj.data = new Pcb() { results = lst };

            ////序列化为json
            //string json = JsonConvert.SerializeObject(obj, new JsonSerializerSettings() { /*NullValueHandling = NullValueHandling.Ignore*/ });

            ////反序列化
            //JsonData<Pcb> lst2 = JsonConvert.DeserializeObject<JsonData<Pcb>>(json, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
            #endregion
        }