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); }
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); }