Example #1
0
    private static int Home()
    {
        int status = 0;

        switch (homeflag)
        {
        case 0:

            Z1Home.StartHome();
            Z2Home.StartHome();
            Z3Home.StartHome();
            Z4Home.StartHome();
            Z5Home.StartHome();
            Z6Home.StartHome();
            sw.StartStopWatch(15000);
            homeflag = 1;
            break;

        case 1:
            //if (!sw.TimeUp()) break;
            if (Z1Home.homeFinish || Z2Home.homeFinish || Z3Home.homeFinish || Z4Home.homeFinish || Z5Home.homeFinish || Z6Home.homeFinish)
            {
                break;
            }
            Z1Home.StopHome();
            Z2Home.StopHome();
            Z3Home.StopHome();
            Z4Home.StopHome();
            Z5Home.StopHome();
            Z6Home.StopHome();
            homeflag = 2;
            break;

        case 2:
            for (int i = 0; i < 6; i++)
            {
                headcard.PfMove(i, 2999, 0, true);
            }

            status   = 1;
            homeflag = 0;
            break;
        }
        return(status);
    }
Example #2
0
        private void DoRTest()
        {
            MyStopWatch sw = new MyStopWatch();

            while (RTest_flag)
            {
                int pos1 = 6400 * 20 / 16;
                int time = int.Parse(Txt_RDelay.Text);
                switch (flag)
                {
                case 0:
                    headcard.PfMove(6, -(int)(pos1), int.Parse(Txt_RPf.Text), Chk_R1.Checked);
                    headcard.PfMove(7, -(int)(pos1), int.Parse(Txt_RPf.Text), Chk_R2.Checked);
                    if (Chk_R1.Checked || Chk_R2.Checked)
                    {
                        num1++;
                    }

                    sw.StartStopWatch(time);
                    flag = 1;
                    break;

                case 1:
                    if (sw.TimeUp())
                    {
                        SetRText("", num1);
                        headcard.PfMove(6, 0, int.Parse(Txt_RPf.Text), Chk_R1.Checked);
                        headcard.PfMove(7, 0, int.Parse(Txt_RPf.Text), Chk_R2.Checked);
                        if (Chk_R1.Checked || Chk_R2.Checked)
                        {
                            num1++;
                        }
                        sw.StartStopWatch(time);
                        flag = 3;
                    }
                    break;

                case 3:
                    if (sw.TimeUp())
                    {
                        SetRText("", num1);
                        Thread.Sleep(15);
                        flag = 0;
                    }
                    break;
                }
            }
        }