Пример #1
0
        /// <summary>
        /// 移动Z
        /// </summary>
        /// <param name="param"></param>
        public void MoveZ(MoveParam param)
        {
            if (!param.MoveZ)
            {
                this.CurState = State.MoveZFinished;
                return;
            }

            bool zReach = true;

            for (int nz = 0; nz < param.NzUsed.Length; ++nz)
            {
                if (param.NzUsed[nz])
                {
                    if (!entiy.MachineAxis.Z[nz].AxisReach(param.ZPos[nz]))
                    {
                        zReach = false;
                        entiy.ZGoPos((Nozzle)nz, param.ZPos[nz], entiy.MachineConfig.AutoSpeedMode);
                    }
                }
            }

            if (zReach)
            {
                this.CurState = State.MoveZFinished;
            }
            else
            {
                Thread.Sleep(5);
            }
        }
Пример #2
0
        /// <summary>
        /// 移动结束后拍照
        /// </summary>
        /// <param name="param"></param>
        public override void MoveXYRFinished(MoveParam param)
        {
            if (this.machine.PCBReach)
            {
                if (this.MarkIndex == 0 && this.PCBIndex == 0)
                {
                    Thread.Sleep(SystemConfig.Instance.General.ReachAfterDelay);
                }

                // 拍照等待
                Thread.Sleep(SystemConfig.Instance.General.UpCamDelay);
                var item = new Tool.ResultItem();
                item.Camera     = Camera.Top;
                item.funcName   = this.markParam.VisionName;
                item.CaptruePos = this.markParam.Pos;
                VisionImage image = entiy.GrabImage(Camera.Top);
                item.Key      = ResultKey.Mark;
                item.PCBIndex = PCBIndex;
                item.PCSIndex = MarkIndex;
                item.Mark     = this.machine.Program.PasteInfos[PCBIndex].MarkPtList[MarkIndex].MarkID;
                VisionCalHelper.Instance.VisionDetect(entiy.Module, item, image);
                VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Top, image);
                MarkIndex++;
                base.MoveXYRFinished(param);
            }
        }
 public override void MoveZFinished(MoveParam param)
 {
     this.entiy.MachineIO.VaccumSuck[(int)this.PasteNozzle].SetIO(false);
     this.entiy.MachineIO.VaccumPO[(int)this.PasteNozzle].SetIO(true);
     Thread.Sleep(FeederDefine.Instance[this.machine.Module, this.machine.RunData.RUN_NzData[this.PasteNozzle].SuckFeeder].PutDelay);
     ReportHelper.Instance[this.machine.Module].PCSCount += 1;
     base.MoveZFinished(param);
 }
        public override void MoveXYRFinished(MoveParam param)
        {
            foreach (Nozzle nozzle in this.RejectList)
            {
                this.entiy.MachineIO.VaccumSuck[(int)nozzle].SetIO(false);
                this.entiy.MachineIO.VaccumPO[(int)nozzle].SetIO(true);
            }

            base.MoveXYRFinished(param);
        }
Пример #5
0
 /// <summary>
 /// 检查是否需要翻转
 /// </summary>
 /// <param name="param"></param>
 public void CheckTrun(MoveParam param)
 {
     if (entiy.MachineAxis.Trun.AxisReach(param.TrunAngle))
     {
         this.CurState = State.StartMoveXYR;
     }
     else
     {
         this.CurState = State.TrunGoXY;
     }
 }
Пример #6
0
 /// <summary>
 /// 翻转
 /// </summary>
 /// <param name="param"></param>
 public void Trun(MoveParam param)
 {
     if (entiy.MachineAxis.Trun.AxisReach(param.TrunAngle))
     {
         this.CurState = State.StartMoveXYR;
     }
     else
     {
         entiy.TurnGoPos(param.TrunAngle, entiy.MachineConfig.AutoSpeedMode);
         Thread.Sleep(5);
     }
 }
Пример #7
0
 /// <summary>
 /// 到翻转点
 /// </summary>
 public void TrunGoXY(MoveParam param)
 {
     if (entiy.XYReach(machine.MachineEntiy.MachineConfig[Nozzle.Nz1].RotateCamPoint))
     {
         this.CurState = State.Trun;
     }
     else
     {
         entiy.XYGoPos(machine.MachineEntiy.MachineConfig[Nozzle.Nz1].RotateCamPoint, entiy.MachineConfig.AutoSpeedMode);
         Thread.Sleep(5);
     }
 }
        public override void MoveZFinished(MoveParam param)
        {
            var item = new Tool.ResultItem();

            item.Camera     = Camera.Top;
            item.funcName   = this.codeParam.VisionName;
            item.CaptruePos = this.codeParam.Pos;
            var image = entiy.GrabImage(Camera.Top);

            item.Key      = ResultKey.PCSCode;
            item.PCBIndex = PCBIndex;
            item.PCSIndex = CodeIndex;

            VisionCalHelper.Instance.VisionDetect(entiy.Module, item, image);
            VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Top, image);
            base.MoveZFinished(param);
        }
