public class YSpectralSensor extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YSpectralSensor.TimedReportCallback
TimedReportCallback for SpectralSensor
|
static interface |
YSpectralSensor.UpdateCallback
Deprecated UpdateCallback for SpectralSensor
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
_estimatedHSL |
protected String |
_estimatedOkLab |
protected int |
_estimatedRGB |
protected String |
_estimatedXYZ |
protected int |
_estimationModel |
protected int |
_gain |
protected int |
_gainAtPowerOn |
protected int |
_integrationTime |
protected int |
_integrationTimeAtPowerOn |
protected int |
_ledCurrent |
protected int |
_ledCurrentAtPowerOn |
protected String |
_nearHTMLColor |
protected String |
_nearRAL1 |
protected String |
_nearRAL2 |
protected String |
_nearRAL3 |
protected String |
_nearSimpleColor |
protected double |
_resolution |
protected int |
_saturation |
protected YSpectralSensor.UpdateCallback |
_valueCallbackSpectralSensor |
static int |
ESTIMATEDHSL_INVALID
invalid estimatedHSL value
|
static String |
ESTIMATEDOKLAB_INVALID
invalid estimatedOkLab value
|
static int |
ESTIMATEDRGB_INVALID
invalid estimatedRGB value
|
static String |
ESTIMATEDXYZ_INVALID
invalid estimatedXYZ value
|
static int |
ESTIMATIONMODEL_EMISSION |
static int |
ESTIMATIONMODEL_INVALID |
static int |
ESTIMATIONMODEL_REFLECTION
invalid estimationModel value
|
static int |
GAIN_INVALID
invalid gain value
|
static int |
GAINATPOWERON_INVALID
invalid gainAtPowerOn value
|
static int |
INTEGRATIONTIME_INVALID
invalid integrationTime value
|
static int |
INTEGRATIONTIMEATPOWERON_INVALID
invalid integrationTimeAtPowerOn value
|
static int |
LEDCURRENT_INVALID
invalid ledCurrent value
|
static int |
LEDCURRENTATPOWERON_INVALID
invalid ledCurrentAtPowerOn value
|
static String |
NEARHTMLCOLOR_INVALID
invalid nearHTMLColor value
|
static String |
NEARRAL1_INVALID
invalid nearRAL1 value
|
static String |
NEARRAL2_INVALID
invalid nearRAL2 value
|
static String |
NEARRAL3_INVALID
invalid nearRAL3 value
|
static String |
NEARSIMPLECOLOR_INVALID
invalid nearSimpleColor value
|
static double |
RESOLUTION_INVALID
invalid resolution value
|
static int |
SATURATION_INVALID
invalid saturation value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID| Modifier | Constructor and Description |
|---|---|
protected |
YSpectralSensor(String func) |
protected |
YSpectralSensor(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YSpectralSensor |
FindSpectralSensor(String func)
Retrieves a spectral sensor for a given identifier.
|
static YSpectralSensor |
FindSpectralSensorInContext(YAPIContext yctx,
String func)
Retrieves a spectral sensor for a given identifier in a YAPI context.
|
static YSpectralSensor |
FirstSpectralSensor()
Starts the enumeration of spectral sensors currently accessible.
|
static YSpectralSensor |
FirstSpectralSensorInContext(YAPIContext yctx)
Starts the enumeration of spectral sensors currently accessible.
|
int |
get_estimatedHSL()
Returns the estimated color in HSL (Hue, Saturation, Lightness) format.
|
String |
get_estimatedOkLab()
Returns the estimated color in OkLab format.
|
int |
get_estimatedRGB()
Returns the estimated color in RGB format (0xRRGGBB).
|
String |
get_estimatedXYZ()
Returns the estimated color in XYZ format.
|
int |
get_estimationModel()
Returns the model for color estimation.
|
int |
get_gain()
Retrieves the current gain.
|
int |
get_gainAtPowerOn() |
int |
get_integrationTime()
Returns the current integration time.
|
int |
get_integrationTimeAtPowerOn() |
int |
get_ledCurrent()
Returns the current value of the LED.
|
int |
get_ledCurrentAtPowerOn() |
String |
get_nearHTMLColor() |
String |
get_nearRAL1() |
String |
get_nearRAL2() |
String |
get_nearRAL3() |
String |
get_nearSimpleColor()
Returns the estimated color.
|
double |
get_resolution()
Returns the resolution of the measured values.
|
int |
get_saturation()
Returns the current saturation of the sensor.
|
int |
getEstimatedHSL()
Returns the estimated color in HSL (Hue, Saturation, Lightness) format.
|
String |
getEstimatedOkLab()
Returns the estimated color in OkLab format.
|
int |
getEstimatedRGB()
Returns the estimated color in RGB format (0xRRGGBB).
|
String |
getEstimatedXYZ()
Returns the estimated color in XYZ format.
|
int |
getEstimationModel()
Returns the model for color estimation.
|
int |
getGain()
Retrieves the current gain.
|
int |
getIntegrationTime()
Returns the current integration time.
|
int |
getLedCurrent()
Returns the current value of the LED.
|
String |
getNearSimpleColor()
Returns the estimated color.
|
double |
getResolution()
Returns the resolution of the measured values.
|
int |
getSaturation()
Returns the current saturation of the sensor.
|
YSpectralSensor |
nextSpectralSensor()
Continues the enumeration of spectral sensors started using yFirstSpectralSensor().
|
int |
registerValueCallback(YSpectralSensor.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_estimationModel(int newval)
Changes the model for color estimation.
|
int |
set_gain(int newval)
Sets the gain for signal processing.
|
int |
set_gainAtPowerOn(int newval)
Sets the gain at power-on.
|
int |
set_integrationTime(int newval)
Sets the integration time for data processing.
|
int |
set_integrationTimeAtPowerOn(int newval)
Sets the integration time at power-on.
|
int |
set_ledCurrent(int newval)
Changes the luminosity of the module leds.
|
int |
set_ledCurrentAtPowerOn(int newval)
Sets the LED current at power-on.
|
int |
set_resolution(double newval)
Changes the resolution of the measured physical values.
|
int |
setEstimationModel(int newval)
Changes the model for color estimation.
|
int |
setGain(int newval)
Sets the gain for signal processing.
|
int |
setGainAtPowerOn(int newval)
Sets the gain at power-on.
|
int |
setIntegrationTime(int newval)
Sets the integration time for data processing.
|
int |
setIntegrationTimeAtPowerOn(int newval)
Sets the integration time at power-on.
|
int |
setLedCurrent(int newval)
Changes the luminosity of the module leds.
|
int |
setLedCurrentAtPowerOn(int newval)
Sets the LED current at power-on.
|
int |
setResolution(double newval)
Changes the resolution of the measured physical values.
|
_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final int LEDCURRENT_INVALID
public static final double RESOLUTION_INVALID
public static final int INTEGRATIONTIME_INVALID
public static final int GAIN_INVALID
public static final int ESTIMATIONMODEL_REFLECTION
public static final int ESTIMATIONMODEL_EMISSION
public static final int ESTIMATIONMODEL_INVALID
public static final int SATURATION_INVALID
public static final int ESTIMATEDRGB_INVALID
public static final int ESTIMATEDHSL_INVALID
public static final String ESTIMATEDXYZ_INVALID
public static final String ESTIMATEDOKLAB_INVALID
public static final String NEARRAL1_INVALID
public static final String NEARRAL2_INVALID
public static final String NEARRAL3_INVALID
public static final String NEARHTMLCOLOR_INVALID
public static final String NEARSIMPLECOLOR_INVALID
public static final int LEDCURRENTATPOWERON_INVALID
public static final int INTEGRATIONTIMEATPOWERON_INVALID
public static final int GAINATPOWERON_INVALID
protected int _ledCurrent
protected double _resolution
protected int _integrationTime
protected int _gain
protected int _estimationModel
protected int _saturation
protected int _estimatedRGB
protected int _estimatedHSL
protected String _estimatedXYZ
protected String _estimatedOkLab
protected String _nearRAL1
protected String _nearRAL2
protected String _nearRAL3
protected String _nearHTMLColor
protected String _nearSimpleColor
protected int _ledCurrentAtPowerOn
protected int _integrationTimeAtPowerOn
protected int _gainAtPowerOn
protected YSpectralSensor.UpdateCallback _valueCallbackSpectralSensor
protected YSpectralSensor(YAPIContext ctx, String func)
func - : functionidprotected YSpectralSensor(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic int get_ledCurrent()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getLedCurrent()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_ledCurrent(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the luminosity of the module ledsYAPI_Exception - on errorpublic int setLedCurrent(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the luminosity of the module ledsYAPI_Exception - on errorpublic int set_resolution(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the resolution of the measured physical valuesYAPI_Exception - on errorpublic int setResolution(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the resolution of the measured physical valuesYAPI_Exception - on errorpublic double get_resolution()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getResolution()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_integrationTime()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getIntegrationTime()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_integrationTime(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int setIntegrationTime(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int get_gain()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getGain()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_gain(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int setGain(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int get_estimationModel()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getEstimationModel()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_estimationModel(int newval)
throws YAPI_Exception
newval - : either YSpectralSensor.ESTIMATIONMODEL_REFLECTION or
YSpectralSensor.ESTIMATIONMODEL_EMISSION, according to the model for color estimationYAPI_Exception - on errorpublic int setEstimationModel(int newval)
throws YAPI_Exception
newval - : either YSpectralSensor.ESTIMATIONMODEL_REFLECTION or
YSpectralSensor.ESTIMATIONMODEL_EMISSION, according to the model for color estimationYAPI_Exception - on errorpublic int get_saturation()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getSaturation()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_estimatedRGB()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getEstimatedRGB()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_estimatedHSL()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getEstimatedHSL()
throws YAPI_Exception
YAPI_Exception - on errorpublic String get_estimatedXYZ() throws YAPI_Exception
YAPI_Exception - on errorpublic String getEstimatedXYZ() throws YAPI_Exception
YAPI_Exception - on errorpublic String get_estimatedOkLab() throws YAPI_Exception
YAPI_Exception - on errorpublic String getEstimatedOkLab() throws YAPI_Exception
YAPI_Exception - on errorpublic String get_nearRAL1() throws YAPI_Exception
YAPI_Exceptionpublic String get_nearRAL2() throws YAPI_Exception
YAPI_Exceptionpublic String get_nearRAL3() throws YAPI_Exception
YAPI_Exceptionpublic String get_nearHTMLColor() throws YAPI_Exception
YAPI_Exceptionpublic String get_nearSimpleColor() throws YAPI_Exception
YAPI_Exception - on errorpublic String getNearSimpleColor() throws YAPI_Exception
YAPI_Exception - on errorpublic int get_ledCurrentAtPowerOn()
throws YAPI_Exception
YAPI_Exceptionpublic int set_ledCurrentAtPowerOn(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int setLedCurrentAtPowerOn(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int get_integrationTimeAtPowerOn()
throws YAPI_Exception
YAPI_Exceptionpublic int set_integrationTimeAtPowerOn(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int setIntegrationTimeAtPowerOn(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int get_gainAtPowerOn()
throws YAPI_Exception
YAPI_Exceptionpublic int set_gainAtPowerOn(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic int setGainAtPowerOn(int newval)
throws YAPI_Exception
newval - : an integerYAPI_Exception - on errorpublic static YSpectralSensor FindSpectralSensor(String func)
func - : a string that uniquely characterizes the spectral sensor, for instance
MyDevice.spectralSensor.public static YSpectralSensor FindSpectralSensorInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the spectral sensor, for instance
MyDevice.spectralSensor.public int registerValueCallback(YSpectralSensor.UpdateCallback callback)
callback - : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback in class YFunctionpublic YSpectralSensor nextSpectralSensor()
public static YSpectralSensor FirstSpectralSensor()
public static YSpectralSensor FirstSpectralSensorInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2025. All rights reserved.