Ejemplo n.º 1
0
        public uint AcquireImage(float exp, float maxWaitSeconds, out ushort[] image)
        { // exp is the exposure time in seconds
            if (!systemInitialized)
            {
                image = null;
                return(NOT_INITIALIZED);
            }

            uint uiErrorCode;
            int  status = 0;

            // set exposure time in seconds
            if (MyCamera.SetExposureTime(exp / 1000) == AndorSDK.DRV_SUCCESS)
            {
                uiErrorCode = MyCamera.PrepareAcquisition();

                // start the image acquisition
                if (MyCamera.StartAcquisition() == AndorSDK.DRV_SUCCESS)
                {
                    while (status != AndorSDK.DRV_IDLE)
                    {
                        uiErrorCode = MyCamera.GetStatus(ref status);
                    }

                    // uiErrorCode = MyCamera.WaitForAcquisition();
                }
            }

            // if good acquisition occurred, get image
            uiErrorCode = MyCamera.GetStatus(ref status);
            if (status == AndorSDK.DRV_IDLE)
            {
                uint TotalPixels;

                TotalPixels = (uint)(XPixels * YPixels);

                image = new ushort[TotalPixels];

                //for (int j = 0; j < TotalPixels; j++) img.image[j] = 10000;

                uiErrorCode = MyCamera.GetAcquiredData16(image, TotalPixels);
                //uiErrorCode = MyCamera.GetOldestImage16(img.image, TotalPixels);
            }
            else
            {
                image = null;
            }


            return(uiErrorCode);
        }
Ejemplo n.º 2
0
        public override uint Acquire(int[] data)
        {
            uint ret;
            uint npx = (uint)data.Length;

            sdk.SetReadMode(ReadModeFVB);
            sdk.StartAcquisition();
            sdk.WaitForAcquisition();
            ret = sdk.GetAcquiredData(data, npx);
            if (ret != AndorSDK.DRV_SUCCESS)
            {
                return(ret);
            }

            //Log.Debug("Camera returned " + DecodeStatus(ret));
            //ThrowIfSaturated(data);
            return(ret);
        }