Пример #9
0
        public override void MoveZFinished(MoveParam param)
        {
            if (SystemConfig.Instance.General.RunMode == RunMode.TestRun)
            {
                this.entiy.MachineIO.VaccumSuck[(int)param.Nozzle].SetIO(true);
            }
            else
            {
                // 提前开真空
                //if (!LabelDefine.Instance[this.Feeder.LabelName].PreSuck)
                {
                    this.entiy.MachineIO.VaccumSuck[(int)param.Nozzle].SetIO(true);
                }
            }

            Thread.Sleep(this.Feeder.SuckDelay);
            base.MoveZFinished(param);
        }
        public override void MoveZFinished(MoveParam param)
        {
            Thread.Sleep(this.entiy.MachineConfig.DropDelay);

            foreach (Nozzle nozzle in this.RejectList)
            {
                this.entiy.MachineIO.VaccumPO[(int)nozzle].SetIO(false);
                int pcbIndex = this.machine.RunData.RUN_NzData[nozzle].PCBIndex;
                int pcsIndex = this.machine.RunData.RUN_NzData[nozzle].PCSIndex;

                this.machine.RunData.SetPasteState(pcbIndex, pcsIndex, -1);
                this.machine.RunData.RUN_NzData[nozzle].State       = NZ_State.NoUsed;
                ReportHelper.Instance[this.machine.Module][nozzle] += 1;
            }

            RejectList.Clear();
            base.MoveZFinished(param);
        }
Пример #11
0
        /// <summary>
        /// 获得下一个吸嘴吸标参数
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public bool GetNextSuck(ref MoveParam param)
        {
            if (SuckQueue.Count == 0)
            {
                return(false);
            }

            Nozzle nz = SuckQueue.Dequeue();

            param = new MoveParam();
            this.MoveParam.TrunAngle = machine.MachineEntiy.MachineConfig.TrunSuckAngle;
            param.Feeder             = this.machine.RunData.RUN_NzData[nz].SuckFeeder;
            param.Nozzle             = nz;
            param.MoveZ           = true;
            param.MoveR           = true;
            param.NzUsed[(int)nz] = true;
            param.ZPos[(int)nz]   = this.entiy.MachineConfig[nz].XIHeight;
            return(true);
        }
Пример #12
0
 /// <summary>
 /// 移动XYR
 /// </summary>
 /// <param name="param"></param>
 public void MoveXYR(MoveParam param)
 {
     if (entiy.XYReach(param.XYPos) && entiy.UReach(param.RPos))
     {
         CurState = State.MoveXYRFinished;
     }
     else
     {
         entiy.XYGoPos(param.XYPos, entiy.MachineConfig.AutoSpeedMode);
         if (param.MoveR)
         {
             for (int i = 0; i < param.RPos.Length; ++i)
             {
                 this.entiy.RGoAngle(param.RPos[i], (Nozzle)i, entiy.MachineConfig.AutoSpeedMode);
             }
         }
         Thread.Sleep(5);
     }
 }
Пример #13
0
        public override void MoveXYRFinished(MoveParam param)
        {
            this.entiy.MachineIO.VaccumPO[(int)param.Nozzle].SetIO(false);

            // 提前开真空
            if (SystemConfig.Instance.General.RunMode == RunMode.Normal)
            {
                this.entiy.MachineIO.VaccumSuck[(int)param.Nozzle].SetIO(true);
            }

            if (Feeder.NewOut && StartNz != param.Nozzle)
            {
                Thread.Sleep(Feeder.NewFeederDelay);
                Feeder.NewOut = false;
            }
            else
            {
                Feeder.NewOut = false;
            }

            base.MoveXYRFinished(param);
        }
Пример #14
0
        public override void MoveXYRFinished(MoveParam param)
        {
            // 翻转到位延时
            Thread.Sleep(SystemConfig.Instance.General.DownCamDelay); // 头部晃动
            var image1 = CameraDefine.Instance.Camera[entiy.Module][Camera.Bottom1].Grab();
            var image2 = CameraDefine.Instance.Camera[entiy.Module][Camera.Bottom2].Grab();

            Task.Factory.StartNew(() =>
            {
                if (this.machine.RunData.RUN_NzData[Nozzle.Nz1].State == NZ_State.Sucked)
                {
                    CalNz(Nozzle.Nz1, this.machine.RunData.RUN_NzData[Nozzle.Nz1].SuckLabel, image1);
                }
                if (this.machine.RunData.RUN_NzData[Nozzle.Nz2].State == NZ_State.Sucked)
                {
                    CalNz(Nozzle.Nz2, this.machine.RunData.RUN_NzData[Nozzle.Nz2].SuckLabel, image1);
                }

                VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Bottom1, image1);
            });

            Task.Factory.StartNew(() =>
            {
                if (this.machine.RunData.RUN_NzData[Nozzle.Nz3].State == NZ_State.Sucked)
                {
                    CalNz(Nozzle.Nz3, this.machine.RunData.RUN_NzData[Nozzle.Nz3].SuckLabel, image2);
                }
                if (this.machine.RunData.RUN_NzData[Nozzle.Nz4].State == NZ_State.Sucked)
                {
                    CalNz(Nozzle.Nz4, this.machine.RunData.RUN_NzData[Nozzle.Nz4].SuckLabel, image2);
                }

                VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Bottom2, image2);
            });

            CameraDefine.Instance.CloseLight(this.entiy.Module, Camera.Bottom1);
            this.OnExit();
        }
