Beispiel #1
0
 /// <summary>
 /// Action concernant un servomoteur.
 /// Effectue lui-même le wait d'attente de fin de rotation
 /// </summary>
 public ActionServo(String description, AX12 servomoteur, ServoCommandTypes commandType, float angle)
     : base(description)
 {
     this.servomoteur = servomoteur;
     this.angle       = angle;
     this.commandType = commandType;
 }
Beispiel #2
0
 /// <summary>
 /// Sert simplement à exécuter la méthode associé au type de rotation demandé dans l'énum
 /// </summary>
 /// <param name="type"></param>
 /// <param name="angle"></param>
 /// <returns></returns>
 public int ExecuteCommand(ServoCommandTypes type, float angle) // OBSOLETE !!!
 {                                                              /*
                                                                 * switch (type)
                                                                 * {
                                                                 *     case ServoCommandTypes.ABSOLUTE_ROTATION:
                                                                 *         return SetAngle(angle);
                                                                 *     case ServoCommandTypes.RELATIVE_ROTATION:
                                                                 *         return RotateOf(angle);
                                                                 *     default:
                                                                 *         return -1;
                                                                 * }*/
     return(-11);
 }
Beispiel #3
0
        /// <summary>
        /// Sert simplement à exécuter la méthode associé au type de rotation demandé dans l'énum
        /// </summary>
        /// <param name="type"></param>
        /// <param name="angle"></param>
        /// <returns></returns>
        public int ExecuteCommand(ServoCommandTypes type, float angle)
        {
            switch (type)
            {
            case ServoCommandTypes.ABSOLUTE_ROTATION:
                return(SetAngle(angle));

            case ServoCommandTypes.RELATIVE_ROTATION:
                return(RotateOf(angle));

            default:
                return(-1);
            }
        }
Beispiel #4
0
 public ActionServo BuildActionServo(AX12 servomoteur, ServoCommandTypes commandType, float angle)
 {
     return(new  ActionServo(description, servomoteur, commandType, angle));
 }