Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
MonitoredItem.prototype._on_opcua_event = function (eventData) {
const self = this;
assert(!self.filter || self.filter instanceof EventFilter);
const selectClauses = self.filter ? self.filter.selectClauses : [];
const eventFields = extractEventFields(selectClauses, eventData);
// istanbul ignore next
if (doDebug) {
console.log(" RECEIVED INTERNAL EVENT THAT WE ARE MONITORING");
console.log(self.filter ? self.filter.toString() : "no filter");
eventFields.forEach(function (e) {
console.log(e.toString());
});
}
self._enqueue_event(eventFields);
};
// Release 1.04 8 OPC Unified Architecture, Part 9
// 4.5 Condition state synchronization
// To ensure a Client is always informed, the three special EventTypes
// (RefreshEndEventType, RefreshStartEventType and RefreshRequiredEventType)
// ignore the Event content filtering associated with a Subscription and will always be
// delivered to the Client.
if (!this.filter || !(this.filter instanceof EventFilter)) {
throw new Error("Internal Error");
}
const selectClauses = this.filter.selectClauses
? this.filter.selectClauses
: ([] as SimpleAttributeOperand[]);
const eventFields = extractEventFields(selectClauses, eventData);
// istanbul ignore next
if (doDebug) {
console.log(" RECEIVED INTERNAL EVENT THAT WE ARE MONITORING");
console.log(this.filter ? this.filter.toString() : "no filter");
eventFields.forEach((e: any) => {
console.log(e.toString());
});
}
this._enqueue_event(eventFields);
}