How to use the node-opcua-service-filter.extractEventFields function in node-opcua-service-filter

To help you get started, we’ve selected a few node-opcua-service-filter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / src / monitored_item.js View on Github external
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);
};
github node-opcua / node-opcua / packages / node-opcua-server / source / monitored_item.ts View on Github external
// 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);
  }

node-opcua-service-filter

pure nodejs OPCUA SDK - module service-filter

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis