public class YQuadratureDecoder extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YQuadratureDecoder.TimedReportCallback
TimedReportCallback for QuadratureDecoder
|
static interface |
YQuadratureDecoder.UpdateCallback
Deprecated UpdateCallback for QuadratureDecoder
|
Modifier and Type | Field and Description |
---|---|
protected int |
_decoding |
protected double |
_speed |
protected YQuadratureDecoder.TimedReportCallback |
_timedReportCallbackQuadratureDecoder |
protected YQuadratureDecoder.UpdateCallback |
_valueCallbackQuadratureDecoder |
static int |
DECODING_INVALID |
static int |
DECODING_OFF
invalid decoding value
|
static int |
DECODING_ON |
static double |
SPEED_INVALID
invalid speed 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 |
YQuadratureDecoder(String func) |
protected |
YQuadratureDecoder(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) |
static YQuadratureDecoder |
FindQuadratureDecoder(String func)
Retrieves a quadrature decoder for a given identifier.
|
static YQuadratureDecoder |
FindQuadratureDecoderInContext(YAPIContext yctx,
String func)
Retrieves a quadrature decoder for a given identifier in a YAPI context.
|
static YQuadratureDecoder |
FirstQuadratureDecoder()
Starts the enumeration of quadrature decoders currently accessible.
|
static YQuadratureDecoder |
FirstQuadratureDecoderInContext(YAPIContext yctx)
Starts the enumeration of quadrature decoders currently accessible.
|
int |
get_decoding()
Returns the current activation state of the quadrature decoder.
|
double |
get_speed()
Returns the increments frequency, in Hz.
|
int |
getDecoding()
Returns the current activation state of the quadrature decoder.
|
double |
getSpeed()
Returns the increments frequency, in Hz.
|
YQuadratureDecoder |
nextQuadratureDecoder()
Continues the enumeration of quadrature decoders started using yFirstQuadratureDecoder().
|
int |
registerTimedReportCallback(YQuadratureDecoder.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YQuadratureDecoder.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_currentValue(double newval)
Changes the current expected position of the quadrature decoder.
|
int |
set_decoding(int newval)
Changes the activation state of the quadrature decoder.
|
int |
setCurrentValue(double newval)
Changes the current expected position of the quadrature decoder.
|
int |
setDecoding(int newval)
Changes the activation state of the quadrature decoder.
|
_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, _devRequest, _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 double SPEED_INVALID
public static final int DECODING_OFF
public static final int DECODING_ON
public static final int DECODING_INVALID
protected double _speed
protected int _decoding
protected YQuadratureDecoder.UpdateCallback _valueCallbackQuadratureDecoder
protected YQuadratureDecoder.TimedReportCallback _timedReportCallbackQuadratureDecoder
protected YQuadratureDecoder(YAPIContext ctx, String func)
func
- : functionidprotected YQuadratureDecoder(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YSensor
Exception
public int set_currentValue(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the current expected position of the quadrature decoderYAPI_Exception
- on errorpublic int setCurrentValue(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the current expected position of the quadrature decoderYAPI_Exception
- on errorpublic double get_speed() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getSpeed() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_decoding() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDecoding() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_decoding(int newval) throws YAPI_Exception
newval
- : either YQuadratureDecoder.DECODING_OFF or YQuadratureDecoder.DECODING_ON, according
to the activation state of the quadrature decoderYAPI_Exception
- on errorpublic int setDecoding(int newval) throws YAPI_Exception
newval
- : either Y_DECODING_OFF or Y_DECODING_ON, according to the activation state of the
quadrature decoderYAPI_Exception
- on errorpublic static YQuadratureDecoder FindQuadratureDecoder(String func)
func
- : a string that uniquely characterizes the quadrature decoderpublic static YQuadratureDecoder FindQuadratureDecoderInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the quadrature decoderpublic int registerValueCallback(YQuadratureDecoder.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(YQuadratureDecoder.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 YQuadratureDecoder nextQuadratureDecoder()
public static YQuadratureDecoder FirstQuadratureDecoder()
public static YQuadratureDecoder FirstQuadratureDecoderInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2019. All rights reserved.