QKnxTimeOfDay Class

The QKnxTimeOfDay class is a datapoint type for the time of day. 更多...

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

公共函数

QKnxTimeOfDay (quint8 h , quint8 m , quint8 s = 0, QKnxTime::DayOfWeek day = QKnxTime::DayOfWeek::Ignore)
QKnxTimeOfDay (const QKnxTime & time )
QKnxTimeOfDay ()
QKnxTime::DayOfWeek dayOfDay () const
quint8 hour () const
quint8 minute () const
quint8 second () const
bool setDayOfWeek (QKnxTime::DayOfWeek day )
bool setHour (quint8 hour )
bool setMinute (quint8 minute )
bool setSecond (quint8 second )
bool setValue (const QKnxTime & time )
QKnxTime value () 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 3 bits and the hour as 5 bits, the middle byte holds the minutes as 5 bits, and the right byte holds the seconds as 5 bits.

Valid times of day are from No day, 00:00:00 to Sunday, 23:59:59 .

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

成员函数文档编制

QKnxTimeOfDay:: QKnxTimeOfDay ( quint8 h , quint8 m , quint8 s = 0, QKnxTime::DayOfWeek day = QKnxTime::DayOfWeek::Ignore)

Creates a fixed size datapoint type with the hour set to h , minutes set to m , seconds set to s , and the day of the week set to day .

QKnxTimeOfDay:: QKnxTimeOfDay (const QKnxTime & time )

Creates a fixed size datapoint type with the time of day set to time .

QKnxTimeOfDay:: QKnxTimeOfDay ()

Creates a fixed size datapoint type with the time of day set to 0,0,0 .

QKnxTime::DayOfWeek QKnxTimeOfDay:: dayOfDay () const

Returns the day of the week stored in the datapoint type.

quint8 QKnxTimeOfDay:: hour () const

Returns the hour stored in the datapoint type.

另请参阅 setHour ().

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

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

quint8 QKnxTimeOfDay:: minute () const

Returns the minutes stored in the datapoint type.

另请参阅 setMinute ().

quint8 QKnxTimeOfDay:: second () const

Returns the seconds stored in the datapoint type.

另请参阅 setSecond ().

bool QKnxTimeOfDay:: setDayOfWeek ( QKnxTime::DayOfWeek day )

Sets the day of the week to day .

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

bool QKnxTimeOfDay:: setHour ( quint8 hour )

Sets the hour to hour .

If the value is outside the allowed range (from 0 to 23 included), returns false and does not set the value.

另请参阅 hour ().

bool QKnxTimeOfDay:: setMinute ( quint8 minute )

Sets the minute to minute .

If the value is outside the allowed range (from 0 to 59 included), returns false and does not set the value.

另请参阅 minute ().

bool QKnxTimeOfDay:: setSecond ( quint8 second )

Sets the seconds to second .

If the value is outside the allowed range (from 0 to 59 included), returns false and does not set the value.

另请参阅 second ().

bool QKnxTimeOfDay:: setValue (const QKnxTime & time )

Sets the time of day stored in the datapoint type to time .

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

另请参阅 value ().

QKnxTime QKnxTimeOfDay:: value () const

Returns the time of day stored in the datapoint type.

另请参阅 setValue ().