예제 #1
0
        /// <summary>
        /// Called when orientation data has been acquired from the Myo.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnAcquiredOrientationData(IntPtr evt, DateTime timestamp)
        {
            var orientation = _myoDeviceDriver.GetEventOrientation(evt);

            this.Orientation = orientation;

            var handler = OrientationDataAcquired;

            if (handler != null)
            {
                var args = new OrientationDataEventArgs(
                    this,
                    timestamp,
                    orientation,
                    CalculateRoll(orientation),
                    CalculatePitch(orientation),
                    CalculateYaw(orientation)
                    );

                handler.Invoke(this, args);
            }
        }
예제 #2
0
        /// <summary>
        /// Called when orientation data has been acquired from the Myo.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnAcquiredOrientationData(IntPtr evt, DateTime timestamp)
        {
            // Contract.Requires<ArgumentException>(evt != IntPtr.Zero, "The event handle must be set.");

            var orientation = _myoDeviceDriver.GetEventOrientation(evt);

            this.Orientation = orientation;

            var handler = OrientationDataAcquired;

            if (handler != null)
            {
                var args = new OrientationDataEventArgs(
                    this,
                    timestamp,
                    orientation,
                    CalculateRoll(orientation),
                    CalculatePitch(orientation),
                    CalculateYaw(orientation)
                    );

                handler.Invoke(this, args);
            }
        }