Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
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;
}
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!);
}
public setLocalTime(localTime: TimeZoneDataType): void {
assert(localTime instanceof TimeZoneDataType);
return this._set_var("localTime", DataType.ExtensionObject, new TimeZoneDataType(localTime));
}