test/helpers/build_server_with_temperature_device.js
/**
 * add a fake analog data item for testing
 * @method addTestUAAnalogItem
 *
 * @param parentNode
 */
add a fake analog data item for testing
@method addTestUAAnalogItem

@param parentNode
add a fake analog data item for testing @method addTestUAAnalogItem @param parentNode
function addTestUAAnalogItem(parentNode) {
    var addressSpace = parentNode.addressSpace;
    var node = addressSpace.addAnalogDataItem({
        componentOf: parentNode,
        nodeId: "ns=4;s=TemperatureAnalogItem",
        browseName: "TemperatureAnalogItem",
        definition: "(tempA -25) + tempB",
        valuePrecision: 0.5,
        engineeringUnitsRange: {low: 100, high: 200},
        instrumentRange: {low: -100, high: +200},
        engineeringUnits: opcua.standardUnits.degree_celsius,
        dataType: "Double",
        value: {
            get: function () {
                return new Variant({dataType: DataType.Double, value: Math.random() + 19.0});
            }
        }
    });
}
function addTestUAAnalogItem ( parentNode ) { var addressSpace = parentNode . addressSpace ; var node = addressSpace . addAnalogDataItem ( { componentOf : parentNode , nodeId : "ns=4;s=TemperatureAnalogItem" , browseName : "TemperatureAnalogItem" , definition : "(tempA -25) + tempB" , valuePrecision : 0.5 , engineeringUnitsRange : { low : 100 , high : 200 } , instrumentRange : { low : - 100 , high : + 200 } , engineeringUnits : opcua . standardUnits . degree_celsius , dataType : "Double" , value : { get : function ( ) { return new Variant ( { dataType : DataType . Double , value : Math . random ( ) + 19.0 } ) ; } } } ) ; }
add a fake analog data item for testing
 @method addTestUAAnalogItem
add a fake analog data item for testing @method addTestUAAnalogItem
//xx    assert(parentNode instanceof opcua.BaseNode); // add a UAAnalogItem