private void OnEndFrameCallback(IntPtr hAcqDesc)
        {
            uint    size = capConfig.dwRows * capConfig.dwColumns;
            uint    off  = size * acqFrameSN;
            ushort *p    = pAcqBuffer + off;

            uint AcqData;

            PKL_Interface.Acquisition_GetAcqData(hAcqDesc, out AcqData);
            if (AcqData != ACQ_CONT)
            {
                return;
            }

            switch (capConfig.dwCorrection)
            {
            case ImageCorrection.None:    //none
                break;

            case ImageCorrection.Offset:    //offset
                PKL_Interface.Acquisition_DoOffsetCorrection(p, p, pOffsetBuffer, (int)(capConfig.dwColumns * capConfig.dwRows));
                break;

            case ImageCorrection.Gain:    //offset_gain
                PKL_Interface.Acquisition_DoOffsetGainCorrection(p, p, pOffsetBuffer, pGainBuffer, (int)(capConfig.dwColumns * capConfig.dwRows));
                break;

            case ImageCorrection.GainSequence:    //GainSequence
                PKL_Interface.Acquisition_DoOffsetGainCorrection_Ex(p, p, pOffsetBuffer, pGainSeqBuffer, pGainSeqMedBuffer,
                                                                    (int)(capConfig.dwColumns * capConfig.dwRows), gainSeqFrames);
                break;

            case ImageCorrection.BadPixel:
                PKL_Interface.Acquisition_DoOffsetGainCorrection_Ex(p, p, pOffsetBuffer, pGainSeqBuffer, pGainSeqMedBuffer,
                                                                    (int)(capConfig.dwColumns * capConfig.dwRows), gainSeqFrames);
                PKL_Interface.Acquisition_DoPixelCorrection(p, pdwPxlCorrList);
                break;
            }
            acqFrameSN++;
            System.Threading.Thread.Sleep(capConfig.FrameDelayTime);
            TextLog.SaveLogOperate("Send message..." + " ......In Function : OnEndFrameCallback"); //log
            Kernel32Interface.PostMessage(this.hWnd, WIN_MSG.WM_PROGRESS, 1, 0);
            PKL_Interface.Acquisition_GetReady(hAcqDesc);
        }
        private void OnEndAcqCallback(IntPtr hAcqDesc)
        {
            uint AcqData;

            PKL_Interface.Acquisition_GetAcqData(hAcqDesc, out AcqData);

            TextLog.SaveLogOperate("Is ACQ_CONT:" + (AcqData == ACQ_CONT).ToString() + " ......In Function : OnEndAcqCallback"); //log
            TextLog.SaveLogOperate("Frames: " + capConfig.captureFrame.ToString() + " ......In Function : OnEndAcqCallback");    //log

            //set data has been acquired consummately
            if (AcqData == ACQ_CONT)
            {
                int Frames = (int)capConfig.captureFrame;
                int Rows   = (int)capConfig.dwRows;
                int Cols   = (int)capConfig.dwColumns;
                dataList = TypeConvert.BufferToArrayList(pAcqBuffer, Frames, Rows, Cols);
                //if (pAcqBuffer != null)
                //{
                //    Marshal.FreeHGlobal((IntPtr)pAcqBuffer);
                //    Kernel32Interface.CloseHandle((IntPtr)pAcqBuffer);
                //    pAcqBuffer = null;
                //}

                if (dataList != null && dataList.Count >= 1)
                {
                    addAngle(angle);
                }

                TextLog.SaveLogOperate("Callback dataList count:" + dataList.Count.ToString() + "......In Function : OnEndAcqCallback"); //log
            }

            TextLog.SaveLogOperate("End Acquire Call Back" + " ......In Function : OnEndAcqCallback"); //log

            Kernel32Interface.PostMessage(this.hWnd, WIN_MSG.WM_PROGRESS, -1, 0);

            //Kernel32Interface.SetEvent(hevEndAcq);
        }