public class YThreshold extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YThreshold.TimedReportCallback
TimedReportCallback for Threshold
|
static interface |
YThreshold.UpdateCallback
Deprecated UpdateCallback for Threshold
|
| Modifier and Type | Field and Description |
|---|---|
protected double |
_alertLevel |
protected double |
_safeLevel |
protected String |
_targetSensor |
protected int |
_thresholdState |
protected YThreshold.UpdateCallback |
_valueCallbackThreshold |
static double |
ALERTLEVEL_INVALID
invalid alertLevel value
|
static double |
SAFELEVEL_INVALID
invalid safeLevel value
|
static String |
TARGETSENSOR_INVALID
invalid targetSensor value
|
static int |
THRESHOLDSTATE_ALERT |
static int |
THRESHOLDSTATE_INVALID |
static int |
THRESHOLDSTATE_SAFE
invalid thresholdState 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 |
YThreshold(String func) |
protected |
YThreshold(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YThreshold |
FindThreshold(String func)
Retrieves a threshold function for a given identifier.
|
static YThreshold |
FindThresholdInContext(YAPIContext yctx,
String func)
Retrieves a threshold function for a given identifier in a YAPI context.
|
static YThreshold |
FirstThreshold()
Starts the enumeration of threshold functions currently accessible.
|
static YThreshold |
FirstThresholdInContext(YAPIContext yctx)
Starts the enumeration of threshold functions currently accessible.
|
double |
get_alertLevel()
Returns the sensor alert level, triggering the threshold function.
|
double |
get_safeLevel()
Returns the sensor acceptable level for disabling the threshold function.
|
String |
get_targetSensor()
Returns the name of the sensor monitored by the threshold function.
|
int |
get_thresholdState()
Returns current state of the threshold function.
|
double |
getAlertLevel()
Returns the sensor alert level, triggering the threshold function.
|
double |
getSafeLevel()
Returns the sensor acceptable level for disabling the threshold function.
|
String |
getTargetSensor()
Returns the name of the sensor monitored by the threshold function.
|
int |
getThresholdState()
Returns current state of the threshold function.
|
YThreshold |
nextThreshold()
Continues the enumeration of threshold functions started using yFirstThreshold().
|
int |
registerValueCallback(YThreshold.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_alertLevel(double newval)
Changes the sensor alert level triggering the threshold function.
|
int |
set_safeLevel(double newval)
Changes the sensor acceptable level for disabling the threshold function.
|
int |
setAlertLevel(double newval)
Changes the sensor alert level triggering the threshold function.
|
int |
setSafeLevel(double newval)
Changes the sensor acceptable level for disabling the threshold function.
|
_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _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 THRESHOLDSTATE_SAFE
public static final int THRESHOLDSTATE_ALERT
public static final int THRESHOLDSTATE_INVALID
public static final String TARGETSENSOR_INVALID
public static final double ALERTLEVEL_INVALID
public static final double SAFELEVEL_INVALID
protected int _thresholdState
protected String _targetSensor
protected double _alertLevel
protected double _safeLevel
protected YThreshold.UpdateCallback _valueCallbackThreshold
protected YThreshold(YAPIContext ctx, String func)
func - : functionidprotected YThreshold(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic int get_thresholdState()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getThresholdState()
throws YAPI_Exception
YAPI_Exception - on errorpublic String get_targetSensor() throws YAPI_Exception
YAPI_Exception - on errorpublic String getTargetSensor() throws YAPI_Exception
YAPI_Exception - on errorpublic int set_alertLevel(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the sensor alert level triggering the
threshold functionYAPI_Exception - on errorpublic int setAlertLevel(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the sensor alert level triggering the
threshold functionYAPI_Exception - on errorpublic double get_alertLevel()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getAlertLevel()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_safeLevel(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the sensor acceptable level for disabling
the threshold functionYAPI_Exception - on errorpublic int setSafeLevel(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the sensor acceptable level for disabling
the threshold functionYAPI_Exception - on errorpublic double get_safeLevel()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getSafeLevel()
throws YAPI_Exception
YAPI_Exception - on errorpublic static YThreshold FindThreshold(String func)
func - : a string that uniquely characterizes the threshold function, for instance
MyDevice.threshold1.public static YThreshold FindThresholdInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the threshold function, for instance
MyDevice.threshold1.public int registerValueCallback(YThreshold.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 YThreshold nextThreshold()
public static YThreshold FirstThreshold()
public static YThreshold FirstThresholdInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.