コード例 #1
0
        /// <summary>
        /// Called when the Myo has recognized which arm it is on.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnArmRecognized(IntPtr evt, DateTime timestamp)
        {
            var arm = _myoDeviceDriver.GetArm(evt);

            this.Arm = arm;

            var xDirection = _myoDeviceDriver.GetEventDirectionX(evt);

            this.XDirectionOnArm = xDirection;

            var handler = ArmRecognized;

            if (handler != null)
            {
                var args = new ArmRecognizedEventArgs(
                    this,
                    timestamp,
                    arm,
                    xDirection);
                handler.Invoke(this, args);
            }
        }
コード例 #2
0
ファイル: Myo.cs プロジェクト: Tineler/Myo-Car-Control
        /// <summary>
        /// Called when the Myo has recognized which arm it is on.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnArmRecognized(IntPtr evt, DateTime timestamp)
        {
            // Contract.Requires<ArgumentException>(evt != IntPtr.Zero, "The event handle must be set.");

            var arm = _myoDeviceDriver.GetArm(evt);

            this.Arm = arm;

            var xDirection = _myoDeviceDriver.GetEventDirectionX(evt);

            this.XDirectionOnArm = xDirection;

            var handler = ArmRecognized;

            if (handler != null)
            {
                var args = new ArmRecognizedEventArgs(
                    this,
                    timestamp,
                    arm,
                    xDirection);
                handler.Invoke(this, args);
            }
        }