UNPKG

jahmin

Version:

A JavaScript framework to build browser friendly Human Machine Interfaces for automation

607 lines (473 loc) 23.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>DataCommsEngine</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"> <link type="text/css" rel="stylesheet" href="css/prism.min.css"> <link type="text/css" rel="stylesheet" href="css/template.min.css"> <script type="text/javascript"> window.TEMPLATE_OPTIONS = {"includeDate":true,"dateFormat":"Do MMM YYYY","systemName":"JaHMIn","systemSummary":"A Javascript framework to build Human Machine Interfaces for IoT","systemLogo":"","systemColor":"","navMembers":[{"kind":"class","title":"Classes","summary":"All documented classes."},{"kind":"external","title":"Externals","summary":"All documented external members."},{"kind":"global","title":"Globals","summary":"All documented globals."},{"kind":"mixin","title":"Mixins","summary":"All documented mixins."},{"kind":"interface","title":"Interfaces","summary":"All documented interfaces."},{"kind":"module","title":"Modules","summary":"All documented modules."},{"kind":"namespace","title":"Namespaces","summary":"All documented namespaces."},{"kind":"tutorial","title":"Tutorials","summary":"All available tutorials."}],"footer":"","copyright":"FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects.","linenums":true,"collapseSymbols":true,"inverseNav":true,"inlineNav":false,"outputSourceFiles":true,"sourceRootPath":null,"disablePackagePath":true,"outputSourcePath":false,"showTableOfContents":true,"showAccessFilter":true,"analytics":null,"methodHeadingReturns":true,"sort":"linenum, longname, version, since","search":true,"favicon":null,"stylesheets":[],"scripts":[],"monospaceLinks":false,"cleverLinks":false,"theme":"yeti"}; window.DOCLET_TOC_ENABLED = true; window.DOCLET_AFILTER_ENABLED = false; </script> </head> <body> <!-- start:navbar.hbs --> <header class="navbar navbar-default navbar-fixed-top navbar-inverse"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.html"> JaHMIn </a> <!-- displayed on small devices --> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse" id="topNavigation"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Globals<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="global.html#VarStatusCodes">VarStatusCodes</a></li> </ul> </li> <li class="dropdown"> <a href="list_class.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="DataCommsEngine.html">DataCommsEngine</a></li> <li><a href="DataTree.html">DataTree</a></li> <li><a href="ErrorCodes.html">ErrorCodes</a></li> <li><a href="ServiceManager.html">ServiceManager</a></li> <li><a href="ServiceStatusCodes.html">ServiceStatusCodes</a></li> <li><a href="systemError.html">systemError</a></li> <li><a href="systemObject.html">systemObject</a></li> <li><a href="systemVariable.html">systemVariable</a></li> <li><a href="VarResponse.html">VarResponse</a></li> </ul> </li> <li class="dropdown"> <a href="list_tutorial.html" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="tutorial-Getting-Started.html">Getting-Started</a></li> </ul> </li> </ul> <!-- start:lunr-search-navbar.hbs --> <form class="navbar-form navbar-right" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" id="lunr-search-input"> <div class="input-group-btn"> <button class="btn btn-default" id="lunr-search-submit"> <i class="glyphicon glyphicon-search"></i> </button> </div> </div> </form> <!-- start:lunr-search-navbar.hbs --> </div> </div> </header> <!-- end:navbar.hbs --> <div class="page-header"> <div class="container"> <span class="kind">class</span> <h1><span class="name">DataCommsEngine</span></h1> </div> </div> <div class="container content"> <div class="row"> <div class="col-md-9 main-content"> <ol class="breadcrumb"> <li><a href="index.html">Home</a></li> <li><a href="list_class.html">Classes</a></li> <li class="active">DataCommsEngine</li> </ol> <section> <dl class="symbol primary"> <dt class="symbol-title class collapsible-symbol expanded"> <h2 class="class"><span class="signature-new">new&nbsp;</span><span class="name">DataCommsEngine</span><span class="signature-params">()</span><span class="signature-type"></span></h2> </dt> <dd class="symbol-details class collapsible-symbol expanded" style="max-height: 9999px;"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="description classdesc">Abstract class defining a Comunication Engine for data I/O with a server.</div> </div> <div class="callout callout-info"> <h5>Properties</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td><code>toBeSubscribed</code></td> <td><span class="param-type">Map.&lt;string, number></span></td> <td class="last"> 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. </td> </tr> <tr> <td><code>toBeUnsubscribed</code></td> <td><span class="param-type">Set.&lt;string></span></td> <td class="last"> List of Variables waiting to be unsubscribed from updates. </td> </tr> <tr> <td><code>subscribedVar</code></td> <td><span class="param-type">Map.&lt;string, number></span></td> <td class="last"> 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. </td> </tr> <tr> <td><code>aggregationTime_ms</code></td> <td><span class="param-type">number</span></td> <td class="last"> Time the system will wait before sending subscruiption/unsubscription, so that variable can be aggregated and make moreefficient network calls. </td> </tr> </tbody> </table> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-19">line 19</a></p> </div> </div> </form> </div> </div> </dd> </dl> <article class="secondary"> <h3>Classes</h3> <dl class="symbol"> <hr/> <dt class="symbol-title class public"> <h4 id="DataCommsEngine" class="class public"><a href="DataCommsEngine.html"><span class="signature-new">new&nbsp;</span><span class="name">DataCommsEngine</span><span class="signature-params">()</span><span class="signature-type"></span></a></h4> </dt> <dd class="symbol-details class public"> <div class="symbol-details-inner"> </div> </dd> </dl> <h3>Methods</h3> <dl class="symbol"> <hr/> <dt class="symbol-title function public collapsible-symbol"> <h4 id="Initialize" class="function public"><span class="signature-attribs">&lt;abstract> </span><span class="name">Initialize</span><span class="signature-params">()</span><span class="signature-type"> &rarr;&nbsp;{basicResponse}</span></h4> </dt> <dd class="symbol-details function public collapsible-symbol"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="description">Abstract method. Action Initialize. Place here anything that is needed for initialization of this engine.</div> </div> <div class="callout callout-success"><h5>Returns</h5> <form class="form-horizontal returns"> <div class="form-group"> <label class="col-sm-3 control-label returns-type"><span class="param-type">basicResponse</span></label> <div class="col-sm-9"> <div class="form-control-static returns-description">- return status of initialization action.</div> </div> </div> </form> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-170">line 170</a></p> </div> </div> </form> </div> </div> </dd> <hr/> <dt class="symbol-title function public collapsible-symbol"> <h4 id="Subscribe" class="function public"><span class="signature-attribs">&lt;abstract> </span><span class="name">Subscribe</span><span class="signature-params">( <span class="signature-param">variables</span>&nbsp;)</span><span class="signature-type"> &rarr;&nbsp;{Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>>}</span></h4> </dt> <dd class="symbol-details function public collapsible-symbol"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="description">Abstract method. Action Subscribe. It subscribes the list of variables names for automatic updates.</div> </div> <div class="callout callout-info"> <h5>Parameters</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td><code>variables</code></td> <td><span class="param-type">Array.&lt;<a href="systemObject.html">systemObject</a>></span></td> <td class="last"> variables names to be subscribed </td> </tr> </tbody> </table> </div> <div class="callout callout-success"><h5>Returns</h5> <form class="form-horizontal returns"> <div class="form-group"> <label class="col-sm-3 control-label returns-type"><span class="param-type">Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>></span></label> <div class="col-sm-9"> <div class="form-control-static returns-description">- Response of the action.</div> </div> </div> </form> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-177">line 177</a></p> </div> </div> </form> </div> </div> </dd> <hr/> <dt class="symbol-title function public collapsible-symbol"> <h4 id="Unsubscribe" class="function public"><span class="signature-attribs">&lt;abstract> </span><span class="name">Unsubscribe</span><span class="signature-params">( <span class="signature-param">variables</span>&nbsp;)</span><span class="signature-type"> &rarr;&nbsp;{Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>>}</span></h4> </dt> <dd class="symbol-details function public collapsible-symbol"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="description">Abstract method. Action Unsubscribe. It unubscribes the list of variables names from automatic updates.</div> </div> <div class="callout callout-info"> <h5>Parameters</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td><code>variables</code></td> <td><span class="param-type">Array.&lt;<a href="systemObject.html">systemObject</a>></span></td> <td class="last"> variables names to be unsubscribed </td> </tr> </tbody> </table> </div> <div class="callout callout-success"><h5>Returns</h5> <form class="form-horizontal returns"> <div class="form-group"> <label class="col-sm-3 control-label returns-type"><span class="param-type">Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>></span></label> <div class="col-sm-9"> <div class="form-control-static returns-description">- Response of the action.</div> </div> </div> </form> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-184">line 184</a></p> </div> </div> </form> </div> </div> </dd> <hr/> <dt class="symbol-title function public collapsible-symbol"> <h4 id="Write" class="function public"><span class="signature-attribs">&lt;abstract> </span><span class="name">Write</span><span class="signature-params">( <span class="signature-param">targets</span>, <span class="signature-param">values</span>&nbsp;)</span><span class="signature-type"> &rarr;&nbsp;{Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>>}</span></h4> </dt> <dd class="symbol-details function public collapsible-symbol"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="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.</div> </div> <div class="callout callout-info"> <h5>Parameters</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td><code>targets</code></td> <td><span class="param-type">Array.&lt;<a href="systemObject.html">systemObject</a>></span></td> <td class="last"> variables names to be unsubscribed </td> </tr> <tr> <td><code>values</code></td> <td><span class="param-type">Array.&lt;any></span></td> <td class="last"> values related to variables to be written </td> </tr> </tbody> </table> </div> <div class="callout callout-success"><h5>Returns</h5> <form class="form-horizontal returns"> <div class="form-group"> <label class="col-sm-3 control-label returns-type"><span class="param-type">Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>></span></label> <div class="col-sm-9"> <div class="form-control-static returns-description"></div> </div> </div> </form> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-193">line 193</a></p> </div> </div> </form> </div> </div> </dd> <hr/> <dt class="symbol-title function public collapsible-symbol"> <h4 id="Read" class="function public"><span class="signature-attribs">&lt;abstract> </span><span class="name">Read</span><span class="signature-params">( <span class="signature-param">names</span>&nbsp;)</span><span class="signature-type"> &rarr;&nbsp;{Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>>}</span></h4> </dt> <dd class="symbol-details function public collapsible-symbol"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="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.</div> </div> <div class="callout callout-info"> <h5>Parameters</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td><code>names</code></td> <td></td> <td class="last"> list of variable to be read </td> </tr> </tbody> </table> </div> <div class="callout callout-success"><h5>Returns</h5> <form class="form-horizontal returns"> <div class="form-group"> <label class="col-sm-3 control-label returns-type"><span class="param-type">Promise.&lt;Array.&lt;<a href="VarResponse.html">VarResponse</a>>></span></label> <div class="col-sm-9"> <div class="form-control-static returns-description"></div> </div> </div> </form> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-201">line 201</a></p> </div> </div> </form> </div> </div> </dd> <hr/> <dt class="symbol-title function public collapsible-symbol"> <h4 id="UpdateData" class="function public"><span class="name">UpdateData</span><span class="signature-params">( <span class="signature-param">data</span>&nbsp;)</span><span class="signature-type"></span></h4> </dt> <dd class="symbol-details function public collapsible-symbol"> <div class="symbol-details-inner"> <div class="callout callout-primary"><h5>Description</h5> <div class="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.</div> </div> <div class="callout callout-info"> <h5>Parameters</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td><code>data</code></td> <td></td> <td class="last"> A list of variable updates, properties (like status or value) that are null will not be updated. </td> </tr> </tbody> </table> </div> <div class="callout callout-default"><h5>Details</h5> <form class="form-horizontal details"> <!-- source --> <div class="form-group"> <label class="col-sm-3 control-label">Source</label> <div class="col-sm-9"> <p class="form-control-static"><a href="DataCommsEngine.js.html">DataCommsEngine.js</a>, <a href="DataCommsEngine.js.html#line-207">line 207</a></p> </div> </div> </form> </div> </div> </dd> </dl> </article> </section> </div> <div class="col-md-3 side-content"> <nav class="toc hidden-print hidden-sm hidden-xs"></nav> </div> </div> </div> <footer> <div class="copyright">FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects.</div> <div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> on 11th Jun 2021 using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div> </footer> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/clipboard.min.js"></script> <script src="js/prism.min.js"></script> <script src="js/template.min.js"></script> <!-- start:lunr-search-modal.hbs --> <div class="modal fade" id="lunr-search-modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">Search results</h4> </div> <div class="modal-body" id="lunr-search-body"> </div> <div class="modal-footer" id="lunr-search-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div> <!-- end:lunr-search-modal.hbs --> <script src="js/lunr.min.js"></script> </body> </html>