/// <summary> /// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Servos.GenericServo"/> /// class with the servo driver, name, and properties. /// </summary> /// <param name="driver"> /// The servo driver to use. /// </param> /// <param name="name"> /// The name of this servo. /// </param> /// <param name="props"> /// A dictionary containing servo properties. /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// The specified end point property value is not between /// <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.END_POINT_MIN"/> /// and <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.END_POINT_MAX"/>. /// - or - /// The specified subtrim property value is not between /// <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.SUBTRIM_MAX_LEFT"/> /// and <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.SUBTRIM_MAX_RIGHT"/>. /// </exception> public GenericServo(IServoDriver driver, String name, Dictionary<String, String> props) : base() { this._driver = driver; base.Name = name; if ((props != null) && (props.Count > 0)) { foreach (KeyValuePair<String, String> entry in props) { this.SetProperty(entry.Key, entry.Value); } } this.Init(); }
/// <summary> /// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Servos.GenericServo"/> /// class with the servo driver, name, and properties. /// </summary> /// <param name="driver"> /// The servo driver to use. /// </param> /// <param name="name"> /// The name of this servo. /// </param> /// <param name="props"> /// A dictionary containing servo properties. /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// The specified end point property value is not between /// <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.END_POINT_MIN"/> /// and <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.END_POINT_MAX"/>. /// - or - /// The specified subtrim property value is not between /// <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.SUBTRIM_MAX_LEFT"/> /// and <see cref="CyrusBuilt.MonoPi.Components.Servos.Servo.SUBTRIM_MAX_RIGHT"/>. /// </exception> public GenericServo(IServoDriver driver, String name, Dictionary <String, String> props) : base() { this._driver = driver; base.Name = name; if ((props != null) && (props.Count > 0)) { foreach (KeyValuePair <String, String> entry in props) { this.SetProperty(entry.Key, entry.Value); } } this.Init(); }
/// <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.Servos.GenericServo"/>. The <see cref="Dispose"/> method leaves the /// <see cref="CyrusBuilt.MonoPi.Components.Servos.GenericServo"/> in an unusable state. After calling /// <see cref="Dispose"/>, you must release all references to the /// <see cref="CyrusBuilt.MonoPi.Components.Servos.GenericServo"/> so the garbage collector can reclaim the memory /// that the <see cref="CyrusBuilt.MonoPi.Components.Servos.GenericServo"/> was occupying.</remarks> public override void Dispose() { if (base.IsDisposed) { return; } if (this._driver != null) { this._driver.Dispose(); this._driver = null; } base.Dispose(); }
public Test(SensorPlatform sensorPlatform, IServoDriver servoDriver, ILogger logger) { _sensorPlattform = sensorPlatform; _servoDriver = servoDriver; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.Components.Servos.GenericServo"/> /// class with the servo driver and name. This overload will use default property values. /// </summary> /// <param name="driver"> /// The servo driver to use. /// </param> /// <param name="name"> /// The name of this servo. /// </param> public GenericServo(IServoDriver driver, String name) : this(driver, name, null) { }