node-opcua-address-space 2.84.0 → 2.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/source/address_space_ts.d.ts +3 -3
  2. package/dist/source/address_space_ts.js +3 -3
  3. package/dist/source/address_space_ts.js.map +1 -1
  4. package/dist/source/continuation_points/continuation_point_manager.js +6 -1
  5. package/dist/source/continuation_points/continuation_point_manager.js.map +1 -1
  6. package/dist/source/helpers/call_helpers.d.ts +1 -1
  7. package/dist/source/helpers/call_helpers.js +4 -3
  8. package/dist/source/helpers/call_helpers.js.map +1 -1
  9. package/dist/source/helpers/multiform_func.d.ts +8 -8
  10. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -1
  11. package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
  12. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +2 -2
  13. package/dist/source/loader/ensure_datatype_extracted.js +1 -1
  14. package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
  15. package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -2
  16. package/dist/source/loader/load_nodeset2.js +1 -1
  17. package/dist/source/loader/load_nodeset2.js.map +1 -1
  18. package/dist/source/loader/make_xml_extension_object_parser.d.ts +1 -1
  19. package/dist/source/loader/namespace_post_step.d.ts +1 -1
  20. package/dist/source/pseudo_session.d.ts +15 -1
  21. package/dist/source/pseudo_session.js +86 -37
  22. package/dist/source/pseudo_session.js.map +1 -1
  23. package/dist/source/session_context.d.ts +1 -1
  24. package/dist/source/session_context.js +3 -4
  25. package/dist/source/session_context.js.map +1 -1
  26. package/dist/src/address_space.d.ts +0 -4
  27. package/dist/src/address_space.js +15 -24
  28. package/dist/src/address_space.js.map +1 -1
  29. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +1 -2
  30. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
  31. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +1 -1
  32. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  33. package/dist/src/alarms_and_conditions/ua_condition_impl.js +1 -1
  34. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  35. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +3 -3
  36. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
  37. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +2 -3
  38. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
  39. package/dist/src/apply_condition_refresh.d.ts +1 -1
  40. package/dist/src/base_node_impl.js +44 -44
  41. package/dist/src/base_node_impl.js.map +1 -1
  42. package/dist/src/base_node_private.js +5 -0
  43. package/dist/src/base_node_private.js.map +1 -1
  44. package/dist/src/event_data.d.ts +2 -2
  45. package/dist/src/historical_access/address_space_historical_data_node.js +3 -3
  46. package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
  47. package/dist/src/namespace_impl.js +1 -0
  48. package/dist/src/namespace_impl.js.map +1 -1
  49. package/dist/src/nodeid_manager.d.ts +2 -2
  50. package/dist/src/nodeset_tools/construct_namespace_dependency.js +7 -0
  51. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
  52. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
  53. package/dist/src/nodeset_tools/nodeset_to_xml.js +5 -1
  54. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  55. package/dist/src/reference_impl.js +6 -6
  56. package/dist/src/reference_impl.js.map +1 -1
  57. package/dist/src/state_machine/finite_state_machine.js +1 -1
  58. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  59. package/dist/src/state_machine/ua_two_state_variable.js +5 -5
  60. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
  61. package/dist/src/tool_isSupertypeOf.d.ts +5 -4
  62. package/dist/src/tool_isSupertypeOf.js +7 -1
  63. package/dist/src/tool_isSupertypeOf.js.map +1 -1
  64. package/dist/src/ua_data_type_impl.js +12 -12
  65. package/dist/src/ua_data_type_impl.js.map +1 -1
  66. package/dist/src/ua_method_impl.js +6 -6
  67. package/dist/src/ua_method_impl.js.map +1 -1
  68. package/dist/src/ua_object_impl.js +7 -7
  69. package/dist/src/ua_object_impl.js.map +1 -1
  70. package/dist/src/ua_object_type_impl.js +6 -6
  71. package/dist/src/ua_object_type_impl.js.map +1 -1
  72. package/dist/src/ua_reference_type_impl.js +6 -6
  73. package/dist/src/ua_reference_type_impl.js.map +1 -1
  74. package/dist/src/ua_variable_impl.js +14 -17
  75. package/dist/src/ua_variable_impl.js.map +1 -1
  76. package/dist/src/ua_variable_type_impl.js +7 -7
  77. package/dist/src/ua_variable_type_impl.js.map +1 -1
  78. package/dist/src/ua_view_impl.js +3 -3
  79. package/dist/src/ua_view_impl.js.map +1 -1
  80. package/package.json +36 -36
  81. package/source/continuation_points/continuation_point_manager.ts +6 -2
  82. package/source/helpers/call_helpers.ts +4 -4
  83. package/source/loader/ensure_datatype_extracted.ts +1 -1
  84. package/source/loader/load_nodeset2.ts +1 -1
  85. package/source/pseudo_session.ts +120 -46
  86. package/source/session_context.ts +4 -4
  87. package/src/address_space.ts +4 -16
  88. package/src/alarms_and_conditions/deviation_alarm_helper.ts +1 -2
  89. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +1 -1
  90. package/src/alarms_and_conditions/ua_condition_impl.ts +1 -1
  91. package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +4 -4
  92. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +2 -2
  93. package/src/base_node_private.ts +6 -0
  94. package/src/historical_access/address_space_historical_data_node.ts +3 -3
  95. package/src/namespace_impl.ts +6 -3
  96. package/src/nodeset_tools/construct_namespace_dependency.ts +9 -0
  97. package/src/nodeset_tools/nodeset_to_xml.ts +5 -2
  98. package/src/state_machine/finite_state_machine.ts +1 -1
  99. package/src/state_machine/ua_two_state_variable.ts +5 -5
  100. package/src/tool_isSupertypeOf.ts +5 -0
  101. package/src/ua_variable_impl.ts +5 -7
  102. package/src/ua_variable_type_impl.ts +1 -1
