BrowserObject Type

When a reference to an object is obtained it is possible to read its attributes as defined in its object model or in the point instance itself. The physical point attributes can be retrieved using the attributes property (see below).

Constructor

Parameter

Type

Description

designation

string

CNS full path of system objects.

Property

Type

Description

attributes

Attributes

Set of attributes of the point associated to this BrowserObject.

descriptor

String

Localized descriptor of the system object.

designation

String

Path consisting in concatenation of CNS names of the system object.

error

Error

In case of error, it indicates the reason why the operation failed.

location

String

Path consisting in concatenation of CNS descriptions of the system object in the view.

name

String

Name of the system object.

point

Point

Physical point that is associated to this BrowserObject.

systemId

Integer

Identifier of the system to which the object belongs.

view

String

Name of the root of the view to which the system object belongs.

viewId

Integer

Identifier of the view to which the system object belongs.
If a designation of a non-root node was specified, the view where the node is defined is used instead.

A read of attributes is returned in the following cases:

  • Read of attributes of objects created using the BrowserObject.
  • Read of attributes of system objects that match filter criteria (using the search function).
  • Read of attributes of system objects returned by the subscribe function in case of value change and callback execution.

Examples of Use

 

How to print all the attributes resulting from searchSync and filter

var filter = new Filter();

filter.name = "Logics";

var results = searchSync(filter);

for (var i = 0; i < results.length; i++){

    printAttributes(results[i]);

}

function printAttributes(object)

{

    console(

    "Alias: " + object.attributes.alias +

    "\nDefaultProperty: " + object.attributes.defaultProperty +

    "\nDisciplineDescriptor: " + object.attributes.disciplineDescriptor +

    "\nDisciplineId: " + object.attributes.disciplineId +

    "\nFunctionName: " + object.attributes.functionName +

    "\nObjectModel: " + object.attributes.objectModel +

    "\nSubDisciplineDescriptor: " + object.Attributes.subDisciplineDescriptor +

    "\nSubDisciplineId: " + object.attributes.subDisciplineId +

    "\nSubTypeDescriptor: " + object.attributes.subTypeDescriptor +

    "\nSubTypeId: " + object.attributes.subTypeId +

    "\nTypeDescriptor: " + object.attributes.typeDescriptor +

    "\nTypeId: " + object.attributes.typeId);

}

 

How to print all the attributes of all the objects on which a callback is executed

subscribeValues("System1.ApplicationView:ApplicationView.Logics", "StatusPropagation.AggregatedSummaryStatus", function(object, values){ printAttributes(object);

    });

function printAttributes(object)

{

    console(

    "Alias: " + object.attributes.alias +

    "\nDefaultProperty: " + object.attributes.defaultProperty +

    "\nDisciplineDescriptor: " + object.attributes.disciplineDescriptor +

    "\nDisciplineId: " + object.attributes.disciplineId +

    "\nFunctionName: " + object.attributes.functionName +

    "\nObjectModel: " + object.attributes.objectModel +

    "\nSubDisciplineDescriptor: " + object.Attributes.subDisciplineDescriptor +

    "\nSubDisciplineId: " + object.attributes.subDisciplineId +

    "\nSubTypeDescriptor: " + object.attributes.subTypeDescriptor +

    "\nSubTypeId: " + object.attributes.subTypeId +

    "\nTypeDescriptor: " + object.attributes.typeDescriptor +

    "\nTypeId: " + object.attributes.typeId);

}

 

How to print all the attributes of an object after its creation with a BrowserObject

var obj = new BrowserObject("System1.ApplicationView:ApplicationView.Logics");

printAttributes(obj);

function printAttributes(object)

{

    console(

    "Alias: " + object.attributes.alias +

    "\nDefaultProperty: " + object.attributes.defaultProperty +

    "\nDisciplineDescriptor: " + object.attributes.disciplineDescriptor +

    "\nDisciplineId: " + object.attributes.disciplineId +

    "\nFunctionName: " + object.attributes.functionName +

    "\nObjectModel: " + object.attributes.objectModel +

    "\nSubDisciplineDescriptor: " + object.Attributes.subDisciplineDescriptor +

    "\nSubDisciplineId: " + object.attributes.subDisciplineId +

    "\nSubTypeDescriptor: " + object.attributes.subTypeDescriptor +

    "\nSubTypeId: " + object.attributes.subTypeId +

    "\nTypeDescriptor: " + object.attributes.typeDescriptor +

    "\nTypeId: " + object.attributes.typeId);

}