Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert(dataValue !== self.oldDataValue, "recordValue expects different dataValue to be provided");
assert(!dataValue.value || dataValue.value !== self.oldDataValue.value, "recordValue expects different dataValue.value to be provided");
assert(!dataValue.value || dataValue.value.isValid(),"expecting a valid variant value");
const hasSemanticChanged = self.node && (self.node.semantic_version !== self._semantic_version);
//xx console.log("`\n----------------------------",skipChangeTest,self.clientHandle,
// self.node.listenerCount("value_changed"),self.node.nodeId.toString());
//xx console.log("events ---- ",self.node.eventNames().join("-"));
//xx console.log("indexRange = ",indexRange ? indexRange.toString() :"");
//xx console.log("self.itemToMonitor.indexRange = ",self.itemToMonitor.indexRange.toString());
if (!hasSemanticChanged && indexRange && self.itemToMonitor.indexRange) {
// we just ignore changes that do not fall within our range
// ( unless semantic bit has changed )
if (!NumericRange.overlap(indexRange,self.itemToMonitor.indexRange)) {
return; // no overlap !
}
}
assert( self.itemToMonitor,"must have a valid itemToMonitor(have this monitoredItem been disposed already ?");
// extract the range that we are interested with
dataValue = extractRange(dataValue, self.itemToMonitor.indexRange);
// istanbul ignore next
if (doDebug) {
debugLog("MonitoredItem#recordValue", self.node.nodeId.toString(), self.node.browseName.toString(), " has Changed = ", !sameDataValue(dataValue, self.oldDataValue));
}
// if semantic has changed, value need to be enqueued regardless of other assumptions
if (hasSemanticChanged) {
return self._enqueue_value(dataValue);
assert(!dataValue.value || dataValue.value.isValid(),
"expecting a valid variant value");
const hasSemanticChanged = this.node && ((this.node as any).semantic_version !== this._semantic_version);
// xx console.log("`\n----------------------------",skipChangeTest,this.clientHandle,
// this.node.listenerCount("value_changed"),this.node.nodeId.toString());
// xx console.log("events ---- ",this.node.eventNames().join("-"));
// xx console.log("indexRange = ",indexRange ? indexRange.toString() :"");
// xx console.log("this.itemToMonitor.indexRange = ",this.itemToMonitor.indexRange.toString());
if (!hasSemanticChanged && indexRange && this.itemToMonitor.indexRange) {
// we just ignore changes that do not fall within our range
// ( unless semantic bit has changed )
if (!NumericRange.overlap(indexRange as NumericalRange0, this.itemToMonitor.indexRange)) {
return; // no overlap !
}
}
assert(this.itemToMonitor, "must have a valid itemToMonitor(have this monitoredItem been disposed already ?");
// extract the range that we are interested with
dataValue = extractRange(dataValue, this.itemToMonitor.indexRange);
// istanbul ignore next
if (doDebug) {
debugLog("MonitoredItem#recordValue",
this.node!.nodeId.toString(),
this.node!.browseName.toString(), " has Changed = ", !sameDataValue(dataValue, this.oldDataValue!));
}
// if semantic has changed, value need to be enqueued regardless of other assumptions