QIRProximityReading Class

The QIRProximityReading class holds readings from the IR proximity sensor. 更多...

头: #include <QIRProximityReading>
qmake: QT += sensors
Since: Qt 5.1
继承: QSensorReading

特性

公共函数

QIRProximityReading (QObject * parent = DECLARE_READING(QIRProximityReading))
virtual ~QIRProximityReading ()
qreal reflectance () const
void setReflectance (qreal reflectance )

重实现公共函数

virtual void copyValuesFrom (QSensorReading * other ) override

静态公共成员

const QMetaObject staticMetaObject

额外继承成员

详细描述

The QIRProximityReading class holds readings from the IR proximity sensor.

The IR (infra-red) proximity sensor detects proximity by beaming out infra-red light and detecting how much of the light returns.

The biggest limitation of this technology is that there is no reliable way to turn the reflectance values into distances unless both the item being detected and the ambient conditions are known.

QIRProximityReading Units

The sensor reports reflectance as a decimal fraction in the range of 0 - 1. That is, 0 indicates nothing was detected within the range of the sensor and 1 indicates the infra-red signal returned at the full power level that it was sent at.

With some IR sensors, it is quite uncommon to reach the top and the bottom of the value range, and some parts of the range ends might not be obtainable at all. This is due to the behavior of the sensor hardware. With these sensors, the absolute value of reflectance should never be used directly. Instead, applications should react to the relative change of the reading values. Use QProximitySensor if it is only necessary to check if something is close to the device or not.

特性文档编制

reflectance : const qreal

Holds the reflectance value.

The reflectance is a decimal fraction (from 0 to 1) indicating how much of the transmitted infra-red light was returned.

访问函数:

qreal reflectance () const

另请参阅 QIRProximityReading Units .

成员函数文档编制

QIRProximityReading:: QIRProximityReading ( QObject * parent = DECLARE_READING(QIRProximityReading))

Default constructs an instance of QIRProximityReading.

[virtual] QIRProximityReading:: ~QIRProximityReading ()

Destroys the instance of QIRProximityReading. The destructor is virtual.

[override virtual] void QIRProximityReading:: copyValuesFrom ( QSensorReading * other )

void QIRProximityReading:: setReflectance ( qreal reflectance )

Sets the reflectance value to reflectance .

另请参阅 reflectance ().