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 .
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 .
Creates a fixed size datapoint type with the time of day set to time .
Creates a fixed size datapoint type with the time of day set to
0,0,0
.
Returns the day of the week stored in the datapoint type.
Returns the hour stored in the datapoint type.
另请参阅 setHour ().
[override virtual]
bool
QKnxTimeOfDay::
isValid
() const
重实现: QKnxDatapointType::isValid () const.
Returns the minutes stored in the datapoint type.
另请参阅 setMinute ().
Returns the seconds stored in the datapoint type.
另请参阅 setSecond ().
Sets the day of the week to day .
If the value is outside the allowed range , returns
false
and does not set the value.
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 ().
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 ().
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 ().
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 ().
Returns the time of day stored in the datapoint type.
另请参阅 setValue ().