NetOceanDirect 3.1.3
OceanDirect .NET API
NetOceanDirect::OceanDirect Class Reference

#include <NetOceanDirect.h>

Inherits NetOceanDirect::ManagedObject< OceanDirectAPI >.

Public Types

enum class  FeatureID {
  FEATURE_ID_SERIAL_NUMBER = ::FeatureId::FEATURE_ID_SERIAL_NUMBER , FEATURE_ID_SPECTROMETER = ::FeatureId::FEATURE_ID_SPECTROMETER , FEATURE_ID_THERMOELECTRIC = ::FeatureId::FEATURE_ID_THERMOELECTRIC , FEATURE_ID_IRRADCAL = ::FeatureId::FEATURE_ID_IRRADCAL ,
  FEATURE_ID_EEPROM = ::FeatureId::FEATURE_ID_EEPROM , FEATURE_ID_STROBE_LAMP = ::FeatureId::FEATURE_ID_STROBE_LAMP , FEATURE_ID_WAVECAL = ::FeatureId::FEATURE_ID_WAVECAL , FEATURE_ID_NONLINEARITYCAL = ::FeatureId::FEATURE_ID_NONLINEARITYCAL ,
  FEATURE_ID_STRAYLIGHTCAL = ::FeatureId::FEATURE_ID_STRAYLIGHTCAL , FEATURE_ID_RAW_BUS_ACCESS = ::FeatureId::FEATURE_ID_RAW_BUS_ACCESS , FEATURE_ID_CONTINUOUS_STROBE = ::FeatureId::FEATURE_ID_CONTINUOUS_STROBE , FEATURE_ID_LIGHT_SOURCE = ::FeatureId::FEATURE_ID_LIGHT_SOURCE ,
  FEATURE_ID_TEMPERATURE = ::FeatureId::FEATURE_ID_TEMPERATURE , FEATURE_ID_OPTICAL_BENCH = ::FeatureId::FEATURE_ID_OPTICAL_BENCH , FEATURE_ID_REVISION = ::FeatureId::FEATURE_ID_REVISION , FEATURE_ID_DATA_BUFFER = ::FeatureId::FEATURE_ID_DATA_BUFFER ,
  FEATURE_ID_PIXEL_BINNING = ::FeatureId::FEATURE_ID_PIXEL_BINNING , FEATURE_ID_GPIO = ::FeatureId::FEATURE_ID_GPIO , FEATURE_ID_SINGLE_STROBE = ::FeatureId::FEATURE_ID_SINGLE_STROBE , FEATURE_ID_QUERY_STATUS = ::FeatureId::FEATURE_ID_QUERY_STATUS ,
  FEATURE_ID_BACK_TO_BACK = ::FeatureId::FEATURE_ID_BACK_TO_BACK , FEATURE_ID_LED_ACTIVITY = ::FeatureId::FEATURE_ID_LED_ACTIVITY , FEATURE_ID_TIME_META = ::FeatureId::FEATURE_ID_TIME_META , FEATURE_ID_DHCP = ::FeatureId::FEATURE_ID_DHCP ,
  FEATURE_ID_PIXEL = ::FeatureId::FEATURE_ID_PIXEL , FEATURE_ID_AUTO_NULLING = ::FeatureId::FEATURE_ID_AUTO_NULLING , FEATURE_ID_IPV4_ADDRESS = ::FeatureId::FEATURE_ID_IPV4_ADDRESS , FEATURE_ID_IPV4_USER_STRING = ::FeatureId::FEATURE_ID_IPV4_USER_STRING ,
  FEATURE_ID_DEVICE_INFORMATION = ::FeatureId::FEATURE_ID_DEVICE_INFORMATION , FEATURE_ID_DEVICE_ALIAS = ::FeatureId::FEATURE_ID_DEVICE_ALIAS , FEATURE_ID_SERIAL_PORT = ::FeatureId::FEATURE_ID_SERIAL_PORT , FEATURE_ID_SPECTRUM_ACQUISITION_CONTROL = ::FeatureId::FEATURE_ID_SPECTRUM_ACQUISITION_CONTROL ,
  FEATURE_ID_NETWORK_CONFIGURATION = ::FeatureId::FEATURE_ID_NETWORK_CONFIGURATION , FEATURE_ID_ETHERNET = ::FeatureId::FEATURE_ID_ETHERNET , FEATURE_ID_SHUTTER = ::FeatureId::FEATURE_ID_SHUTTER , FEATURE_ID_HIGH_GAIN_MODE = ::FeatureId::FEATURE_ID_HIGH_GAIN_MODE
}
 

Public Member Functions

 OceanDirect (OceanDirectAPI *instance)
 
virtual ~OceanDirect ()
 
virtual int addNetworkDevice (String^ ipAddress, String^ deviceType, int% errorCode)
 
virtual Advanced AdvancedFeatures ()
 
virtual void applyElectricDarkCorrection (int deviceID, int% errorCode, bool apply)
 
virtual void applyNonLinearityCorrection (int deviceID, int% errorCode, bool apply)
 
array< double > boxcarCorrectSpectrum (long deviceID, int% errorCode, array< double >^% illuminatedSpectrum, unsigned int boxcarWidth)
 
virtual void closeDevice (int deviceID, int% errorCode)
 
virtual array< double > darkCorrectSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum, array< double >^% illuminatedSpectrum)
 
virtual array< double > darkCorrectSpectrum (long deviceID, int% errorCode, array< double >^% illuminatedSpectrum)
 
