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

To help you get started, we’ve selected a few node-opcua-types 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 / source / server_engine.ts View on Github external
dataType: variantDataType,
              value
            });
          },
          set: null // read only
        });
      }

      bindStandardScalar(VariableIds.Server_EstimatedReturnTime,
        DataType.DateTime, () => minOPCUADate);

      // TimeZoneDataType
      const timeZoneDataType = addressSpace.findDataType(resolveNodeId(DataTypeIds.TimeZoneDataType))!;
      // xx console.log(timeZoneDataType.toString());

      const timeZone = new TimeZoneDataType({
        daylightSavingInOffset: /* boolean*/ false,
        offset: /* int16 */ 0
      });
      bindStandardScalar(VariableIds.Server_LocalTime,
        DataType.ExtensionObject, () => {
          return timeZone;
        });

      bindStandardScalar(VariableIds.Server_ServiceLevel,
        DataType.Byte, () => {
          return 255;
        });

      bindStandardScalar(VariableIds.Server_Auditing,
        DataType.Boolean, () => {
          return engine.isAuditing;
github node-opcua / node-opcua / packages / node-opcua-address-space / src / alarms_and_conditions / ua_condition_base.ts View on Github external
const sourceNodes = conditionNode.findReferencesAsObject("HasCondition", false);
    if (sourceNodes.length) {
        assert(sourceNodes.length === 1);
        conditionNode.setSourceNode(sourceNodes[0].nodeId);
        conditionNode.setSourceName(sourceNodes[0].browseName.toString());
    }

    conditionNode.post_initialize();

    const branch0 = conditionNode.currentBranch();
    branch0.setRetain(false);
    branch0.setComment("");
    branch0.setQuality(StatusCodes.Good);
    branch0.setSeverity(0);
    branch0.setLocalTime(
      new TimeZoneDataType({
          daylightSavingInOffset: false,
          offset: 0
      })
    );
    branch0.setMessage("");

    branch0.setReceiveTime(minDate);
    branch0.setTime(minDate);

    // UAConditionBase
    return conditionNode;
}
github node-opcua / node-opcua / packages / node-opcua-address-space / src / alarms_and_conditions / ua_condition_base.ts View on Github external
const selfConditionType = this.typeDefinitionObj;
        const conditionType = addressSpace.findObjectType("ConditionType")!;
        assert(selfConditionType.isSupertypeOf(conditionType));

        const branch = this.currentBranch();

        const now = new Date();
        // install the eventTimestamp
        // set the received Time
        branch.setTime(now);
        branch.setReceiveTime(now);

        // note : in 1.04 LocalTime property is optional
        if (this.hasOwnProperty("localTime")) {
            branch.setLocalTime(
              new TimeZoneDataType({
                  daylightSavingInOffset: false,
                  offset: 0
              })
            );
        }

        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!);
        }
github node-opcua / node-opcua / packages / node-opcua-address-space / src / alarms_and_conditions / condition_snapshot.ts View on Github external
public setLocalTime(localTime: TimeZoneDataType): void {
        assert(localTime instanceof TimeZoneDataType);
        return this._set_var("localTime", DataType.ExtensionObject, new TimeZoneDataType(localTime));
    }