void DriveManualFocus(eNkMAIDMFDrive direction)
        {
            // Start driving the manual focus motor
            _device.SetUnsigned(eNkMAIDCapability.kNkMAIDCapability_MFDrive, (uint)direction);

            // Keep looping here until drive is complete
            bool isDriving;

            do
            {
                // Get the most recent live view image
                NikonLiveViewImage image = _device.GetLiveViewImage();

                // NOTE: For Type0003.md3, the drive state flag is located at index 30 - this might
                //       not be the case for other MD3 files. Please double check your SDK documentation.
                const int driveStateIndex = 30;

                isDriving = (image.HeaderBuffer[driveStateIndex] > 0);
            }while (isDriving);
        }
Esempio n. 2
0
        void DriveManualFocus(eNkMAIDMFDrive direction)
        {
            // Start driving the manual focus motor
            _device.SetUnsigned(eNkMAIDCapability.kNkMAIDCapability_MFDrive, (uint)direction);

            // Keep looping here until drive is complete
            bool isDriving;

            do
            {
                // Get the most recent live view image
                NikonLiveViewImage image = _device.GetLiveViewImage();

                // NOTE: For Type0003.md3, the drive state flag is located at index 30 - this might
                //       not be the case for other MD3 files. Please double check your SDK documentation.
                const int driveStateIndex = 30;

                isDriving = (image.HeaderBuffer[driveStateIndex] > 0);
            }
            while (isDriving);
        }