virtual array< Devices^> findDevices ()
 
virtual int findSpectrumLength (int deviceID, int% errorCode)
 
virtual array< Devices^> findUSBDevices ()
 
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 getApiVersion (unsigned int% major, unsigned int% minor, unsigned int% point)
 
virtual unsigned int getBoxcarWidth (long deviceID, int% errorCode)
 
virtual array< Devices^> getCurrentDevicesConnected ()
 
virtual array< double > getDarkCorrectedSpectrum (long deviceID, int% errorCode)
 
virtual array< double > getDarkCorrectedSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum)
 
virtual array< int > getDeviceIDs ()
 
virtual String getDeviceModel (long deviceID, int% errorCode)
 
virtual int getEDPCount (int deviceID, int% errorCode)
 
virtual array< int > getEDPIndices (int deviceID, int% errorCode, int length)
 
virtual bool getElectricDarkCorrectionUsage (int deviceID, int% errorCode)
 
virtual String getErrorMessage (int errorCode)
 
virtual int getErrorMessageLength (int errorCode)
 
virtual int getIndexAtWavelength (long deviceID, int% errorCode, double% wavelength, double aproxWavelength)
 
virtual array< int > getIndicesAtAnyWavelength (long deviceID, int% errorCode, array< double >^% wavelength, int length)
 
virtual array< int > getIndicesAtWavelengthRange (long deviceID, int% errorCode, array< double >^% wavelength, double lo, double hi)
 
virtual unsigned long getIntegrationTimeMicros (int deviceID, int% errorCode)
 
virtual unsigned long getIntegrationTimeStepSize (int deviceID, int% errorCode)
 
virtual unsigned long getMaximumIntegrationTime (int deviceID, int% errorCode)
 
virtual double getMaximumIntensity (int deviceID, int% errorCode)
 
virtual unsigned long getMinimumAveragingIntegrationTimeMicros (long deviceID, int% errorCode)
 
virtual unsigned long getMinimumIntegrationTime (int deviceID, int% errorCode)
 
virtual array< double > getNonlinearityCorrectedSpectrum (long deviceID, int% errorCode)
 
virtual array< double > getNonlinearityCorrectedSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum)
 
virtual bool getNonLinearityCorrectionUsage (int deviceID, int% errorCode)
 
virtual int getNumberOfPixels (int deviceID, int% errorCode)
 
virtual array< SpectrumWithMetadata^> getRawSpectrumWithMetadata (int deviceID, int% errorCode, int count)
 
virtual unsigned int getScansToAverage (long deviceID, int% errorCode)
 
virtual String getSerialNumber (long deviceID, int% errorCode)
 
virtual array< double > getSpectrum (int deviceID, int% errorCode)
 
virtual array< double > getStoredDarkSpectrum (long deviceID, int% errorCode)
 
virtual int getTriggerMode (long deviceID, int% errorCode)
 
virtual double getWavelength (int deviceID, int% errorCode, int pixel)
 
virtual array< double > getWavelengthCoefficients (long deviceID, int% errorCode)
 
virtual array< double > getWavelengths (int deviceID, int% errorCode)
 
virtual bool isFeatureEnabled (int deviceID, int% errorCode, NetOceanDirect::OceanDirect::FeatureID featureId)
 
virtual array< double > nonlinearityCorrectSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum, array< double >^% illuminatedSpectrum)
 
virtual array< double > nonlinearityCorrectSpectrum (long deviceID, int% errorCode, array< double >^% illuminatedSpectrum)
 
virtual void openDevice (int deviceID, int% errorCode)
 
virtual void setAcquisitionDelayMicroseconds (long deviceID, int% errorCode, unsigned long delay_usec)
 
virtual void setBoxcarWidth (long deviceID, int% errorCode, unsigned int boxcarWidth)
 
virtual void setIntegrationTimeMicros (int deviceID, int% errorCode, unsigned long integrationTimeMicros)
 
virtual void setMulticastMsgResponseReadDelay (size_t delayMs)
 
virtual void setMulticastMsgResponseReadRetry (size_t retryCount)
 
virtual void setMulticastMsgSendRetry (size_t retryCount)
 
virtual void setScansToAverage (long deviceID, int% errorCode, unsigned int scansToAverage)
 
virtual void setStoredDarkSpectrum (long deviceID, int% errorCode, array< double >^% darkSpectrum)
 
virtual void setTriggerMode (int deviceID, int% errorCode, int triggerMode)
 
virtual void shutDown ()
 
- Public Member Functions inherited from NetOceanDirect::ManagedObject< OceanDirectAPI >
 ManagedObject (OceanDirectAPI *instance)
 
 !ManagedObject ()
 
virtual ~ManagedObject ()
 
OceanDirectAPI * GetInstance ()
 

Static Public Member Functions

static OceanDirect getInstance ()
 

Protected Member Functions

 OceanDirect ()
 

Static Protected Attributes

static OceanDirect odInstance
 

Additional Inherited Members

- Protected Attributes inherited from NetOceanDirect::ManagedObject< OceanDirectAPI >
OceanDirectAPI * m_Instance
 

Member Enumeration Documentation

◆ FeatureID

enum class used to determine if spectrometer features are enabled with the method isFeatureEnabled. This is now redeclared as an enum class to expose it to .NET The :: is not strictly necessary but it makes it obvious where the original enum is from

Enumerator
FEATURE_ID_SERIAL_NUMBER 
FEATURE_ID_SPECTROMETER 
FEATURE_ID_THERMOELECTRIC 
FEATURE_ID_IRRADCAL 
FEATURE_ID_EEPROM 
FEATURE_ID_STROBE_LAMP 
FEATURE_ID_WAVECAL 
FEATURE_ID_NONLINEARITYCAL 
FEATURE_ID_STRAYLIGHTCAL 
FEATURE_ID_RAW_BUS_ACCESS 
FEATURE_ID_CONTINUOUS_STROBE 
FEATURE_ID_LIGHT_SOURCE 
FEATURE_ID_TEMPERATURE 
FEATURE_ID_OPTICAL_BENCH 
FEATURE_ID_REVISION 
FEATURE_ID_DATA_BUFFER 
FEATURE_ID_PIXEL_BINNING 
FEATURE_ID_GPIO 
FEATURE_ID_SINGLE_STROBE 
FEATURE_ID_QUERY_STATUS 
FEATURE_ID_BACK_TO_BACK 
FEATURE_ID_LED_ACTIVITY 
FEATURE_ID_TIME_META 
FEATURE_ID_DHCP 
FEATURE_ID_PIXEL 
FEATURE_ID_AUTO_NULLING 
FEATURE_ID_IPV4_ADDRESS 
FEATURE_ID_IPV4_USER_STRING 
FEATURE_ID_DEVICE_INFORMATION 
FEATURE_ID_DEVICE_ALIAS 
FEATURE_ID_SERIAL_PORT 
FEATURE_ID_SPECTRUM_ACQUISITION_CONTROL 
FEATURE_ID_NETWORK_CONFIGURATION 
FEATURE_ID_ETHERNET 
FEATURE_ID_SHUTTER 
FEATURE_ID_HIGH_GAIN_MODE 

Constructor & Destructor Documentation

◆ OceanDirect() [1/2]

OceanDirect::OceanDirect ( )
protected

◆ OceanDirect() [2/2]

OceanDirect::OceanDirect ( OceanDirectAPI * instance)

◆ ~OceanDirect()

virtual NetOceanDirect::OceanDirect::~OceanDirect ( )
inlinevirtual

Member Function Documentation

◆ addNetworkDevice()

int OceanDirect::addNetworkDevice ( String^ ipAddress,
String^ deviceType,
int% errorCode )
virtual

Manually create an instance of the network attached device and then open it with openDevice() function. It is the responsiblitiy of the user to ensure that the device existed and configured properly. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Parameters
[in]ipAddressThe ip address of the device to be opened.
[in]deviceTypeThe device type could be OceanFX or OceanHDX. This is case sensitive.
[out]errorCodeA code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist;
Returns
The device id.

◆ AdvancedFeatures()

Advanced OceanDirect::AdvancedFeatures ( )
virtual

Retrieves a tracked handle to an Advanced instance, which may be used to access advanced hardware features beyond what is accessible from the OceanDirect class alone, such as trigger delay or raw USB access.

Returns
Tracked handle to Advanced instance granting access to advanced spectrometer features

◆ applyElectricDarkCorrection()

void OceanDirect::applyElectricDarkCorrection ( int deviceID,
int% errorCode,
bool apply )
virtual
Deprecated
Sets whether electric dark correction is used.
See also
setStoredDarkSpectrum
getStoredDarkSpectrum
getDarkCorrectedSpectrum
Warning
if electric dark correction is enabled using this function then some of the newer dark correction functionality e.g. getDarkCorrectedSpectrum may not be used.
Parameters
[in]deviceIDThe device ID of the device to configure
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_TRANSFER_ERROR if data transfer to/from device fails
[in]Applytrue or false.

◆ applyNonLinearityCorrection()

void OceanDirect::applyNonLinearityCorrection ( int deviceID,
int% errorCode,
bool apply )
virtual
Deprecated
Sets whether nonlinearity correction is used.
See also
setStoredDarkSpectrum
getStoredDarkSpectrum
getNonlinearityCorrectedSpectrum
Warning
If nonlinearity correction is enabled using this function then some of the newer nonlinearity correction functionality e.g. getNonlinearityCorrectedSpectrum may not be used.
Parameters
[in]deviceIDThe device ID of the device to configure
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID
[in]Applytrue or false.

◆ boxcarCorrectSpectrum()

array< double > OceanDirect::boxcarCorrectSpectrum ( long deviceID,
int% errorCode,
array< double >^% illuminatedSpectrum,
unsigned int boxcarWidth )

Apply a boxcar correction on the given illuminated spectrum.

Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet 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]boxcarWidthThe boxcar width.

◆ closeDevice()

void OceanDirect::closeDevice ( int deviceID,
int% errorCode )
virtual

Closes the spectrometer with the given ID, which cleans up associated resources and cached values and allows it to be disconnected from the computer with no negative repurcussions. Only spectrometers that have already been opened using openDevice() should be closed. The id becomes invalid after closing the device. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Parameters
[in]deviceIDThe device ID of the device to be closed
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid device ID
See also
openDevice()

◆ darkCorrectSpectrum() [1/2]

array< double > OceanDirect::darkCorrectSpectrum ( long deviceID,
int% errorCode,
array< double >^% darkSpectrum,
array< double >^% illuminatedSpectrum )
virtual

