EventFilter QML Type

監視項目に対する EventFilter を定義します。詳細...

Import Statement: import QtOpcUa
Since: QtOpcUa 5.13

プロパティ

  • select : list<SimpleAttributeOperand>
  • where : list<FilterElement>

詳細説明

イベント・フィルターは、サーバー上のイベントを監視するために必要である。これは、select 節とwhere 節で構成される。

select 節は、イベントが発生したときにユーザーが受け取りたいデータを指定するために使用される。SimpleAttributeOperand 、イベント・タイプの子ノードの属性(例えば BaseEventType の "Message" プロパティの値属性)を選択する単純な属性オペランドで構成される。

where 節は、特定の条件とのマッチングによって報告されるイベントを制限するために使用されます。いくつかの演算子と4つの異なるオペランド・タイプにより、イベント・タイプの子ノードの属性値に基づくフィルタリングが可能になります。

select 節はSimpleAttributeOperand の配列で構成されます。 where 節はSimpleAttributeOperandLiteralOperandElementOperand またはAttributeOperand の配列で構成されます。

以下の EventFilter は、"Severity" フィールドの値が >= 500 であるイベントに対して、"Message" フィールドの値を報告するようにサーバーに指示する:

import QtOpcUa as QtOpcUa
QtOpcUa.Node {
    ...

    eventFilter: QtOpcUa.EventFilter {
        select: [
                  QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Severity"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                  },
                  QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Message"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                  }
        ]

        where: [
            QtOpcUa.FilterElement {
                operator: QtOpcUa.FilterElement.GreaterThanOrEqual
                firstOperand: QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Severity"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                }
                secondOperand: QtOpcUa.LiteralOperand {
                                value: 700
                                type: QtOpcUa.Constants.UInt16
                 }
            }
        ]
    }
}

2つの条件を持つより複雑な例については、QOpcUaElementOperand を参照のこと。

FilterElementも参照のこと

プロパティ・ドキュメンテーション

新しいイベントが報告されるときに含まれる、選択されたイベントフィールド。


where : list<FilterElement>

Content filter 報告されるイベントを、特定の条件に一致するイベントに制限するために使用されるフィルタ。


© 2025 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.