How to use the node-opcua-common.TimeZoneDataType function in node-opcua-common

To help you get started, we’ve selected a few node-opcua-common 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-address-space / src / alarms_and_conditions / condition.js View on Github external
ConditionSnapshot.prototype.setLocalTime = function(localTime) {
    assert(localTime instanceof TimeZoneDataType);
    const self = this;
    return self._set_var("localTime", DataType.ExtensionObject, new TimeZoneDataType(localTime));
};
// read only !
github node-opcua / node-opcua / packages / node-opcua-address-space / src / alarms_and_conditions / condition.js View on Github external
const addressSpace = self.addressSpace;

    const selfConditionType = self.typeDefinitionObj;
    const conditionType = addressSpace.findObjectType("ConditionType");

    assert(selfConditionType.isSupertypeOf(conditionType));

    const branch = self.currentBranch();

    const now = new Date();
    // install the eventTimestamp
    // set the received Time
    branch.setTime(now);
    branch.setReceiveTime(now);
    branch.setLocalTime(
        new TimeZoneDataType({
            offset: 0,
            daylightSavingInOffset: false
        })
    );

    if (conditionInfo.hasOwnProperty("message") && conditionInfo.message) {
        branch.setMessage(conditionInfo.message);
    }
    // todo receive time : when the server received the event from the underlying system.
    // self.receiveTime.setValueFromSource();

    if (conditionInfo.hasOwnProperty("severity") && conditionInfo.severity !== null) {
        assert(_.isFinite(conditionInfo.severity));
        branch.setSeverity(conditionInfo.severity);
    }
    if (conditionInfo.hasOwnProperty("quality") && conditionInfo.quality !== null) {