Dark correct a previously acquired illuminated spectrum and using a previously acquired dark spectrum.

Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeA code indicating the result of the operation: ERROR_SUCCESS on success;
[in]darkSpectrumThe buffer that contains the dark spectrum to be used for the dark correction.
[in]illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The corrected spectrum on success, empty otherwise.

◆ darkCorrectSpectrum() [2/2]

array< double > OceanDirect::darkCorrectSpectrum ( long deviceID,
int% errorCode,
array< double >^% illuminatedSpectrum )
virtual

Dark correct a previously acquired illuminated spectrum and using a stored dark spectrum.

See also
setStoredDarkSpectrum
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found.
[in]illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The corrected spectrum on success, empty otherwise.

◆ findDevices()

array< NetOceanDirect::Devices^> OceanDirect::findDevices ( )
virtual

Finds all available Ocean devices by scanning on USB for devices with Ocean drivers, finding devices that respond to UDP multicast (FX and HDX), and also returning IDs for any TCP-enabled devices that have been manually specified using addTCPDeviceLocation(). Returns a list of Devices objects corresponding to all of these devices, which contain some associated metadata, including their device IDs, which may be used to refer to them using the other OceanDirect member functions (starting with openDevice()). Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
tracked handle to a list of Devices objects containing metadata for all detected/known devices on USB/ethernet
Note
may take a second or two as this function needs to wait for UDP multicast responses.
See also
addTCPDeviceLocation()
openDevice()
findUSBDevices()

◆ findSpectrumLength()

int OceanDirect::findSpectrumLength ( int deviceID,
int% errorCode )
virtual

Return the length of spectra.

Returns
Spectra length.

◆ findUSBDevices()

array< NetOceanDirect::Devices^> OceanDirect::findUSBDevices ( )
virtual

Finds all available Ocean devices by scanning on USB for devices with Ocean drivers. Returns a list of Devices objects corresponding to all of these devices, which contain some associated metadata, including their device IDs, which may be used to refer to them using the other OceanDirect member functions (starting with openDevice()). Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
tracked handle to a list of Devices objects containing metadata for all detected/known devices on USB/ethernet
Note
May take a second or two as this function needs to wait for UDP multicast responses.
See also
addTCPDeviceLocation()
openDevice()
findDevices()

◆ getAcquisitionDelayIncrementMicroseconds()

unsigned long OceanDirect::getAcquisitionDelayIncrementMicroseconds ( long deviceID,
int% errorCode )
virtual

Retrieves the given device's acquisition delay resolution, which is the minimum delta between possible consecutive acquisition delay settings. The device supports a range of acquisition delay settings [min, max] with intermediate values spaced apart by this quantity, which forms the following range in MATLAB notation: getDelayMinimumMicroseconds() : getDelayIncrementMicroseconds() : getDelayMaximumMicroseconds()

Parameters
[in]deviceIDThe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
The acquisition delay increment, in microseconds
See also
getDelayMinimumMicroseconds()
getDelayMaximumMicroseconds()

◆ getAcquisitionDelayMaximumMicroseconds()

unsigned long OceanDirect::getAcquisitionDelayMaximumMicroseconds ( long deviceID,
int% errorCode )
virtual

Retrieves the given device's maximum possible acquisition delay setting.

Parameters
[in]deviceIDThe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
The maximum allowed acquisition delay setting for this device
See also
getDelayMimimumMicroseconds()
getDelayIncrementMicroseconds()

◆ getAcquisitionDelayMicroseconds()

unsigned long OceanDirect::getAcquisitionDelayMicroseconds ( long deviceID,
int% errorCode )
virtual

Retrieves the given device's current acquisition delay setting (time between when device receives trigger signal and when integration begins).

See also
setAcquisitionDelayMicroseconds()
Parameters
[in]deviceIDThe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
Current acquisition delay setting for the specified device, in microseconds

◆ getAcquisitionDelayMinimumMicroseconds()

unsigned long OceanDirect::getAcquisitionDelayMinimumMicroseconds ( long deviceID,
int% errorCode )
virtual

Retrieves the given device's minimum possible acquisition delay setting.

Parameters
[in]deviceIDThe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
the minimum allowed acquisition delay setting for this device
See also
getDelayMaximumMicroseconds()
getDelayIncrementMicroseconds()

◆ getAPIRCNumber()

void OceanDirect::getAPIRCNumber ( unsigned int% candidate)
virtual

◆ getApiVersion()

void OceanDirect::getApiVersion ( unsigned int% major,
unsigned int% minor,
unsigned int% point )
virtual

Retrieves the API version number (major.minor.point) for the Ocean Direct SDK

Parameters
[out]majorthe major number of the software version.
[out]minorthe minor number of the software version.
[out]pointthe point number of the software version.

◆ getBoxcarWidth()

unsigned int OceanDirect::getBoxcarWidth ( long deviceID,
int% errorCode )
virtual

Retrieves the given device's current boxcar filter width setting.

See also
setBoxcarWidth()
Parameters
[in]deviceIDThe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
The width of the boxcar filter used by the device

◆ getCurrentDevicesConnected()

array< NetOceanDirect::Devices^> OceanDirect::getCurrentDevicesConnected ( )
virtual

Finds all available Ocean devices which are currently attached by scanning on USB for devices with Ocean drivers. Returns information whether device is in use or not.

◆ getDarkCorrectedSpectrum() [1/2]

array< double > OceanDirect::getDarkCorrectedSpectrum ( long deviceID,
int% errorCode )
virtual

Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum.

