Esempio n. 1
0
        private void XYDrawingaCorssHatch()
        {
            updateBtn = UpdateRunbtnMethod;
            uint  count = 0;
            bool  isCompleted = true;
            float xCoordinate, yCoordinate;

            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);
                        Thread.Sleep(50);
                        count++;
                    }
                }
            }
            RunedorRunAbort = true;
            BeginInvoke(updateBtn);
        }
Esempio n. 2
0
        private void btnInitialization_Click(object sender, EventArgs e)
        {
            updateBtn = new Updatebtn(UpdateHomebtnMethod);


            //objThread = new Thread(new ThreadStart(delegate { AxiseHomeUseThread(XAxis); })
            //  );
            //objThread.Start();

            if (nCard != 0)
            {
                foreach (Axis axis in AxisGroup)
                {
                    objThread = new Thread(new ThreadStart(delegate { AxiseHomeUseThread(axis); }));

                    objThread.Start();
                }
            }


            this.btnInitialization.Enabled = false;
        }
Esempio n. 3
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);
        }