Пример #1
0
        virtual public bool Move(MapAGVPosition end, double lineVelocity, double lineAcc, double lineDec, double lineJerk, double thetaVelocity, double thetaAcc, double thetaDec, double thetaJerk)
        {
            if (mipcControl.AGV_Move(end, lineVelocity, lineAcc, lineDec, lineJerk, thetaVelocity, thetaAcc, thetaDec, thetaJerk))
            {
                MapAGVPosition now = localData.Real;

                double distance = 10000;

                if (now != null)
                {
                    distance = computeFunction.GetDistanceFormTwoAGVPosition(now, end) * 2;
                }

                if (lineVelocity != eq.Velocity)
                {
                    SimulateControl.SetMoveCommandSimulateData(distance, lineVelocity, lineAcc, lineDec, lineJerk);
                }
                else
                {
                    SimulateControl.SetMoveCommandSimulateData(distance, lineVelocity, lineAcc, lineDec, lineJerk, false);
                }

                localData.MoveControlData.MotionControlData.PreMoveStatus = EnumAxisMoveStatus.PreMove;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        private void button_CommandStart_Click(object sender, EventArgs e)
        {
            //if (localData.MoveControlData.MotionControlData.MoveStatus != EnumAxisMoveStatus.Stop)
            //    return;

            button_CommandStart.Enabled = false;

            if (localData.AutoManual == EnumAutoState.Manual && localData.MoveControlData.MoveCommand == null && localData.LoadUnloadData.CommandStatus == EnumCommandStatus.Idle)
            {
                double mapX;
                double mapY;
                double mapTheta;
                double lineVelocity;
                double lineAcc;
                double lineDec;
                double lineJerk;
                double thetaVelocity;
                double thetaAcc;
                double thetaDec;
                double thetaJerk;

                if (double.TryParse(tB_X.Text, out mapX) && double.TryParse(tB_Y.Text, out mapY) && double.TryParse(tB_Angle.Text, out mapTheta) &&
                    double.TryParse(tB_LineVelocity.Text, out lineVelocity) && double.TryParse(tB_LineAcc.Text, out lineAcc) &&
                    double.TryParse(tB_LineDec.Text, out lineDec) && double.TryParse(tB_LineJerk.Text, out lineJerk) &&
                    double.TryParse(tB_ThetaVelocity.Text, out thetaVelocity) && double.TryParse(tB_ThetaAcc.Text, out thetaAcc) &&
                    double.TryParse(tB_ThetaDec.Text, out thetaDec) && double.TryParse(tB_ThetaJerk.Text, out thetaJerk) &&
                    lineVelocity > 0 && lineAcc > 0 && lineDec > 0 && lineJerk > 0 &&
                    thetaVelocity > 0 && thetaAcc > 0 && thetaDec > 0 && thetaJerk > 0)
                {
                    MapAGVPosition agvPosition = new MapAGVPosition();
                    agvPosition.Position = new MapPosition(mapX, mapY);
                    agvPosition.Angle    = mapTheta;

                    mipcControl.AGV_Move(agvPosition, lineVelocity, lineAcc, lineDec, lineJerk, thetaVelocity, thetaAcc, thetaDec, thetaJerk);
                }
                else
                {
                    MessageBox.Show("有資料輸入錯誤");
                }
            }
            else
            {
                MessageBox.Show("Auto 或 半自動移動中 無法使用");
            }

            button_CommandStart.Enabled = true;
        }