OceanDirectLighthouseC++
3.1.1
OceanDirect Lighthouse C++/C API
|
Public Member Functions | |
virtual int | addNetworkDevice (const char *ipAddressStr, const char *deviceTypeStr, int *errorCode) |
virtual void | addRS232DeviceLocation (char *deviceTypeName, char *deviceBusPath, unsigned int baud, int *errorCode) |
virtual Advance * | AdvancedControl () |
virtual void | applyElectricDarkCorrection (long deviceID, int *errorCode, bool value) |
virtual void | applyNonLinearityCorrection (long deviceID, int *errorCode, bool value) |
void | boxcarCorrectSpectrum (long deviceID, int *errorCode, const double *illuminatedSpectrum, unsigned int illuminatedSpectrumLength, unsigned int boxcarWidth, double *boxcarCorrectedSpectrum, unsigned int boxcarCorrectedSpectrumLength) |
virtual void | closeDevice (long deviceID, int *errorCode) |
virtual int | darkCorrectSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
virtual int | darkCorrectSpectrum (long deviceID, int *errorCode, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
virtual int | detectNetworkDevices () |
virtual bool | electricDarkCorrectionUsage (long deviceID, int *errorCode) |
virtual unsigned long | getAcquisitionDelayIncrementMicroseconds (long deviceID, int *errorCode) |
virtual unsigned long | getAcquisitionDelayMaximumMicroseconds (long deviceID, int *errorCode) |
virtual unsigned long | getAcquisitionDelayMicroseconds (long deviceID, int *errorCode) |
virtual unsigned long | getAcquisitionDelayMinimumMicroseconds (long deviceID, int *errorCode) |
virtual void | getAPIRCNumber (unsigned int *candidate) |
virtual void | getAPIVersionNumber (unsigned int *major, unsigned int *minor, unsigned int *point) |
virtual unsigned short int | getBoxcarWidth (long deviceID, int *errorCode) |
virtual int | getDarkCorrectedSpectrum (long deviceID, int *errorCode, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
virtual int | getDarkCorrectedSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *darkCorrectedSpectrum, int darkCorrectedSpectrumLength) |
virtual IDevice * | getDeviceByID (long id) |
virtual unsigned char | getDeviceEndpoint (long deviceID, int *error_code, usbEndpointType endpointType) |
virtual int | getDeviceIDs (long *ids, unsigned long maxLength) |
virtual int | getDeviceModelText (long deviceID, int *errorCode, char *buffer, unsigned int bufferLength) |
virtual int | getDeviceType (long deviceID, int *errorCode, char *buffer, unsigned int length) |
virtual int | getElectricDarkPixelCount (long deviceID, int *errorCode) |
virtual int | getElectricDarkPixelIndices (long deviceID, int *errorCode, int *indices, int length) |
virtual int | getErrorMessage (int errorCode, char *returnMessage, int length) |
virtual int | getErrorStringLength (int errorCode) |
virtual int | getFormattedSpectrum (long deviceID, int *errorCode, double *buffer, int bufferLength) |
virtual int | getFormattedSpectrumLength (long deviceID, int *errorCode) |
virtual int | getIndexAtWavelength (long deviceID, int *errorCode, double &wavelength, double approxWavelength) |
virtual int | getIndicesAtAnyWavelength (long deviceID, int *errorCode, int *indices, int indicesLength, double *wavelength, int wavelengthLength) |
virtual int | getIndicesAtWavelengthRange (long deviceID, int *errorCode, int *indices, int indicesLength, double *wavelengthLength, int wavelengthSize, double lo, double hi) |
virtual unsigned long | getIntegrationTimeIncrementMicros (long deviceID, int *errorCode) |
virtual unsigned long | getIntegrationTimeMicros (long deviceID, int *errorCode) |
virtual unsigned long | getMaximumIntegrationTimeMicros (long deviceID, int *errorCode) |
virtual double | getMaximumIntensity (long deviceID, int *errorCode) |
virtual unsigned long | getMinimumAveragingIntegrationTimeMicros (long deviceID, int *errorCode) |
virtual unsigned long | getMinimumIntegrationTimeMicros (long deviceID, int *errorCode) |
virtual int | getNetworkDeviceIDs (long *ids, unsigned long maxLength) |
virtual int | getNonlinearityCorrectedSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
virtual int | getNonlinearityCorrectedSpectrum (long deviceID, int *errorCode, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
virtual int | getNumberOfDeviceIDs () |
virtual int | getRawSpectrumWithMetadata (long deviceID, int *errorCode, SpectrumWithMetadata *buffer, int bufferLength) |
virtual unsigned int | getScansToAverage (long deviceID, int *errorCode) |
virtual int | getSerialNumber (long deviceID, int *errorCode, char *buffer, int bufferLength) |
virtual unsigned char | getSerialNumberMaximumLength (long deviceID, int *errorCode) |
virtual int | getStoredDarkSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength) |
virtual long long int | getTime (long deviceID, int *errorCode) |
virtual int | getTriggerMode (long deviceID, int *errorCode) |
virtual int | getWavelengthCoefficients (long deviceID, int *errorCode, double *coeff, int length) |
virtual int | getWavelengths (long deviceID, int *errorCode, double *wavelengths, int length) |
virtual bool | isFeatureEnabled (long deviceId, int *errorCode, FeatureId featureId) |
virtual bool | nonLinearityCorrectionUsage (long deviceID, int *errorCode) |
virtual int | nonlinearityCorrectSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
virtual int | nonlinearityCorrectSpectrum (long deviceID, int *errorCode, double *illuminatedSpectrum, int illuminatedSpectrumLength, double *nonlinearityCorrectedSpectrum, int nonlinearityCorrectedSpectrumLength) |
virtual void | openDevice (long deviceID, int *errorCode) |
virtual int | probeDevices () |
virtual void | setAcquisitionDelayMicroseconds (long deviceID, int *errorCode, unsigned long delayMicroseconds) |
virtual void | setBoxcarWidth (long deviceID, int *errorCode, unsigned short int boxcarWidth) |
virtual void | setIntegrationTimeMicros (long deviceID, int *errorCode, unsigned long integrationTimeMicros) |
void | setMulticastMsgResponseReadDelay (size_t delayMs) |
void | setMulticastMsgResponseReadRetry (size_t retryCount) |
void | setMulticastMsgSendRetry (size_t retryCount) |
virtual void | setScansToAverage (long deviceID, int *errorCode, unsigned int scansToAverage) |
virtual void | setStoredDarkSpectrum (long deviceID, int *errorCode, double *darkSpectrum, int darkSpectrumLength) |
virtual void | setTime (long deviceID, int *errorCode, long long int timeInMicrosecond) |
virtual void | setTriggerMode (long deviceID, int *errorCode, int mode) |
Static Public Member Functions | |
static OceanDirectAPI * | getInstance () |
static void | shutdown () |
Protected Member Functions | |
virtual long | addTCPIPv4DeviceLocation (const char *deviceTypeName, std::string ipAddr, int port, int *errorCode) |
virtual long | addTCPIPv4OBP2DeviceLocation (const char *deviceTypeName, std::string ipAddr, int port, int *errorCode) |
virtual std::string | getDeviceModel (long deviceID, int *errorCode, int index) |
Static Protected Attributes | |
static OceanDirectAPI * | instance |
Friends | |
class | InstrumentedOceanDirectAPI |
class | NetOceanDirectAdmin |
class | OceanDirectAdminAPI |
|
virtual |
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; |
|
virtual |
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. |
|
protectedvirtual |
Use the addIPv4DeviceLocation() method to specify that a device may be found on a TCP/IPv4 network on a given port. Once specified, the typical openDevice() function can be used to access it.
deviceTypeName | a valid Ocean spectrometer device type. |
ipAddr | a valid IP address. |
port | a valid TCP/UDP port. |
errorCode | a code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_CODE_INVALID_ARGUMENT if the device cannot be created. |
|
virtual |
Advanced extension of the API. Access to the advanced APIs is throught the pointer returned by this function.
|
virtual |
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. |
|
virtual |
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, | ||
const double * | illuminatedSpectrum, | ||
unsigned int | illuminatedSpectrumLength, | ||
unsigned int | boxcarWidth, | ||
double * | boxcarCorrectedSpectrum, | ||
unsigned int | boxcarCorrectedSpectrumLength | ||
) |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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.
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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) |
|
virtual |
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. |
|
protectedvirtual |
Get the device Model name
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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 |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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.
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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). |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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; |
|
virtual |
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.
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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::setMulticastMsgResponseReadDelay | ( | size_t | delayMs | ) |
Set the delay between reading multicast response. This must be called before probing network devices.
delayMs | The delay in milliseconds before next read. |
void oceandirect::api::OceanDirectAPI::setMulticastMsgResponseReadRetry | ( | size_t | retryCount | ) |
Set the number of times to read multicast message response. This must be called before probing network devices.
retryCount | The number of times to try reading multicast response messages. |
void oceandirect::api::OceanDirectAPI::setMulticastMsgSendRetry | ( | size_t | retryCount | ) |
Set the number of times to send multicast message for dynamic probing. This must be called before probing network devices.
retryCount | The number of times to send messages. |
|
virtual |
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 |
|
virtual |
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. |
|
virtual |
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. |
|
virtual |
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.