Пример #15
0
        public override void MoveXYRFinished(MoveParam param)
        {
            if (SystemConfig.Instance.General.RunMode == RunMode.TestRun) // 空跑
            {
                this.OnExit();
            }
            else
            {
                #region 拍照检测面积是否匹配
                //var image1 = CameraDefine.Instance.Camera[entiy.Module][Camera.Bottom1].Grab();
                //var image2 = CameraDefine.Instance.Camera[entiy.Module][Camera.Bottom2].Grab();

                //Task.Factory.StartNew(() =>
                //{
                //if (this.machine.RunData.RUN_NzData[Nozzle.Nz1].State == NZ_State.Sucked)
                //    CalNz(Nozzle.Nz1, this.machine.RunData.RUN_NzData[Nozzle.Nz1].SuckLabel, image1);
                //if (this.machine.RunData.RUN_NzData[Nozzle.Nz2].State == NZ_State.Sucked)
                //    CalNz(Nozzle.Nz2, this.machine.RunData.RUN_NzData[Nozzle.Nz2].SuckLabel, image1);

                //VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Bottom1, image1);
                //});

                //Task.Factory.StartNew(() =>
                //{
                //if (this.machine.RunData.RUN_NzData[Nozzle.Nz3].State == NZ_State.Sucked)
                //    CalNz(Nozzle.Nz3, this.machine.RunData.RUN_NzData[Nozzle.Nz3].SuckLabel, image2);
                //if (this.machine.RunData.RUN_NzData[Nozzle.Nz4].State == NZ_State.Sucked)
                //    CalNz(Nozzle.Nz4, this.machine.RunData.RUN_NzData[Nozzle.Nz4].SuckLabel, image2);

                //VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Bottom2, image2);
                //});

                //CameraDefine.Instance.CloseLight(this.entiy.Module, Camera.Bottom1);
                #endregion
                this.OnExit();
            }
            base.MoveXYRFinished(param);
        }
        public override void MoveXYRFinished(MoveParam param)
        {
            // 拍照等待
            Thread.Sleep(SystemConfig.Instance.General.UpCamDelay);
            if (SystemConfig.Instance.General.RunMode == RunMode.TestRun)
            {
                this.BadmarkIndex++;
            }
            else
            {
                var item = new Tool.ResultItem();
                item.Camera     = Camera.Top;
                item.funcName   = this.badmark.VisionName;
                item.CaptruePos = this.badmark.Pos;
                VisionImage image = entiy.GrabImage(Camera.Top);
                item.Key      = ResultKey.Badmark;
                item.PCBIndex = PCBIndex;
                item.PCSIndex = BadmarkIndex;
                VisionCalHelper.Instance.ImageShow(this.entiy.Module, Camera.Top, image);
                VisionCalHelper.Instance.VisionDetect(entiy.Module, item, image);
            }

            base.MoveXYRFinished(param);
        }
 public override void MoveXYRFinished(MoveParam param)
 {
     // 拍照等待
     Thread.Sleep(SystemConfig.Instance.General.UpCamDelay);
     base.MoveXYRFinished(param);
 }
Пример #18
0
 /// <summary>
 /// 移动XYR结束,开始移动Z
 /// </summary>
 /// <param name="param"></param>
 public virtual void MoveXYRFinished(MoveParam param)
 {
     this.CurState = State.MoveZ;
 }
 public override void MoveXYRFinished(MoveParam param)
 {
     base.MoveXYRFinished(param);
     // 需要即时计算
     // 进行Panel 绑定或者 BadMark 对应
 }
 public override void MoveXYRFinished(MoveParam param)
 {
     base.MoveXYRFinished(param);
 }
Пример #21
0
 /// <summary>
 /// 移动Z完成,开始Z回安全高度
 /// </summary>
 /// <param name="param"></param>
 public virtual void MoveZFinished(MoveParam param)
 {
     this.CurState = State.ZMoveSafe;
 }