public class YTemperature extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YTemperature.TimedReportCallback
TimedReportCallback for Temperature
|
static interface |
YTemperature.UpdateCallback
Deprecated UpdateCallback for Temperature
|
_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 |
YTemperature(String func) |
protected |
YTemperature(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 YTemperature |
FindTemperature(String func)
Retrieves a temperature sensor for a given identifier.
|
static YTemperature |
FindTemperatureInContext(YAPIContext yctx,
String func)
Retrieves a temperature sensor for a given identifier in a YAPI context.
|
static YTemperature |
FirstTemperature()
Starts the enumeration of temperature sensors currently accessible.
|
static YTemperature |
FirstTemperatureInContext(YAPIContext yctx)
Starts the enumeration of temperature sensors currently accessible.
|
String |
get_command() |
int |
get_sensorType()
Returns the temperature sensor type.
|
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.
|
int |
getSensorType()
Returns the temperature sensor type.
|
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.
|
int |
loadThermistorResponseTable(ArrayList<Double> tempValues,
ArrayList<Double> resValues)
Retrieves the thermistor response table previously configured using the
set_thermistorResponseTable function.
|
YTemperature |
nextTemperature()
Continues the enumeration of temperature sensors started using yFirstTemperature().
|
int |
registerTimedReportCallback(YTemperature.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YTemperature.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_command(String newval) |
int |
set_ntcParameters(double res25,
double beta)
Configures NTC thermistor parameters in order to properly compute the temperature from
the measured resistance.
|
int |
set_sensorType(int newval)
Changes the temperature sensor type.
|
int |
set_thermistorResponseTable(ArrayList<Double> tempValues,
ArrayList<Double> resValues)
Records a thermistor response table, in order to interpolate the temperature from
the measured resistance.
|
int |
set_unit(String newval)
Changes the measuring unit for the measured temperature.
|
int |
setSensorType(int newval)
Changes the temperature sensor type.
|
int |
setUnit(String newval)
Changes the measuring unit for the measured temperature.
|
_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 SENSORTYPE_DIGITAL
public static final int SENSORTYPE_TYPE_K
public static final int SENSORTYPE_TYPE_E
public static final int SENSORTYPE_TYPE_J
public static final int SENSORTYPE_TYPE_N
public static final int SENSORTYPE_TYPE_R
public static final int SENSORTYPE_TYPE_S
public static final int SENSORTYPE_TYPE_T
public static final int SENSORTYPE_PT100_4WIRES
public static final int SENSORTYPE_PT100_3WIRES
public static final int SENSORTYPE_PT100_2WIRES
public static final int SENSORTYPE_RES_OHM
public static final int SENSORTYPE_RES_NTC
public static final int SENSORTYPE_RES_LINEAR
public static final int SENSORTYPE_RES_INTERNAL
public static final int SENSORTYPE_IR
public static final int SENSORTYPE_RES_PT1000
public static final int SENSORTYPE_CHANNEL_OFF
public static final int SENSORTYPE_INVALID
public static final double SIGNALVALUE_INVALID
public static final String SIGNALUNIT_INVALID
public static final String COMMAND_INVALID
protected int _sensorType
protected double _signalValue
protected String _signalUnit
protected String _command
protected YTemperature.UpdateCallback _valueCallbackTemperature
protected YTemperature.TimedReportCallback _timedReportCallbackTemperature
protected YTemperature(YAPIContext ctx, String func)
func
- : functionidprotected YTemperature(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 temperatureYAPI_Exception
- on errorpublic int setUnit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the measured temperatureYAPI_Exception
- on errorpublic int get_sensorType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getSensorType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_sensorType(int newval) throws YAPI_Exception
newval
- : a value among YTemperature.SENSORTYPE_DIGITAL, YTemperature.SENSORTYPE_TYPE_K,
YTemperature.SENSORTYPE_TYPE_E, YTemperature.SENSORTYPE_TYPE_J, YTemperature.SENSORTYPE_TYPE_N,
YTemperature.SENSORTYPE_TYPE_R, YTemperature.SENSORTYPE_TYPE_S, YTemperature.SENSORTYPE_TYPE_T,
YTemperature.SENSORTYPE_PT100_4WIRES, YTemperature.SENSORTYPE_PT100_3WIRES,
YTemperature.SENSORTYPE_PT100_2WIRES, YTemperature.SENSORTYPE_RES_OHM,
YTemperature.SENSORTYPE_RES_NTC, YTemperature.SENSORTYPE_RES_LINEAR,
YTemperature.SENSORTYPE_RES_INTERNAL, YTemperature.SENSORTYPE_IR,
YTemperature.SENSORTYPE_RES_PT1000 and YTemperature.SENSORTYPE_CHANNEL_OFF corresponding to the
temperature sensor typeYAPI_Exception
- on errorpublic int setSensorType(int newval) throws YAPI_Exception
newval
- : a value among Y_SENSORTYPE_DIGITAL, Y_SENSORTYPE_TYPE_K, Y_SENSORTYPE_TYPE_E,
Y_SENSORTYPE_TYPE_J, Y_SENSORTYPE_TYPE_N, Y_SENSORTYPE_TYPE_R, Y_SENSORTYPE_TYPE_S,
Y_SENSORTYPE_TYPE_T, Y_SENSORTYPE_PT100_4WIRES, Y_SENSORTYPE_PT100_3WIRES,
Y_SENSORTYPE_PT100_2WIRES, Y_SENSORTYPE_RES_OHM, Y_SENSORTYPE_RES_NTC, Y_SENSORTYPE_RES_LINEAR,
Y_SENSORTYPE_RES_INTERNAL, Y_SENSORTYPE_IR, Y_SENSORTYPE_RES_PT1000 and Y_SENSORTYPE_CHANNEL_OFF
corresponding to the temperature sensor typeYAPI_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_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YTemperature FindTemperature(String func)
func
- : a string that uniquely characterizes the temperature sensor, for instance
METEOMK2.temperature.public static YTemperature FindTemperatureInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the temperature sensor, for instance
METEOMK2.temperature.public int registerValueCallback(YTemperature.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(YTemperature.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 set_ntcParameters(double res25, double beta) throws YAPI_Exception
res25
- : thermistor resistance at 25 degrees Celsiusbeta
- : Beta valueYAPI_Exception
- on errorpublic int set_thermistorResponseTable(ArrayList<Double> tempValues, ArrayList<Double> resValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all
temperatures (in degrees Celsius) for which the resistance of the
thermistor is specified.resValues
- : array of floating point numbers, corresponding to the resistance
values (in Ohms) for each of the temperature included in the first
argument, index by index.YAPI_Exception
- on errorpublic int loadThermistorResponseTable(ArrayList<Double> tempValues, ArrayList<Double> resValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all temperatures (in degrees Celsius) for which the resistance
of the thermistor is specified.resValues
- : array of floating point numbers, that is filled by the function
with the value (in Ohms) for each of the temperature included in the
first argument, index by index.YAPI_Exception
- on errorpublic YTemperature nextTemperature()
public static YTemperature FirstTemperature()
public static YTemperature FirstTemperatureInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2020. All rights reserved.