QKnxDate Class

The QKnxDate class is a datapoint type for a date. 更多...

头: #include <QKnxDate>
qmake: QT += knx
继承: QKnxFixedSizeDatapointType

公共函数

QKnxDate (quint16 year , quint8 month , quint8 day )
QKnxDate (const QDate & date )
QKnxDate ()
quint8 day () const
quint8 month () const
bool setDay (quint8 day )
bool setMonth (quint8 month )
bool setValue (const QDate & date )
bool setYear (quint16 year )
QDate value () const
quint16 year () const

重实现公共函数

virtual bool isValid () const override

详细描述

This is a fixed size datapoint type with the length of 3 bytes.

The left byte of the data holds the day as 5 bits, the middle byte holds the month as 4 bits, and the right byte holds the year as 7 bits.

Valid dates are from Monday, 1990-01-01 to Saturday, 2089-12-31 .

另请参阅 QKnxDatapointType and Qt KNX Datapoint Type Classes .

成员函数文档编制

QKnxDate:: QKnxDate ( quint16 year , quint8 month , quint8 day )

Creates a fixed size datapoint type with the year set to year , month to month , and day to day .

QKnxDate:: QKnxDate (const QDate & date )

Creates a fixed size datapoint type with the date set to date .

QKnxDate:: QKnxDate ()

Creates a fixed size datapoint type with the date set to 2000, 0, 0 .

quint8 QKnxDate:: day () const

Returns the day stored in the datapoint type.

另请参阅 setDay ().

[override virtual] bool QKnxDate:: isValid () const

重实现: QKnxDatapointType::isValid () const.

quint8 QKnxDate:: month () const

Returns the month stored in the datapoint type.

另请参阅 setMonth ().

bool QKnxDate:: setDay ( quint8 day )

Sets the day to day .

If the value is outside the allowed range, returns false and does not set the value.

另请参阅 day ().

bool QKnxDate:: setMonth ( quint8 month )

Sets the month to month .

If the value is outside the allowed range, returns false and does not set the value.

另请参阅 month ().

bool QKnxDate:: setValue (const QDate & date )

Sets the date stored in the datapoint type to date .

If the value is outside the allowed range, returns false and does not set the value.

另请参阅 value ().

bool QKnxDate:: setYear ( quint16 year )

Sets the year to year .

If the value is outside the allowed range, returns false and does not set the value.

另请参阅 year ().

QDate QKnxDate:: value () const

Returns the date stored in the datapoint type.

另请参阅 setValue ().

quint16 QKnxDate:: year () const

Returns the year stored in the datapoint type.

另请参阅 setYear ().