Example #1
0
        private void Play(ProcessFrameResult result)
        {
            if (BidaSiusSettings.IgnoreWhiteShots && result.Shot != null && result.Shot.Value < 7)
            {
                return;
            }


            switch ((string)comboGame.SelectedItem)
            {
            case "naked":
                PlayNaked(result);
                break;

            case "normal":
                PlayNormal(result);
                break;

            case "TenSeries":
                PlayTenSeries(result);
                break;

            case "Final":
                PlayFinal(result);
                break;
            }
        }
Example #2
0
        private void PlayNormal(ProcessFrameResult result)
        {
            if (MainF == null)
            {
                MainF = new MainForm(BidaSiusSettings);
                //  MainF.Parent = this;
            }

            MainForm mf = (MainForm)MainF;

            if (mf.IsDisposed)
            {
                CaptureButtonClick(null, null);
                return;
            }

            if (!mf.Visible)
            {
                mf.Show();
            }

            if (mf != null && result.Shot != null)
            {
                var lastshot = mf.Shots.LastOrDefault();
                alreadyManual                = false;
                useManualShotPositiong       = false;
                buttonPauseAndSelect.Enabled = true;
                if (lastshot != null && (result.Shot.Time - lastshot.Time) < (TimeSpan.TicksPerSecond * 4))
                {
                    return;
                }
                mf.Shots.Add(result.Shot);


                var ticks = DateTime.Now.Ticks.ToString();
                result.Shot.TargetScanWithResultFileName = ticks + ".jpg";
                result.Shot.WarpedFileName = ticks + "_oryg.jpg";
                result.TargetScanWithResult?.Save(BidaSiusSettings.ImagesFolderPath + result.Shot.TargetScanWithResultFileName);
                result.Warped?.Save(BidaSiusSettings.ImagesFolderPath + result.Shot.WarpedFileName);

                ScrollPaper();
                mf.RefreshTarget();

                if (result.TargetScanWithResult != null)
                {
                    using (Mat mm = result.TargetScanWithResult.Clone())
                    {
                        nw.setImage(mm.Bitmap);
                    }
                }
            }
        }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            ProcessFrameResult result = new ProcessFrameResult();

            result.Shot = new Shot {
                No = 1, Value = 9.9, Time = DateTime.Now.Ticks, PointFromCenter = new Point {
                    X = 5, Y = 5
                }
            };


            Play(result);
        }
Example #4
0
        // public bool Ustawienia { get; set; }

        private void UstawRezultat(ProcessFrameResult result)
        {
            // InvokeRequired required compares the thread ID of the
            // calling thread to the thread ID of the creating thread.
            // If these threads are different, it returns true.
            if (this.label10.InvokeRequired)
            {
                SkonczonyPrzepierdalanie d = new SkonczonyPrzepierdalanie(UstawRezultat);
                this.Invoke(d, new object[] { result });
            }
            else
            {
                if (captureRectFlag)
                {
                    FillSettingsToGui(result.Target);
                }
                switch (CurrentState)
                {
                case BidaSiusState.Start:
                    break;

                case BidaSiusState.SetTargetBoundries:
                    using (Mat mm = result.TargetMarked.Clone())
                    {
                        nw.setImage(mm.Bitmap);
                    }
                    break;

                case BidaSiusState.SetTargetSizeNPosition:

                    using (result.Warped)
                    {
                        using (Mat mm1 = result.Warped.Clone())
                        {
                            nw.setImage(mm1.Bitmap);
                        }
                    }
                    break;

                case BidaSiusState.Play:
                    Play(result);


                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
Example #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            //NakedPic nn = new NakedPic();
            //nn.Show();
            // ((NakedPic)NakedF).HideOneTile();

            ProcessFrameResult result = new ProcessFrameResult();

            result.Shot = new Shot {
                No = 1, Value = 10.9, Time = DateTime.Now.Ticks, PointFromCenter = new Point {
                    X = 5, Y = 5
                }
            };


            Play(result);
        }
Example #6
0
        private void PlayFinal(ProcessFrameResult result)
        {
            if (FinalForm == null)
            {
                FinalForm = new Final(BidaSiusSettings);
            }
            Final ff = (Final)FinalForm;

            if (!ff.IsAccessible)
            {
                ff.Show();
            }

            if (ff != null && result.Shot != null)
            {
                var lastshot = ff.Shots.LastOrDefault();
                alreadyManual                = false;
                useManualShotPositiong       = false;
                buttonPauseAndSelect.Enabled = true;
                if (lastshot != null && (result.Shot.Time - lastshot.Time) < (TimeSpan.TicksPerSecond * 4))
                {
                    return;
                }
                ff.Shots.Add(result.Shot);


                var ticks = DateTime.Now.Ticks.ToString();
                //result.Shot.TargetScanWithResultFileName = ticks + ".jpg";
                //result.Shot.WarpedFileName = ticks + "_oryg.jpg";
                //result.TargetScanWithResult?.Save(BidaSiusSettings.ImagesFolderPath + result.Shot.TargetScanWithResultFileName);
                //result.Warped?.Save(BidaSiusSettings.ImagesFolderPath + result.Shot.WarpedFileName);

                ScrollPaper();
                ff.RefreshTarget();

                if (result.TargetScanWithResult != null)
                {
                    using (Mat mm = result.TargetScanWithResult.Clone())
                    {
                        nw.setImage(mm.Bitmap);
                    }
                }
            }
        }
Example #7
0
        private void PlayNaked(ProcessFrameResult result)
        {
            if (result.TargetScanWithResult != null)
            {
                using (Mat mm = result.TargetScanWithResult.Clone())
                {
                    nw.setImage(mm.Bitmap);
                }
            }

            if (result.Shot != null)
            {
                if (NakedF == null)
                {
                    NakedF = new NakedPic();
                }

                NakedPic np = (NakedPic)NakedF;
                if (!NakedF.IsAccessible)
                {
                    NakedF.Show();
                }

                var lastshot = np.Shots.LastOrDefault();
                alreadyManual                = false;
                useManualShotPositiong       = false;
                buttonPauseAndSelect.Enabled = true;
                if (lastshot != null && (result.Shot.Time - lastshot.Time) < (TimeSpan.TicksPerSecond * 4))
                {
                    return;
                }
                np.Shots.Add(result.Shot);
                ScrollPaper();
                if (result.Shot.Value > 8.1)
                {
                    ((NakedPic)NakedF).HideOneTile();
                }
                else
                {
                    ((NakedPic)NakedF).Missed();
                }
            }
        }
Example #8
0
        private void PlayTenSeries(ProcessFrameResult result)
        {
            if (result.Shot == null)
            {
                return;
            }

            alreadyManual                = false;
            useManualShotPositiong       = false;
            buttonPauseAndSelect.Enabled = true;

            PlayTenSeries np = (PlayTenSeries)TenSeriesF;

            if (!TenSeriesF.IsAccessible)
            {
                TenSeriesF.Show();
            }

            var lastshot = np.Shots.LastOrDefault();

            if (lastshot != null && (result.Shot.Time - lastshot.Time) < (TimeSpan.TicksPerSecond * 4))
            {
                return;
            }
            ScrollPaper();
            np.Shots.Add(result.Shot);

            np.pach();



            if (result.TargetScanWithResult != null)
            {
                using (Mat mm = result.TargetScanWithResult.Clone())
                {
                    nw.setImage(mm.Bitmap);
                }
            }
        }