OceanDirect
2.4.0
OceanDirect C++/C API
|
Public Member Functions | |
int | addNetworkDevice (const char *ipAddressStr, const char *deviceTypeStr, int *errorCode) |
void | addRS232DeviceLocation (char *deviceTypeName, char *deviceBusPath, unsigned int baud, int *errorCode) |
Advance * | AdvancedControl () |
void | applyElectricDarkCorrection (long deviceID, int *errorCode, bool value) |
void | applyNonLinearityCorrection (long deviceID, int *errorCode, bool value) |
void | boxcarCorrectSpectrum (long deviceID, int *errorCode, double *illuminatedSpectrum, unsigned int illuminatedSpectrumLength, unsigned int boxcarWidth) |
void | closeDevice (long deviceID, int *errorCode) |
int | darkCorrectSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
int | darkCorrectSpectrum (long deviceID, int *errorCode, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
int | detectNetworkDevices () |
bool | electricDarkCorrectionUsage (long deviceID, int *errorCode) |
void | getAPIRCNumber (unsigned int *candidate) |
double | getAPIVersionNumber () |
void | getAPIVersionNumber (unsigned int *major, unsigned int *minor, unsigned int *point) |
unsigned short int | getBoxcarWidth (long deviceID, int *errorCode) |
int | getDarkCorrectedSpectrum (long deviceID, int *errorCode, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
int | getDarkCorrectedSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
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) |
IDevice * | getDeviceByID (unsigned long id) |
unsigned char | getDeviceEndpoint (long deviceID, int *error_code, usbEndpointType endpointType) |
int | getDeviceIDs (long *ids, unsigned long maxLength) |
int | getDeviceModelText (long deviceID, int *errorCode, char *buffer, unsigned int bufferLength) |
int | getDeviceType (long deviceID, int *errorCode, char *buffer, unsigned int length) |
int | getElectricDarkPixelCount (long deviceID, int *errorCode) |
int | getElectricDarkPixelIndices (long deviceID, int *errorCode, int *indices, int length) |
int | getErrorMessage (int errorCode, char *returnMessage, int length) |
int | getErrorStringLength (int errorCode) |
int | getFormattedSpectrum (long deviceID, int *errorCode, double *buffer, int bufferLength) |
int | getFormattedSpectrumLength (long deviceID, int *errorCode) |
int | getIndexAtWavelength (long deviceID, int *errorCode, double &wavelength, double approxWavelength) |
int | getIndicesAtAnyWavelength (long deviceID, int *errorCode, int *indices, int indicesLength, double *wavelength, int wavelengthLength) |
int | getIndicesAtWavelengthRange (long deviceID, int *errorCode, int *indices, int indicesLength, double *wavelengthLength, int wavelengthSize, double lo, double hi) |
unsigned long | getIntegrationTimeIncrementMicros (long deviceID, int *errorCode) |
unsigned long | getIntegrationTimeMicros (long deviceID, int *errorCode) |
unsigned long | getMaximumIntegrationTimeMicros (long deviceID, int *errorCode) |
double | getMaximumIntensity (long deviceID, int *errorCode) |
unsigned long | getMinimumAveragingIntegrationTimeMicros (long deviceID, int *errorCode) |
unsigned long | getMinimumIntegrationTimeMicros (long deviceID, int *errorCode) |
int | getNetworkDeviceIDs (long *ids, unsigned long maxLength) |
int | getNonlinearityCorrectedSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
int | getNonlinearityCorrectedSpectrum (long deviceID, int *errorCode, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
int | getNumberOfDeviceIDs () |
int | getRawSpectrumWithMetadata (long deviceID, int *errorCode, SpectrumWithMetadata *buffer, int bufferLength) |
unsigned int | getScansToAverage (long deviceID, int *errorCode) |
int | getSerialNumber (long deviceID, int *errorCode, char *buffer, int bufferLength) |
unsigned char | getSerialNumberMaximumLength (long deviceID, int *errorCode) |
int | getStoredDarkSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength) |
long long int | getTime (long deviceID, int *errorCode) |
int | getTriggerMode (long deviceID, int *errorCode) |
int | getWavelengthCoefficients (long deviceID, int *errorCode, double *coeff, int length) |
int | getWavelengths (long deviceID, int *errorCode, double *wavelengths, int length) |
bool | isFeatureEnabled (long deviceId, int *errorCode, FeatureId featureId) |
bool | nonLinearityCorrectionUsage (long deviceID, int *errorCode) |
int | nonlinearityCorrectSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
int | nonlinearityCorrectSpectrum (long deviceID, int *errorCode, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
void | openDevice (long deviceID, int *errorCode) |
int | probeDevices () |
void | setBoxcarWidth (long deviceID, int *errorCode, unsigned short int boxcarWidth) |
void | setDelayMicroseconds (long deviceID, int *errorCode, unsigned long delayMicroseconds) |
void | setIntegrationTimeMicros (long deviceID, int *errorCode, unsigned long integrationTimeMicros) |
void | setScansToAverage (long deviceID, int *errorCode, unsigned int scansToAverage) |
void | setStoredDarkSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength) |
void | setTime (long deviceID, int *errorCode, long long int timeInMicrosecond) |
void | setTriggerMode (long deviceID, int *errorCode, int mode) |
Static Public Member Functions | |
static OceanDirectAPI * | getInstance () |
static void | shutdown () |
Friends | |
class | NetOceanDirectAdmin |
class | OceanDirectAdminAPI |
int oceandirect::api::OceanDirectAPI::addNetworkDevice | ( | const char * | ipAddressStr, |
const char * | deviceTypeStr, | ||
int * | errorCode | ||
) |
Manually create an instance of the network attached device and then open it using the openDevice() function. It is the responsiblitiy of the user to ensure that the device exists and is configured properly. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
ipAddressStr | The ip address as string (ex: "10.20.30.100" ) of the device to be opened. |
deviceTypeStr | The device type could be OceanFX or OceanHDX. This is case sensitive. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; |
void oceandirect::api::OceanDirectAPI::addRS232DeviceLocation | ( | char * | deviceTypeName, |
char * | deviceBusPath, | ||
unsigned int | baud, | ||
int * | errorCode | ||
) |
Use the addRS232DeviceLocation() method to specify that a device may be found on a particular serial bus with a given baud rate. Once specified, the typical openDevice() function can be used to access it.
deviceTypeName | a valid Ocean spectrometer device type. |
deviceBusPath | a valid serial port path that the device is connected to. |
baud | the baud rate for the specified serial port. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_CODE_INVALID_ARGUMENT if the device cannot be created. |
Advance* oceandirect::api::OceanDirectAPI::AdvancedControl | ( | ) |
Advanced extension of the API. Access to the advanced APIs is throught the pointer returned by this function.
void oceandirect::api::OceanDirectAPI::applyElectricDarkCorrection | ( | long | deviceID, |
int * | errorCode, | ||
bool | value | ||
) |
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_NO_DEVICE if the device does not exist. |
void oceandirect::api::OceanDirectAPI::applyNonLinearityCorrection | ( | long | deviceID, |
int * | errorCode, | ||
bool | value | ||
) |
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist. |
value | true if nonlinearity correction is to be used, false otherwise. |
void oceandirect::api::OceanDirectAPI::boxcarCorrectSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | illuminatedSpectrum, | ||
unsigned int | illuminatedSpectrumLength, | ||
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::api::OceanDirectAPI::closeDevice | ( | long | deviceID, |
int * | errorCode | ||
) |
This will attempt to close the bus connection to the device with the given ID. 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.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist. |
int oceandirect::api::OceanDirectAPI::darkCorrectSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkSpectrum, | ||
int | darkSpectrumLength, | ||
double * | illuminatedSpectrum, | ||
int | illuminatedSpectrumLength, | ||
double * | darkCorrectedSpectrum, | ||
int | darkCorrectedSpectrumLength | ||
) |
Dark correct a previously acquired illuminated spectrum using a previously acquired dark spectrum.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; |
darkSpectrum | the buffer that contains the dark spectrum to be used for the dark correction. |
darkSpectrumLength | the actual size of the dark spectrum buffer. |
illuminatedSpectrum | the buffer that contains the illuminated spectrum to be corrected. |
illuminatedSpectrumLength | the actual size of the illuminated spectrum buffer. |
darkCorrectedSpectrum | the buffer that will receive the dark corrected spectrum. |
darkCorrectedSpectrumLength | the actual size of the dark corrected buffer. |
int oceandirect::api::OceanDirectAPI::darkCorrectSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | illuminatedSpectrum, | ||
int | illuminatedSpectrumLength, | ||
double * | darkCorrectedSpectrum, | ||
int | darkCorrectedSpectrumLength | ||
) |
Dark correct a previously acquired illuminated spectrum using a stored dark spectrum.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_VALUE_NOT_FOUND no stored dark spectrum was found. |
illuminatedSpectrum | the buffer that contains the illuminated spectrum to be corrected. |
illuminatedSpectrumLength | the actual size of the illuminated spectrum buffer. |
darkCorrectedSpectrum | the buffer that will receive the dark corrected spectrum. |
darkCorrectedSpectrumLength | the actual size of the dark corrected buffer. |
int oceandirect::api::OceanDirectAPI::detectNetworkDevices | ( | ) |
This provides a way to find all Ethernet discoverable devices on a network. Afterwards, a call to probeDevices is neccessary to grab the interface for opening and connecting to discovered device. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
bool oceandirect::api::OceanDirectAPI::electricDarkCorrectionUsage | ( | long | deviceID, |
int * | errorCode | ||
) |
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_NO_DEVICE if the device does not exist. |
double oceandirect::api::OceanDirectAPI::getAPIVersionNumber | ( | ) |
void oceandirect::api::OceanDirectAPI::getAPIVersionNumber | ( | unsigned int * | major, |
unsigned int * | minor, | ||
unsigned int * | point | ||
) |
Return the major, minor and point release version numbers.
major | the major software version number. |
minor | the minor software version number. |
point | the point software version number. |
unsigned short int oceandirect::api::OceanDirectAPI::getBoxcarWidth | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the width of the boxcar smoothing to be applied to the returned spectrum. When this value has been set greater than 0, boxcar smoothing (a moving average) is applied to the spectrum returned by getFormattedSpectrum (or getRawSpectrumWithMetadata). The width specified is the number of pixels either side of the central pixel of the average i.e. if the result of this function is n, the "full width" of the smoothing is 2*n+1.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
int oceandirect::api::OceanDirectAPI::getDarkCorrectedSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkCorrectedSpectrum, | ||
int | darkCorrectedSpectrumLength | ||
) |
Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
darkCorrectedSpectrum | the buffer that will receive the dark corrected spectrum. |
darkCorrectedSpectrumLength | the actual size of the dark correction buffer. |
int oceandirect::api::OceanDirectAPI::getDarkCorrectedSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkSpectrum, | ||
int | darkSpectrumLength, | ||
double * | darkCorrectedSpectrum, | ||
int | darkCorrectedSpectrumLength | ||
) |
Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
darkSpectrum | the buffer that contains the dark spectrum to be used for the dark correction. |
darkSpectrumLength | the actual size of the dark spectrum buffer. |
darkCorrectedSpectrum | the buffer that will receive the dark corrected spectrum. |
darkCorrectedSpectrumLength | the actual size of the dark correction buffer. |
unsigned long oceandirect::api::OceanDirectAPI::getDelayIncrementMicroseconds | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the acquisition delay period increment in microseconds. The increment is the minimum difference (in microseconds) between two adjacent, valid acquisition delay periods.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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_NO_DEVICE if the device does not exist. |
unsigned long oceandirect::api::OceanDirectAPI::getDelayMaximumMicroseconds | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the maximum valid acquisition delay period in microseconds.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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_NO_DEVICE if the device does not exist. |
unsigned long oceandirect::api::OceanDirectAPI::getDelayMicroseconds | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the acquisition delay period in microseconds.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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_NO_DEVICE if the device does not exist. |
unsigned long oceandirect::api::OceanDirectAPI::getDelayMinimumMicroseconds | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the minimum valid acquisition delay period in microseconds.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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_NO_DEVICE if the device does not exist. |
unsigned char oceandirect::api::OceanDirectAPI::getDeviceEndpoint | ( | long | deviceID, |
int * | error_code, | ||
usbEndpointType | endpointType | ||
) |
Get the usb endpoint address for a specified type of endpoint
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_INPUT_OUT_OF_BOUNDS if an invalid endpoint value is supplied; ERROR_NO_DEVICE if the device does not exist. |
endpointType | the USB endpoint type (see UsbEndpoint.h) |
int oceandirect::api::OceanDirectAPI::getDeviceIDs | ( | long * | ids, |
unsigned long | maxLength | ||
) |
This provides a unique ID of each device that is detected or specified. The IDs are copied into the user-provided buffer. These IDs are weak references: attempting to access a device that no longer exists will cause an error value to be returned but should not cause any instability. The IDs may be entirely random, but a given ID will always refer to the same device for as long as the program is running. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
ids | the buffer to receive the device IDs. |
maxLength | the actual size of the buffer ids. |
int oceandirect::api::OceanDirectAPI::getDeviceModelText | ( | long | deviceID, |
int * | errorCode, | ||
char * | buffer, | ||
unsigned int | bufferLength | ||
) |
Get the device model name by passing in a pre-allocated buffer
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the feature is not available; ERROR_NO_DEVICE if the device does not exist. |
buffer | a character buffer to receive the device model string. |
bufferLength | the length of the supplied buffer. |
int oceandirect::api::OceanDirectAPI::getDeviceType | ( | long | deviceID, |
int * | errorCode, | ||
char * | buffer, | ||
unsigned int | length | ||
) |
Get a string that describes the type of device
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_BAD_USER_BUFFER if the pointer to the buffer is null or the supplied buffer length is 0; ERROR_NO_DEVICE if the device does not exist. |
buffer | a character buffer to receive the device type string. |
length | the length of the supplied buffer. |
int oceandirect::api::OceanDirectAPI::getElectricDarkPixelCount | ( | long | deviceID, |
int * | errorCode | ||
) |
Get electric dark pixel count
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_NO_DEVICE if the device does not exist. |
int oceandirect::api::OceanDirectAPI::getElectricDarkPixelIndices | ( | long | deviceID, |
int * | errorCode, | ||
int * | indices, | ||
int | length | ||
) |
Get electric dark pixel indices.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_NO_DEVICE if the device does not exist. |
indices | the buffer that will receive the indices of the electric dark pixels. |
length | the actual size of the buffer. |
int oceandirect::api::OceanDirectAPI::getErrorMessage | ( | int | errorCode, |
char * | returnMessage, | ||
int | length | ||
) |
Get error message associated with the given error code. If the error code is incorrect then the return message will be "Error. Undefined error".
errorCode | The error code. |
returnMessage | The output buffer. |
length | Output buffer length |
int oceandirect::api::OceanDirectAPI::getErrorStringLength | ( | int | errorCode | ) |
Get error message length associated with the given error code. If the error code is incorrect then the return message length will be 0.
errorCode | The error code. |
int oceandirect::api::OceanDirectAPI::getFormattedSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | buffer, | ||
int | bufferLength | ||
) |
Get a formatted spectrum
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NOT_ENOUGH_BUFFER_SPACE if the size of the buffer is smaller than the formatted spectrum length; ERROR_NO_DEVICE if the device does not exist. |
buffer | the buffer that will receive the formatted spectrum. |
bufferLength | the actual size of the buffer. |
int oceandirect::api::OceanDirectAPI::getFormattedSpectrumLength | ( | long | deviceID, |
int * | errorCode | ||
) |
Get formatted spectrum length i.e. the number of pixels in the spectrum.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
int oceandirect::api::OceanDirectAPI::getIndexAtWavelength | ( | long | deviceID, |
int * | errorCode, | ||
double & | wavelength, | ||
double | approxWavelength | ||
) |
Get wavelength closest to the specified approximate wavelength.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS the specified wavelengths is not within the device's wavelength range; ERROR_NO_DEVICE if the device does not exist. |
wavelength | the wavelength of the pixel nearest to the approximate wavelength within the device's wavelength range. |
approxWavelength | the approximate wavelength of the desired pixel to be found. |
int oceandirect::api::OceanDirectAPI::getIndicesAtAnyWavelength | ( | long | deviceID, |
int * | errorCode, | ||
int * | indices, | ||
int | indicesLength, | ||
double * | wavelength, | ||
int | wavelengthLength | ||
) |
Get the indices and actual wavelengths of a specified set of wavelengths.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS one or more of the specified wavelengths is not within the device's wavelength range; ERROR_NO_DEVICE if the device does not exist. |
indices | The buffer that will receive the indices of the pixels associated with the specified wavelengths. |
indicesLength | The indices buffer size. |
wavelength | The wavelengths to be searched for, overwritten with the actual wavelengths found. |
wavelengthLength | The wavelength buffer size. |
length | the actual length of the array of wavelengths to be searched for. |
int oceandirect::api::OceanDirectAPI::getIndicesAtWavelengthRange | ( | long | deviceID, |
int * | errorCode, | ||
int * | indices, | ||
int | indicesLength, | ||
double * | wavelengthLength, | ||
int | wavelengthSize, | ||
double | lo, | ||
double | hi | ||
) |
Get wavelength indices within a specified wavelength range
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS the lower or upper bound specified is not within the device's wavelength range; ERROR_NO_DEVICE if the device does not exist. |
indices | The output buffer that will receive the indices of the pixels in the specified range. |
indicesLength | The indices buffer size. |
wavelength | The output buffer that will receive the wavelengths associated with each pixel index. |
wavelengthLength | The wavelength buffer size. |
lo | the lower bound of the wavelength range. |
hi | the upper bound of the wavelength range. |
|
static |
No public constructor. To use this class in C++, you must first call getInstance(). This provides a singleton: it is the same on every call.
licenseStatus | returns 0 on success i.e. there is a valid software license, 1 otherwise in which case Ocean should be contacted. |
unsigned long oceandirect::api::OceanDirectAPI::getIntegrationTimeIncrementMicros | ( | long | deviceID, |
int * | errorCode | ||
) |
Get integration time increment in microseconds
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_INPUT_OUT_OF_BOUNDS if an invalid integration time is supplied; ERROR_NO_DEVICE if the device does not exist. |
unsigned long oceandirect::api::OceanDirectAPI::getIntegrationTimeMicros | ( | long | deviceID, |
int * | errorCode | ||
) |
Get integration time in microseconds
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_INPUT_OUT_OF_BOUNDS if an invalid integration time is supplied; ERROR_NO_DEVICE if the device does not exist. |
unsigned long oceandirect::api::OceanDirectAPI::getMaximumIntegrationTimeMicros | ( | long | deviceID, |
int * | errorCode | ||
) |
Get maximum integration time in microseconds
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
double oceandirect::api::OceanDirectAPI::getMaximumIntensity | ( | long | deviceID, |
int * | errorCode | ||
) |
Get max intensity (in raw counts) that can be returned in any pixel.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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::api::OceanDirectAPI::getMinimumAveragingIntegrationTimeMicros | ( | long | deviceID, |
int * | errorCode | ||
) |
Get minimum integration time in microseconds when averaging is enabled.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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::api::OceanDirectAPI::getMinimumIntegrationTimeMicros | ( | long | deviceID, |
int * | errorCode | ||
) |
Get minimum integration time in microseconds.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
int oceandirect::api::OceanDirectAPI::getNetworkDeviceIDs | ( | long * | ids, |
unsigned long | maxLength | ||
) |
This provides a unique ID of each network attached device that is detected or manually specified. The IDs are copied into the user-provided buffer. These IDs are weak references: attempting to access a device that no longer exists will cause an error value to be returned but should not cause any instability. The IDs may be entirely random, but a given ID will always refer to the same device for as long as the program is running. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
ids | the buffer to receive the device IDs. |
maxLength | the actual size of the buffer ids. |
int oceandirect::api::OceanDirectAPI::getNonlinearityCorrectedSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkSpectrum, | ||
int | darkSpectrumLength, | ||
double * | nonlinearityCorrectedSpectrum, | ||
int | nonlinearityCorrectedSpectrumLength | ||
) |
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.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
darkSpectrum | the buffer that contains the dark spectrum to be used for the dark correction. |
darkSpectrumLength | the actual size of the dark spectrum buffer. |
nonlinearityCorrectedSpectrum | the buffer that will receive the nonlinearity corrected spectrum. |
nonlinearityCorrectedSpectrumLength | the actual size of the nonlinearity correction buffer. |
int oceandirect::api::OceanDirectAPI::getNonlinearityCorrectedSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | nonlinearityCorrectedSpectrum, | ||
int | nonlinearityCorrectedSpectrumLength | ||
) |
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.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
nonlinearityCorrectedSpectrum | the buffer that will receive the nonlinearity corrected spectrum. |
nonlinearityCorrectedSpectrumLength | the actual size of the nonlinearity correction buffer. |
int oceandirect::api::OceanDirectAPI::getNumberOfDeviceIDs | ( | ) |
This provides the number of devices that have either been probed or manually specified. Devices are not opened automatically, but this can provide a bound for getDeviceIDs(). Note that this should only be done by one thread at a time.
int oceandirect::api::OceanDirectAPI::getRawSpectrumWithMetadata | ( | long | deviceID, |
int * | errorCode, | ||
SpectrumWithMetadata * | buffer, | ||
int | bufferLength | ||
) |
Get raw spectrum with meta-data. Only OBP enabled devices supported this command. The number of returned spectra depends on the following condition: 1) Device supports data buffering: A) If buffering is enabled then the number of spectra returned depends on how many spectra are in the buffer. It can be 0. B) If buffering is disabled then command will block until the requested number of spectra is received. 2) Device don't support data buffering: A) Only 1 spectra will be returned per call.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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 size of the buffer is less than 1 or greater than 15; ERROR_NO_DEVICE if the device does not exist. |
buffer | the buffer that will receive the formatted spectrum. |
bufferLength | the actual size of the buffer. |
unsigned int oceandirect::api::OceanDirectAPI::getScansToAverage | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the number of spectra to be averaged per returned spectrum. When this value has been set greater than 1 the specified number of spectra are averaged and the resulting average is returned by getFormattedSpectrum (or getRawSpectrumWithMetadata).
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
int oceandirect::api::OceanDirectAPI::getSerialNumber | ( | long | deviceID, |
int * | errorCode, | ||
char * | buffer, | ||
int | bufferLength | ||
) |
Get the serial number of the device.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the serial number feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
buffer | the buffer to receive the returned serial number. |
bufferLength | the size of the supplied buffer. |
unsigned char oceandirect::api::OceanDirectAPI::getSerialNumberMaximumLength | ( | long | deviceID, |
int * | errorCode | ||
) |
Return maximum length of the device serial number.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the serial number feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
int oceandirect::api::OceanDirectAPI::getStoredDarkSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkSpectrum, | ||
int | darkSpectrumLength | ||
) |
Retrieve a previously stored dark spectrum for use in subsequent corrections i.e. dark correction and nonlinearity correction.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
darkSpectrum | the buffer that contains the dark spectrum to be retrieved. |
darkSpectrumLength | the actual size of the dark buffer. |
long long int oceandirect::api::OceanDirectAPI::getTime | ( | long | deviceID, |
int * | errorCode | ||
) |
Return the system time of the device. The time is returned as an integer representing the number of microseconds since January 1 1970 based on the current device system clock.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
int oceandirect::api::OceanDirectAPI::getTriggerMode | ( | long | deviceID, |
int * | errorCode | ||
) |
Get the spectrometer trigger mode. Please see your spectrometer documentation for valid values of the trigger mode.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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 ERROR_COMMAND_NOT_SUPPORTED device don't support this command. |
int oceandirect::api::OceanDirectAPI::getWavelengthCoefficients | ( | long | deviceID, |
int * | errorCode, | ||
double * | coeff, | ||
int | length | ||
) |
Get the coefficients of the polynomial used to calculate the wavelengths.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the wavelengths feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
coeff | an array to receive the coefficient values. |
length | the actual length of the supplied coefficients array. |
int oceandirect::api::OceanDirectAPI::getWavelengths | ( | long | deviceID, |
int * | errorCode, | ||
double * | wavelengths, | ||
int | length | ||
) |
Get the wavelengths for each pixel of the specified device.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the wavelengths feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
wavelengths | an array to receive the wavelength values. |
length | the actual length of the supplied wavelengths array. |
bool oceandirect::api::OceanDirectAPI::isFeatureEnabled | ( | long | deviceId, |
int * | errorCode, | ||
FeatureId | featureId | ||
) |
Check if a specified feature is enabled for a device, return true if yes, false if not
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist. |
featureId | the feature ID of interest (declared elsewhere in OceanDirectAPI.h). |
bool oceandirect::api::OceanDirectAPI::nonLinearityCorrectionUsage | ( | long | deviceID, |
int * | errorCode | ||
) |
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist. |
int oceandirect::api::OceanDirectAPI::nonlinearityCorrectSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkSpectrum, | ||
int | darkSpectrumLength, | ||
double * | illuminatedSpectrum, | ||
int | illuminatedSpectrumLength, | ||
double * | nonlinearityCorrectedSpectrum, | ||
int | nonlinearityCorrectedSpectrumLength | ||
) |
Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; |
darkSpectrum | the buffer that contains the dark spectrum to be used prior to the nonlinearity correction. |
darkSpectrumLength | the actual size of the dark spectrum buffer. |
illuminatedSpectrum | the buffer that contains the illuminated spectrum to be corrected. |
illuminatedSpectrumLength | the actual size of the illuminated spectrum buffer. |
nonlinearityCorrectedSpectrum | the buffer that will receive the nonlinearity corrected spectrum. |
nonlinearityCorrectedSpectrumLength | the actual size of the nonlinearity corrected buffer. |
int oceandirect::api::OceanDirectAPI::nonlinearityCorrectSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | illuminatedSpectrum, | ||
int | illuminatedSpectrumLength, | ||
double * | nonlinearityCorrectedSpectrum, | ||
int | nonlinearityCorrectedSpectrumLength | ||
) |
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.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_VALUE_NOT_FOUND no stored dark spectrum was found. |
illuminatedSpectrum | the buffer that contains the illuminated spectrum to be corrected. |
illuminatedSpectrumLength | the actual size of the illuminated spectrum buffer. |
nonlinearityCorrectedSpectrum | the buffer that will receive the nonlinearity corrected spectrum. |
nonlinearityCorrectedSpectrumLength | the actual size of the nonlinearity corrected buffer. |
void oceandirect::api::OceanDirectAPI::openDevice | ( | long | deviceID, |
int * | errorCode | ||
) |
This will attempt to open the bus connection to the device with the given ID. After the device is closed the id becomes invalid. You need to call either probeDevices()/addNetworkDevice()/detectNetworkDevices() 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.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; |
int oceandirect::api::OceanDirectAPI::probeDevices | ( | ) |
Use the probeDevices() method to force the driver to look for any device that can be found automatically. If this is not called then such devices will not be available for use. This should be used when attempting to find USB devices. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.
void oceandirect::api::OceanDirectAPI::setBoxcarWidth | ( | long | deviceID, |
int * | errorCode, | ||
unsigned short int | boxcarWidth | ||
) |
Set the width of the boxcar smoothing to be applied to the returned spectrum. When this value is set greater than 0, boxcar smoothing (a moving average) is applied to the spectrum returned by getFormattedSpectrum (or getRawSpectrumWithMetadata). The width specified is the number of pixels either side of the central pixel of the average i.e. if the result of this function is n, the "full width" of the smoothing is 2*n+1.
Setting this value to 0 turns off the boxcar smoothing.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
boxcarWidth | the width of the smoothing to be applied, or zero if smoothing is to be turned off. |
void oceandirect::api::OceanDirectAPI::setDelayMicroseconds | ( | long | deviceID, |
int * | errorCode, | ||
unsigned long | delayMicroseconds | ||
) |
Set the acquisition delay to the specified number of microseconds.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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 period supplied is not valid; ERROR_NO_DEVICE if the device does not exist |
delayMicroseconds | the acquisition delay period in microseconds. |
void oceandirect::api::OceanDirectAPI::setIntegrationTimeMicros | ( | long | deviceID, |
int * | errorCode, | ||
unsigned long | integrationTimeMicros | ||
) |
Set integration time in microseconds.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; 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_NO_DEVICE if the device does not exist. |
integrationTimeMicros | the desired integration time in microseconds. |
void oceandirect::api::OceanDirectAPI::setScansToAverage | ( | long | deviceID, |
int * | errorCode, | ||
unsigned int | scansToAverage | ||
) |
Set the number of spectra to be averaged per returned spectrum. 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).
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; 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); ERROR_NO_DEVICE if the device does not exist. |
scansToAverage | the number of scans to be averaged |
void oceandirect::api::OceanDirectAPI::setStoredDarkSpectrum | ( | long | deviceID, |
int * | errorCode, | ||
double * | darkSpectrum, | ||
int | darkSpectrumLength | ||
) |
Store a dark spectrum for use in subsequent corrections i.e. dark correction and nonlinearity correction.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_NO_DEVICE if the device does not exist. |
darkSpectrum | the buffer that contains the dark spectrum to be stored. |
darkSpectrumLength | the actual size of the dark spectrum buffer. |
void oceandirect::api::OceanDirectAPI::setTime | ( | long | deviceID, |
int * | errorCode, | ||
long long int | timeInMicrosecond | ||
) |
Sets the system time of the device. The time must be sepcified as the integer number of microseconds since 1 January 1970.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_FEATURE_NOT_FOUND if the feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist. |
timeInMicrosecond | the time to set the device system clock as the number of microseconds since 1 January 1970. |
void oceandirect::api::OceanDirectAPI::setTriggerMode | ( | long | deviceID, |
int * | errorCode, | ||
int | mode | ||
) |
Set the spectrometer trigger mode. Please see your spectrometer documentation for valid values of the trigger mode.
deviceID | the identifier of the device as returned by getDeviceIDs. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; 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. |
mode | the trigger mode to apply. |
|
static |
No public destructor. Call this to force memory cleanup.