See also
setStoredDarkSpectrum.
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_VALUE_NOT_FOUND no stored dark spectrum was found. ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist.
Returns
The corrected spectrum on success, empty otherwise.

◆ getDarkCorrectedSpectrum() [2/2]

array< double > OceanDirect::getDarkCorrectedSpectrum ( long deviceID,
int% errorCode,
array< double >^% darkSpectrum )
virtual

Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum.

Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist.
[in]darkSpectrumThe buffer that contains the dark spectrum to be used for the dark correction.
Returns
The corrected spectrum on success, empty otherwise.

◆ getDeviceIDs()

array< int > OceanDirect::getDeviceIDs ( )
virtual

Return an array of device ids from devices that were both probe or manually added. Note that this should only be done by one thread at a time.

Returns
An array of device ids.

◆ getDeviceModel()

String OceanDirect::getDeviceModel ( long deviceID,
int% errorCode )
virtual

Retrieves the model name from the specified device

Parameters
[in]deviceIDThe device ID of the device to query
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a currently-open device ERROR_FEATURE_NOT_FOUND if device does not support this feature
Returns
The device's model (e.g., "STS")

◆ getEDPCount()

int OceanDirect::getEDPCount ( int deviceID,
int% errorCode )
virtual

Retrieves the number of electric dark pixels on the detector of the given device. Electric dark pixels are optically masked so that they receive no light. Does not communicate with the device - uses cached values.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction;
Returns
The number of electric dark pixels on the detector (>= 0) or zero if electric dark correction is not supported (see the returned error code).
See also
getEDPIndices()

◆ getEDPIndices()

array< int > OceanDirect::getEDPIndices ( int deviceID,
int% errorCode,
int length )
virtual

Retrieves the indices of electric dark pixels on the detector of the given device. Electric dark pixels are optically masked so that they receive no light. Does not communicate with the device - uses cached values.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature
[in]lengthThe number of indices to retrieve, starting with the least (determines length of returned)
Returns
List of indices (zero-based) of pixels that are electric dark pixels, with length matching length input argument or an empty list if electric dark correction is not suported (see the returned error code).
See also
getEDPCount()

◆ getElectricDarkCorrectionUsage()

bool OceanDirect::getElectricDarkCorrectionUsage ( int deviceID,
int% errorCode )
virtual

Gets electric dark correction usage from the given device.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_COMMAND_NOT_SUPPORTED if the device does not support electric dark correction; ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
Device's current electric dark usage state

◆ getErrorMessage()

String OceanDirect::getErrorMessage ( int errorCode)
virtual

Get the error message associated with the given error code. If the error code is incorrect then the return message will be "Error. Undefined error".

Parameters
[in]errorCodeThe error code.
Returns
The error message associated with the error code.

◆ getErrorMessageLength()

int OceanDirect::getErrorMessageLength ( int errorCode)
virtual

Get the error message length associated with the given error code. If the error code is incorrect then the return message length will be 0.

Parameters
[in]errorCodeThe error code.
Returns
The message length.

◆ getIndexAtWavelength()

int OceanDirect::getIndexAtWavelength ( long deviceID,
int% errorCode,
double% wavelength,
double aproxWavelength )
virtual

Determines the pixel index on the given device that measures light at a wavelength closest to the given query wavelength. Does not communicate with the device - uses cached wavelengths.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS if aproxWavelength does not fall within wavelength bounds of detector
[out]wavelengthThe wavelength of light measured by the pixel that most closely matches aproxWavelength, in nanometers
[in]aproxWavelengthThe query wavelength for which to look up the closest pixel index, in nanometers
Returns
The index (zero-based) of the pixel on the detector whose wavelength is closest to aproxWavelength. Will be on range [0, getNumberOfPixels()-1]
See also
getIndicesAtAnyWavelength()
getIndicesAtWavelengthRange()

◆ getIndicesAtAnyWavelength()

array< int > OceanDirect::getIndicesAtAnyWavelength ( long deviceID,
int% errorCode,
array< double >^% wavelength,
int length )
virtual

As getIndexAtWavelength, but looks up multiple query wavelengths and returns an index for each.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS if aproxWavelength does not fall within wavelength bounds of detector
[in,out]wavelengthThe query wavelengths for which to look up the closest pixel indices, in nanometers. Will be overwritten with a new pointer to a new array containing the same values.
[in]lengthThe length of wavelength, in elements
Returns
A list of indices (zero-based) of pixels corresponding to wavelength (length of array is given length parameter)
See also
getIndexAtWavelength()
getIndicesAtWavelengthRange()

◆ getIndicesAtWavelengthRange()

array< int > OceanDirect::getIndicesAtWavelengthRange ( long deviceID,
int% errorCode,
array< double >^% wavelength,
double lo,
double hi )
virtual

Retrieves the indices and wavelengths of pixels that measure light at wavelengths within the given spectral range.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_CODE_ARRAY_INDEX_OUT_OF_BOUNDS if lo or hi do not fall within wavelength bounds of detector
[out]wavelengthList of wavelengths of pixels whose indices are returned (length of array is given in length output parameter), given in nanometers
[in]loThe inclusive lower bound of the wavelength range to look within, in nanometers
[in]hiThe inclusive upper bound of the wavelength range to look within, in nanometers
Returns
A list of indices (zero-based) of pixels corresponding to wavelength (length of array is length output parameter)
See also
getIndexAtWavelength()
getIndicesAtAnyWavelength()

◆ getInstance()

