-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Copyright 2017-2021 Kai Huebl ([email protected]) | ||
Copyright 2017-2023 Kai Huebl ([email protected]) | ||
Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser | ||
Datei nur in Übereinstimmung mit der Lizenz erlaubt. | ||
|
@@ -98,16 +98,23 @@ namespace OpcUaStackCore | |
} | ||
|
||
bool | ||
FilterStack::buildOperatorNode(ContentFilter& contentFilter, ContentFilterResult& contentFilterResult, int idx, FilterNode::SPtr& node) | ||
FilterStack::buildOperatorNode( | ||
ContentFilter& contentFilter, | ||
ContentFilterResult& contentFilterResult, | ||
int idx, | ||
FilterNode::SPtr& node | ||
) | ||
{ | ||
|
||
OpcUaStatusCode operatorStatus = OpcUaStatusCode::Success; | ||
|
||
bool hasOperandError = false; | ||
|
||
// get content filter element | ||
ContentFilterElement::SPtr el; | ||
contentFilter.elements().get(idx, el); | ||
|
||
// create result elements | ||
auto operandStatuses = boost::make_shared<OpcUaStatusCodeArray>(); | ||
operandStatuses->resize(el->filterOperands().size()); | ||
|
||
|
@@ -179,7 +186,7 @@ namespace OpcUaStackCore | |
{ | ||
SimpleAttributeOperand::SPtr simpleAttributeOperand = operand->parameter<SimpleAttributeOperand>(); | ||
SimpleAttributeFilterNode::SPtr simpleAttributeNode(new SimpleAttributeFilterNode( | ||
simpleAttributeOperand->typeId(), | ||
simpleAttributeOperand->typeDefinitionId(), | ||
simpleAttributeOperand->browsePath(), | ||
simpleAttributeOperand->attributeId(), | ||
simpleAttributeOperand->indexRange())); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Copyright 2017-2021 Kai Huebl ([email protected]) | ||
Copyright 2017-2023 Kai Huebl ([email protected]) | ||
Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser | ||
Datei nur in Übereinstimmung mit der Lizenz erlaubt. | ||
|
@@ -16,6 +16,8 @@ | |
*/ | ||
|
||
#include <iostream> | ||
#include <sstream> | ||
|
||
#include "OpcUaStackCore/Base/Log.h" | ||
#include "OpcUaStackCore/StandardDataTypes/EventFilter.h" | ||
#include "OpcUaStackCore/StandardEventType/BaseEventType.h" | ||
|
@@ -69,6 +71,7 @@ namespace OpcUaStackServer | |
{ | ||
OpcUaStatusCode statusCode; | ||
|
||
// check parameter | ||
if (monitoredItemCreateRequest.get() == nullptr) { | ||
return BadInvalidArgument; | ||
} | ||
|
@@ -170,6 +173,10 @@ namespace OpcUaStackServer | |
NodeSetNamespace nodeSetNamespace; | ||
eventBase->namespaceArray(&nodeSetNamespace.globalNamespaceVec()); | ||
|
||
// | ||
// handle base event type | ||
// | ||
|
||
// generate event id if necessary | ||
if (baseEventType->eventId().get() == nullptr) { | ||
boost::posix_time::ptime time = boost::posix_time::microsec_clock::local_time(); | ||
|
@@ -225,6 +232,11 @@ namespace OpcUaStackServer | |
baseEventType->severity(variant); | ||
} | ||
|
||
// log event information | ||
std::stringstream ss; | ||
ss << *baseEventType.get(); | ||
Log(Debug, "fire event").parameter("Event", ss.str()); | ||
|
||
// process select clause | ||
bool resultCode; | ||
eventBase_ = eventBase; | ||
|