new DataCommsEngine()

Description
Abstract class defining a Comunication Engine for data I/O with a server.
Properties
Name Type Description
toBeSubscribed Map.<string, number> Variables waiting to be subscribed for updates. It is a key-number map. The number represent how many UI element times requested updates from that variable. Variables are purged once subscribed. If subscription fails with "NO-NET" or "CANT-SUB" error the var is kept for later subscription, if fails with "WONT-SUB" or "NOT-EXIST" it will be purged from list.
toBeUnsubscribed Set.<string> List of Variables waiting to be unsubscribed from updates.
subscribedVar Map.<string, number> List of Variables currently subscribed for updates. It is a key-number map. The number represent the number of UI-elements registered with the same variable, usually one, but for special cases could be more.
aggregationTime_ms number Time the system will wait before sending subscruiption/unsubscription, so that variable can be aggregated and make moreefficient network calls.
Details

Classes


new DataCommsEngine()

Methods


<abstract> Initialize() → {basicResponse}

Description
Abstract method. Action Initialize. Place here anything that is needed for initialization of this engine.
Returns
- return status of initialization action.
Details

<abstract> Subscribe( variables ) → {Promise.<Array.<VarResponse>>}

Description
Abstract method. Action Subscribe. It subscribes the list of variables names for automatic updates.
Parameters
Name Type Description
variables Array.<systemObject> variables names to be subscribed
Returns
- Response of the action.
Details

<abstract> Unsubscribe( variables ) → {Promise.<Array.<VarResponse>>}

Description
Abstract method. Action Unsubscribe. It unubscribes the list of variables names from automatic updates.
Parameters
Name Type Description
variables Array.<systemObject> variables names to be unsubscribed
Returns
- Response of the action.
Details

<abstract> Write( targets, values ) → {Promise.<Array.<VarResponse>>}

Description
Abstract method. Action Write, this can be called by a UI element. It writes to server the provided list of values to the relative variables.
Parameters
Name Type Description
targets Array.<systemObject> variables names to be unsubscribed
values Array.<any> values related to variables to be written
Returns
Details

<abstract> Read( names ) → {Promise.<Array.<VarResponse>>}

Description
Abstract method. Action Read, this can be called by a UI element. Forces a list of variables to be read from server even if not scheduled.
Parameters
Name Type Description
names list of variable to be read
Returns
Details

UpdateData( data )

Description
Action Update. It updates a list of variable values and statuses in the DataManager. The updates will be automatically dispatched to all UI component connected to those variables.
Parameters
Name Type Description
data A list of variable updates, properties (like status or value) that are null will not be updated.
Details