QKnxGroupAddressInfos Class

The QKnxGroupAddressInfos class provides access to information about group addresses used inside a KNX project. 更多...

头: #include <QKnxGroupAddressInfos>
qmake: QT += knx

公共类型

enum class Status { NoError, FileError, ProjectError, ParseError }

公共函数

QKnxGroupAddressInfos (QKnxGroupAddressInfos && other )
QKnxGroupAddressInfos (const QKnxGroupAddressInfos & other )
QKnxGroupAddressInfos (const QString & projectFile )
QKnxGroupAddressInfos ()
QKnxGroupAddressInfos & operator= (QKnxGroupAddressInfos && other )
QKnxGroupAddressInfos & operator= (const QKnxGroupAddressInfos & other )
~QKnxGroupAddressInfos ()
void add (const QKnxGroupAddressInfo & info , const QString & projectId )
void add (const QString & name , const QKnxAddress & address , QKnxDatapointType::Type type , const QString & description , const QString & projectId , const QString & installation = {})
void add (const QString & name , const QKnxAddress & address , const QString & datapointType , const QString & description , const QString & projectId , const QString & installation = {})
QVector<QKnxGroupAddressInfo> addressInfos (const QString & projectId , const QString & installation = {}) const
QVector<QKnxGroupAddressInfo> addressInfos (const QKnxAddress & address , const QString & projectId , const QString & installation = {}) const
QVector<QKnxGroupAddressInfo> addressInfos (QKnxDatapointType::Type type , const QString & projectId , const QString & installation = {}) const
void clear ()
QString errorString () const
qint32 infoCount (const QString & projectId , const QString & installation = {}) const
QVector<QString> installations (const QString & projectId ) const
bool parse ()
QString projectFile () const
QVector<QString> projectIds () const
QString projectName (const QString & projectId ) const
void remove (const QKnxAddress & address , const QString & projectId , const QString & installation = {})
void remove (const QKnxGroupAddressInfo & info , const QString & projectId )
void setProjectFile (const QString & projectFile )
QKnxGroupAddressInfos::Status status () const
void swap (QKnxGroupAddressInfos & other )
bool operator!= (const QKnxGroupAddressInfos & other ) const
bool operator== (const QKnxGroupAddressInfos & other ) const
QDebug operator<< (QDebug debug , const QKnxGroupAddressInfos & infos )

详细描述

This class parses the KNX project information specified via the setProjectFile () method and provides access to the information defined within the file through an API. You can:

  • Get information about existing project IDs and, if available, the corresponding project names.
  • Get the installations used inside a given project.
  • Get information about the number of group addresses used throughout an installation inside a given KNX project.
  • Fetch and set group address information for an installation associated with a KNX project.

成员类型文档编制

enum class QKnxGroupAddressInfos:: Status

This enum holds the status of parsing the KNX project information.

常量
QKnxGroupAddressInfos::Status::NoError 0
QKnxGroupAddressInfos::Status::FileError 1
QKnxGroupAddressInfos::Status::ProjectError 2
QKnxGroupAddressInfos::Status::ParseError 3

另请参阅 parse ().

成员函数文档编制

QKnxGroupAddressInfos:: QKnxGroupAddressInfos ( QKnxGroupAddressInfos && other )

Move-constructs an object instance, making it point to the same object that other 所指向的。

QKnxGroupAddressInfos:: QKnxGroupAddressInfos (const QKnxGroupAddressInfos & other )

构造副本为 other .

QKnxGroupAddressInfos:: QKnxGroupAddressInfos (const QString & projectFile )

Creates a new empty group address infos object and sets the current project file to projectFile . Creating the object does not automatically trigger parsing the given projectFile .

The function argument can be either a valid KNX 0.xml .knxproj project file.

另请参阅 parse ().

QKnxGroupAddressInfos:: QKnxGroupAddressInfos ()

Creates a new empty group address infos object.

QKnxGroupAddressInfos &QKnxGroupAddressInfos:: operator= ( QKnxGroupAddressInfos && other )

移动赋值 other to this object instance.

QKnxGroupAddressInfos &QKnxGroupAddressInfos:: operator= (const QKnxGroupAddressInfos & other )

赋值指定 other 到此对象。

QKnxGroupAddressInfos:: ~QKnxGroupAddressInfos ()

销毁对象并释放任何分配资源。

void QKnxGroupAddressInfos:: add (const QKnxGroupAddressInfo & info , const QString & projectId )

Adds a group address info object of a KNX project identified by projectId . The group address info QKnxGroupAddressInfo::installation ID is used to associate the group address info with an existing KNX project.

