NetOceanDirect
2.4.0
OceanDirect .NET API
|
Inherits NetOceanDirect::ManagedObject< OceanDirectAPI >.
Public Types | |
enum class | FeatureID { FEATURE_ID_SERIAL_NUMBER = ::FeatureId::FEATURE_ID_SERIAL_NUMBER , FEATURE_ID_SPECTROMETER = ::FeatureId::FEATURE_ID_SPECTROMETER , FEATURE_ID_THERMOELECTRIC = ::FeatureId::FEATURE_ID_THERMOELECTRIC , FEATURE_ID_IRRADCAL = ::FeatureId::FEATURE_ID_IRRADCAL , FEATURE_ID_EEPROM = ::FeatureId::FEATURE_ID_EEPROM , FEATURE_ID_STROBE_LAMP = ::FeatureId::FEATURE_ID_STROBE_LAMP , FEATURE_ID_WAVECAL = ::FeatureId::FEATURE_ID_WAVECAL , FEATURE_ID_NONLINEARITYCAL = ::FeatureId::FEATURE_ID_NONLINEARITYCAL , FEATURE_ID_STRAYLIGHTCAL = ::FeatureId::FEATURE_ID_STRAYLIGHTCAL , FEATURE_ID_RAW_BUS_ACCESS = ::FeatureId::FEATURE_ID_RAW_BUS_ACCESS , FEATURE_ID_CONTINUOUS_STROBE = ::FeatureId::FEATURE_ID_CONTINUOUS_STROBE , FEATURE_ID_LIGHT_SOURCE = ::FeatureId::FEATURE_ID_LIGHT_SOURCE , FEATURE_ID_TEMPERATURE = ::FeatureId::FEATURE_ID_TEMPERATURE , FEATURE_ID_OPTICAL_BENCH = ::FeatureId::FEATURE_ID_OPTICAL_BENCH , FEATURE_ID_REVISION = ::FeatureId::FEATURE_ID_REVISION , FEATURE_ID_DATA_BUFFER = ::FeatureId::FEATURE_ID_DATA_BUFFER , FEATURE_ID_PIXEL_BINNING = ::FeatureId::FEATURE_ID_PIXEL_BINNING , FEATURE_ID_GPIO = ::FeatureId::FEATURE_ID_GPIO , FEATURE_ID_SINGLE_STROBE = ::FeatureId::FEATURE_ID_SINGLE_STROBE , FEATURE_ID_QUERY_STATUS = ::FeatureId::FEATURE_ID_QUERY_STATUS , FEATURE_ID_BACK_TO_BACK = ::FeatureId::FEATURE_ID_BACK_TO_BACK , FEATURE_ID_LED_ACTIVITY = ::FeatureId::FEATURE_ID_LED_ACTIVITY , FEATURE_ID_TIME_META = ::FeatureId::FEATURE_ID_TIME_META , FEATURE_ID_DHCP = ::FeatureId::FEATURE_ID_DHCP , FEATURE_ID_IPV4_ADDRESS = ::FeatureId::FEATURE_ID_IPV4_ADDRESS , FEATURE_ID_AUTO_NULLING = ::FeatureId::FEATURE_ID_AUTO_NULLING , FEATURE_ID_DEVICE_INFORMATION = ::FeatureId::FEATURE_ID_DEVICE_INFORMATION , FEATURE_ID_DEVICE_ALIAS = ::FeatureId::FEATURE_ID_DEVICE_ALIAS , FEATURE_ID_USER_STRING = ::FeatureId::FEATURE_ID_IPV4_USER_STRING , FEATURE_ID_SERIAL_PORT = ::FeatureId::FEATURE_ID_SERIAL_PORT , FEATURE_ID_PIXEL = ::FeatureId::FEATURE_ID_PIXEL , FEATURE_ID_SPECTRUM_ACQUISITION_CONTROL = ::FeatureId::FEATURE_ID_SPECTRUM_ACQUISITION_CONTROL , FEATURE_ID_NETWORK_CONFIGURATION = ::FeatureId::FEATURE_ID_NETWORK_CONFIGURATION , FEATURE_ID_ETHERNET = ::FeatureId::FEATURE_ID_ETHERNET , FEATURE_ID_SHUTTER = ::FeatureId::FEATURE_ID_SHUTTER } |
Public Member Functions | |
int | addNetworkDevice (String^ ipAddress, String^ deviceType, int% errorCode) |
Advanced | AdvancedFeatures () |
void | applyElectricDarkCorrection (int deviceID, int% errorCode, bool apply) |
void | applyNonLinearityCorrection (int deviceID, int% errorCode, bool apply) |
void | boxcarCorrectSpectrum (long deviceID, int% errorCode, array< double >^% illuminatedSpectrum, unsigned int boxcarWidth) |
void | closeDevice (int deviceID, int% errorCode) |
array< double > | darkCorrectSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum, array< double >^% illuminatedSpectrum) |
array< double > | darkCorrectSpectrum (long deviceID, int% errorCode, array< double >^% illuminatedSpectrum) |
array< Devices^> | findDevices () |
int | findSpectrumLength (int deviceID, int% errorCode) |
array< Devices^> | findUSBDevices () |
void | getAPIRCNumber (unsigned int% candidate) |
Double | getApiVersion () |
void | getApiVersion (unsigned int% major, unsigned int% minor, unsigned int% point) |
unsigned int | getBoxcarWidth (long deviceID, int% errorCode) |
array< Devices^> | getCurrentDevicesConnected () |
array< double > | getDarkCorrectedSpectrum (long deviceID, int% errorCode) |
array< double > | getDarkCorrectedSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum) |
unsigned long | getDelayIncrementMicroseconds (long deviceID, int% errorCode) |
unsigned long | getDelayMaximumMicroseconds (long deviceID, int% errorCode) |
unsigned long | getDelayMicroseconds (long deviceID, int% errorCode) |
unsigned long | getDelayMinimumMicroseconds (long deviceID, int% errorCode) |
array< int > | getDeviceIDs () |
String | getDeviceModel (long deviceID, int% errorCode) |
int | getEDPCount (int deviceID, int% errorCode) |
array< int > | getEDPIndices (int deviceID, int% errorCode, int length) |
bool | getElectricDarkCorrectionUsage (int deviceID, int% errorCode) |
String | getErrorMessage (int errorCode) |
int | getErrorMessageLength (int errorCode) |
int | getIndexAtWavelength (long deviceID, int% errorCode, double% wavelength, double aproxWavelength) |
array< int > | getIndicesAtAnyWavelength (long deviceID, int% errorCode, array< double >^% wavelength, int length) |
array< int > | getIndicesAtWavelengthRange (long deviceID, int% errorCode, array< double >^% wavelength, double lo, double hi) |
unsigned long | getIntegrationTimeMicros (int deviceID, int% errorCode) |
unsigned long | getIntegrationTimeStepSize (int deviceID, int% errorCode) |
unsigned long | getMaximumIntegrationTime (int deviceID, int% errorCode) |
double | getMaximumIntensity (int deviceID, int% errorCode) |
unsigned long | getMinimumAveragingIntegrationTimeMicros (long deviceID, int% errorCode) |
unsigned long | getMinimumIntegrationTime (int deviceID, int% errorCode) |
array< double > | getNonlinearityCorrectedSpectrum (long deviceID, int% errorCode) |
array< double > | getNonlinearityCorrectedSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum) |
bool | getNonLinearityCorrectionUsage (int deviceID, int% errorCode) |
int | getNumberOfPixels (int deviceID, int% errorCode) |
array< SpectrumWithMetadata^> | getRawSpectrumWithMetadata (int deviceID, int% errorCode, int count) |
unsigned int | getScansToAverage (long deviceID, int% errorCode) |
String | getSerialNumber (long deviceID, int% errorCode) |
array< double > | getSpectrum (int deviceID, int% errorCode) |
array< double > | getStoredDarkSpectrum (long deviceID, int% errorCode) |
int | getTriggerMode (long deviceID, int% errorCode) |
double | getWavelength (int deviceID, int% errorCode, int pixel) |
array< double > | getWavelengthCoefficients (long deviceID, int% errorCode) |
array< double > | getWavelengths (int deviceID, int% errorCode) |
bool | isFeatureEnabled (int deviceID, int% errorCode, NetOceanDirect::OceanDirect::FeatureID featureId) |
array< double > | nonlinearityCorrectSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum, array< double >^% illuminatedSpectrum) |
array< double > | nonlinearityCorrectSpectrum (long deviceID, int% errorCode, array< double >^% illuminatedSpectrum) |
void | openDevice (int deviceID, int% errorCode) |
void | setBoxcarWidth (long deviceID, int% errorCode, unsigned int boxcarWidth) |
void | setDelayMicroseconds (long deviceID, int% errorCode, unsigned long delay_usec) |
void | setIntegrationTimeMicros (int deviceID, int% errorCode, unsigned long integrationTimeMicros) |
void | setScansToAverage (long deviceID, int% errorCode, unsigned int scansToAverage) |
void | setStoredDarkSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum) |
void | setTriggerMode (int deviceID, int% errorCode, int triggerMode) |
void | shutDown () |
![]() | |
ManagedObject (OceanDirectAPI *instance) | |
OceanDirectAPI * | GetInstance () |
Static Public Member Functions | |
static OceanDirect | getInstance () |
Static Public Attributes | |
static OceanDirect | odInstance |
Additional Inherited Members | |
![]() | |
OceanDirectAPI * | m_Instance |
|
strong |
enum class used to determine if spectrometer features are enabled with the method isFeatureEnabled. This is now redeclared as an enum class to expose it to .NET The :: is not strictly necessary but it makes it obvious where the original enum is from
int OceanDirect::addNetworkDevice | ( | String^ | ipAddress, |
String^ | deviceType, | ||
int% | errorCode | ||
) |
Manually create an instance of the network attached device and then open it with openDevice() function. It is the responsiblitiy of the user to ensure that the device existed and configured properly. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
[in] | ipAddress | The ip address of the device to be opened. |
[in] | deviceType | The device type could be OceanFX or OceanHDX. This is case sensitive. |
[out] | errorCode | A code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; |
Advanced OceanDirect::AdvancedFeatures | ( | ) |
Retrieves a tracked handle to an Advanced instance, which may be used to access advanced hardware features beyond what is accessible from the OceanDirect class alone, such as trigger delay or raw USB access.
void OceanDirect::applyElectricDarkCorrection | ( | int | deviceID, |
int% | errorCode, | ||
bool | apply | ||
) |
[in] | deviceID | The device ID of the device to configure |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_TRANSFER_ERROR if data transfer to/from device fails |
[in] | Apply | true or false. |
void OceanDirect::applyNonLinearityCorrection | ( | int | deviceID, |
int% | errorCode, | ||
bool | apply | ||
) |
[in] | deviceID | The device ID of the device to configure |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID |
[in] | Apply | true or false. |
void OceanDirect::boxcarCorrectSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | illuminatedSpectrum, | ||
unsigned int | boxcarWidth | ||
) |
Apply a boxcar correction on the given illuminated spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_COMMAND_NOT_SUPPORTED if device does not support this command. |
[in/out] | illuminatedSpectrum The spectrum that will be boxcar corrected. | |
[in] | boxcarWidth | The boxcar width. |
void OceanDirect::closeDevice | ( | int | deviceID, |
int% | errorCode | ||
) |
Closes the spectrometer with the given ID, which cleans up associated resources and cached values and allows it to be disconnected from the computer with no negative repurcussions. Only spectrometers that have already been opened using openDevice() should be closed. The id becomes invalid after closing the device. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
[in] | deviceID | The device ID of the device to be closed |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid device ID |
array< double > OceanDirect::darkCorrectSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | darkSpectrum, | ||
array< double >^% | illuminatedSpectrum | ||
) |
Dark correct a previously acquired illuminated spectrum and using a previously acquired dark spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | A code indicating the result of the operation: ERROR_SUCCESS on success; |
[in] | darkSpectrum | The buffer that contains the dark spectrum to be used for the dark correction. |
[in] | illuminatedSpectrum | The buffer that contains the illuminated spectrum to be corrected. |
array< double > OceanDirect::darkCorrectSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | illuminatedSpectrum | ||
) |
Dark correct a previously acquired illuminated spectrum and using a stored dark spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found. |
[in] | illuminatedSpectrum | The buffer that contains the illuminated spectrum to be corrected. |
array< NetOceanDirect::Devices^> OceanDirect::findDevices | ( | ) |
Finds all available Ocean devices by scanning on USB for devices with Ocean drivers, finding devices that respond to UDP multicast (FX and HDX), and also returning IDs for any TCP-enabled devices that have been manually specified using addTCPDeviceLocation(). Returns a list of Devices objects corresponding to all of these devices, which contain some associated metadata, including their device IDs, which may be used to refer to them using the other OceanDirect member functions (starting with openDevice()). Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
int OceanDirect::findSpectrumLength | ( | int | deviceID, |
int% | errorCode | ||
) |
Return the length of spectra.
array< NetOceanDirect::Devices^> OceanDirect::findUSBDevices | ( | ) |
Finds all available Ocean devices by scanning on USB for devices with Ocean drivers. Returns a list of Devices objects corresponding to all of these devices, which contain some associated metadata, including their device IDs, which may be used to refer to them using the other OceanDirect member functions (starting with openDevice()). Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
Double OceanDirect::getApiVersion | ( | ) |
[in] | deviceID | The device ID of the device to query |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a currently-open device ERROR_FEATURE_NOT_FOUND if device does not support this feature |
void OceanDirect::getApiVersion | ( | unsigned int% | major, |
unsigned int% | minor, | ||
unsigned int% | point | ||
) |
Retrieves the API version number (major.minor.point) for the Ocean Direct SDK
[out] | major | the major number of the software version. |
[out] | minor | the minor number of the software version. |
[out] | point | the point number of the software version. |
unsigned int OceanDirect::getBoxcarWidth | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the given device's current boxcar filter width setting.
[in] | deviceID | The device ID for the device to be queried (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
array< NetOceanDirect::Devices^> OceanDirect::getCurrentDevicesConnected | ( | ) |
Finds all available Ocean devices which are currently attached by scanning on USB for devices with Ocean drivers. Returns information whether device is in use or not.
array< double > OceanDirect::getDarkCorrectedSpectrum | ( | long | deviceID, |
int% | errorCode | ||
) |
Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_VALUE_NOT_FOUND no stored dark spectrum was found. ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
array< double > OceanDirect::getDarkCorrectedSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | darkSpectrum | ||
) |
Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
[in] | darkSpectrum | The buffer that contains the dark spectrum to be used for the dark correction. |
unsigned long OceanDirect::getDelayIncrementMicroseconds | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the given device's acquisition delay resolution, which is the minimum delta between possible consecutive acquisition delay settings. The device supports a range of acquisition delay settings [min, max] with intermediate values spaced apart by this quantity, which forms the following range in MATLAB notation: getDelayMinimumMicroseconds() : getDelayIncrementMicroseconds() : getDelayMaximumMicroseconds()
[in] | deviceID | The device ID for the device to be queried (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise |
unsigned long OceanDirect::getDelayMaximumMicroseconds | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the given device's maximum possible acquisition delay setting.
[in] | deviceID | The device ID for the device to be queried (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise |
unsigned long OceanDirect::getDelayMicroseconds | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the given device's current acquisition delay setting (time between when device receives trigger signal and when integration begins). *
[in] | deviceID | The device ID for the device to be queried (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise |
unsigned long OceanDirect::getDelayMinimumMicroseconds | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the given device's minimum possible acquisition delay setting.
[in] | deviceID | The device ID for the device to be queried (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise |
array< int > OceanDirect::getDeviceIDs | ( | ) |
Return an array of device ids from devices that were both probe or manually added. Note that this should only be done by one thread at a time.
String OceanDirect::getDeviceModel | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the model name from the specified device
[in] | deviceID | The device ID of the device to query |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a currently-open device ERROR_FEATURE_NOT_FOUND if device does not support this feature |
int OceanDirect::getEDPCount | ( | int | deviceID, |
int% | errorCode | ||
) |
Retrieves the number of electric dark pixels on the detector of the given device. Electric dark pixels are optically masked so that they receive no light. Does not communicate with the device - uses cached values.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; |
array< int > OceanDirect::getEDPIndices | ( | int | deviceID, |
int% | errorCode, | ||
int | length | ||
) |
Retrieves the indices of electric dark pixels on the detector of the given device. Electric dark pixels are optically masked so that they receive no light. Does not communicate with the device - uses cached values.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature |
[in] | length | The number of indices to retrieve, starting with the least (determines length of returned) |
bool OceanDirect::getElectricDarkCorrectionUsage | ( | int | deviceID, |
int% | errorCode | ||
) |
Gets electric dark correction usage from the given device.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_TRANSFER_ERROR if data transfer to/from device fails |
String OceanDirect::getErrorMessage | ( | int | errorCode | ) |
Get the error message associated with the given error code. If the error code is incorrect then the return message will be "Error. Undefined error".
[in] | errorCode | The error code. |
int OceanDirect::getErrorMessageLength | ( | int | errorCode | ) |
Get the error message length associated with the given error code. If the error code is incorrect then the return message length will be 0.
[in] | errorCode | The error code. |
int OceanDirect::getIndexAtWavelength | ( | long | deviceID, |
int% | errorCode, | ||
double% | wavelength, | ||
double | aproxWavelength | ||
) |
Determines the pixel index on the given device that measures light at a wavelength closest to the given query wavelength. Does not communicate with the device - uses cached wavelengths.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS if aproxWavelength does not fall within wavelength bounds of detector |
[out] | wavelength | The wavelength of light measured by the pixel that most closely matches aproxWavelength, in nanometers |
[in] | aproxWavelength | The query wavelength for which to look up the closest pixel index, in nanometers |
array< int > OceanDirect::getIndicesAtAnyWavelength | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | wavelength, | ||
int | length | ||
) |
As getIndexAtWavelength, but looks up multiple query wavelengths and returns an index for each.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS if aproxWavelength does not fall within wavelength bounds of detector |
[in,out] | wavelength | The query wavelengths for which to look up the closest pixel indices, in nanometers. Will be overwritten with a new pointer to a new array containing the same values. |
[in] | length | The length of wavelength, in elements |
array< int > OceanDirect::getIndicesAtWavelengthRange | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | wavelength, | ||
double | lo, | ||
double | hi | ||
) |
Retrieves the indices and wavelengths of pixels that measure light at wavelengths within the given spectral range.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS if lo or hi do not fall within wavelength bounds of detector |
[out] | wavelength | List of wavelengths of pixels whose indices are returned (length of array is given in length output parameter), given in nanometers |
[in] | lo | The inclusive lower bound of the wavelength range to look within, in nanometers |
[in] | hi | The inclusive upper bound of the wavelength range to look within, in nanometers |
|
inlinestatic |
Creates a tracked handle to an OceanDirect instance, which may be used to access all of the functionality listed below.
unsigned long OceanDirect::getIntegrationTimeMicros | ( | int | deviceID, |
int% | errorCode | ||
) |
Gets current integration time from the given device.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if data transfer to/from device fails |
unsigned long OceanDirect::getIntegrationTimeStepSize | ( | int | deviceID, |
int% | errorCode | ||
) |
Gets the integration time step size from the given device. Use this value when making changes with the integration time.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if data transfer to/from device fails |
unsigned long OceanDirect::getMaximumIntegrationTime | ( | int | deviceID, |
int% | errorCode | ||
) |
Returns the maximum allowed integration time for the given device. Trying to set the device's integration time to a value above this maximum will result in setIntegrationTimeMicros() silently clamping the given time to this maximum value. Does not communicate with the device - uses cached values.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature |
double OceanDirect::getMaximumIntensity | ( | int | deviceID, |
int% | errorCode | ||
) |
Returns the greatest intensity value that could possibly be reported at any pixel by the given device (i.e., by getSpectrum()). Does not communicate with the device - uses cached values.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature |
unsigned long OceanDirect::getMinimumAveragingIntegrationTimeMicros | ( | long | deviceID, |
int% | errorCode | ||
) |
Get minimum integration time in microseconds when averaging is enabled. NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is not enabled can be determined using getMinimumIntegrationTimeMicros.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
unsigned long OceanDirect::getMinimumIntegrationTime | ( | int | deviceID, |
int% | errorCode | ||
) |
Returns the minimum allowed integration time for the given device. Trying to set the device's integration time to a value below this minimum will result in setIntegrationTimeMicros() silently clamping the given time to this minimum value. Does not communicate with the device - uses cached values. NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is enabled can be determined using getMinimumAveragingIntegrationTimeMicros.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature |
array< double > OceanDirect::getNonlinearityCorrectedSpectrum | ( | long | deviceID, |
int% | errorCode | ||
) |
Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction followed by a nonlinearity correction then return the nonlinearity corrected spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
array< double > OceanDirect::getNonlinearityCorrectedSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | darkSpectrum | ||
) |
Acquire a spectrum and use the supplied dark spectrum to perform a dark correction followed by the nonlinearity correction then return the nonlinearity corrected spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
[in] | darkSpectrum | The buffer that contains the dark spectrum to be used for the dark correction. |
bool OceanDirect::getNonLinearityCorrectionUsage | ( | int | deviceID, |
int% | errorCode | ||
) |
Gets nonlinearity correction usage from the given device.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID |
int OceanDirect::getNumberOfPixels | ( | int | deviceID, |
int% | errorCode | ||
) |
Gets the number of pixels on the detector, which matches the length of spectra returned by getSpectrum or wavelengths returned by getWavelengths(). Depends on device and current pixel binning mode, if applicable. Does not actually communicate with the device, since this value is read during openDevice() and cached in OceanDirect.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature |
array< NetOceanDirect::SpectrumWithMetadata^> OceanDirect::getRawSpectrumWithMetadata | ( | int | deviceID, |
int% | errorCode, | ||
int | count | ||
) |
Retrieved raw spectrum with timestamp. To use this function, the data buffer must be enabled and the back-to-back spectra acquisition count be set. Note: this method will return up to the maximum number of spectra specified. Some spectrometer types may return a single spectrum at a time so it is advisable to check the size of the returned array.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_COMMAND_NOT_SUPPORTED this command is not supported by the device ERROR_TRANSFER_ERROR if data transfer to/from device fails |
[in] | count | The maximum desired number of spectra to retrieve. This must be between 1 and 15. |
unsigned int OceanDirect::getScansToAverage | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the given device's current averaging setting.
[in] | deviceID | The device ID for the device to be queried (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
String OceanDirect::getSerialNumber | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the serial number of the given device.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
array< double > OceanDirect::getSpectrum | ( | int | deviceID, |
int% | errorCode | ||
) |
Retrieves a spectral measurement in a manner depending on the device's current trigger mode.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
array< double > NetOceanDirect::OceanDirect::getStoredDarkSpectrum | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieve a previously stored dark spectrum for use in subsequent corrections i.e. dark correction and nonlinearity correction.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_NO_DEVICE if the device does not exist. |
int OceanDirect::getTriggerMode | ( | long | deviceID, |
int% | errorCode | ||
) |
Read the spectrometer trigger mode. Please see your spectrometer documentation for valid values of the trigger mode.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_COMMAND_NOT_SUPPORTED this command is not supported by the device; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_CODE_INVALID_ARGUMENT if the mode supplied is not valid; ERROR_NO_DEVICE if the device does not exist. |
double OceanDirect::getWavelength | ( | int | deviceID, |
int% | errorCode, | ||
int | pixel | ||
) |
Gets wavelength for a single pixel on the detector at the specified index.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
[in] | pixel | Index (zero-based) of pixel on detector for which to get the wavelength - must be on range [0, getNumberOfPixels()-1] |
IndexOutOfRangeException | if provided pixel index is not in valid range |
array< double > OceanDirect::getWavelengthCoefficients | ( | long | deviceID, |
int% | errorCode | ||
) |
Retrieves the wavelength coefficients of the given device.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
array< double > OceanDirect::getWavelengths | ( | int | deviceID, |
int% | errorCode | ||
) |
Gets wavelength at which each pixel on the device's detector reports intensity.
[in] | deviceID | The device ID of the device to be queried |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
bool OceanDirect::isFeatureEnabled | ( | int | deviceID, |
int% | errorCode, | ||
NetOceanDirect::OceanDirect::FeatureID | featureId | ||
) |
Determines whether a feature is supported by a particular spectrometer or not.
[in] | deviceID | The device ID of the device to query |
[in] | FeatureID | The enumeration of the feature to query |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a currently-open device ERROR_FEATURE_NOT_FOUND if device does not support this feature |
array< double > OceanDirect::nonlinearityCorrectSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | darkSpectrum, | ||
array< double >^% | illuminatedSpectrum | ||
) |
Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_COMMAND_NOT_SUPPORTED if device does not support this command. |
[in] | darkSpectrum | The buffer that contains the dark spectrum to be used prior to the nonlinearity correction. |
[in] | illuminatedSpectrum | The buffer that contains the illuminated spectrum to be corrected. |
array< double > OceanDirect::nonlinearityCorrectSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | illuminatedSpectrum | ||
) |
Nonlinearity correct a previously acquired illuminated spectrum using a stored dark spectrum. This function performs a dark correction using a previously stored dark spectrum prior to performing the nonlinearity correction.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_COMMAND_NOT_SUPPORTED if device does not support this command. |
[in] | illuminatedSpectrum | The buffer that contains the illuminated spectrum to be corrected. |
void OceanDirect::openDevice | ( | int | deviceID, |
int% | errorCode | ||
) |
Opens the spectrometer with the given device ID, which allows the various operations listed below to be performed on it by passing this same device ID. After being opened, the spectrometer not be opened again until it is first closed using closeDevice(). After the device is closed the id becomes invalid. You need to call either findDevices()/findUSBDevices/addNetworkDevice() and getDeviceIDs() in order to have a valid id before reopening the device again. For a network connected device this function may return an error code if the device is not yet ready to accept incoming connection or the device is unreachable. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
[in] | deviceID | The device ID of the device to be opened (get using findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid device ID or device does not support spectrometer feature. |
void OceanDirect::setBoxcarWidth | ( | long | deviceID, |
int% | errorCode, | ||
unsigned int | boxcarWidth | ||
) |
Sets the boxcar filter width for a given device.
[in] | deviceID | The device ID for the device to be configured (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails |
[in] | boxcarWidth | The width of the boxcar filter to be applied on the device |
void OceanDirect::setDelayMicroseconds | ( | long | deviceID, |
int% | errorCode, | ||
unsigned long | delay_usec | ||
) |
Sets acquisition delay (time between when device receives trigger signal and when integration begins) for the given device. Functions such as getDelayMaximumMicroseconds() can be used to determine valid values for this setting.
[in] | deviceID | The device ID for the device to be configured (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise |
[in] | delay_usec | The new acquisition delay, in microseconds |
void OceanDirect::setIntegrationTimeMicros | ( | int | deviceID, |
int% | errorCode, | ||
unsigned long | integrationTimeMicros | ||
) |
Sets integration time for the given device, which is how long the detector collects photons before reading it out. NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is enabled can be determined using getMinimumAveragingIntegrationTimeMicros.
[in] | deviceID | The device ID of the device to configure |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_INPUT_OUT_OF_BOUNDS if an invalid integration time is supplied ERROR_INTEGRATION_TIME_BELOW_AVERAGING_MIN if averaging is enabled and the specified integration time is below the minimum required for averaging (see getMinimumAveragingIntegrationTimeMicros); ERROR_TRANSFER_ERROR if data transfer to/from device fails |
[in] | integrationTimeMicros | The integration time to set, in microseconds |
void OceanDirect::setScansToAverage | ( | long | deviceID, |
int% | errorCode, | ||
unsigned int | scansToAverage | ||
) |
Sets the number of scans to be averaged per measurement for a given device. When this value is set greater than 1 the specified number of spectra are averaged and the resulting average is returned by getFormattedSpectrum (or getRawSpectrumWithMetadata). NOTE: Some devices have a minimum integration time for averaging that is different to the minimum integration time for unaveraged acquisition (see your spectrometer documentation to determine if this is a requirement).
[in] | deviceID | The device ID for the device to be configured (from OceanDirect::findDevices()) |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails ERROR_INTEGRATION_TIME_BELOW_AVERAGING_MIN if the current integration time is below the minimum required for averaging it will not be possible to enable averaging (see getMinimumAveragingIntegrationTimeMicros); |
[in] | scansToAverage | The number of scans to average on the device for each measurement |
void OceanDirect::setStoredDarkSpectrum | ( | long | deviceID, |
int% | errorCode, | ||
array< double >^% | darkSpectrum | ||
) |
Store a dark spectrum for use in subsequent corrections i.e. dark correction and nonlinearity correction.
[in] | deviceID | The identifier of the device as returned by getDeviceIDs. |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_NO_DEVICE if the device does not exist. |
[int] | darkSpectrum The buffer that contains the dark spectrum to be stored. |
void OceanDirect::setTriggerMode | ( | int | deviceID, |
int% | errorCode, | ||
int | triggerMode | ||
) |
Sets trigger mode for the given device, which signals when to collects photons.
[in] | deviceID | The device ID of the device to configure |
[out] | errorCode | Set to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_INPUT_OUT_OF_BOUNDS if an invalid integration time is supplied ERROR_TRANSFER_ERROR if data transfer to/from device fails |
[in] | triggerMode | Refer to your device manual on supported trigger modes. |
void OceanDirect::shutDown | ( | ) |
This may be called to free up any allocated memory being held by the driver interface. This must be called before the program ends.