/// <summary>
        /// StartDobot
        /// </summary>
        private void StartDobot()
        {
            int ret;

            // start connect
            if ((ret = DobotDll.ConnectDobot()) >= (int)DobotResult.DobotResult_Error_Min)
            {
                Msg("Connect error ,code:" + ret.ToString(), MsgInfoType.Error);
                return;
            }

            isConnectted = true;
            // reset and start
            //DobotDll.ResetDobot();
            DobotDll.SetCmdTimeout(500);
            DobotDll.SetEndType(EndType.EndTypePump);

            // Must set when sensor is not exist
            InitialPose initialPose;

            initialPose.joint2Angle = 45;
            initialPose.joint3Angle = 45;
            DobotDll.SetInitialPose(ref initialPose);


            JogStaticParams jsParam;

            jsParam.jointMaxVelocity      = 15;
            jsParam.jointMaxAcceleration  = 50;
            jsParam.servoMaxVelocity      = 30;
            jsParam.servoMaxAcceleration  = 10;
            jsParam.linearMaxVelocity     = 40;
            jsParam.linearMaxAcceleration = 40;
            DobotDll.SetJogStaticParams(ref jsParam);

            JogDynamicParams jdParam;

            jdParam.velocityRatio = 30;
            DobotDll.SetJogDynamicParams(ref jdParam);

            PlaybackStaticParams pbsParam;

            pbsParam.jointMaxVelocity      = 200;
            pbsParam.jointMaxAcceleration  = 200;
            pbsParam.servoMaxVelocity      = 200;
            pbsParam.servoMaxAcceleration  = 200;
            pbsParam.linearMaxVelocity     = 800;
            pbsParam.linearMaxAcceleration = 1000;
            pbsParam.pauseTime             = 100;
            pbsParam.jumpHeight            = 20;
            DobotDll.SetPlaybackStaticParams(ref pbsParam);

            PlaybackDynamicParams pbdParam;

            pbdParam.velocityRatio     = 30;
            pbdParam.accelerationRatio = 30;
            DobotDll.SetPlaybackDynamicParams(ref pbdParam);
        }
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!isConnectted)
            {
                return;
            }

            ComboBox obj = (ComboBox)sender;
            String   tag = obj.Tag.ToString();

            if (tag == "mode")
            {
                bool isJ = ((ComboBoxItem)obj.SelectedItem).Content.ToString() == "Axis";
                isJoint = isJ ? (byte)1 : (byte)0;
                if (isJ)
                {
                    XI.Content = "Joint1+";
                    YI.Content = "Joint2+";
                    ZI.Content = "Joint3+";
                    RI.Content = "Joint4+";

                    XN.Content = "Joint1-";
                    YN.Content = "Joint2-";
                    ZN.Content = "Joint3-";
                    RN.Content = "Joint4-";
                }
                else
                {
                    XI.Content = "X+";
                    YI.Content = "Y+";
                    ZI.Content = "Z+";
                    RI.Content = "R+";

                    XN.Content = "X-";
                    YN.Content = "Y-";
                    ZN.Content = "Z-";
                    RN.Content = "R-";
                }
            }
            else if (tag == "headType")
            {
                string str = ((ComboBoxItem)obj.SelectedItem).Content.ToString();
                if (str == "Pump")
                {
                    DobotDll.SetEndType(EndType.EndTypePump);
                    cbGrab.IsEnabled    = true;
                    cbLaser.IsEnabled   = false;
                    btnGrpOn.IsEnabled  = false;
                    btnGrpOff.IsEnabled = false;
                }
                else if (str == "Gripper")
                {
                    cbGrab.IsEnabled    = false;
                    cbLaser.IsEnabled   = false;
                    btnGrpOn.IsEnabled  = true;
                    btnGrpOff.IsEnabled = true;
                    DobotDll.SetEndType(EndType.EndTypeGripper);
                }
                else if (str == "Laser")
                {
                    cbGrab.IsEnabled    = false;
                    cbLaser.IsEnabled   = true;
                    btnGrpOn.IsEnabled  = false;
                    btnGrpOff.IsEnabled = false;
                    DobotDll.SetEndType(EndType.EndTypeLaser);
                }
            }
        }