注意: projectId must not be empty.

注意: The function does not prevent multiple identical entries.

void QKnxGroupAddressInfos:: add (const QString & name , const QKnxAddress & address , QKnxDatapointType::Type type , const QString & description , const QString & projectId , const QString & installation = {})

Creates a group address info object with values set to name , address , type , description and installation . The created object is associated with the given KNX projectId ID, and installation .

注意: projectId must not be empty.

注意: The function does not prevent multiple identical entries.

void QKnxGroupAddressInfos:: add (const QString & name , const QKnxAddress & address , const QString & datapointType , const QString & description , const QString & projectId , const QString & installation = {})

Creates a group address info object with values set to name , address , datapointType , description and installation . The created object is associated with the given KNX projectId ID, and installation .

注意: projectId must not be empty.

注意: The function does not prevent multiple identical entries.

QVector < QKnxGroupAddressInfo > QKnxGroupAddressInfos:: addressInfos (const QString & projectId , const QString & installation = {}) const

Returns a vector of all available group address infos from a KNX project identified by projectId and installation .

QVector < QKnxGroupAddressInfo > QKnxGroupAddressInfos:: addressInfos (const QKnxAddress & address , const QString & projectId , const QString & installation = {}) const

Returns a vector of all available group address infos from a KNX project identified by address , projectId ,和 installation .

QVector < QKnxGroupAddressInfo > QKnxGroupAddressInfos:: addressInfos ( QKnxDatapointType::Type type , const QString & projectId , const QString & installation = {}) const

Returns a vector of all available group address infos from a KNX project identified by datapoint type , projectId and installation .

void QKnxGroupAddressInfos:: clear ()

Clears all existing information including the KNX project file name.

QString QKnxGroupAddressInfos:: errorString () const

Returns the human-readable message appropriate to the reported read status.

qint32 QKnxGroupAddressInfos:: infoCount (const QString & projectId , const QString & installation = {}) const

Returns the number of group address info objects contained in this class; identified by projectId and installation .

QVector < QString > QKnxGroupAddressInfos:: installations (const QString & projectId ) const

Returns a vector of all installation ids for the given KNX projectId ID.

bool QKnxGroupAddressInfos:: parse ()

Clears all existing information and parses the KNX project file.

返回 true if parsing was successful; otherwise returns false . If an error occurs, sets the Status , and fills the errorString ().

QString QKnxGroupAddressInfos:: projectFile () const

Returns the current project file from where the group address information was collected.

另请参阅 setProjectFile ().

QVector < QString > QKnxGroupAddressInfos:: projectIds () const

Returns a vector of all KNX project ids found in the KNX project file.

QString QKnxGroupAddressInfos:: projectName (const QString & projectId ) const

Returns the project name associated with the given KNX projectId ID. Since the project name is an optional field in a KNX project, it can be empty.

void QKnxGroupAddressInfos:: remove (const QKnxAddress & address , const QString & projectId , const QString & installation = {})

Removes all the group address info objects from a KNX project identified by projectId and installation ID and with the same KNX group address .

注意: projectId must not be empty.

void QKnxGroupAddressInfos:: remove (const QKnxGroupAddressInfo & info , const QString & projectId )

Removes all the objects equal to group address info from a KNX project identified by projectId . The group address info QKnxGroupAddressInfo::installation ID is used to associate the group address info with an existing KNX project.

注意: projectId must not be empty.

void QKnxGroupAddressInfos:: setProjectFile (const QString & projectFile )

Sets the current project file to projectFile and clears all existing information. Calling this function does not automatically trigger parsing the given projectFile .

The function argument can be either a valid KNX 0.xml .knxproj project file.

另请参阅 projectFile () 和 parse ().

QKnxGroupAddressInfos::Status QKnxGroupAddressInfos:: status () const

Returns the read status of the current KNX project file.

void QKnxGroupAddressInfos:: swap ( QKnxGroupAddressInfos & other )

交换 other 与此对象。此操作非常快且从不失败。

bool QKnxGroupAddressInfos:: operator!= (const QKnxGroupAddressInfos & other ) const

返回 true if this object and the given other 不相等;则返回 false .

bool QKnxGroupAddressInfos:: operator== (const QKnxGroupAddressInfos & other ) const

返回 true if this object and the given other 相等;否则返回 false .

相关非成员

QDebug operator<< ( QDebug debug , const QKnxGroupAddressInfos & infos )

写入 infos 对象到 debug stream and returns a reference to the stream.