Пример #1
0
        public override void run(double dt)
        {
            bool resultz = true;
            bool resultx = true;
            bool resulty = true;

            sumdt += dt;
            if (sumdt >= time || istimeout)
            {
                istimeout = true;
                isfinish  = true;
                return;
            }
            var device = new ActionDevice(node);
            var inject = (InjectorDevice)node;

            switch (step)
            {
            case 0:
                //是否已有吸头
                //针头数据检测(针头序号+装针个数不能大于通道个数)
                int inject_count = inject.GetSeleteced().Count();
                if (head_index + tipdata.count <= inject_count)
                {
                    step++;
                }
                else
                {
                    istimeout = true;
                    isfinish  = true;
                }
                break;

            case 1:
                resultx = device.MoveX(tipdata.x);
                resulty = device.MoveY(tipdata.y);
                if (resultx && resulty)
                {
                    step++;
                }
                break;

            case 2:
                if (xdone == false)
                {
                    xdone = device.DoneX();
                }
                if (ydone == false)
                {
                    ydone = device.DoneY();
                }
                if (xdone && ydone)
                {
                    step = 7;
                }
                break;

            case 3:
                int[] z_tem = { -1, -1, -1, -1 };
                for (int i = head_index; i < tipdata.count; i++)
                {
                    z_tem[i] = z;
                }
                resultz = device.MoveInjectZ(z_tem, true);
                if (resultz)
                {
                    step++;
                }
                break;

            case 4:
                for (int i = head_index; i < tipdata.count; i++)
                {
                    if (zdone[i] == false)
                    {
                        xdone = device.DoneInjectZ(i);
                    }
                }
                if (zdone[0] && zdone[1] && zdone[2] && zdone[3])
                {
                    step++;
                }
                break;

            case 5:
                resultz = device.MoveZ(0, true);
                if (resultz)
                {
                    step++;
                }
                break;

            case 6:
                if (device.DoneZ())
                {
                    step++;
                }
                break;

            case 7:
                isfinish = true;
                break;
            }
        }
Пример #2
0
        public override void run(double dt)
        {
            bool resultz = true;

            sumdt += dt;
            if (sumdt >= time || istimeout)
            {
                istimeout = true;
                isfinish  = true;
                return;
            }
            var device = new ActionDevice(node);
            var inject = (InjectorDevice)node;

            switch (step)
            {
            case 0:
                //是否已有吸头
                //针头数据检测(针头序号+装针个数不能大于通道个数)
                int inject_count = inject.GetSeleteced().Count();
                if (head_index + tipdata.count <= inject_count)
                {
                    step++;
                }
                else
                {
                    istimeout = true;
                    isfinish  = true;
                }
                break;

            case 1:
                act_movexy.run(dt);
                if (act_movexy.getIsFinish())
                {
                    step++;
                }
                break;

            case 2:
                int[] z_tem = { -1, -1, -1, -1 };
                for (int i = head_index; i < tipdata.count; i++)
                {
                    z_tem[i] = z;
                }
                resultz = device.MoveInjectZ(z_tem, true);
                if (resultz)
                {
                    step++;
                }
                break;

            case 3:
                for (int i = head_index; i < tipdata.count; i++)
                {
                    if (zdone[i] == false)
                    {
                        zdone[i] = device.DoneInjectZ(i);
                    }
                }
                if (zdone[0] && zdone[1] && zdone[2] && zdone[3])
                {
                    step++;
                }
                break;

            case 4:
                act_movezb.run(dt);
                if (act_movezb.getIsFinish())
                {
                    step++;
                }
                break;

            case 5:
                isfinish = true;
                break;
            }
        }