QKnxDateTime Class

The QKnxDateTime class is a datapoint type for the date and time. 更多...

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

公共类型

enum 属性 { Fault, WorkingDay, NoWorkingDay, NoYear, NoDate, …, StandardSummerTime }
flags 属性
enum class ClockQuality { WithoutExtendedSyncSignal, WithExtendedSyncSignal }

公共函数

QKnxDateTime (const QDate & date , const QKnxTime24 & time , QKnxDateTime::Attributes 属性 , QKnxDateTime::ClockQuality quality )
QKnxDateTime ()
QKnxDateTime::Attributes 属性 () const
QKnxDateTime::ClockQuality clockQuality () const
QDate date () const
void setAttributes (QKnxDateTime::Attributes 属性 )
void setClockQuality (QKnxDateTime::ClockQuality quality )
bool setDate (const QDate & date )
bool setTime (const QKnxTime24 & time )
bool setValue (const QDate & date , const QKnxTime24 & time , QKnxDateTime::Attributes 属性 , QKnxDateTime::ClockQuality quality )
QKnxTime24 time () const

重实现公共函数

virtual bool isValid () const override

详细描述

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

Valid dates are from Monday, 1900-01-01 to Wednesday, 2155-12-31 , and valid times are from Any day, 00:00:00 to Sunday, 24:00:00 .

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

成员类型文档编制

enum QKnxDateTime:: 属性
flags QKnxDateTime:: 属性

This enum type holds the date attributes.

常量 描述
QKnxDateTime::Fault 0x00 Set if one or more supported fields of the date and time information are corrupted.
QKnxDateTime::WorkingDay 0x01 Set to indicate a working day.
QKnxDateTime::NoWorkingDay 0x02 Set if the Working day field is not valid.
QKnxDateTime::NoYear 0x04 Set if the Year field is not valid.
QKnxDateTime::NoDate 0x08 Set if the Month and Day of the Month field are not valid.
QKnxDateTime::NoDayOfWeek 0x10 Set if the Day of week field is not valid.
QKnxDateTime::NoTime 0x20 Set if the Hour of day, Minutes and Seconds fields are not valid.
QKnxDateTime::StandardSummerTime 0x40 Standard Summer Time is only an attribute for information and visualization. In the hour field, summer-time correction is already considered. Therefore, no hour offset shall be added by the receiver if Standard Summer Time Information is set.

The Attributes type is a typedef for QFlags <Attribute>. It stores an OR combination of Attribute values.

enum class QKnxDateTime:: ClockQuality

This enum type holds whether the device sending date and time information sends signals which are synchronized (time to time) with an external date and time information source.

常量 描述
QKnxDateTime::ClockQuality::WithoutExtendedSyncSignal 0 Clock without an external synchronization signal. The device sending date & time information has a local clock, which can be inaccurate.
QKnxDateTime::ClockQuality::WithExtendedSyncSignal 0x01 Clock with an external synchronization signal (like DCF77, videotext). Also an externally synchronized clock should send CLQ = 0 after start-up (until reception of first synchronization signal) or after a synchronization timeout.

成员函数文档编制

QKnxDateTime:: QKnxDateTime (const QDate & date , const QKnxTime24 & time , QKnxDateTime::Attributes 属性 , QKnxDateTime::ClockQuality quality )

Creates a fixed size datapoint type with the date set to date , time to time , attributes to 属性 , and clock quality to quality .

QKnxDateTime:: QKnxDateTime ()

Creates a fixed size datapoint type with the date set to 2000, 0, 0 , the time set to 0 ,0 , the clock quality set to WithoutExtendedSyncSignal , and an empty list of attributes.

QKnxDateTime::Attributes QKnxDateTime:: 属性 () const

Returns the additional information stored in the datapoint type as a list of attributes.

另请参阅 setAttributes ().

QKnxDateTime::ClockQuality QKnxDateTime:: clockQuality () const

Returns the clock quality stored in the datapoint type.

另请参阅 setClockQuality ().

QDate QKnxDateTime:: date () const

Returns the date stored in the datapoint type.

另请参阅 setDate ().

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

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

void QKnxDateTime:: setAttributes ( QKnxDateTime::Attributes 属性 )

Sets the additional information of the datapoint type to the list of attributes specified by 属性 .

另请参阅 属性 ().

void QKnxDateTime:: setClockQuality ( QKnxDateTime::ClockQuality quality )

Sets the clock quality to quality .

另请参阅 clockQuality ().

bool QKnxDateTime:: setDate (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.

另请参阅 date ().

bool QKnxDateTime:: setTime (const QKnxTime24 & time )

Sets the time stored in the datapoint type to time .

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

另请参阅 time ().

bool QKnxDateTime:: setValue (const QDate & date , const QKnxTime24 & time , QKnxDateTime::Attributes 属性 , QKnxDateTime::ClockQuality quality )

Sets the date stored in the datapoint type to date , time to time , the list of attributes to 属性 , and clock quality to quality .

返回 true if the value was set; otherwise returns false .

QKnxTime24 QKnxDateTime:: time () const

Returns the time stored in the datapoint type.

另请参阅 setTime ().