static OceanDirect NetOceanDirect::OceanDirect::getInstance ( )
inlinestatic

Creates a tracked handle to an OceanDirect instance, which may be used to access all of the functionality listed below.

◆ getIntegrationTimeMicros()

unsigned long OceanDirect::getIntegrationTimeMicros ( int deviceID,
int% errorCode )
virtual

Gets current integration time from the given device.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
Device's current integration time, in microseconds
Warning
For devices that do not support integration time queries (such as the STS), this function will return A cached value rather than actually querying the device. In this case, if the device's integration time has not yet been set via setIntegrationTimeMicros(), then this function will return zero.
See also
setIntegrationTimeMicros()
getMinimumIntegrationTime()
getMaximumIntegrationTime()

◆ getIntegrationTimeStepSize()

unsigned long OceanDirect::getIntegrationTimeStepSize ( int deviceID,
int% errorCode )
virtual

Gets the integration time step size from the given device. Use this value when making changes with the integration time.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
Device's current integration time, in microseconds
Warning
For devices that do not support integration time step size queries (such as the STS), this function will return a command not supported error code.
See also
setIntegrationTimeMicros()
getMinimumIntegrationTime()
getMaximumIntegrationTime()

◆ getMaximumIntegrationTime()

unsigned long OceanDirect::getMaximumIntegrationTime ( int deviceID,
int% errorCode )
virtual

Returns the maximum allowed integration time for the given device. Trying to set the device's integration time to a value above this maximum will result in setIntegrationTimeMicros() silently clamping the given time to this maximum value. Does not communicate with the device - uses cached values.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature
Returns
maximum Allowed integration time for this device, in microseconds
See also
getMinimumIntegrationTime()

◆ getMaximumIntensity()

double OceanDirect::getMaximumIntensity ( int deviceID,
int% errorCode )
virtual

Returns the greatest intensity value that could possibly be reported at any pixel by the given device (i.e., by getSpectrum()). Does not communicate with the device - uses cached values.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature
Returns
Maximum possible intensity value, in digital counts

◆ getMinimumAveragingIntegrationTimeMicros()

unsigned long OceanDirect::getMinimumAveragingIntegrationTimeMicros ( long deviceID,
int% errorCode )
virtual

Get minimum integration time in microseconds when averaging is enabled. NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is not enabled can be determined using getMinimumIntegrationTimeMicros.

Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist.
Returns
The minimum integration time in microseconds with averaging enabled.

◆ getMinimumIntegrationTime()

unsigned long OceanDirect::getMinimumIntegrationTime ( int deviceID,
int% errorCode )
virtual

Returns the minimum allowed integration time for the given device. Trying to set the device's integration time to a value below this minimum will result in setIntegrationTimeMicros() silently clamping the given time to this minimum value. Does not communicate with the device - uses cached values. NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is enabled can be determined using getMinimumAveragingIntegrationTimeMicros.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature
Returns
Minimum allowed integration time for this device, in microseconds
See also
getMaximumIntegrationTime()

◆ getNonlinearityCorrectedSpectrum() [1/2]

array< double > OceanDirect::getNonlinearityCorrectedSpectrum ( long deviceID,
int% errorCode )
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.

See also
setStoredDarkSpectrum.
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist.
Returns
The corrected spectrum on success, empty otherwise.

◆ getNonlinearityCorrectedSpectrum() [2/2]

array< double > OceanDirect::getNonlinearityCorrectedSpectrum ( long deviceID,
int% errorCode,
array< double >^% darkSpectrum )
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.

Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_DARK_NONLINEARITY_CORRECTION_CONFLICT legacy correction functionality has been enabled using either applyElectricDarkCorrection or applyNonLinearityCorrection or both; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_NO_DEVICE if the device does not exist.
[in]darkSpectrumThe buffer that contains the dark spectrum to be used for the dark correction.
Returns
The corrected spectrum on success, empty otherwise.

◆ getNonLinearityCorrectionUsage()

bool OceanDirect::getNonLinearityCorrectionUsage ( int deviceID,
int% errorCode )
virtual

Gets nonlinearity correction usage from the given device.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID
Returns
Device's current nonlinearity usage state.

◆ getNumberOfPixels()

int OceanDirect::getNumberOfPixels ( int deviceID,
int% errorCode )
virtual

Gets the number of pixels on the detector, which matches the length of spectra returned by getSpectrum or wavelengths returned by getWavelengths(). Depends on device and current pixel binning mode, if applicable. Does not actually communicate with the device, since this value is read during openDevice() and cached in OceanDirect.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_TRANSFER_ERROR if a communication error occurred ERROR_FEATURE_NOT_FOUND if device does not support this feature
Returns
The number of pixels on the device's detector

◆ getRawSpectrumWithMetadata()

array< NetOceanDirect::SpectrumWithMetadata^> OceanDirect::getRawSpectrumWithMetadata ( int deviceID,
int% errorCode,
int count )
virtual

Retrieved raw spectrum with timestamp. To use this function, the data buffer must be enabled and the back-to-back spectra acquisition count be set. Note: this method will return up to the maximum number of spectra specified. Some spectrometer types may return a single spectrum at a time so it is advisable to check the size of the returned array.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_COMMAND_NOT_SUPPORTED this command is not supported by the device ERROR_TRANSFER_ERROR if data transfer to/from device fails
[in]countThe maximum desired number of spectra to retrieve. This must be between 1 and 15.
Returns
An array of SpectrumWithMetadata class.