@@ -8,7 +8,7 @@ import { NodeClass } from "node-opcua-data-model";
8
8
  import { DataValue } from "node-opcua-data-value";
9
9
  import { make_warningLog } from "node-opcua-debug";
10
10
  import { NodeId } from "node-opcua-nodeid";
11
- import { StatusCodes } from "node-opcua-status-code";
11
+ import { StatusCode, StatusCodes } from "node-opcua-status-code";
12
12
  import { DataType, VariantOptions } from "node-opcua-variant";
13
13
  import { UAShelvedStateMachineEx } from "../../source/interfaces/state_machine/ua_shelved_state_machine_ex";
14
14
  import { InstantiateLimitAlarmOptions } from "../../source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options";
@@ -246,13 +246,13 @@ export class UALimitAlarmImpl extends UAAlarmConditionImpl implements UALimitAla
246
246
  assert(dataValue instanceof DataValue);
247
247
 
248
248
  if (
249
- dataValue.statusCode === StatusCodes.BadWaitingForInitialData &&
250
- dataValue.statusCode === StatusCodes.UncertainInitialValue
249
+ dataValue.statusCode.equals(StatusCodes.BadWaitingForInitialData) &&
250
+ dataValue.statusCode.equals(StatusCodes.UncertainInitialValue)
251
251
  ) {
252
252
  // we are not ready yet to use the input node value
253
253
  return;
254
254
  }
