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