node-red-contrib-bacnet
Version:
The BACnet toolbox package for Node-RED from the P4NR B2B Community.
3 lines (2 loc) • 4.15 kB
JavaScript
;function _createForOfIteratorHelper(e,r){var o,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||r&&e&&"number"==typeof e.length)return a&&(e=a),o=0,{s:r=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t,n=!0,c=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){c=!0,t=e},f:function(){try{n||null==a.return||a.return()}finally{if(c)throw t}}}}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(o="Object"===o&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var o=0,a=new Array(r);o<r;o++)a[o]=e[o];return a}var de=de||{biancoroyal:{bacnet:{core:{}}}};de.biancoroyal.bacnet.core.internalDebugLog=de.biancoroyal.bacnet.core.internalDebugLog||require("debug")("bacnet:nodered:core"),de.biancoroyal.bacnet.core.detailDebugLog=de.biancoroyal.bacnet.core.detailDebugLog||require("debug")("bacnet:nodered:core:details"),de.biancoroyal.bacnet.core.specialDebugLog=de.biancoroyal.bacnet.core.specialDebugLog||require("debug")("bacnet:nodered:core:special"),de.biancoroyal.bacnet.core.errorCodeList=de.biancoroyal.bacnet.core.errorCodeList||[],de.biancoroyal.bacnet.core.errorClassList=de.biancoroyal.bacnet.core.errorClassList||[],de.biancoroyal.bacnet.core.initCodeLists=function(){var e,r,o=require("node-bacnet"),a=require("underscore"),t=o.enum.ErrorCode,n=a.toArray(a.invert(t)),c=(de.biancoroyal.bacnet.core.errorCodeList=[],_createForOfIteratorHelper(n));try{for(c.s();!(r=c.n()).done;)e=r.value,de.biancoroyal.bacnet.core.errorCodeList.push({typeValue:t[e],label:e})}catch(e){c.e(e)}finally{c.f()}a.sortBy(de.biancoroyal.bacnet.core.errorCodeList,"typeValue");var i,l,b=o.enum.ErrorClass,n=a.toArray(a.invert(b)),s=(de.biancoroyal.bacnet.core.errorClassList=[],_createForOfIteratorHelper(n));try{for(s.s();!(l=s.n()).done;)i=l.value,de.biancoroyal.bacnet.core.errorClassList.push({typeValue:b[i],label:i})}catch(e){s.e(e)}finally{s.f()}a.sortBy(de.biancoroyal.bacnet.core.errorClassList,"typeValue"),de.biancoroyal.bacnet.core.internalDebugLog("List init done with "+de.biancoroyal.bacnet.core.errorClassList.length+" class errors and "+de.biancoroyal.bacnet.core.errorCodeList.length+" code errors")},de.biancoroyal.bacnet.core.translateErrorMessage=function(e){var r,o=e.message,a=o.split("-");return 3===a.length&&(r=a[1].split(":"),a=a[2].split(":"),de.biancoroyal.bacnet.core.internalDebugLog(r),de.biancoroyal.bacnet.core.internalDebugLog(a),r[1]=de.biancoroyal.bacnet.core.errorClassToString(r[1]),a[1]=de.biancoroyal.bacnet.core.errorCodeToString(a[1]),e.message=o+" "+r.join(":")+" "+a.join(":")),e},de.biancoroyal.bacnet.core.errorCodeToString=function(e){de.biancoroyal.bacnet.core.errorCodeList.length<1&&de.biancoroyal.bacnet.core.initCodeLists();var r,o,a,t=_createForOfIteratorHelper(de.biancoroyal.bacnet.core.errorCodeList);try{for(t.s();!(a=t.n()).done;)r=a.value,parseInt(r.typeValue)===parseInt(e)&&(de.biancoroyal.bacnet.core.detailDebugLog(r.typeValue+" --\x3e "+r.label),o=r)}catch(e){t.e(e)}finally{t.f()}return o?o.label:e},de.biancoroyal.bacnet.core.errorClassToString=function(e){de.biancoroyal.bacnet.core.errorClassList.length<1&&de.biancoroyal.bacnet.core.initCodeLists();var r,o,a,t=_createForOfIteratorHelper(de.biancoroyal.bacnet.core.errorClassList);try{for(t.s();!(a=t.n()).done;)r=a.value,parseInt(r.typeValue)===parseInt(e)&&(de.biancoroyal.bacnet.core.detailDebugLog(r.typeValue+" --\x3e "+r.label),o=r)}catch(e){t.e(e)}finally{t.f()}return o?o.label:e},module.exports=de.biancoroyal.bacnet.core;
//# sourceMappingURL=../maps/core/bacnet-core.js.map