public class YGenericSensor extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YGenericSensor.TimedReportCallback
TimedReportCallback for GenericSensor
|
static interface |
YGenericSensor.UpdateCallback
Deprecated UpdateCallback for GenericSensor
|
_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 |
YGenericSensor(String func) |
protected |
YGenericSensor(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 YGenericSensor |
FindGenericSensor(String func)
Retrieves a generic sensor for a given identifier.
|
static YGenericSensor |
FindGenericSensorInContext(YAPIContext yctx,
String func)
Retrieves a generic sensor for a given identifier in a YAPI context.
|
static YGenericSensor |
FirstGenericSensor()
Starts the enumeration of generic sensors currently accessible.
|
static YGenericSensor |
FirstGenericSensorInContext(YAPIContext yctx)
Starts the enumeration of generic sensors currently accessible.
|
int |
get_enabled()
Returns the activation state of this input.
|
double |
get_signalBias()
Returns the electric signal bias for zero shift adjustment.
|
String |
get_signalRange()
Returns the electric signal range used by the sensor.
|
int |
get_signalSampling()
Returns the electric signal sampling method to use.
|
String |
get_signalUnit()
Returns the measuring unit of the electrical signal used by the sensor.
|
double |
get_signalValue()
Returns the current value of the electrical signal measured by the sensor.
|
String |
get_valueRange()
Returns the physical value range measured by the sensor.
|
int |
getEnabled()
Returns the activation state of this input.
|
double |
getSignalBias()
Returns the electric signal bias for zero shift adjustment.
|
String |
getSignalRange()
Returns the electric signal range used by the sensor.
|
int |
getSignalSampling()
Returns the electric signal sampling method to use.
|
String |
getSignalUnit()
Returns the measuring unit of the electrical signal used by the sensor.
|
double |
getSignalValue()
Returns the current value of the electrical signal measured by the sensor.
|
String |
getValueRange()
Returns the physical value range measured by the sensor.
|
YGenericSensor |
nextGenericSensor()
Continues the enumeration of generic sensors started using yFirstGenericSensor().
|
int |
registerTimedReportCallback(YGenericSensor.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YGenericSensor.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_enabled(int newval)
Changes the activation state of this input.
|
int |
set_signalBias(double newval)
Changes the electric signal bias for zero shift adjustment.
|
int |
set_signalRange(String newval)
Changes the electric signal range used by the sensor.
|
int |
set_signalSampling(int newval)
Changes the electric signal sampling method to use.
|
int |
set_unit(String newval)
Changes the measuring unit for the measured value.
|
int |
set_valueRange(String newval)
Changes the physical value range measured by the sensor.
|
int |
setEnabled(int newval)
Changes the activation state of this input.
|
int |
setSignalBias(double newval)
Changes the electric signal bias for zero shift adjustment.
|
int |
setSignalRange(String newval)
Changes the electric signal range used by the sensor.
|
int |
setSignalSampling(int newval)
Changes the electric signal sampling method to use.
|
int |
setUnit(String newval)
Changes the measuring unit for the measured value.
|
int |
setValueRange(String newval)
Changes the physical value range measured by the sensor.
|
int |
zeroAdjust()
Adjusts the signal bias so that the current signal value is need
precisely as zero.
|
_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 SIGNALVALUE_INVALID
public static final String SIGNALUNIT_INVALID
public static final String SIGNALRANGE_INVALID
public static final String VALUERANGE_INVALID
public static final double SIGNALBIAS_INVALID
public static final int SIGNALSAMPLING_HIGH_RATE
public static final int SIGNALSAMPLING_HIGH_RATE_FILTERED
public static final int SIGNALSAMPLING_LOW_NOISE
public static final int SIGNALSAMPLING_LOW_NOISE_FILTERED
public static final int SIGNALSAMPLING_HIGHEST_RATE
public static final int SIGNALSAMPLING_INVALID
public static final int ENABLED_FALSE
public static final int ENABLED_TRUE
public static final int ENABLED_INVALID
protected double _signalValue
protected String _signalUnit
protected String _signalRange
protected String _valueRange
protected double _signalBias
protected int _signalSampling
protected int _enabled
protected YGenericSensor.UpdateCallback _valueCallbackGenericSensor
protected YGenericSensor.TimedReportCallback _timedReportCallbackGenericSensor
protected YGenericSensor(YAPIContext ctx, String func)
func
- : functionidprotected YGenericSensor(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 valueYAPI_Exception
- on errorpublic int setUnit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the measured valueYAPI_Exception
- on errorpublic double get_signalValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getSignalValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_signalUnit() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getSignalUnit() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_signalRange() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getSignalRange() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_signalRange(String newval) throws YAPI_Exception
newval
- : a string corresponding to the electric signal range used by the sensorYAPI_Exception
- on errorpublic int setSignalRange(String newval) throws YAPI_Exception
newval
- : a string corresponding to the electric signal range used by the sensorYAPI_Exception
- on errorpublic String get_valueRange() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getValueRange() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_valueRange(String newval) throws YAPI_Exception
newval
- : a string corresponding to the physical value range measured by the sensorYAPI_Exception
- on errorpublic int setValueRange(String newval) throws YAPI_Exception
newval
- : a string corresponding to the physical value range measured by the sensorYAPI_Exception
- on errorpublic int set_signalBias(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the electric signal bias for zero shift adjustmentYAPI_Exception
- on errorpublic int setSignalBias(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the electric signal bias for zero shift adjustmentYAPI_Exception
- on errorpublic double get_signalBias() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getSignalBias() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_signalSampling() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getSignalSampling() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_signalSampling(int newval) throws YAPI_Exception
newval
- : a value among YGenericSensor.SIGNALSAMPLING_HIGH_RATE,
YGenericSensor.SIGNALSAMPLING_HIGH_RATE_FILTERED, YGenericSensor.SIGNALSAMPLING_LOW_NOISE,
YGenericSensor.SIGNALSAMPLING_LOW_NOISE_FILTERED and YGenericSensor.SIGNALSAMPLING_HIGHEST_RATE
corresponding to the electric signal sampling method to useYAPI_Exception
- on errorpublic int setSignalSampling(int newval) throws YAPI_Exception
newval
- : a value among Y_SIGNALSAMPLING_HIGH_RATE, Y_SIGNALSAMPLING_HIGH_RATE_FILTERED,
Y_SIGNALSAMPLING_LOW_NOISE, Y_SIGNALSAMPLING_LOW_NOISE_FILTERED and Y_SIGNALSAMPLING_HIGHEST_RATE
corresponding to the electric signal sampling method to useYAPI_Exception
- on errorpublic int get_enabled() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getEnabled() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_enabled(int newval) throws YAPI_Exception
newval
- : either YGenericSensor.ENABLED_FALSE or YGenericSensor.ENABLED_TRUE, according to
the activation state of this inputYAPI_Exception
- on errorpublic int setEnabled(int newval) throws YAPI_Exception
newval
- : either Y_ENABLED_FALSE or Y_ENABLED_TRUE, according to the activation state of this inputYAPI_Exception
- on errorpublic static YGenericSensor FindGenericSensor(String func)
func
- : a string that uniquely characterizes the generic sensorpublic static YGenericSensor FindGenericSensorInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the generic sensorpublic int registerValueCallback(YGenericSensor.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(YGenericSensor.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 int zeroAdjust() throws YAPI_Exception
YAPI_Exception
- on errorpublic YGenericSensor nextGenericSensor()
public static YGenericSensor FirstGenericSensor()
public static YGenericSensor FirstGenericSensorInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2019. All rights reserved.