public int[] getEDCIndices() { int[] result = null; mut.WaitOne(); try { int error = 0; int[] buf = new int[64]; int count = SeaBreezeWrapper.seabreeze_get_electric_dark_pixel_indices(specIndex, ref error, ref buf[0], 64); result = new int[count]; for (int i = 0; i < count; i++) { result[i] = buf[i]; } } catch (Exception e) { logger.log("Error getting EDC indices: {0}", e); } finally { mut.ReleaseMutex(); } return(result); }
public FlameTestClass(ListBox lb, int spectrometerID) : base(lb) { int errorCode = 0; const int maxIndiciesCount = 32; int [] pixelIndicies = new int[maxIndiciesCount]; uint numberOfPixels = 0; // these commands are called when the spectrometer is initialized Log("The Flame X sends introspective commands during initialization."); mySpectrometerID = spectrometerID; // even though these were called in the initialization, call again to display values. numberOfPixels = SeaBreezeWrapper.seabreeze_get_number_of_pixels(spectrometerID, ref errorCode); if (errorCode == SeaBreezeWrapper.ERROR_SUCCESS) { Log("Executed Command: 0x00110220 Get number of pixels. " + numberOfPixels.ToString()); } else { Log("Failure getting pixel count: " + GetErrorDescription(errorCode)); } int numberOfIndicies = SeaBreezeWrapper.seabreeze_get_active_pixel_indices(spectrometerID, ref errorCode, ref pixelIndicies[0], 32); if (errorCode == SeaBreezeWrapper.ERROR_SUCCESS) { string indicies = ""; for (int x = 0; x < numberOfIndicies; x = x + 2) { indicies = indicies + "(" + pixelIndicies[x].ToString() + ", " + pixelIndicies[x + 1].ToString() + ") "; } Log("Executed Command: 0x00110221 Get active pixel ranges:" + indicies); } else { Log("Failure getting pixel count: " + GetErrorDescription(errorCode)); } int opticalDarkIndex = SeaBreezeWrapper.seabreeze_get_optical_dark_pixel_indices(spectrometerID, ref errorCode, ref pixelIndicies[0], 32); if (errorCode == SeaBreezeWrapper.ERROR_SUCCESS) { string indicies = ""; for (int x = 0; x < opticalDarkIndex; x = x + 2) { indicies = indicies + "(" + pixelIndicies[x].ToString() + ", " + pixelIndicies[x + 1].ToString() + ") "; } Log("Executed Command: 0x00110222 Get optical dark pixel ranges" + indicies); } else { Log("Failure getting pixel count: " + GetErrorDescription(errorCode)); } int electricDarkPixelIndex = SeaBreezeWrapper.seabreeze_get_electric_dark_pixel_indices(spectrometerID, ref errorCode, ref pixelIndicies[0], 32); if (errorCode == SeaBreezeWrapper.ERROR_SUCCESS) { string indicies = ""; for (int x = 0; x < electricDarkPixelIndex; x = x + 2) { indicies = indicies + "(" + pixelIndicies[x].ToString() + ", " + pixelIndicies[x + 1].ToString() + ") "; } Log("Executed Command: 0x00110223 Get electrical dark pixel ranges" + indicies); } else { Log("Failure getting pixel count: " + GetErrorDescription(errorCode)); } }