示例#1
0
        public void UpdateHomebtnMethod()
        {
            int count = 0;

            do
            {
                count = 0;
                foreach (Axis axis in AxisGroup)
                {
                    if (Motion2610Control.GetAxisIsDoWell(axis))
                    {
                        count++;

                        Thread.Sleep(100);
                    }
                }
            } while (count != 4);

            btnInitialization.Enabled = true;
        }
示例#2
0
        private void XYMotion()
        {
            updateBtn = UpdateRunbtnMethod;
            uint  count = 0;
            bool  isCompleted = true;
            float xCoordinate, yCoordinate;

            #region 循环所有孔类型的操作
            foreach (DrillTAPE.HoleShapeCollections holeShape in drill1.HoleList)
            {
                if (isCompleted)
                {
                    for (int i = 0; i < holeShape.XYCoordinateGroup.GetCoordinateCount(); i++)
                    {
                        xCoordinate = holeShape.XYCoordinateGroup.Pointfs[i].X;
                        yCoordinate = holeShape.XYCoordinateGroup.Pointfs[i].Y;

                        picBox1.Image = DrawCurrentHitHole1(xCoordinate, yCoordinate);

                        if (!Motion2610Control.XYPMoveAbsolutUseTMode(XAxis, YAxis, xCoordinate, yCoordinate))
                        {
                            isCompleted = false;
                            break;
                        }
                        else
                        {
                            Thread.Sleep(50);
                            count++;
                        }
                        while ((!Motion2610Control.GetAxisIsDoWell(XAxis)) && (!Motion2610Control.GetAxisIsDoWell(YAxis)))
                        {
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Some wrong has Happend!!!");
                    RunedorRunAbort = true;
                    BeginInvoke(updateBtn);
                    return;
                }
            }
            #endregion

            #region 循环所有Slot类型的操作
            //foreach (DrillTAPE.SlotShapeCollections slotShape in drill1.SlotList)
            //{
            //    if (isCompleted)
            //    {
            //        Stack<PointF> singleSlotSequenceStack;

            //        for (int i = 0; i < slotShape.Count; i++)
            //        {



            //            xCoordinate = slotShape.XYCoordinateGroup.Pointfs[i].X;
            //            yCoordinate = slotShape.XYCoordinateGroup.Pointfs[i].Y;

            //            picBox1.Image = DrawCurrentHitHole1(xCoordinate, yCoordinate);

            //            if (!Motion2610Control.XYPMoveAbsolutUseTMode(XAxis, YAxis, xCoordinate, yCoordinate))
            //            {
            //                isCompleted = false;
            //                break;
            //            }
            //            else
            //            {
            //                Thread.Sleep(50);
            //                count++;
            //            }
            //            while ((!Motion2610Control.GetAxisIsDoWell(XAxis)) && (!Motion2610Control.GetAxisIsDoWell(YAxis)))
            //            {
            //            }
            //        }
            //    }
            //    else
            //    {
            //        MessageBox.Show("Some wrong has Happend!!!");
            //        RunedorRunAbort = true;
            //        BeginInvoke(updateBtn);
            //        return;
            //    }
            //}
            #endregion

            RunedorRunAbort = true;
            BeginInvoke(updateBtn);
        }