◆ getScansToAverage()

unsigned int OceanDirect::getScansToAverage ( long deviceID,
int% errorCode )
virtual

Retrieves the given device's current averaging setting.

See also
setScansToAverage()
Parameters
[in]deviceIDThe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
The number of scans being averaged together for each measurement made by the device

◆ getSerialNumber()

String OceanDirect::getSerialNumber ( long deviceID,
int% errorCode )
virtual

Retrieves the serial number of the given device.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
Serial number of the device, which may contain both letters and numbers

◆ getSpectrum()

array< double > OceanDirect::getSpectrum ( int deviceID,
int% errorCode )
virtual

Retrieves a spectral measurement in a manner depending on the device's current trigger mode.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
spectral measurement as list of (getNumberOfPixels) intensity values read from detector, in order of ascending wavelength
Warning
may block for a long time if device is configured for external triggering and a trigger signal hasn't arrived yet

◆ getStoredDarkSpectrum()

array< double > NetOceanDirect::OceanDirect::getStoredDarkSpectrum ( long deviceID,
int% errorCode )
virtual

Retrieve a previously stored dark spectrum for use in subsequent corrections i.e. dark correction and nonlinearity correction.

See also
setStoredDarkSpectrum.
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_VALUE_NOT_FOUND no stored dark spectrum was found; ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_NO_DEVICE if the device does not exist.
Returns
The stored dark spectrum on success, empty otherwise.

◆ getTriggerMode()

int OceanDirect::getTriggerMode ( long deviceID,
int% errorCode )
virtual

Read the spectrometer trigger mode. Please see your spectrometer documentation for valid values of the trigger mode.

See also
setTriggerMode()
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_COMMAND_NOT_SUPPORTED this command is not supported by the device; ERROR_TRANSFER_ERROR if a communication error occurred; ERROR_CODE_INVALID_ARGUMENT if the mode supplied is not valid; ERROR_NO_DEVICE if the device does not exist.
Returns
the current trigger mode.

◆ getWavelength()

double OceanDirect::getWavelength ( int deviceID,
int% errorCode,
int pixel )
virtual

Gets wavelength for a single pixel on the detector at the specified index.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
[in]pixelIndex (zero-based) of pixel on detector for which to get the wavelength - must be on range [0, getNumberOfPixels()-1]
Returns
wavelength at that index, in nanometers
Exceptions
IndexOutOfRangeExceptionif provided pixel index is not in valid range
See also
getWavelengths()

◆ getWavelengthCoefficients()

array< double > OceanDirect::getWavelengthCoefficients ( long deviceID,
int% errorCode )
virtual

Retrieves the wavelength coefficients of the given device.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
The wavelength coefficients of the device.

◆ getWavelengths()

array< double > OceanDirect::getWavelengths ( int deviceID,
int% errorCode )
virtual

Gets wavelength at which each pixel on the device's detector reports intensity.

Parameters
[in]deviceIDThe device ID of the device to be queried
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
Returns
List of wavelengths corresponding to pixels returned by getSpectrum(), in nanometers, in ascending order (length of returned array is equal to number of pixels, which is found via getNumberOfPixels())
See also
getWavelength()

◆ isFeatureEnabled()

bool OceanDirect::isFeatureEnabled ( int deviceID,
int% errorCode,
NetOceanDirect::OceanDirect::FeatureID featureId )
virtual

Determines whether a feature is supported by a particular spectrometer or not.

Parameters
[in]deviceIDthe device ID of the device to query
[in]FeatureIDthe enumeration of the feature to query
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a currently-open device ERROR_FEATURE_NOT_FOUND if device does not support this feature
Returns
true or false

◆ nonlinearityCorrectSpectrum() [1/2]

array< double > OceanDirect::nonlinearityCorrectSpectrum ( long deviceID,
int% errorCode,
array< double >^% darkSpectrum,
array< double >^% illuminatedSpectrum )
virtual

Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum.

Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet 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]darkSpectrumThe buffer that contains the dark spectrum to be used prior to the nonlinearity correction.
[in]illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The corrected spectrum on success, empty otherwise.

◆ nonlinearityCorrectSpectrum() [2/2]

array< double > OceanDirect::nonlinearityCorrectSpectrum ( long deviceID,
int% errorCode,
array< double >^% illuminatedSpectrum )
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.

See also
setStoredDarkSpectrum
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet 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]illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The corrected spectrum on success, empty otherwise.

◆ openDevice()

void OceanDirect::openDevice ( int deviceID,
int% errorCode )
virtual

