/// <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; }
/// <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; }
/// <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(); }
/// <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(); }
/// <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; }
/// <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; }