Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// --------------------------------- Discrete Alarms
const UADiscreteAlarm = require("./discrete_alarm").UADiscreteAlarm;
/**
* @class AddressSpace
* @method instantiateOffNormalAlarm
* @param discreteAlarmType
* @param options
* @param data
* @return {UAOffNormalAlarm}
*/
AddressSpace.prototype.instantiateDiscreteAlarm = function (discreteAlarmType, options, data) {
return this._resolveRequestedNamespace(options).instantiateDiscreteAlarm(discreteAlarmType, options, data);
};
utils.setDeprecated(AddressSpace,"instantiateDiscreteAlarm","use Namespace#instantiateDiscreteAlarm instead");
Namespace.prototype.instantiateDiscreteAlarm = function (discreteAlarmType, options, data) {
const namespace = this;
return UADiscreteAlarm.instantiate(namespace, discreteAlarmType, options, data);
};
const UAOffNormalAlarm = require("./off_normal_alarm").UAOffNormalAlarm;
/**
* @class AddressSpace
* @method instantiateOffNormalAlarm
* @param options
* @param data
* @return {UAOffNormalAlarm}
*/
AddressSpace.prototype.instantiateOffNormalAlarm = function (options, data) {
return this._resolveRequestedNamespace(options).instantiateOffNormalAlarm(options, data);
};
utils.setDeprecated(AddressSpace,"instantiateOffNormalAlarm","use Namespace#instantiateOffNormalAlarm instead");
utils.setDeprecated(AddressSpace,"addVariableType","use addressSpace.getOwnNamespace().addVariableType() instead");
/**
*
* @method addFolder
* @param parentFolder
* @param options {String|Object}
* @param options.browseName {String} the name of the folder
* @param [options.nodeId] {NodeId}. An optional nodeId for this object
*
* @return {BaseNode}
*/
AddressSpace.prototype.addFolder = function (parentFolder, options) {
return this.getOwnNamespace().addFolder(parentFolder, options);
};
utils.setDeprecated(AddressSpace,"addFolder","use addressSpace.getOwnNamespace().addFolder(..) instead");
/**
* cleanup all resources maintained by this addressSpace.
* @method dispose
*/
AddressSpace.prototype.dispose = function() {
this._namespaceArray.map(namespace=>namespace.dispose());
this._aliases = null;
AddressSpace.registry.unregister(this);
if(this._shutdownTask && this._shutdownTask.length > 0) {
throw new Error("AddressSpace#dispose : shutdown has not been called");
}
UAConditionBase.install_condition_refresh_handle(this);
UAAcknowledgeableConditionBase.install_method_handle_on_type(this);
};
/**
* @class AddressSpace
* @method instantiateCondition
* @param conditionTypeId
* @param options
* @param data
* @return {UAConditionBase}
*/
AddressSpace.prototype.instantiateCondition = function (conditionTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateCondition(conditionTypeId, options, data);
};
utils.setDeprecated(AddressSpace,"instantiateCondition","use Namespace#instantiateCondition instead");
Namespace.prototype.instantiateCondition = function (conditionTypeId, options, data) {
const namespace = this;
return UAConditionBase.instantiate(namespace, conditionTypeId, options, data);
};
/**
* @class AddressSpace
* @method instantiateAcknowledgeableCondition
* @param conditionTypeId
* @param options
* @param data
* @return {UAAcknowledgeableConditionBase}
*/
AddressSpace.prototype.instantiateAcknowledgeableCondition = function (conditionTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateCondition(conditionTypeId, options, data);
};
* @param options.axisScaleType {AxisScaleEnumeration}
*
* @param options.xAxisDefinition {AxisInformation}
* @param options.xAxisDefinition.engineeringUnits {EURange}
* @param options.xAxisDefinition.range
* @param options.xAxisDefinition.range.low
* @param options.xAxisDefinition.range.high
* @param options.xAxisDefinition.title {LocalizedText}
* @param options.xAxisDefinition.axisScaleType {AxisScaleEnumeration}
* @param options.xAxisDefinition.axisSteps = {Array}
* @param options.value
*/
AddressSpace.prototype.addYArrayItem = function (options) {
return this._resolveRequestedNamespace(options).addYArrayItem(options);
};
utils.setDeprecated(AddressSpace,"addYArrayItem","");
Namespace.prototype.addYArrayItem = function(options) {
assert(options.hasOwnProperty("engineeringUnitsRange"), "expecting engineeringUnitsRange");
assert(options.hasOwnProperty("axisScaleType"), "expecting axisScaleType");
assert(_.isObject(options.xAxisDefinition), "expecting a xAxisDefinition");
const addressSpace = this.addressSpace;
const YArrayItemType = addressSpace.findVariableType("YArrayItemType");
assert(YArrayItemType, "expecting YArrayItemType to be defined , check nodeset xml file");
const dataType = options.dataType || "Float";
const optionals = [];
if (options.hasOwnProperty("instrumentRange")) {
const namespace = this;
return UAExclusiveDeviationAlarm.instantiate(namespace, "ExclusiveDeviationAlarmType", options, data);
};
const UANonExclusiveLimitAlarm = require("./non_exclusive_limit_alarm").UANonExclusiveLimitAlarm;
/**
* @class AddressSpace
* @method instantiateNonExclusiveLimitAlarm
* @param nonExclusiveLimitAlarmTypeId
* @param options
* @param data
* @return {UANonExclusiveLimitAlarm}
*/
AddressSpace.prototype.instantiateNonExclusiveLimitAlarm = function (nonExclusiveLimitAlarmTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateNonExclusiveLimitAlarm(nonExclusiveLimitAlarmTypeId, options, data);
};
utils.setDeprecated(AddressSpace,"instantiateNonExclusiveLimitAlarm","use Namespace#instantiateNonExclusiveLimitAlarm instead");
Namespace.prototype.instantiateNonExclusiveLimitAlarm = function (nonExclusiveLimitAlarmTypeId, options, data) {
const namespace = this;
return UANonExclusiveLimitAlarm.instantiate(namespace, nonExclusiveLimitAlarmTypeId, options, data);
};
const UANonExclusiveDeviationAlarm = require("./non_exclusive_deviation_alarm").UANonExclusiveDeviationAlarm;
/**
* @class AddressSpace
* @method instantiateNonExclusiveDeviationAlarm
* @param options
* @param data
* @return {UANonExclusiveDeviationAlarm}
*/
AddressSpace.prototype.instantiateNonExclusiveDeviationAlarm = function (options, data) {
return this._resolveRequestedNamespace(options).instantiateNonExclusiveDeviationAlarm(options, data);
};
const namespace = this;
return UALimitAlarm.instantiate(namespace, limitAlarmTypeId, options, data);
};
const UAExclusiveLimitAlarm = require("./exclusive_limit_alarm").UAExclusiveLimitAlarm;
/**
* @class AddressSpace
* @method instantiateExclusiveLimitAlarm
* @param exclusiveLimitAlarmTypeId
* @param options
* @param data
* @return {UAExclusiveLimitAlarm}
*/
AddressSpace.prototype.instantiateExclusiveLimitAlarm = function (exclusiveLimitAlarmTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateExclusiveLimitAlarm(exclusiveLimitAlarmTypeId, options, data);
};
utils.setDeprecated(AddressSpace,"instantiateExclusiveLimitAlarm","use Namespace#instantiateExclusiveLimitAlarm instead");
Namespace.prototype.instantiateExclusiveLimitAlarm = function (exclusiveLimitAlarmTypeId, options, data) {
const namespace = this;
return UAExclusiveLimitAlarm.instantiate(namespace, exclusiveLimitAlarmTypeId, options, data);
};
const UAExclusiveDeviationAlarm = require("./exclusive_deviation_alarm").UAExclusiveDeviationAlarm;
/**
* @class AddressSpace
* @method instantiateExclusiveDeviationAlarm
* @param options
* @param data
* @return {UAExclusiveDeviationAlarm}
*/
AddressSpace.prototype.instantiateExclusiveDeviationAlarm = function (options, data) {
return this._resolveRequestedNamespace(options).instantiateExclusiveDeviationAlarm(options, data);
};
utils.setDeprecated(AddressSpace,"instantiateExclusiveDeviationAlarm","use Namespace#instantiateExclusiveDeviationAlarm instead");
Namespace.prototype.instantiateDiscreteAlarm = function (discreteAlarmType, options, data) {
const namespace = this;
return UADiscreteAlarm.instantiate(namespace, discreteAlarmType, options, data);
};
const UAOffNormalAlarm = require("./off_normal_alarm").UAOffNormalAlarm;
/**
* @class AddressSpace
* @method instantiateOffNormalAlarm
* @param options
* @param data
* @return {UAOffNormalAlarm}
*/
AddressSpace.prototype.instantiateOffNormalAlarm = function (options, data) {
return this._resolveRequestedNamespace(options).instantiateOffNormalAlarm(options, data);
};
utils.setDeprecated(AddressSpace,"instantiateOffNormalAlarm","use Namespace#instantiateOffNormalAlarm instead");
Namespace.prototype.instantiateOffNormalAlarm = function (options, data) {
const namespace = this;
return UAOffNormalAlarm.instantiate(namespace, "OffNormalAlarmType", options, data);
};
};
const namespace = this;
return UAAcknowledgeableConditionBase.instantiate(namespace, conditionTypeId, options, data);
};
const UAAlarmConditionBase = require("./alarm_condition").UAAlarmConditionBase;
/**
* @class AddressSpace
* @method instantiateAlarmCondition
* @param alarmConditionTypeId
* @param options
* @param data
* @return {UAAlarmConditionBase}
*/
AddressSpace.prototype.instantiateAlarmCondition = function (alarmConditionTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateAlarmCondition(alarmConditionTypeId, options, data);
};
utils.setDeprecated(AddressSpace,"instantiateAlarmCondition","use Namespace#instantiateAlarmCondition instead");
Namespace.prototype.instantiateAlarmCondition = function (alarmConditionTypeId, options, data) {
const namespace = this;
return UAAlarmConditionBase.instantiate(namespace, alarmConditionTypeId, options, data);
};
const UALimitAlarm = require("./limit_alarm").UALimitAlarm;
/**
* @class AddressSpace
* @method instantiateLimitAlarm
* @param limitAlarmTypeId
* @param options
* @param data
* @return {UALimitAlarm}
*/
AddressSpace.prototype.instantiateLimitAlarm = function (limitAlarmTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateLimitAlarm(limitAlarmTypeId, options, data);
Namespace.prototype.instantiateCondition = function (conditionTypeId, options, data) {
const namespace = this;
return UAConditionBase.instantiate(namespace, conditionTypeId, options, data);
};
/**
* @class AddressSpace
* @method instantiateAcknowledgeableCondition
* @param conditionTypeId
* @param options
* @param data
* @return {UAAcknowledgeableConditionBase}
*/
AddressSpace.prototype.instantiateAcknowledgeableCondition = function (conditionTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateCondition(conditionTypeId, options, data);
};
utils.setDeprecated(AddressSpace,"instantiateAcknowledgeableCondition","use Namespace#instantiateAcknowledgeableCondition instead");
Namespace.prototype.instantiateAcknowledgeableCondition = function (conditionTypeId, options, data) {
const namespace = this;
return UAAcknowledgeableConditionBase.instantiate(namespace, conditionTypeId, options, data);
};
const UAAlarmConditionBase = require("./alarm_condition").UAAlarmConditionBase;
/**
* @class AddressSpace
* @method instantiateAlarmCondition
* @param alarmConditionTypeId
* @param options
* @param data
* @return {UAAlarmConditionBase}
*/
AddressSpace.prototype.instantiateAlarmCondition = function (alarmConditionTypeId, options, data) {
return this._resolveRequestedNamespace(options).instantiateAlarmCondition(alarmConditionTypeId, options, data);
};
AddressSpace.prototype.addObject =function(options) {
return this._resolveRequestedNamespace(options).addObject(options);
};
utils.setDeprecated(AddressSpace,"addObject","use addressSpace.getOwnNamespace().addObject(..) instead");
AddressSpace.prototype.addVariable =function(options) {
return this._resolveRequestedNamespace(options).addVariable(options);
};
utils.setDeprecated(AddressSpace,"addVariable","use addressSpace.getOwnNamespace().addVariable(..) instead");
AddressSpace.prototype.addObjectType =function(options) {
return this._resolveRequestedNamespace(options).addObjectType(options);
};
utils.setDeprecated(AddressSpace,"addObjectType","use addressSpace.getOwnNamespace().addObjectType() instead");
AddressSpace.prototype.addVariableType =function(options) {
return this._resolveRequestedNamespace(options).addVariableType(options);
};
utils.setDeprecated(AddressSpace,"addVariableType","use addressSpace.getOwnNamespace().addVariableType() instead");
/**
*
* @method addFolder
* @param parentFolder
* @param options {String|Object}
* @param options.browseName {String} the name of the folder
* @param [options.nodeId] {NodeId}. An optional nodeId for this object
*
* @return {BaseNode}
*/