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.
- package/dist/source/address_space_ts.d.ts +3 -3
- package/dist/source/address_space_ts.js +3 -3
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/continuation_points/continuation_point_manager.js +6 -1
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -1
- package/dist/source/helpers/call_helpers.d.ts +1 -1
- package/dist/source/helpers/call_helpers.js +4 -3
- package/dist/source/helpers/call_helpers.js.map +1 -1
- package/dist/source/helpers/multiform_func.d.ts +8 -8
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -1
- package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +2 -2
- package/dist/source/loader/ensure_datatype_extracted.js +1 -1
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -2
- package/dist/source/loader/load_nodeset2.js +1 -1
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +1 -1
- package/dist/source/loader/namespace_post_step.d.ts +1 -1
- package/dist/source/pseudo_session.d.ts +15 -1
- package/dist/source/pseudo_session.js +86 -37
- package/dist/source/pseudo_session.js.map +1 -1
- package/dist/source/session_context.d.ts +1 -1
- package/dist/source/session_context.js +3 -4
- package/dist/source/session_context.js.map +1 -1
- package/dist/src/address_space.d.ts +0 -4
- package/dist/src/address_space.js +15 -24
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +1 -2
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +3 -3
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +2 -3
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/apply_condition_refresh.d.ts +1 -1
- package/dist/src/base_node_impl.js +44 -44
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.js +5 -0
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/event_data.d.ts +2 -2
- package/dist/src/historical_access/address_space_historical_data_node.js +3 -3
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/namespace_impl.js +1 -0
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/nodeid_manager.d.ts +2 -2
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +7 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.js +5 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/reference_impl.js +6 -6
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.js +1 -1
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.js +5 -5
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/tool_isSupertypeOf.d.ts +5 -4
- package/dist/src/tool_isSupertypeOf.js +7 -1
- package/dist/src/tool_isSupertypeOf.js.map +1 -1
- package/dist/src/ua_data_type_impl.js +12 -12
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.js +6 -6
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.js +7 -7
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.js +6 -6
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.js +6 -6
- package/dist/src/ua_reference_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.js +14 -17
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_type_impl.js +7 -7
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/src/ua_view_impl.js +3 -3
- package/dist/src/ua_view_impl.js.map +1 -1
- package/package.json +36 -36
- package/source/continuation_points/continuation_point_manager.ts +6 -2
- package/source/helpers/call_helpers.ts +4 -4
- package/source/loader/ensure_datatype_extracted.ts +1 -1
- package/source/loader/load_nodeset2.ts +1 -1
- package/source/pseudo_session.ts +120 -46
- package/source/session_context.ts +4 -4
- package/src/address_space.ts +4 -16
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +1 -2
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_condition_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +4 -4
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +2 -2
- package/src/base_node_private.ts +6 -0
- package/src/historical_access/address_space_historical_data_node.ts +3 -3
- package/src/namespace_impl.ts +6 -3
- package/src/nodeset_tools/construct_namespace_dependency.ts +9 -0
- package/src/nodeset_tools/nodeset_to_xml.ts +5 -2
- package/src/state_machine/finite_state_machine.ts +1 -1
- package/src/state_machine/ua_two_state_variable.ts +5 -5
- package/src/tool_isSupertypeOf.ts +5 -0
- package/src/ua_variable_impl.ts +5 -7
- 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
|
|
250
|
-
dataValue.statusCode
|
|
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
|
|
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
|
|
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
|
|
207
|
+
if (dataValue.statusCode.isNotGood()) {
|
|
208
208
|
// what shall we do ?
|
|
209
209
|
return;
|
|
210
210
|
}
|
package/src/base_node_private.ts
CHANGED
|
@@ -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
|
|
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
|
|
810
|
-
dataValue.statusCode
|
|
809
|
+
dataValue.statusCode.isNot(StatusCodes.BadWaitingForInitialData) &&
|
|
810
|
+
dataValue.statusCode.isNot(StatusCodes.UncertainInitialValue)
|
|
811
811
|
) {
|
|
812
812
|
on_value_change.call(node, dataValue);
|
|
813
813
|
}
|
package/src/namespace_impl.ts
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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>(
|
package/src/ua_variable_impl.ts
CHANGED
|
@@ -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
|
-
|
|
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 (
|
|
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 (
|
|
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
|
|
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 || !
|
|
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
|
|
245
|
+
(defaultDataType.namespace === 0 && defaultDataType.value == 0) || defaultDataValue.statusCode.isNotGood()
|
|
246
246
|
? undefined
|
|
247
247
|
: defaultDataValue.value;
|
|
248
248
|
|