Ejemplo n.º 1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/>
		/// class with the multi-axis gyro to read from.
		/// </summary>
		/// <param name="multiAxisGyro">
		/// The multi-axis gyro to read from.
		/// </param>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="multiAxisGyro"/> cannot be null.
		/// </exception>
		public AxisGyroscope(IMultiAxisGyro multiAxisGyro)
			: base() {
			if (multiAxisGyro == null) {
				throw new ArgumentNullException("multiAxisGyro");
			}
			this._multiAxisGyro = multiAxisGyro;
		}
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/>
 /// class with the multi-axis gyro to read from.
 /// </summary>
 /// <param name="multiAxisGyro">
 /// The multi-axis gyro to read from.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="multiAxisGyro"/> cannot be null.
 /// </exception>
 public AxisGyroscope(IMultiAxisGyro multiAxisGyro)
     : base()
 {
     if (multiAxisGyro == null)
     {
         throw new ArgumentNullException("multiAxisGyro");
     }
     this._multiAxisGyro = multiAxisGyro;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        /// <remarks>Call <see cref="Dispose"/> when you are finished using the
        /// <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/>. The <see cref="Dispose"/> method leaves the
        /// <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/> in an unusable state. After calling
        /// <see cref="Dispose"/>, you must release all references to the
        /// <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/> so the garbage collector can reclaim the memory
        /// that the <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/> was occupying.</remarks>
        public override void Dispose()
        {
            if (base.IsDisposed)
            {
                return;
            }

            if (this._multiAxisGyro != null)
            {
                this._multiAxisGyro.Dispose();
                this._multiAxisGyro = null;
            }

            this._trigger = GyroTriggerMode.ReadNotTriggered;
            base.Dispose();
        }
Ejemplo n.º 4
0
		/// <summary>
		/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
		/// </summary>
		/// <filterpriority>2</filterpriority>
		/// <remarks>Call <see cref="Dispose"/> when you are finished using the
		/// <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/>. The <see cref="Dispose"/> method leaves the
		/// <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/> in an unusable state. After calling
		/// <see cref="Dispose"/>, you must release all references to the
		/// <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/> so the garbage collector can reclaim the memory
		/// that the <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/> was occupying.</remarks>
		public override void Dispose() {
			if (base.IsDisposed) {
				return;
			}

			if (this._multiAxisGyro != null) {
				this._multiAxisGyro.Dispose();
				this._multiAxisGyro = null;
			}

			this._trigger = GyroTriggerMode.ReadNotTriggered;
			base.Dispose();
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/>
		/// class with the multi-axis gyro to read from and the
		/// degrees-per-second factor value.
		/// </summary>
		/// <param name="multiAxisGyro">
		/// The multi-axis gyro to read from.
		/// </param>
		/// <param name="degPerSecondFactor">
		/// The degrees-per-second factor value.
		/// </param>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="multiAxisGyro"/> cannot be null.
		/// </exception>
		public AxisGyroscope(IMultiAxisGyro multiAxisGyro, float degPerSecondFactor)
			: this(multiAxisGyro) {
			this._degPerSecondFactor = degPerSecondFactor;
			this._factorSet = true;
		}
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Gyroscope.AxisGyroscope"/>
 /// class with the multi-axis gyro to read from and the
 /// degrees-per-second factor value.
 /// </summary>
 /// <param name="multiAxisGyro">
 /// The multi-axis gyro to read from.
 /// </param>
 /// <param name="degPerSecondFactor">
 /// The degrees-per-second factor value.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="multiAxisGyro"/> cannot be null.
 /// </exception>
 public AxisGyroscope(IMultiAxisGyro multiAxisGyro, float degPerSecondFactor)
     : this(multiAxisGyro) {
     this._degPerSecondFactor = degPerSecondFactor;
     this._factorSet          = true;
 }