com.yoctopuce.YoctoAPI
public class YRefFrame extends YFunction
Modifier and Type | Class and Description |
---|---|
static class |
YRefFrame.MOUNTORIENTATION |
static class |
YRefFrame.MOUNTPOSITION |
static interface |
YRefFrame.TimedReportCallback
TimedReportCallback for RefFrame
|
static interface |
YRefFrame.UpdateCallback
Deprecated UpdateCallback for RefFrame
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YRefFrame(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_calibSort(int start,
int stopidx) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
int |
cancel3DCalibration()
Aborts the sensors tridimensional calibration process et restores normal settings.
|
static YRefFrame |
FindRefFrame(String func)
Retrieves a reference frame for a given identifier.
|
static YRefFrame |
FirstRefFrame()
Starts the enumeration of reference frames currently accessible.
|
String |
get_3DCalibrationHint()
Returns instructions to proceed to the tridimensional calibration initiated with
method start3DCalibration.
|
String |
get_3DCalibrationLogMsg()
Returns the latest log message from the calibration process.
|
int |
get_3DCalibrationProgress()
Returns the global process indicator for the tridimensional calibration
initiated with method start3DCalibration.
|
int |
get_3DCalibrationStage()
Returns index of the current stage of the calibration
initiated with method start3DCalibration.
|
int |
get_3DCalibrationStageProgress()
Returns the process indicator for the current stage of the calibration
initiated with method start3DCalibration.
|
double |
get_bearing()
Returns the reference bearing used by the compass.
|
String |
get_calibrationParam() |
YRefFrame.MOUNTORIENTATION |
get_mountOrientation()
Returns the installation orientation of the device, as configured
in order to define the reference frame for the compass and the
pitch/roll tilt sensors.
|
int |
get_mountPos() |
YRefFrame.MOUNTPOSITION |
get_mountPosition()
Returns the installation position of the device, as configured
in order to define the reference frame for the compass and the
pitch/roll tilt sensors.
|
double |
getBearing()
Returns the reference bearing used by the compass.
|
String |
getCalibrationParam() |
int |
getMountPos() |
int |
more3DCalibration()
Continues the sensors tridimensional calibration process previously
initiated using method start3DCalibration.
|
YRefFrame |
nextRefFrame()
Continues the enumeration of reference frames started using yFirstRefFrame().
|
int |
registerValueCallback(YRefFrame.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
save3DCalibration()
Applies the sensors tridimensional calibration parameters that have just been computed.
|
int |
set_bearing(double newval)
Changes the reference bearing used by the compass.
|
int |
set_calibrationParam(String newval) |
int |
set_mountPos(int newval) |
int |
set_mountPosition(YRefFrame.MOUNTPOSITION position,
YRefFrame.MOUNTORIENTATION orientation)
Changes the compass and tilt sensor frame of reference.
|
int |
setBearing(double newval)
Changes the reference bearing used by the compass.
|
int |
setCalibrationParam(String newval) |
int |
setMountPos(int newval) |
int |
start3DCalibration()
Initiates the sensors tridimensional calibration process.
|
_AddToCache, _devRequest, _download, _escapeAttr, _FindFromCache, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, describe, errMessage, errorMessage, errorType, errType, FindFunction, FirstFunction, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, module, nextFunction, registerValueCallback, set_logicalName, set_userData, setLogicalName, setUserData, toString, userData
public static final int MOUNTPOS_INVALID
public static final double BEARING_INVALID
public static final String CALIBRATIONPARAM_INVALID
protected int _mountPos
protected double _bearing
protected String _calibrationParam
protected YRefFrame.UpdateCallback _valueCallbackRefFrame
protected int _calibStage
protected String _calibStageHint
protected int _calibStageProgress
protected int _calibProgress
protected String _calibLogMsg
protected String _calibSavedParams
protected int _calibCount
protected int _calibInternalPos
protected int _calibPrevTick
protected double _calibAccXOfs
protected double _calibAccYOfs
protected double _calibAccZOfs
protected double _calibAccXScale
protected double _calibAccYScale
protected double _calibAccZScale
protected YRefFrame(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public int get_mountPos() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getMountPos() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_mountPos(int newval) throws YAPI_Exception
YAPI_Exception
public int setMountPos(int newval) throws YAPI_Exception
YAPI_Exception
public int set_bearing(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the reference bearing used by the compassYAPI_Exception
- on errorpublic int setBearing(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the reference bearing used by the compassYAPI_Exception
- on errorpublic double get_bearing() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getBearing() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_calibrationParam() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCalibrationParam() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_calibrationParam(String newval) throws YAPI_Exception
YAPI_Exception
public int setCalibrationParam(String newval) throws YAPI_Exception
YAPI_Exception
public static YRefFrame FindRefFrame(String func)
func
- : a string that uniquely characterizes the reference framepublic int registerValueCallback(YRefFrame.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 YFunction
public YRefFrame.MOUNTPOSITION get_mountPosition() throws YAPI_Exception
YAPI_Exception
- on errorpublic YRefFrame.MOUNTORIENTATION get_mountOrientation() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_mountPosition(YRefFrame.MOUNTPOSITION position, YRefFrame.MOUNTORIENTATION orientation) throws YAPI_Exception
position
- : a value among the YRefFrame.MOUNTPOSITION enumeration
(YRefFrame.MOUNTPOSITION_BOTTOM, YRefFrame.MOUNTPOSITION_TOP,
YRefFrame.MOUNTPOSITION_FRONT, YRefFrame.MOUNTPOSITION_RIGHT,
YRefFrame.MOUNTPOSITION_REAR, YRefFrame.MOUNTPOSITION_LEFT),
corresponding to the installation in a box, on one of the six faces.orientation
- : a value among the enumeration YRefFrame.MOUNTORIENTATION
(YRefFrame.MOUNTORIENTATION_TWELVE, YRefFrame.MOUNTORIENTATION_THREE,
YRefFrame.MOUNTORIENTATION_SIX, YRefFrame.MOUNTORIENTATION_NINE)
corresponding to the orientation of the "X" arrow on the device,
as on a clock dial seen from an observer in the center of the box.
On the bottom face, the 12H orientation points to the front, while
on the top face, the 12H orientation points to the rear.
Remember to call the saveToFlash()
method of the module if the modification must be kept.YAPI_Exception
- on errorpublic int _calibSort(int start, int stopidx)
public int start3DCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int more3DCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_3DCalibrationHint()
public int get_3DCalibrationProgress()
public int get_3DCalibrationStage()
public int get_3DCalibrationStageProgress()
public String get_3DCalibrationLogMsg()
public int save3DCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int cancel3DCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic YRefFrame nextRefFrame()
public static YRefFrame FirstRefFrame()
Copyright © 2014. All rights reserved.