Esempio n. 1
0
        public bool GetSpectrum(out bool isSaturated, out double[] spectrumData, out uint timestamp)
        {
            bool result = false;

            isSaturated  = true;
            spectrumData = new double[1];

            Avaspec.PixelArrayType     l_pSpectrum  = new Avaspec.PixelArrayType();
            Avaspec.SaturatedArrayType l_pSaturated = new Avaspec.SaturatedArrayType();

            timestamp = 0;
            if (Avaspec.ERR_SUCCESS == (int)Avaspec.AVS_GetScopeData((IntPtr)_deviceHandle, ref timestamp,
                                                                     ref l_pSpectrum))
            {
                spectrumData = l_pSpectrum.Value.ToArray();

                if (Avaspec.ERR_SUCCESS ==
                    (int)Avaspec.AVS_GetSaturatedPixels((IntPtr)_deviceHandle, ref l_pSaturated))
                {
                    isSaturated = false;
                    for (int i = 0; i < l_pSaturated.Value.Length; i++)
                    {
                        if (l_pSaturated.Value[i] == 1)
                        {
                            isSaturated = true;
                            break;
                        }
                    }

                    result = true;
                }
            }

            return(result);
        }
Esempio n. 2
0
        public uint GetTimestamp()
        {
            Avaspec.PixelArrayType l_pSpectrum = new Avaspec.PixelArrayType();
            uint timestamp = 0;

            if (Avaspec.ERR_SUCCESS == (int)Avaspec.AVS_GetScopeData((IntPtr)_deviceHandle, ref timestamp,
                                                                     ref l_pSpectrum))
            {
                return(timestamp);
            }

            return(0);
        }
Esempio n. 3
0
        public bool GetWavelengths(out double[] wavelengths)
        {
            bool result = false;

            wavelengths = new double[1];

            Avaspec.PixelArrayType m_Lambda = new Avaspec.PixelArrayType();

            if (0 == (int)Avaspec.AVS_GetLambda((IntPtr)_deviceHandle, ref m_Lambda))
            {
                wavelengths = m_Lambda.Value.ToArray();
                result      = true;
            }

            return(result);
        }