255
- if (dataValue.statusCode !== StatusCodes.Good) {
255
+ if (dataValue.statusCode.isNotGood()) {
256
256
  // what shall we do ?
257
257
  this._signalNewCondition(null);
258
258
  return;
@@ -190,7 +190,7 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
190
190
  }
191
191
 
192
192
  protected _onInputDataValueChange(dataValue: DataValue): void {
193
- if (dataValue.statusCode !== StatusCodes.Good) {
193
+ if (dataValue.statusCode.isNotGood()) {
194
194
  // what shall we do ?
195
195
  return;
196
196
  }
@@ -204,7 +204,7 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
204
204
  }
205
205
 
206
206
  protected _onNormalStateDataValueChange(dataValue: DataValue): void {
207
- if (dataValue.statusCode !== StatusCodes.Good) {
207
+ if (dataValue.statusCode.isNotGood()) {
208
208
  // what shall we do ?
209
209
  return;
210
210
  }
@@ -40,6 +40,7 @@ import { UANamespace_process_modelling_rule } from "./namespace_private";
40
40
  import { ReferenceImpl } from "./reference_impl";
41
41
  import { BaseNodeImpl, getReferenceType } from "./base_node_impl";
42
42
  import { AddressSpacePrivate } from "./address_space_private";
43
+ import { wipeMemorizedStuff } from "./tool_isSupertypeOf";
43
44
 
44
45
  // eslint-disable-next-line prefer-const
45
46
  let doTrace = checkDebugFlag("INSTANTIATE");
@@ -126,6 +127,7 @@ export function BaseNode_clearCache(node: BaseNode): void {
126
127
  if (_private && _private._cache) {
127
128
  _private._cache = {};
128
129
  }
130
+ wipeMemorizedStuff(node);
129
131
  }
130
132
  const hasTypeDefinition_ReferenceTypeNodeId = resolveNodeId("HasTypeDefinition");
131
133
 
@@ -681,6 +683,10 @@ function _cloneInterface(
681
683
 
682
684
  extraInfo = extraInfo || defaultExtraInfo;
683
685
  const addressSpace = node.addressSpace;
686
+
687
+ if (node.nodeClass !== NodeClass.Object && node.nodeClass !== NodeClass.Variable) {
688
+ return;
689
+ }
684
690
  const typeDefinitionNode = node.typeDefinitionObj;
685
691
  if (!typeDefinitionNode) {
686
692
  return;
@@ -224,7 +224,7 @@ function _update_startOfOnlineArchive(this: UAVariableImpl, newDate: Date): void
224
224
  const startOfArchiveDataValue = _get_startOfOfflineArchive(this);
225
225
  if (
226
226
  startOfArchiveDataValue &&
227
- (startOfArchiveDataValue.statusCode !== StatusCodes.Good ||
227
+ (startOfArchiveDataValue.statusCode.isNotGood() ||
228
228
  !startOfArchiveDataValue.value ||
229
229
  !startOfArchiveDataValue.value.value ||
230
230
  startOfArchiveDataValue.value.value.getTime() >= newDate.getTime())
@@ -806,8 +806,8 @@ export function AddressSpace_installHistoricalDataNode(
806
806
 
807
807
  const dataValue = node.readValue();
808
808
  if (
809
- dataValue.statusCode !== StatusCodes.BadWaitingForInitialData &&
810
- dataValue.statusCode !== StatusCodes.UncertainInitialValue
809
+ dataValue.statusCode.isNot(StatusCodes.BadWaitingForInitialData) &&
810
+ dataValue.statusCode.isNot(StatusCodes.UncertainInitialValue)
811
811
  ) {
812
812
  on_value_change.call(node, dataValue);
813
813
  }
@@ -10,7 +10,7 @@ import { AxisScaleEnumeration } from "node-opcua-data-access";
10
10
  import { AccessRestrictionsFlag, coerceLocalizedText, QualifiedNameLike } from "node-opcua-data-model";
11
11
  import { QualifiedName } from "node-opcua-data-model";
12
12
  import { BrowseDirection } from "node-opcua-data-model";
13
- import { LocalizedText, NodeClass } from "node-opcua-data-model";
13
+ import { NodeClass } from "node-opcua-data-model";
14
14
  import { dumpIf, make_errorLog } from "node-opcua-debug";
15
15
  import { NodeIdLike, NodeIdType, resolveNodeId } from "node-opcua-nodeid";
16
16
  import { NodeId } from "node-opcua-nodeid";
@@ -124,7 +124,7 @@ import { UAReferenceTypeImpl } from "./ua_reference_type_impl";
124
124
  import { UAViewImpl } from "./ua_view_impl";
125
125
  import { UAStateMachineImpl, UATransitionImpl } from "./state_machine/finite_state_machine";
126
126
  import { _addMultiStateValueDiscrete } from "./data_access/ua_multistate_value_discrete_impl";
127
- import { notDeepEqual } from "assert";
127
+
128
128
 
129
129
  function _makeHashKey(nodeId: NodeId): string | number {
130
130
  switch (nodeId.identifierType) {
@@ -615,7 +615,7 @@ export class NamespaceImpl implements NamespacePrivate {
615
615
  assert(!Object.prototype.hasOwnProperty.call(options, "nodeClass"));
616
616
  assert(Object.prototype.hasOwnProperty.call(options, "browseName"), "must provide a browseName");
617
617
 
618
- const options1 = options as any;
618
+ const options1 = options as unknown as { nodeClass: NodeClass; references: AddReferenceOpts[]; subtypeOf: UADataType };
619
619
  options1.nodeClass = NodeClass.DataType;
620
620
  options1.references = options.references || [];
621
621
 
@@ -638,6 +638,9 @@ export class NamespaceImpl implements NamespacePrivate {
638
638
  });
639
639
  }
640
640
  const node = this.internalCreateNode(options) as UADataType;
641
+
642
+ node.propagate_back_references();
643
+
641
644
  return node;
642
645
  }
643
646
 
@@ -1,9 +1,12 @@
1
1
  import { INamespace, UADataType, UAVariable, UAVariableType } from "node-opcua-address-space-base";
2
2
  import { NodeClass } from "node-opcua-data-model";
3
3
  import { StructureField } from "node-opcua-types";
4
+ import { make_warningLog } from "node-opcua-debug";
4
5
  import { NamespacePrivate } from "../namespace_private";
5
6
  import { BaseNodeImpl, getReferenceType } from "../base_node_impl";
6
7
 
8
+ const warningLog = make_warningLog(__filename);
9
+
7
10
  function _constructNamespaceDependency(
8
11
  namespace: INamespace,
9
12
  dependency: INamespace[],
@@ -43,6 +46,12 @@ function _constructNamespaceDependency(
43
46
  if (_visitedDataType.has(dataType.toString())) {
44
47
  return;
45
48
  }
49
+ // istanbul ignore next
50
+ if (dataTypeNode.nodeClass !== NodeClass.DataType) {
51
+ warningLog("exploreDataTypes! ignoring ",dataTypeNode.toString());
52
+ return;
53
+ }
54
+
46
55
  const namespaceIndex = dataType.namespace;
47
56
  consider(namespaceIndex);
48
57
  if (dataTypeNode.isStructure()) {
@@ -35,7 +35,6 @@ import { AttributeIds, Int64, minOPCUADate, StatusCode, StatusCodes } from "node
35
35
  import { BrowseDescription, EnumDefinition, StructureDefinition, StructureType } from "node-opcua-types";
36
36
 
37
37
  import { ITranslationTable, XmlWriter } from "../../source/xml_writer";
38
- import { NamespacePrivate } from "../namespace_private";
39
38
  import { ReferenceImpl } from "../reference_impl";
40
39
  import { BaseNodeImpl, getReferenceType } from "../base_node_impl";
41
40
  import { UAReferenceTypeImpl } from "../ua_reference_type_impl";
@@ -251,6 +250,10 @@ function findXsdNamespaceUri(xw: XmlWriter, nodeId: NodeId): string {
251
250
  if (namespace === "http://opcfoundation.org/UA/") {
252
251
  return "http://opcfoundation.org/UA/2008/02/Types.xsd";
253
252
  }
253
+ // istanbul ignore next
254
+ if (!namespace) {
255
+ return "";
256
+ }
254
257
  return namespace.replace(/\/$/, "") + "/Types.xsd";
255
258
  }
256
259
 
@@ -919,7 +922,7 @@ function _dumpUADataTypeDefinition(xw: XmlWriter, uaDataType: UADataType) {
919
922
 
920
923
  const dataValue = uaDataType.readAttribute(SessionContext.defaultContext, AttributeIds.DataTypeDefinition);
921
924
 
922
- if (true || dataValue.statusCode === StatusCodes.Good) {
925
+ if (true || dataValue.statusCode.isGood()) {
923
926
  const definition = uaDataType.getStructureDefinition();
924
927
  const baseDefinition = uaDataTypeBase ? uaDataTypeBase.getStructureDefinition() : null;
925
928
  xw.startElement("Definition");
@@ -403,7 +403,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
403
403
 
404
404
  const d = this.currentState.readValue();
405
405
 
406
- if (d.statusCode !== StatusCodes.Good) {
406
+ if (d.statusCode.isNotGood()) {
407
407
  this.setState(null);
408
408
  } else {
409
409
  const txt =
@@ -76,7 +76,7 @@ function _getEffectiveDisplayName<T, DT extends DataType>(
76
76
  node: UATwoStateVariableImpl
77
77
  ): DataValueT<LocalizedText, DataType.LocalizedText> {
78
78
  const humanReadableString = _getHumanReadableString(node);
79
- if (humanReadableString.statusCode !== StatusCodes.Good) {
79
+ if (humanReadableString.statusCode.isNotGood()) {
80
80
  return humanReadableString;
81
81
  }
82
82
  const boolValue = node.getValue();
@@ -97,7 +97,7 @@ function _getEffectiveDisplayName<T, DT extends DataType>(
97
97
  function _getHumanReadableString(node: UATwoStateVariableImpl): DataValueT<LocalizedText, DataType.LocalizedText> {
98
98
  const dataValue = node.id.readValue();
99
99
 
100
- if (dataValue.statusCode !== StatusCodes.Good) {
100
+ if (dataValue.statusCode.isNotGood()) {
101
101
  const _c = dataValue.clone() as DataValueT<LocalizedText, DataType.LocalizedText>;
102
102
  _c.value = new Variant({
103
103
  dataType: DataType.LocalizedText,
@@ -313,7 +313,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
313
313
  assert(typeof boolValue === "boolean");
314
314
  const dataValue = this.id!.readValue();
315
315
  const oldValue = dataValue.value.value;
316
- if (dataValue.statusCode === StatusCodes.Good && boolValue === oldValue) {
316
+ if (dataValue.statusCode.isGood() && boolValue === oldValue) {
317
317
  return; // nothing to do
318
318
  }
319
319
  //
@@ -328,7 +328,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
328
328
  */
329
329
  public getValue(): boolean {
330
330
  const dataValue = this.id!.readValue();
331
- assert(dataValue.statusCode === StatusCodes.Good);
331
+ assert(dataValue.statusCode.isGood());
332
332
  assert(dataValue.value.dataType === DataType.Boolean);
333
333
  return dataValue.value.value;
334
334
  }
@@ -339,7 +339,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
339
339
  */
340
340
  public getValueAsString(): string {
341
341
  const dataValue = this.readValue();
342
- assert(dataValue.statusCode === StatusCodes.Good);
342
+ assert(dataValue.statusCode.isGood());
343
343
  assert(dataValue.value.dataType === DataType.LocalizedText);
344
344
  return dataValue.value.value.text?.toString() || "";
345
345
  }
@@ -60,6 +60,11 @@ function _slow_isSupertypeOf<T extends UAType>(this: T, Class: typeof BaseNodeIm
60
60
 
61
61
  export type MemberFuncValue<T, P, R> = (this: T, param: P) => R;
62
62
 
63
+ export function wipeMemorizedStuff(node: any) {
64
+ if (!node.__cache) {
65
+ node.__cache = undefined;
66
+ }
67
+ }
63
68
  // http://jsperf.com/underscore-js-memoize-refactor-test
64
69
  // http://addyosmani.com/blog/faster-javascript-memoization/
65
70
  function wrap_memoize<T, P, R>(
@@ -97,9 +97,7 @@ const warningLog = make_warningLog(__filename);
97
97
  const doDebug = checkDebugFlag(__filename);
98
98
  const errorLog = make_errorLog(__filename);
99
99
 
100
- function isGoodish(statusCode: StatusCode) {
101
- return statusCode.value < 0x10000000;
102
- }
100
+
103
101
 
104
102
  export function adjust_accessLevel(accessLevel: string | number | null): AccessLevelFlag {
105
103
  accessLevel = utils.isNullOrUndefined(accessLevel) ? "CurrentRead | CurrentWrite" : accessLevel;
@@ -494,7 +492,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
494
492
 
495
493
  let dataValue = this.$dataValue;
496
494
 
497
- if (isGoodish(dataValue.statusCode)) {
495
+ if (dataValue.statusCode.isGoodish()) {
498
496
  // note : extractRange will clone the dataValue
499
497
  dataValue = extractRange(dataValue, indexRange);
500
498
  }
@@ -542,7 +540,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
542
540
  public asyncRefresh(oldestDate: Date, callback: CallbackT<DataValue>): void;
543
541
  public asyncRefresh(oldestDate: Date): Promise<DataValue>;
544
542
  public asyncRefresh(...args: any[]): any {
545
- if (isGoodish(this.$dataValue.statusCode)) {
543
+ if (this.$dataValue.statusCode.isGoodish()) {
546
544
  this.verifyVariantCompatibility(this.$dataValue.value);
547
545
  }
548
546
 
@@ -1980,7 +1978,7 @@ function _Variable_bind_with_async_refresh(this: UAVariableImpl, options: any) {
1980
1978
 
1981
1979
  this.refreshFunc = options.refreshFunc;
1982
1980
 
1983
- // assert(this.readValue().statusCode === StatusCodes.BadNodeIdUnknown);
1981
+ // assert(this.readValue().statusCode.equals(StatusCodes.BadNodeIdUnknown));
1984
1982
  this.$dataValue.statusCode = StatusCodes.UncertainInitialValue;
1985
1983
 
1986
1984
  // TO DO : REVISIT THIS ASSUMPTION
@@ -2071,7 +2069,7 @@ function _Variable_bind_with_simple_get(this: UAVariableImpl, options: GetterOpt
2071
2069
  if (is_StatusCode(value)) {
2072
2070
  return new DataValue({ statusCode: value });
2073
2071
  } else {
2074
- if (!this.$dataValue || !isGoodish(this.$dataValue.statusCode) || !sameVariant(this.$dataValue.value, value)) {
2072
+ if (!this.$dataValue || !this.$dataValue.statusCode.isGoodish() || !sameVariant(this.$dataValue.value, value)) {
2075
2073
  this.setValueFromSource(value, StatusCodes.Good);
2076
2074
  }
2077
2075
  return this.$dataValue;
@@ -242,7 +242,7 @@ export class UAVariableTypeImpl extends BaseNodeImpl implements UAVariableType {
242
242
  // BadAttributeIdInvalid
243
243
  const defaultDataValue = this.readAttribute(null, AttributeIds.Value);
244
244
  const defaultValue =
245
- (defaultDataType.namespace === 0 && defaultDataType.value == 0) || defaultDataValue.statusCode !== StatusCodes.Good
245
+ (defaultDataType.namespace === 0 && defaultDataType.value == 0) || defaultDataValue.statusCode.isNotGood()
246
246
  ? undefined
247
247
  : defaultDataValue.value;
248
248