Opens the spectrometer with the given device ID, which allows the various operations listed below to be performed on it by passing this same device ID. After being opened, the spectrometer not be opened again until it is first closed using closeDevice(). After the device is closed the id becomes invalid. You need to call either findDevices()/findUSBDevices/addNetworkDevice() and getDeviceIDs() in order to have a valid id before reopening the device again. For a network connected device this function may return an error code if the device is not yet ready to accept incoming connection or the device is unreachable. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Parameters
[in]deviceIDThe device ID of the device to be opened (get using findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid device ID or device does not support spectrometer feature.
See also
findDevices()
closeDevice()

◆ setAcquisitionDelayMicroseconds()

void OceanDirect::setAcquisitionDelayMicroseconds ( long deviceID,
int% errorCode,
unsigned long delay_usec )
virtual

Sets acquisition delay (time between when device receives trigger signal and when integration begins) for the given device. Functions such as getDelayMaximumMicroseconds() can be used to determine valid values for this setting.

See also
getAcquisitionDelayMicroseconds()
Parameters
[in]deviceIDThe device ID for the device to be configured (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]delay_usecThe new acquisition delay, in microseconds

◆ setBoxcarWidth()

void OceanDirect::setBoxcarWidth ( long deviceID,
int% errorCode,
unsigned int boxcarWidth )
virtual

Sets the boxcar filter width for a given device.

See also
getBoxcarWidth()
Parameters
[in]deviceIDThe device ID for the device to be configured (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails
[in]boxcarWidthThe width of the boxcar filter to be applied on the device

◆ setIntegrationTimeMicros()

void OceanDirect::setIntegrationTimeMicros ( int deviceID,
int% errorCode,
unsigned long integrationTimeMicros )
virtual

Sets integration time for the given device, which is how long the detector collects photons before reading it out. NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is enabled can be determined using getMinimumAveragingIntegrationTimeMicros.

Parameters
[in]deviceIDThe device ID of the device to configure
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_INPUT_OUT_OF_BOUNDS if an invalid integration time is supplied ERROR_INTEGRATION_TIME_BELOW_AVERAGING_MIN if averaging is enabled and the specified integration time is below the minimum required for averaging (see getMinimumAveragingIntegrationTimeMicros); ERROR_TRANSFER_ERROR if data transfer to/from device fails
[in]integrationTimeMicrosThe integration time to set, in microseconds
Warning
Will perform a single integration after integration time is set, since some spectrometers require this in order to perform new background scans and so on. This scan will be completed and discarded before this function returns.
If specified integration time is below the minimum or above the maximum integration time supported by the device, then it will be clamped to those values before it is applied.
See also
getIntegrationTimeMicros()
getMinimumIntegrationTime()
getMaximumIntegrationTime()
getMinimumAveragingIntegrationTimeMicros()

◆ setMulticastMsgResponseReadDelay()

void OceanDirect::setMulticastMsgResponseReadDelay ( size_t delayMs)
virtual

Set the delay between reading multicast response. This must be called before probing network devices.

See also
findDevices()
Parameters
delayMsThe delay in milliseconds before next read.

◆ setMulticastMsgResponseReadRetry()

void OceanDirect::setMulticastMsgResponseReadRetry ( size_t retryCount)
virtual

Set the number of times to read multicast message response. This must be called before probing network devices.

See also
findDevices()
Parameters
retryCountThe number of times to try reading multicast response messages.

◆ setMulticastMsgSendRetry()

void OceanDirect::setMulticastMsgSendRetry ( size_t retryCount)
virtual

Set the number of times to send multicast message for dynamic probing. This must be called before probing network devices.

See also
findDevices()
Parameters
retryCountThe number of times to send messages.

◆ setScansToAverage()

void OceanDirect::setScansToAverage ( long deviceID,
int% errorCode,
unsigned int scansToAverage )
virtual

Sets the number of scans to be averaged per measurement for a given device. When this value is set greater than 1 the specified number of spectra are averaged and the resulting average is returned by getFormattedSpectrum (or getRawSpectrumWithMetadata). NOTE: Some devices have a minimum integration time for averaging that is different to the minimum integration time for unaveraged acquisition (see your spectrometer documentation to determine if this is a requirement).

See also
getScansToAverage()
Parameters
[in]deviceIDThe device ID for the device to be configured (from OceanDirect::findDevices())
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid and open deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_TRANSFER_ERROR if data transfer to/from device fails ERROR_INTEGRATION_TIME_BELOW_AVERAGING_MIN if the current integration time is below the minimum required for averaging it will not be possible to enable averaging (see getMinimumAveragingIntegrationTimeMicros);
[in]scansToAverageThe number of scans to average on the device for each measurement

◆ setStoredDarkSpectrum()

void OceanDirect::setStoredDarkSpectrum ( long deviceID,
int% errorCode,
array< double >^% darkSpectrum )
virtual

Store a dark spectrum for use in subsequent corrections i.e. dark correction and nonlinearity correction.

See also
getStoredDarkSpectrum.
Parameters
[in]deviceIDThe identifier of the device as returned by getDeviceIDs.
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_FEATURE_NOT_FOUND if the spectrometer feature is not available; ERROR_NO_DEVICE if the device does not exist.
[int]darkSpectrum The buffer that contains the dark spectrum to be stored.

◆ setTriggerMode()

void OceanDirect::setTriggerMode ( int deviceID,
int% errorCode,
int triggerMode )
virtual

Sets trigger mode for the given device, which signals when to collects photons.

See also
getTriggerMode()
Parameters
[in]deviceIDThe device ID of the device to configure
[out]errorCodeSet to 0 if successful, an OceanDirect error code (nonzero) otherwise ERROR_NO_DEVICE if deviceID is not a valid (and open) deviceID ERROR_FEATURE_NOT_FOUND if device does not support this feature ERROR_INPUT_OUT_OF_BOUNDS if an invalid integration time is supplied ERROR_TRANSFER_ERROR if data transfer to/from device fails
[in]triggerModeRefer to your device manual on supported trigger modes.

◆ shutDown()

void OceanDirect::shutDown ( )
virtual

This may be called to free up any allocated memory being held by the driver interface. This must be called before the program ends.

Member Data Documentation

◆ odInstance

OceanDirect NetOceanDirect::OceanDirect::odInstance
staticprotected

The documentation for this class was generated from the following files: