public class YRangeFinder extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YRangeFinder.TimedReportCallback
TimedReportCallback for RangeFinder
|
static interface |
YRangeFinder.UpdateCallback
Deprecated UpdateCallback for RangeFinder
|
Modifier and Type | Field and Description |
---|---|
protected String |
_command |
protected double |
_currentTemperature |
protected String |
_hardwareCalibration |
protected int |
_quality |
protected int |
_rangeFinderMode |
protected YRangeFinder.TimedReportCallback |
_timedReportCallbackRangeFinder |
protected long |
_timeFrame |
protected YRangeFinder.UpdateCallback |
_valueCallbackRangeFinder |
static String |
COMMAND_INVALID
invalid command value
|
static double |
CURRENTTEMPERATURE_INVALID
invalid currentTemperature value
|
static String |
HARDWARECALIBRATION_INVALID
invalid hardwareCalibration value
|
static int |
QUALITY_INVALID
invalid quality value
|
static int |
RANGEFINDERMODE_DEFAULT
invalid rangeFinderMode value
|
static int |
RANGEFINDERMODE_HIGH_ACCURACY |
static int |
RANGEFINDERMODE_HIGH_SPEED |
static int |
RANGEFINDERMODE_INVALID |
static int |
RANGEFINDERMODE_LONG_RANGE |
static long |
TIMEFRAME_INVALID
invalid timeFrame value
|
_advMode, _calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, ADVMODE_IMMEDIATE, ADVMODE_INVALID, ADVMODE_PERIOD_AVG, ADVMODE_PERIOD_MAX, ADVMODE_PERIOD_MIN, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, SENSORSTATE_INVALID, UNIT_INVALID
_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 |
YRangeFinder(String func) |
protected |
YRangeFinder(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
cancelCoverGlassCalibrations()
Cancels the effect of previous hardware calibration procedures to compensate
for cover glass, and restores factory settings.
|
static YRangeFinder |
FindRangeFinder(String func)
Retrieves a range finder for a given identifier.
|
static YRangeFinder |
FindRangeFinderInContext(YAPIContext yctx,
String func)
Retrieves a range finder for a given identifier in a YAPI context.
|
static YRangeFinder |
FirstRangeFinder()
Starts the enumeration of range finders currently accessible.
|
static YRangeFinder |
FirstRangeFinderInContext(YAPIContext yctx)
Starts the enumeration of range finders currently accessible.
|
String |
get_command() |
double |
get_currentTemperature()
Returns the current sensor temperature, as a floating point number.
|
String |
get_hardwareCalibration() |
double |
get_hardwareCalibrationTemperature()
Returns the temperature at the time when the latest calibration was performed.
|
int |
get_quality()
Returns a measure quality estimate, based on measured dispersion.
|
int |
get_rangeFinderMode()
Returns the range finder running mode.
|
long |
get_timeFrame()
Returns the time frame used to measure the distance and estimate the measure
reliability.
|
double |
getCurrentTemperature()
Returns the current sensor temperature, as a floating point number.
|
int |
getQuality()
Returns a measure quality estimate, based on measured dispersion.
|
int |
getRangeFinderMode()
Returns the range finder running mode.
|
long |
getTimeFrame()
Returns the time frame used to measure the distance and estimate the measure
reliability.
|
YRangeFinder |
nextRangeFinder()
Continues the enumeration of range finders started using yFirstRangeFinder().
|
int |
registerTimedReportCallback(YRangeFinder.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YRangeFinder.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_command(String newval) |
int |
set_hardwareCalibration(String newval) |
int |
set_rangeFinderMode(int newval)
Changes the rangefinder running mode, allowing you to put priority on
precision, speed or maximum range.
|
int |
set_timeFrame(long newval)
Changes the time frame used to measure the distance and estimate the measure
reliability.
|
int |
set_unit(String newval)
Changes the measuring unit for the measured range.
|
int |
setRangeFinderMode(int newval)
Changes the rangefinder running mode, allowing you to put priority on
precision, speed or maximum range.
|
int |
setTimeFrame(long newval)
Changes the time frame used to measure the distance and estimate the measure
reliability.
|
int |
setUnit(String newval)
Changes the measuring unit for the measured range.
|
int |
triggerOffsetCalibration(double targetDist)
Triggers the hardware offset calibration of the distance sensor.
|
int |
triggerSpadCalibration()
Triggers the photon detector hardware calibration.
|
int |
triggerTemperatureCalibration()
Triggers a sensor calibration according to the current ambient temperature.
|
int |
triggerXTalkCalibration(double targetDist)
Triggers the hardware cross-talk calibration of the distance sensor.
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parserHelper, calibrateFromPoints, FindSensor, FindSensorInContext, FirstSensor, FirstSensorInContext, get_advMode, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getAdvMode, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_advMode, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setAdvMode, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _clearDataStreamCache, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _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, userData
public static final int RANGEFINDERMODE_DEFAULT
public static final int RANGEFINDERMODE_LONG_RANGE
public static final int RANGEFINDERMODE_HIGH_ACCURACY
public static final int RANGEFINDERMODE_HIGH_SPEED
public static final int RANGEFINDERMODE_INVALID
public static final long TIMEFRAME_INVALID
public static final int QUALITY_INVALID
public static final String HARDWARECALIBRATION_INVALID
public static final double CURRENTTEMPERATURE_INVALID
public static final String COMMAND_INVALID
protected int _rangeFinderMode
protected long _timeFrame
protected int _quality
protected String _hardwareCalibration
protected double _currentTemperature
protected String _command
protected YRangeFinder.UpdateCallback _valueCallbackRangeFinder
protected YRangeFinder.TimedReportCallback _timedReportCallbackRangeFinder
protected YRangeFinder(YAPIContext ctx, String func)
func
- : functionidprotected YRangeFinder(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YSensor
Exception
public int set_unit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the measured rangeYAPI_Exception
- on errorpublic int setUnit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the measured rangeYAPI_Exception
- on errorpublic int get_rangeFinderMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getRangeFinderMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_rangeFinderMode(int newval) throws YAPI_Exception
newval
- : a value among YRangeFinder.RANGEFINDERMODE_DEFAULT,
YRangeFinder.RANGEFINDERMODE_LONG_RANGE, YRangeFinder.RANGEFINDERMODE_HIGH_ACCURACY and
YRangeFinder.RANGEFINDERMODE_HIGH_SPEED corresponding to the rangefinder running mode, allowing you
to put priority on
precision, speed or maximum rangeYAPI_Exception
- on errorpublic int setRangeFinderMode(int newval) throws YAPI_Exception
newval
- : a value among YRangeFinder.RANGEFINDERMODE_DEFAULT,
YRangeFinder.RANGEFINDERMODE_LONG_RANGE, YRangeFinder.RANGEFINDERMODE_HIGH_ACCURACY and
YRangeFinder.RANGEFINDERMODE_HIGH_SPEED corresponding to the rangefinder running mode, allowing you
to put priority on
precision, speed or maximum rangeYAPI_Exception
- on errorpublic long get_timeFrame() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getTimeFrame() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_timeFrame(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the time frame used to measure the distance and estimate the measure
reliabilityYAPI_Exception
- on errorpublic int setTimeFrame(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the time frame used to measure the distance and estimate the measure
reliabilityYAPI_Exception
- on errorpublic int get_quality() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getQuality() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_hardwareCalibration() throws YAPI_Exception
YAPI_Exception
public int set_hardwareCalibration(String newval) throws YAPI_Exception
YAPI_Exception
public double get_currentTemperature() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCurrentTemperature() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YRangeFinder FindRangeFinder(String func)
func
- : a string that uniquely characterizes the range finder, for instance
YRNGFND1.rangeFinder1.public static YRangeFinder FindRangeFinderInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the range finder, for instance
YRNGFND1.rangeFinder1.public int registerValueCallback(YRangeFinder.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 YSensor
public int registerTimedReportCallback(YRangeFinder.TimedReportCallback 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 an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback
in class YSensor
public double get_hardwareCalibrationTemperature() throws YAPI_Exception
YAPI_Exception
- on errorpublic int triggerTemperatureCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int triggerSpadCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int triggerOffsetCalibration(double targetDist) throws YAPI_Exception
targetDist
- : true distance of the calibration target, in mm or inches, depending
on the unit selected in the deviceYAPI_Exception
- on errorpublic int triggerXTalkCalibration(double targetDist) throws YAPI_Exception
targetDist
- : true distance of the calibration target, in mm or inches, depending
on the unit selected in the deviceYAPI_Exception
- on errorpublic int cancelCoverGlassCalibrations() throws YAPI_Exception
YAPI_Exception
- on errorpublic YRangeFinder nextRangeFinder()
public static YRangeFinder FirstRangeFinder()
public static YRangeFinder FirstRangeFinderInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2021. All rights reserved.