public static IHeldPose Create(IMyoEventGenerator myo, IEnumerable <Pose> targetPoses) { return(new HeldPose( myo, DEFAULT_INTERVAL, targetPoses)); }
public static IHeldPose Create(IMyoEventGenerator myo, TimeSpan interval, params Pose[] targetPoses) { return(Create( myo, interval, (IEnumerable <Pose>)targetPoses)); }
/// <summary> /// Unhooks the Myo events. /// </summary> /// <param name="myo">The myo to hook onto.</param> protected virtual void UnhookMyoEvents(IMyoEventGenerator myo) { Contract.Requires <ArgumentNullException>(myo != null, "myo"); myo.Connected -= Myo_Connected; myo.Disconnected -= Myo_Disconnected; }
public static IHeldPose Create(IMyoEventGenerator myo, TimeSpan interval, IEnumerable <Pose> targetPoses) { return(new HeldPose( myo, interval, targetPoses)); }
public static IHeldPose Create(IMyoEventGenerator myo, Pose targetPose) { return(Create( myo, DEFAULT_INTERVAL, targetPose)); }
protected HeldPose(IMyoEventGenerator myo, TimeSpan interval, IEnumerable <Pose> targetPoses) { // Contract.Requires<ArgumentNullException>(myo != null, "myo"); // Contract.Requires<ArgumentOutOfRangeException>(interval.TotalMilliseconds >= 0, "interval"); // Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses"); _targetPoses = new List <Pose>(targetPoses); if (_targetPoses.Contains(Pose.Unknown)) { throw new ArgumentException("All target poses must be specified.", "targetPoses"); } if (_targetPoses.Count < 1) { throw new ArgumentException("At least one target pose must be specified.", "targetPoses"); } _timer = new Timer() { AutoReset = true, Interval = interval.TotalMilliseconds, }; _timer.Elapsed += Timer_Elapsed; _lastPose = Pose.Unknown; _myo = myo; _myo.PoseChanged += Myo_PoseChanged; }
protected HeldPose(IMyoEventGenerator myo, TimeSpan interval, IEnumerable<Pose> targetPoses) { Contract.Requires<ArgumentNullException>(myo != null, "myo"); Contract.Requires<ArgumentOutOfRangeException>(interval.TotalMilliseconds >= 0, "interval"); Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses"); _targetPoses = new List<Pose>(targetPoses); if (_targetPoses.Contains(Pose.Unknown)) { throw new ArgumentException("All target poses must be specified.", "targetPoses"); } if (_targetPoses.Count < 1) { throw new ArgumentException("At least one target pose must be specified.", "targetPoses"); } _timer = new Timer() { AutoReset = true, Interval = interval.TotalMilliseconds, }; _timer.Elapsed += Timer_Elapsed; _lastPose = Pose.Unknown; _myo = myo; _myo.PoseChanged += Myo_PoseChanged; }
public static IPoseSequence Create(IMyoEventGenerator myo, params Pose[] sequence) { Contract.Requires<ArgumentNullException>(myo != null); Contract.Requires<ArgumentNullException>(sequence != null); Contract.Ensures(Contract.Result<IPoseSequence>() != null); return new PoseSequence(myo, sequence); }
public static IPoseSequence Create(IMyoEventGenerator myo, IEnumerable <Pose> sequence) { // Contract.Requires<ArgumentNullException>(myo != null); // Contract.Requires<ArgumentNullException>(sequence != null); Contract.Ensures(Contract.Result <IPoseSequence>() != null); return(new PoseSequence(myo, sequence)); }
/// <summary> /// Unhooks the Myo events. /// </summary> /// <param name="myo">The myo to hook onto.</param> protected virtual void UnhookMyoEvents(IMyoEventGenerator myo) { myo.Connected -= Myo_Connected; myo.Disconnected -= Myo_Disconnected; myo.Locked -= Myo_Locked; myo.Unlocked -= Myo_Unlocked; myo.PoseChanged -= Myo_PoseChanged; }
public static IHeldPose Create(IMyoEventGenerator myo, Pose targetPose) { var interval = DEFAULT_INTERVAL; return(Create( myo, interval, targetPose)); }
public static IHeldPose Create(IMyoEventGenerator myo, IEnumerable <Pose> targetPoses) { var interval = DEFAULT_INTERVAL; return(Create( myo, interval, targetPoses)); }
public static IHeldPose Create(IMyoEventGenerator myo, params Pose[] targetPoses) { // Contract.Requires<ArgumentNullException>(myo != null, "myo"); // Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses"); Contract.Ensures(Contract.Result <IHeldPose>() != null); return(Create( myo, (IEnumerable <Pose>)targetPoses)); }
public static IHeldPose Create(IMyoEventGenerator myo, TimeSpan interval, IEnumerable <Pose> targetPoses) { // Contract.Requires<ArgumentNullException>(myo != null, "myo"); // Contract.Requires<ArgumentOutOfRangeException>(interval.TotalMilliseconds >= 0, "interval"); // Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses"); Contract.Ensures(Contract.Result <IHeldPose>() != null); return(new HeldPose( myo, interval, targetPoses)); }
public static IHeldPose Create(IMyoEventGenerator myo, Pose targetPose) { //Contract.Requires<ArgumentNullException>(myo != null, "myo"); Contract.Ensures(Contract.Result<IHeldPose>() != null); var interval = DEFAULT_INTERVAL; Contract.Assume(interval.TotalMilliseconds >= 0); return Create( myo, interval, targetPose); }
/// <summary> /// Initializes a new instance of the <see cref="PoseSequence"/> class. /// </summary> /// <param name="myo">The Myo.</param> /// <param name="sequence">The sequence of poses to watch for. Cannot be <c>null</c>.</param> protected PoseSequence(IMyoEventGenerator myo, IEnumerable <Pose> sequence) { _sequence = new List <Pose>(); _sequence.AddRange(sequence); if (_sequence.Count < 2) { throw new ArgumentException("Sequence length should be at least 2 poses long.", "sequence"); } _currentSequence = new List <Pose>(); _myo = myo; _myo.PoseChanged += Myo_PoseChanged; }
/// <summary> /// Initializes a new instance of the <see cref="PoseSequence"/> class. /// </summary> /// <param name="myo">The Myo.</param> /// <param name="sequence">The sequence of poses to watch for. Cannot be <c>null</c>.</param> protected PoseSequence(IMyoEventGenerator myo, IEnumerable<Pose> sequence) { Contract.Requires<ArgumentNullException>(myo != null); Contract.Requires<ArgumentNullException>(sequence != null); _sequence = new List<Pose>(); _sequence.AddRange(sequence); if (_sequence.Count < 2) { throw new ArgumentException("Sequence length should be at least 2 poses long.", "sequence"); } _currentSequence = new List<Pose>(); _myo = myo; _myo.PoseChanged += Myo_PoseChanged; }
protected HeldPose(IMyoEventGenerator myo, TimeSpan interval, IEnumerable <Pose> targetPoses) { if (myo == null) { throw new ArgumentNullException("myo", "The Myo cannot be null."); } if (targetPoses == null) { throw new ArgumentNullException("targetPoses", "The target poses cannot be null."); } if (interval.TotalMilliseconds <= 0) { throw new ArgumentException("The interval must be a positive time value.", "interval"); } _targetPoses = new List <Pose>(targetPoses); if (_targetPoses.Contains(Pose.Unknown)) { throw new ArgumentException("All target poses must be specified.", "targetPoses"); } if (_targetPoses.Count < 1) { throw new ArgumentException("At least one target pose must be specified.", "targetPoses"); } _timer = new Timer(); _timer.AutoReset = true; _timer.Interval = interval.TotalMilliseconds; _timer.Elapsed += Timer_Elapsed; _lastPose = Pose.Unknown; _myo = myo; _myo.PoseChanged += Myo_PoseChanged; }
protected PoseSequence(IMyoEventGenerator myo, IEnumerable <Pose> sequence) { if (myo == null) { throw new ArgumentNullException("myo", "The Myo cannot be null."); } if (sequence == null) { throw new ArgumentNullException("sequence", "The sequence cannot be null."); } _sequence = new List <Pose>(); _sequence.AddRange(sequence); if (_sequence.Count < 2) { throw new ArgumentException("Sequence length should be at least 2 poses long.", "sequence"); } _currentSequence = new List <Pose>(); _myo = myo; _myo.PoseChanged += Myo_PoseChanged; }
public static IPoseSequence Create(IMyoEventGenerator myo, params Pose[] sequence) { return(new PoseSequence(myo, sequence)); }
protected PoseSequence(IMyoEventGenerator myo, params Pose[] sequence) : this(myo, (IEnumerable <Pose>)sequence) { }
/// <summary> /// Unhooks the Myo events. /// </summary> /// <param name="myo">The myo to hook onto.</param> protected virtual void UnhookMyoEvents(IMyoEventGenerator myo) { Contract.Requires<ArgumentNullException>(myo != null, "myo"); myo.Connected -= Myo_Connected; myo.Disconnected -= Myo_Disconnected; }
/// <summary> /// Unhooks the Myo events. /// </summary> /// <param name="myo">The myo to hook onto.</param> protected virtual void UnhookMyoEvents(IMyoEventGenerator myo) { myo.Connected -= Myo_Connected; myo.Disconnected -= Myo_Disconnected; }
/// <summary> /// Initializes a new instance of the <see cref="PoseSequence"/> class. /// </summary> /// <param name="myo">The Myo.</param> /// <param name="sequence">The sequence of poses to watch for. Cannot be <c>null</c>.</param> protected PoseSequence(IMyoEventGenerator myo, params Pose[] sequence) : this(myo, (IEnumerable <Pose>)sequence) { // Contract.Requires<ArgumentNullException>(myo != null); // Contract.Requires<ArgumentNullException>(sequence != null); }
public static IHeldPose Create(IMyoEventGenerator myo, params Pose[] targetPoses) { Contract.Requires<ArgumentNullException>(myo != null, "myo"); Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses"); Contract.Ensures(Contract.Result<IHeldPose>() != null); return Create( myo, (IEnumerable<Pose>)targetPoses); }
public static IHeldPose Create(IMyoEventGenerator myo, TimeSpan interval, IEnumerable<Pose> targetPoses) { Contract.Requires<ArgumentNullException>(myo != null, "myo"); Contract.Requires<ArgumentOutOfRangeException>(interval.TotalMilliseconds >= 0, "interval"); Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses"); Contract.Ensures(Contract.Result<IHeldPose>() != null); return new HeldPose( myo, interval, targetPoses); }
public static IPoseSequence Create(IMyoEventGenerator myo, IEnumerable <Pose> sequence) { return(new PoseSequence(myo, sequence)); }
/// <summary> /// Initializes a new instance of the <see cref="PoseSequence"/> class. /// </summary> /// <param name="myo">The Myo.</param> /// <param name="sequence">The sequence of poses to watch for. Cannot be <c>null</c>.</param> protected PoseSequence(IMyoEventGenerator myo, params Pose[] sequence) : this(myo, (IEnumerable<Pose>)sequence) { Contract.Requires<ArgumentNullException>(myo != null); Contract.Requires<ArgumentNullException>(sequence != null); }
public static IHeldPose Create(IMyoEventGenerator myo, Pose targetPose) { Contract.Requires<ArgumentNullException>(myo != null, "myo"); Contract.Ensures(Contract.Result<IHeldPose>() != null); var interval = DEFAULT_INTERVAL; Contract.Assume(interval.TotalMilliseconds >= 0); return Create( myo, interval, targetPose); }