コード例 #1
0
        public int[] Weathers()
        {
            Rectangle[] c = { PointsAndRectangles.Weather1, PointsAndRectangles.Weather2, PointsAndRectangles.Weather3, PointsAndRectangles.Weather4, PointsAndRectangles.Weather5 };
            int         n;
            bool        flag;

            int[] c1 = new int[5];

            for (int i = 0; i < 5; i++)
            {
                flag = true;
                MasterOfPictures.BW2Capture(c[i], ("Weather" + (i + 1) + "\\test"));
                n = 0;
                for (int i1 = 1; i1 < 10; i1++)
                {
                    if (File.Exists(weatherDirectory + (i + 1) + "\\" + i1 + ".jpg"))
                    {
                        n = i1;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int i2 = 1; i2 < (n + 1); i2++)
                {
                    if (MasterOfPictures.VerifyBW(("Weather" + (i + 1) + "\\" + i2), ("Weather" + (i + 1) + "\\test"), 30))
                    {
                        c1[i] = i2;
                        File.Delete(weatherDirectory + (i + 1) + "\\test.jpg");
                        flag = false;
                        break;
                    }
                }

                if (flag == true)
                {
                    c1[i] = 0;
                    NotePad.DoLog("Добавляю новую погоду");
                    try
                    {
                        File.Move(weatherDirectory + (i + 1) + "\\test.jpg", weatherDirectory + (i + 1) + "\\" + (n + 1) + ".jpg");
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }

            return(c1);
        }
コード例 #2
0
        public bool MainFrameBW(Rectangle bounds, string name, int errors)
        {
            bool   x               = false;
            string testPicture     = "HeadPictures\\Test" + name;
            string originalPicture = "HeadPictures\\Original" + name;

            MasterOfPictures.BW2Capture(bounds, testPicture);
            if (MasterOfPictures.VerifyBW(testPicture, originalPicture, errors))
            {
                x = true;
            }
            return(x);
        }
コード例 #3
0
        public int[] Tracks()
        {
            int  n;
            bool flag;

            Rectangle[] a  = { PointsAndRectangles.Track1, PointsAndRectangles.Track2, PointsAndRectangles.Track3, PointsAndRectangles.Track4, PointsAndRectangles.Track5 };
            int[]       a1 = new int[5];

            for (int i = 0; i < 5; i++)
            {
                flag = true;
                MasterOfPictures.TrackCapture(a[i], ("Track" + (i + 1) + "\\test"));
                n = 0;
                for (int i1 = 1; i1 < 100; i1++)
                {
                    if (File.Exists(trackDirectory + (i + 1) + "\\" + i1 + ".jpg"))
                    {
                        n = i1;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int i2 = 1; i2 < (n + 1); i2++)
                {
                    if (MasterOfPictures.VerifyBW(("Track" + (i + 1) + "\\" + i2), ("Track" + (i + 1) + "\\test"), 120))
                    {
                        a1[i] = i2;
                        File.Delete(trackDirectory + (i + 1) + "\\test.jpg");
                        flag = false;
                        break;
                    }
                }

                if (flag == true)
                {
                    a1[i] = 0;
                    NotePad.DoLog("Добавляю новый трэк");
                    File.Move(trackDirectory + (i + 1) + "\\test.jpg", trackDirectory + (i + 1) + "\\" + (n + 1) + ".jpg");
                }
            }

            return(a1);
        }
コード例 #4
0
        public int[] Grounds()
        {
            Rectangle[] b = { PointsAndRectangles.Ground1, PointsAndRectangles.Ground2, PointsAndRectangles.Ground3, PointsAndRectangles.Ground4, PointsAndRectangles.Ground5 };
            int         n;
            bool        flag;

            int[] b1 = new int[5];
            for (int i = 0; i < 5; i++)
            {
                flag = true;
                MasterOfPictures.BW2Capture(b[i], ("Ground" + (i + 1) + "\\test"));
                n = 0;
                for (int i1 = 1; i1 < 100; i1++)
                {
                    if (File.Exists(groundDirectory + (i + 1) + "\\" + i1 + ".jpg"))
                    {
                        n = i1;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int i2 = 1; i2 < (n + 1); i2++)
                {
                    if (MasterOfPictures.VerifyBW(("Ground" + (i + 1) + "\\" + i2), ("Ground" + (i + 1) + "\\test"), 150))
                    {
                        b1[i] = i2;
                        File.Delete(groundDirectory + (i + 1) + "\\test.jpg");
                        flag = false;
                        break;
                    }
                }

                if (flag == true)
                {
                    b1[i] = 0;
                    NotePad.DoLog("Добавляю новое покрытие");
                    File.Move(groundDirectory + (i + 1) + "\\test.jpg", groundDirectory + (i + 1) + "\\" + (n + 1) + ".jpg");
                }
            }

            return(b1);
        }