node-opcua-data-value
Advanced tools
Comparing version 0.1.1-0 to 0.2.0
@@ -1,2 +0,2 @@ | ||
// --------- This code has been automatically generated !!! 2017-12-15T21:13:56.082Z | ||
// --------- This code has been automatically generated !!! 2018-01-23T21:10:22.250Z | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /** |
{ | ||
"name": "node-opcua-data-value", | ||
"main": "./index.js", | ||
"version": "0.1.1-0", | ||
"version": "0.2.0", | ||
"description": "pure nodejs OPCUA SDK - module -data-value", | ||
@@ -12,18 +12,18 @@ "scripts": { | ||
"dependencies": { | ||
"node-opcua-assert": "^0.1.1-0", | ||
"node-opcua-basic-types": "^0.1.1-0", | ||
"node-opcua-binary-stream": "^0.1.1-0", | ||
"node-opcua-date-time": "^0.1.1-0", | ||
"node-opcua-factory": "^0.1.1-0", | ||
"node-opcua-nodeid": "^0.1.1-0", | ||
"node-opcua-status-code": "^0.1.1-0", | ||
"node-opcua-utils": "^0.1.1-0", | ||
"node-opcua-variant": "^0.1.1-0", | ||
"node-opcua-assert": "^0.2.0", | ||
"node-opcua-basic-types": "^0.2.0", | ||
"node-opcua-binary-stream": "^0.2.0", | ||
"node-opcua-date-time": "^0.2.0", | ||
"node-opcua-factory": "^0.2.0", | ||
"node-opcua-nodeid": "^0.2.0", | ||
"node-opcua-status-code": "^0.2.0", | ||
"node-opcua-utils": "^0.2.0", | ||
"node-opcua-variant": "^0.2.0", | ||
"underscore": "^1.8.3" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-generator": "^0.1.1-0", | ||
"node-opcua-numeric-range": "^0.1.1-0", | ||
"node-opcua-packet-analyzer": "^0.1.1-0", | ||
"should": "13.2.0" | ||
"node-opcua-generator": "^0.2.0", | ||
"node-opcua-numeric-range": "^0.2.0", | ||
"node-opcua-packet-analyzer": "^0.2.0", | ||
"should": "13.2.1" | ||
}, | ||
@@ -30,0 +30,0 @@ "author": "Etienne Rossignon", |
@@ -123,4 +123,4 @@ "use strict"; | ||
arrayType: dataValue.value.arrayType, | ||
dimensions: result.dimensions, | ||
value: result.array, | ||
dimensions: dataValue.value.dimensions | ||
} | ||
@@ -144,3 +144,3 @@ }); | ||
if (indexRange && canRange(dataValue)) { | ||
var result = indexRange.extract_values(variant.value); | ||
var result = indexRange.extract_values(variant.value,variant.dimensions); | ||
dataValue = _clone_with_array_replacement(dataValue, result); | ||
@@ -147,0 +147,0 @@ //xx console.log(" dataValue =",dataValue.toString()); |
@@ -155,2 +155,73 @@ "use strict"; | ||
it("DataValue - extractRange on a ByteString (null value)", function () { | ||
var dataValue = new DataValue({ | ||
value: new Variant({ | ||
dataType: DataType.ByteString, | ||
arrayType: VariantArrayType.Scalar, | ||
value: null | ||
}) | ||
}); | ||
var dataValue1 = extractRange(dataValue, new NumericRange("2:3")); | ||
dataValue1.value.dataType.should.eql(DataType.ByteString); | ||
dataValue1.value.arrayType.should.eql(VariantArrayType.Scalar); | ||
should.equal(null,dataValue1.value.value); | ||
}); | ||
it("DataValue - extractRange on a Array of ByteString", function () { | ||
var dataValue = new DataValue({ | ||
value: new Variant({ | ||
dataType: DataType.ByteString, | ||
arrayType: VariantArrayType.Array, | ||
value: [ | ||
new Buffer("ABC"), | ||
new Buffer("DEF"), | ||
new Buffer("GHI"), | ||
new Buffer("JKL"), | ||
null | ||
] | ||
}) | ||
}); | ||
var dataValue1 = extractRange(dataValue, new NumericRange("2:3")); | ||
dataValue1.value.value.length.should.eql(2); | ||
dataValue1.value.value[0].toString().should.eql("GHI"); | ||
dataValue1.value.value[1].toString().should.eql("JKL"); | ||
dataValue1.value.dataType.should.eql(DataType.ByteString); | ||
dataValue1.value.arrayType.should.eql(VariantArrayType.Array); | ||
}); | ||
it("DataValue - extractRange on a Matrix of ByteString", function () { | ||
var dataValue = new DataValue({ | ||
value: new Variant({ | ||
dataType: DataType.ByteString, | ||
arrayType: VariantArrayType.Matrix, | ||
dimensions: [3, 3], | ||
value: [ | ||
//[ | ||
new Buffer("11"), | ||
new Buffer("12"), | ||
new Buffer("13") | ||
,//], | ||
//[ | ||
new Buffer("21"), | ||
new Buffer("22"), | ||
new Buffer("23") | ||
,//], | ||
//[ | ||
new Buffer("31"), | ||
new Buffer("32"), | ||
new Buffer("33"), | ||
//] | ||
] | ||
}) | ||
}); | ||
var dataValue1 = extractRange(dataValue, new NumericRange("2,1:2")); | ||
dataValue1.value.value.length.should.eql(2); | ||
dataValue1.value.value[0].toString().should.eql("32"); | ||
dataValue1.value.value[1].toString().should.eql("33"); | ||
dataValue1.value.dataType.should.eql(DataType.ByteString); | ||
dataValue1.value.arrayType.should.eql(VariantArrayType.Matrix); | ||
dataValue1.value.dimensions.should.eql([1,2]); | ||
}); | ||
describe("Cloning a DataValue", function () { | ||
@@ -207,2 +278,37 @@ function SomeExtensionObject(options) { | ||
}); | ||
it("should " + copy_construct_or_clone + " a DataValue with a variant array of ByteString", function () { | ||
var dv = new DataValue({ | ||
value: new Variant({ | ||
dataType: DataType.ByteString, | ||
arrayType: VariantArrayType.Array, | ||
value: [ | ||
new Buffer("ABC"), | ||
new Buffer("DEF"), | ||
new Buffer("GHI"), | ||
new Buffer("JKL"), | ||
null | ||
] | ||
}) | ||
}); | ||
var cloned = copy_construct_or_clone_func(dv); | ||
cloned.value.dataType.should.eql(dv.value.dataType); | ||
cloned.value.value.should.eql(dv.value.value); | ||
cloned.value.value[0].toString().should.eql(dv.value.value[0].toString()); | ||
cloned.value.value[1].toString().should.eql(dv.value.value[1].toString()); | ||
cloned.value.value[2].toString().should.eql(dv.value.value[2].toString()); | ||
cloned.value.value[3].toString().should.eql(dv.value.value[3].toString()); | ||
dv.value.value[0] = new Buffer("ZZZ"); | ||
dv.value.value[1] = new Buffer("YYY"); | ||
// clone object should not have been affected ! | ||
cloned.value.value[0].toString().should.eql("ABC"); | ||
cloned.value.value[1].toString().should.eql("DEF"); | ||
}); | ||
it("should " + copy_construct_or_clone + " a DataValue with a variant containing a extension object", function () { | ||
@@ -209,0 +315,0 @@ |
42056
888
+ Addednode-opcua-assert@0.2.0(transitive)
+ Addednode-opcua-basic-types@0.2.3(transitive)
+ Addednode-opcua-binary-stream@0.2.3(transitive)
+ Addednode-opcua-buffer-utils@0.2.0(transitive)
+ Addednode-opcua-constants@0.2.0(transitive)
+ Addednode-opcua-data-model@0.2.3(transitive)
+ Addednode-opcua-date-time@0.2.3(transitive)
+ Addednode-opcua-debug@0.2.2(transitive)
+ Addednode-opcua-enum@0.2.3(transitive)
+ Addednode-opcua-factory@0.2.3(transitive)
+ Addednode-opcua-guid@0.2.0(transitive)
+ Addednode-opcua-nodeid@0.2.3(transitive)
+ Addednode-opcua-status-code@0.2.3(transitive)
+ Addednode-opcua-utils@0.2.3(transitive)
+ Addednode-opcua-variant@0.2.3(transitive)
- Removednode-opcua-assert@0.1.1-0(transitive)
- Removednode-opcua-basic-types@0.1.1-0(transitive)
- Removednode-opcua-binary-stream@0.1.1-0(transitive)
- Removednode-opcua-buffer-utils@0.1.1-0(transitive)
- Removednode-opcua-constants@0.1.1-0(transitive)
- Removednode-opcua-data-model@0.1.1-0(transitive)
- Removednode-opcua-date-time@0.1.1-0(transitive)
- Removednode-opcua-debug@0.1.1-0(transitive)
- Removednode-opcua-enum@0.1.1-0(transitive)
- Removednode-opcua-factory@0.1.1-0(transitive)
- Removednode-opcua-guid@0.1.1-0(transitive)
- Removednode-opcua-nodeid@0.1.1-0(transitive)
- Removednode-opcua-status-code@0.1.1-0(transitive)
- Removednode-opcua-utils@0.1.1-0(transitive)
- Removednode-opcua-variant@0.1.1-0(transitive)
Updatednode-opcua-assert@^0.2.0
Updatednode-opcua-date-time@^0.2.0
Updatednode-opcua-factory@^0.2.0
Updatednode-opcua-nodeid@^0.2.0
Updatednode-opcua-utils@^0.2.0
Updatednode-opcua-variant@^0.2.0