NetOceanDirect  1.31.0
OceanDirect .NET API
Public Member Functions | Static Public Member Functions
NetOceanDirect::LightSource Class Reference

Inherits NetOceanDirect::ManagedObject< LightSourceAPI >.

Public Member Functions

int getCount (long deviceID, int% errorCode)
 
double getIntensity (long deviceID, int% errorCode, int lightSourceIndex)
 
bool hasEnable (long deviceID, int% errorCode, int lightSourceIndex)
 
bool hasVariableIntensity (long deviceID, int% errorCode, int lightSourceIndex)
 
bool isEnabled (long deviceID, int% errorCode, int lightSourceIndex)
 
void setEnable (long deviceID, int% errorCode, int lightSourceIndex, bool enable)
 
void setIntensity (long deviceID, int% errorCode, int lightSourceIndex, double intensity)
 
int setLampEnable (long deviceID, int% errorCode, bool state)
 
- Public Member Functions inherited from NetOceanDirect::ManagedObject< LightSourceAPI >
 ManagedObject (LightSourceAPI *instance)
 
LightSourceAPI * GetInstance ()
 

Static Public Member Functions

static LightSource getInstance ()
 

Additional Inherited Members

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

Member Function Documentation

◆ getCount()

int LightSource::getCount ( long  deviceID,
int%  errorCode 
)

Gets the number of light sources that are connected to the given device. Such light sources could be individual LEDs, light bulbs, lasers, etc. Each of these light sources may have different capabilities, such as programmable intensities and enables, which should be queried before they are used.

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
number of light sources connected to the given device

◆ getIntensity()

double LightSource::getIntensity ( long  deviceID,
int%  errorCode,
int  lightSourceIndex 
)

Retrieves the current intensity setting of a light source connected to the given device. The light source specified must support variable intensity for this to work. The intensity is normalized over the range [0, 1], with 0 as the minimum and 1 as the maximum.

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
[in]lightSourceIndexthe index of the light source to query (should be < getCount())
Returns
current intensity setting of the specified light source
See also
hasVariableIntensity()
setIntensity()

◆ hasEnable()

bool LightSource::hasEnable ( long  deviceID,
int%  errorCode,
int  lightSourceIndex 
)

Queries whether the indicated light source connected to the given device has a usable enable/disable control. If this returns 0 (meaning no enable available) then calling isEnabled() or setEnable() will fail.

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
[in]lightSourceIndexthe index of the light source to query (should be < getCount())
Returns
true if specified light source has an enable/disable control, false otherwise also returns false if an error occurred
See also
isEnabled()
setEnable()

◆ hasVariableIntensity()

bool LightSource::hasVariableIntensity ( long  deviceID,
int%  errorCode,
int  lightSourceIndex 
)

Queries the given device to check whether the specified connected light source supports variable intensity.

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
[in]lightSourceIndexthe index of the light source to query (should be < getCount())
Returns
true if specified light source supports variable intensity, false otherwise also returns false if an error occurred
See also
getIntensity()
setIntensity()

◆ isEnabled()

bool LightSource::isEnabled ( long  deviceID,
int%  errorCode,
int  lightSourceIndex 
)

Retrieves whether the specified light source connected to the given device is currently enabled. This function should not be called if hasEnable() returns false for this light source.

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
[in]lightSourceIndexthe index of the light source to query (should be < getCount())
Returns
true if the specified light source is currently enabled, false otherwise also returns false if an error occurred
See also
hasEnable()
setEnable()

◆ setEnable()

void LightSource::setEnable ( long  deviceID,
int%  errorCode,
int  lightSourceIndex,
bool  enable 
)

Enables/disables the specified light source connected to the given device.

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]lightSourceIndexthe index of the light source to query (should be < getCount())
[in]enableif true, light source is to be enabled - will be disabled otherwise
See also
isEnabled()
hasEnable()

◆ setIntensity()

void LightSource::setIntensity ( long  deviceID,
int%  errorCode,
int  lightSourceIndex,
double  intensity 
)

Sets the intensity of a light source connected to the given device. The light source specified must support variable intensity for this to work. The intensity is normalized over the range [0, 1], with 0 as the minimum and 1 as the maximum.

SAFETY WARNING: a light source at its minimum intensity (0) might still emit light, and in some cases, this may be harmful radiation. A value of 0 indicates the minimum of the programmable range for the light source, and does not necessarily turn the light source off. To disable a light source completely, use setEnable() if the device supports this feature, or provide some other mechanism to allow the light to be disabled or blocked by the operator.

In some cases, the intensity may refer to the duty cycle of a pulsed light source instead of a continuous power rating. The actual power output of the light source might not vary linearly with the reported intensity, so independent measurement or calibration of the light source may be necessary.

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]lightSourceIndexthe index of the light source to query (should be < getCount())
[in]intensitythe intensity at which to set the light source

◆ setLampEnable()

int LightSource::setLampEnable ( long  deviceID,
int%  errorCode,
bool  state 
)

Sets the strobe enable state of the given device.

Parameters
[in]deviceIDthe device ID for the device to be configured (from OceanDirect::findDevices())
[in]statethe new strobe enable state (true for strobe enabled, false for strobe disabled)
Returns
0 if successful, a nonzero OceanDirect error code otherwise

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