QKnxDateTime Class

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

Header: #include <QKnxDateTime>
qmake: QT += knx
Inherits: QKnxFixedSizeDatapointType

Public Types

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

Public Functions

QKnxDateTime(const QDate &date, const QKnxTime24 &time, QKnxDateTime::Attributes attributes, QKnxDateTime::ClockQuality quality)
QKnxDateTime()
QKnxDateTime::Attributes attributes() const
QKnxDateTime::ClockQuality clockQuality() const
QDate date() const
void setAttributes(QKnxDateTime::Attributes 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 attributes, QKnxDateTime::ClockQuality quality)
QKnxTime24 time() const

Reimplemented Public Functions

virtual bool isValid() const override

Detailed Description

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.

See also QKnxDatapointType and Qt KNX Datapoint Type Classes.

Member Type Documentation

enum QKnxDateTime::Attribute
flags QKnxDateTime::Attributes

This enum type holds the date attributes.

ConstantValueDescription
QKnxDateTime::Fault0x00Set if one or more supported fields of the date and time information are corrupted.
QKnxDateTime::WorkingDay0x01Set to indicate a working day.
QKnxDateTime::NoWorkingDay0x02Set if the Working day field is not valid.
QKnxDateTime::NoYear0x04Set if the Year field is not valid.
QKnxDateTime::NoDate0x08Set if the Month and Day of the Month field are not valid.
QKnxDateTime::NoDayOfWeek0x10Set if the Day of week field is not valid.
QKnxDateTime::NoTime0x20Set if the Hour of day, Minutes and Seconds fields are not valid.
QKnxDateTime::StandardSummerTime0x40Standard 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.

ConstantValueDescription
QKnxDateTime::ClockQuality::WithoutExtendedSyncSignal0Clock without an external synchronization signal. The device sending date & time information has a local clock, which can be inaccurate.
QKnxDateTime::ClockQuality::WithExtendedSyncSignal0x01Clock 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.

Member Function Documentation

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

Creates a fixed size datapoint type with the date set to date, time to time, attributes to attributes, 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::attributes() const

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

See also setAttributes().

QKnxDateTime::ClockQuality QKnxDateTime::clockQuality() const

Returns the clock quality stored in the datapoint type.

See also setClockQuality().

QDate QKnxDateTime::date() const

Returns the date stored in the datapoint type.

See also setDate().

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

Reimplements: QKnxDatapointType::isValid() const.

void QKnxDateTime::setAttributes(QKnxDateTime::Attributes attributes)

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

See also attributes().

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

Sets the clock quality to quality.

See also 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.

See also 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.

See also time().

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

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

Returns true if the value was set; otherwise returns false.

QKnxTime24 QKnxDateTime::time() const

Returns the time stored in the datapoint type.

See also setTime().

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.