@c8y/ng1-modules 1022.3.2 → 1022.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,f=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new L(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=y,function(t,e){if(c===h)throw Error("Generator is already running");if(c===v){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;n=s(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,m;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}(r,a);if(r){if(r===m)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===y)throw c=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=h;r=s(o,i,a);if("normal"===r.type){if(c=a.done?v:p,r.arg===m)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=v,a.method="throw",a.arg=r.arg)}})}),e}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var y="suspendedStart",p="suspendedYield",h="executing",v="completed",m={};function g(){}function d(){}function b(){}var e={},w=(i(e,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(E([]))),_=(w&&w!==t&&f.call(w,n)&&(e=w),b.prototype=g.prototype=Object.create(e));function O(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function x(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=s(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&f.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function E(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(f.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(_,"constructor",{value:d.prototype=b,configurable:!0}),l(b,"constructor",{value:d,configurable:!0}),d.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},O(x.prototype),i(x.prototype,r,function(){return this}),a.AsyncIterator=x,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new x(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},O(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=E,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=f.call(o,"catchLoc"),c=f.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,j(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),m}},a}function ownKeys(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}(()=>{function t(a,t,c,n,e){var u="c8y_DeviceShellTemplate";function f(t,e,r){return _.map(t||[],function(t){return _.assign(t,{syntax:e,deviceType:r})})}function r(){return(r=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.getGlobalParam(u);case 2:return r=t.sent,r=_.assign(_objectSpread({type:u},r&&{c8y_Global:{}}),e),t.abrupt("return",c.save(r));case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}return{getCommandTemplatesForDeviceType:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];o=e,n=[],_.forEach(o,function(t){e=t;var e=_.get(window.c8y,"collections.devicecommands",{})[e];e&&n.push(((e,t)=>(t=_.isArray(t)?_(t).map(function(t){return f(t.templates,t.syntax,e)}).flatten().value():f(t.templates,t.syntax,e),a.when(t)))(t,e))});var n,o=a.all(n).then(_.flatten),i=(t=>(t={__filter:{type:u,deviceType:{__in:t}},__orderby:[{creationTime:-1}]},c.listQuery(t,{pageSize:1e3},!0)))(e);return a.all([o,i]).then(_.flatten)},canSendCommandsViaSMS:function(){return t.getSystemOptionValue({category:"messaging",key:"provider"},!1).then(function(t){return!!t})},saveTemplate:function(t){return r.apply(this,arguments)},getDeliveryTypes:function(){return{defaultDeliveryType:e("Default"),standardDeliveryTypes:[e("Default"),e("SMS")]}},removeTemplate:c.remove}}t.$inject=["$q","c8ySettings","c8yInventory","c8yGlobalConfigService","gettext"],angular.module("c8y.core").factory("c8yDeviceShell",t)})();
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regenerator(){var v,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function n(e,t,r,n){var o,i,a,c,u,f,y,l,p,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(o=e,i=r,y=n||[],l=!1,p={p:f=0,n:0,v:v,a:s,f:s.bind(v,4),d:function(e,t){return a=e,c=0,u=v,p.n=t,_}},function(e,t,r){if(1<f)throw TypeError("Generator is already running");for(l&&1===t&&s(t,r),c=t,u=r;(b=c<2?v:u)||!l;){a||(c?c<3?(1<c&&(p.n=-1),s(c,u)):p.n=u:p.v=u);try{if(f=2,a){if(b=a[e=c?e:"next"]){if(!(b=b.call(a,u)))throw TypeError("iterator result is not an object");if(!b.done)return b;u=b.value,c<2&&(c=0)}else 1===c&&(b=a.return)&&b.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+e+"' method"),c=1);a=v}else if((b=(l=p.n<0)?u:o.call(i,p))!==_)break}catch(e){a=v,c=1,u=e}finally{f=1}}return{value:b,done:l}}),!0),t;function s(e,t){for(c=e,u=t,b=0;!l&&f&&!r&&b<y.length;b++){var r,n=y[b],o=p.p,i=n[2];3<e?(r=i===t)&&(u=n[(c=n[4])?5:c=3],n[4]=n[5]=v):n[0]<=o&&((r=e<2&&o<n[1])?(c=0,p.v=t,p.n=n[1]):o<i&&(r=e<3||n[0]>t||i<t)&&(n[4]=e,n[5]=t,p.n=i,c=0))}if(r||1<e)return _;throw l=!0,t}}var _={};function g(){}function o(){}function i(){}var b=Object.getPrototypeOf,e=[][t]?b(b([][t]())):(_regeneratorDefine2(b={},t,function(){return this}),b),a=i.prototype=g.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(a),e}return _regeneratorDefine2(a,"constructor",o.prototype=i),_regeneratorDefine2(i,"constructor",o),_regeneratorDefine2(i,r,o.displayName="GeneratorFunction"),_regeneratorDefine2(a),_regeneratorDefine2(a,r,"Generator"),_regeneratorDefine2(a,t,function(){return this}),_regeneratorDefine2(a,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:c}})()}function _regeneratorDefine2(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,t,r,n){t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:((n=function(t,r){_regeneratorDefine2(e,t,function(e){return this._invoke(t,r,e)})})("next",0),n("throw",1),n("return",2))})(e,t,r,n)}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}(()=>{function e(a,e,c,n,t){var u="c8y_DeviceShellTemplate";function f(e,t,r){return _.map(e||[],function(e){return _.assign(e,{syntax:t,deviceType:r})})}function r(){return(r=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.getGlobalParam(u);case 1:return r=e.v,r=_.assign(_objectSpread({type:u},r&&{c8y_Global:{}}),t),e.a(2,c.save(r))}},e)}))).apply(this,arguments)}return{getCommandTemplatesForDeviceType:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o=t,n=[],_.forEach(o,function(e){t=e;var t=_.get(window.c8y,"collections.devicecommands",{})[t];t&&n.push(((t,e)=>(e=_.isArray(e)?_(e).map(function(e){return f(e.templates,e.syntax,t)}).flatten().value():f(e.templates,e.syntax,t),a.when(e)))(e,t))});var n,o=a.all(n).then(_.flatten),i=(e=>(e={__filter:{type:u,deviceType:{__in:e}},__orderby:[{creationTime:-1}]},c.listQuery(e,{pageSize:1e3},!0)))(t);return a.all([o,i]).then(_.flatten)},canSendCommandsViaSMS:function(){return e.getSystemOptionValue({category:"messaging",key:"provider"},!1).then(function(e){return!!e})},saveTemplate:function(e){return r.apply(this,arguments)},getDeliveryTypes:function(){return{defaultDeliveryType:t("Default"),standardDeliveryTypes:[t("Default"),t("SMS")]}},removeTemplate:c.remove}}e.$inject=["$q","c8ySettings","c8yInventory","c8yGlobalConfigService","gettext"],angular.module("c8y.core").factory("c8yDeviceShell",e)})();
@@ -10731,6 +10731,9 @@ msgstr "Keine weiteren Software-Versionen verfügbar."
10731
10731
  msgid "No package selected"
10732
10732
  msgstr "Kein Packet ausgewählt"
10733
10733
 
10734
+ msgid "No parameters to display."
10735
+ msgstr "Keine Parameter zum Anzeigen."
10736
+
10734
10737
  msgid "No password"
10735
10738
  msgstr "Kein Passwort"
10736
10739
 
@@ -11684,6 +11687,12 @@ msgstr "Seite {{ pageNo }} wird geladen…"
11684
11687
  msgid "Panel"
11685
11688
  msgstr "Panel"
11686
11689
 
11690
+ msgid "Parameters"
11691
+ msgstr "Parameters"
11692
+
11693
+ msgid "Parameters used in the device will be displayed here"
11694
+ msgstr "Die im Gerät verwendeten Parameter werden hier angezeigt."
11695
+
11687
11696
  msgid "Parent group ID"
11688
11697
  msgstr "ID der übergeordneten Gruppe"
11689
11698
 
@@ -10745,6 +10745,9 @@ msgstr "No existen más versiones de software disponibles."
10745
10745
  msgid "No package selected"
10746
10746
  msgstr "Ningún paquete seleccionado"
10747
10747
 
10748
+ msgid "No parameters to display."
10749
+ msgstr "No hay parámetros que mostrar."
10750
+
10748
10751
  msgid "No password"
10749
10752
  msgstr "Ninguna contraseña"
10750
10753
 
@@ -11699,6 +11702,12 @@ msgstr "La página {{ pageNo }} se está cargando…"
11699
11702
  msgid "Panel"
11700
11703
  msgstr "Panel"
11701
11704
 
11705
+ msgid "Parameters"
11706
+ msgstr "Parameters"
11707
+
11708
+ msgid "Parameters used in the device will be displayed here"
11709
+ msgstr "Los parámetros utilizados en el dispositivo se mostrarán aquí."
11710
+
11702
11711
  msgid "Parent group ID"
11703
11712
  msgstr "ID de grupo primario"
11704
11713
 
@@ -10746,6 +10746,9 @@ msgstr "Aucune autre version du logiciel disponible."
10746
10746
  msgid "No package selected"
10747
10747
  msgstr "Aucun package sélectionné"
10748
10748
 
10749
+ msgid "No parameters to display."
10750
+ msgstr "Aucun paramètre à afficher."
10751
+
10749
10752
  msgid "No password"
10750
10753
  msgstr "Aucun mot de passe"
10751
10754
 
@@ -11700,6 +11703,12 @@ msgstr "La page {{ pageNo }} est en cours de chargement…"
11700
11703
  msgid "Panel"
11701
11704
  msgstr "Volet"
11702
11705
 
11706
+ msgid "Parameters"
11707
+ msgstr "Parameters"
11708
+
11709
+ msgid "Parameters used in the device will be displayed here"
11710
+ msgstr "Les paramètres utilisés dans l'appareil s'affichent ici."
11711
+
11703
11712
  msgid "Parent group ID"
11704
11713
  msgstr "ID du groupe parent"
11705
11714
 
@@ -10716,6 +10716,9 @@ msgstr "利用できる他のソフトウェア バージョンはありませ
10716
10716
  msgid "No package selected"
10717
10717
  msgstr "パッケージは選択されていません"
10718
10718
 
10719
+ msgid "No parameters to display."
10720
+ msgstr ""
10721
+
10719
10722
  msgid "No password"
10720
10723
  msgstr "パスワードがありません"
10721
10724
 
@@ -11670,6 +11673,12 @@ msgstr "ページ {{ pageNo }} を読み込んでいます…"
11670
11673
  msgid "Panel"
11671
11674
  msgstr "パネル"
11672
11675
 
11676
+ msgid "Parameters"
11677
+ msgstr "Parameters"
11678
+
11679
+ msgid "Parameters used in the device will be displayed here"
11680
+ msgstr ""
11681
+
11673
11682
  msgid "Parent group ID"
11674
11683
  msgstr "親グループ ID"
11675
11684
 
@@ -2571,7 +2571,8 @@ msgstr "날짜별(내림차순)"
2571
2571
 
2572
2572
  msgid "By default, every unsecure HTML is removed from the HTML widget. You can disable\n"
2573
2573
  " this behavior in this application and allow unsecure HTML to be used."
2574
- msgstr ""
2574
+ msgstr "기본적으로, 모든 안전하지 않은 HTML은 HTML 위젯에서 제거됩니다. 이 애플리케이션에서 이 동작을 비활성화하고 안전하지 않은 HTML을 사용할 수 있도록 허용할 수 있습니다.\n"
2575
+ " ."
2575
2576
 
2576
2577
  msgid "By severity"
2577
2578
  msgstr "심각도에 따름"
@@ -10725,6 +10726,9 @@ msgstr "사용 가능한 다른 소프트웨어 버전이 없습니다."
10725
10726
  msgid "No package selected"
10726
10727
  msgstr "선택된 패키지 없음"
10727
10728
 
10729
+ msgid "No parameters to display."
10730
+ msgstr "표시할 매개 변수가 없습니다."
10731
+
10728
10732
  msgid "No password"
10729
10733
  msgstr "비밀번호 없음"
10730
10734
 
@@ -11679,6 +11683,12 @@ msgstr "{{ pageNo }} 페이지 로드 중…"
11679
11683
  msgid "Panel"
11680
11684
  msgstr "패널"
11681
11685
 
11686
+ msgid "Parameters"
11687
+ msgstr "Parameters"
11688
+
11689
+ msgid "Parameters used in the device will be displayed here"
11690
+ msgstr "디바이스에 사용된 매개 변수가 여기에 표시됩니다."
11691
+
11682
11692
  msgid "Parent group ID"
11683
11693
  msgstr "상위 그룹 ID"
11684
11694
 
@@ -10744,6 +10744,9 @@ msgstr "Geen andere softwareversies beschikbaar."
10744
10744
  msgid "No package selected"
10745
10745
  msgstr "Geen pakket geselecteerd"
10746
10746
 
10747
+ msgid "No parameters to display."
10748
+ msgstr "Geen parameters om weer te geven."
10749
+
10747
10750
  msgid "No password"
10748
10751
  msgstr "Geen wachtwoord"
10749
10752
 
@@ -11698,6 +11701,12 @@ msgstr "Pagina {{ pageNo }} wordt geladen…"
11698
11701
  msgid "Panel"
11699
11702
  msgstr "Paneel"
11700
11703
 
11704
+ msgid "Parameters"
11705
+ msgstr "Parameters"
11706
+
11707
+ msgid "Parameters used in the device will be displayed here"
11708
+ msgstr "De parameters die in het apparaat worden gebruikt, worden hier weergegeven."
11709
+
11701
11710
  msgid "Parent group ID"
11702
11711
  msgstr "ID bovenliggende groep"
11703
11712
 
@@ -10791,6 +10791,9 @@ msgstr "Brak innych dostępnych wersji oprogramowania."
10791
10791
  msgid "No package selected"
10792
10792
  msgstr "Nie wybrano pakietu"
10793
10793
 
10794
+ msgid "No parameters to display."
10795
+ msgstr "Brak parametrów do wyświetlenia."
10796
+
10794
10797
  msgid "No password"
10795
10798
  msgstr "Brak hasła"
10796
10799
 
@@ -11745,6 +11748,12 @@ msgstr "Trwa wczytywanie strony nr {{ pageNo }}…"
11745
11748
  msgid "Panel"
11746
11749
  msgstr "Panel"
11747
11750
 
11751
+ msgid "Parameters"
11752
+ msgstr "Parameters"
11753
+
11754
+ msgid "Parameters used in the device will be displayed here"
11755
+ msgstr "Parametry używane w urządzeniu zostaną wyświetlone tutaj."
11756
+
11748
11757
  msgid "Parent group ID"
11749
11758
  msgstr "Identyfikator grupy nadrzędnej"
11750
11759
 
@@ -10745,6 +10745,9 @@ msgstr "Nenhuma outra versão de software disponível."
10745
10745
  msgid "No package selected"
10746
10746
  msgstr "Nenhum pacote selecionado"
10747
10747
 
10748
+ msgid "No parameters to display."
10749
+ msgstr "Não há parâmetros a exibir."
10750
+
10748
10751
  msgid "No password"
10749
10752
  msgstr "Sem senha"
10750
10753
 
@@ -11699,6 +11702,12 @@ msgstr "Página {{ pageNo }} está carregando…"
11699
11702
  msgid "Panel"
11700
11703
  msgstr "Painel"
11701
11704
 
11705
+ msgid "Parameters"
11706
+ msgstr "Parameters"
11707
+
11708
+ msgid "Parameters used in the device will be displayed here"
11709
+ msgstr "Os parâmetros usados no dispositivo serão exibidos aqui."
11710
+
11702
11711
  msgid "Parent group ID"
11703
11712
  msgstr "ID do grupo principal"
11704
11713
 
@@ -2572,7 +2572,8 @@ msgstr "按日期(降序)"
2572
2572
 
2573
2573
  msgid "By default, every unsecure HTML is removed from the HTML widget. You can disable\n"
2574
2574
  " this behavior in this application and allow unsecure HTML to be used."
2575
- msgstr ""
2575
+ msgstr "\n"
2576
+ " 默认情况下,所有不安全的 HTML 都会从 HTML 小组件中移除。您可以在该应用程序中禁用此行为,允许使用不安全的 HTML。"
2576
2577
 
2577
2578
  msgid "By severity"
2578
2579
  msgstr "按严重性"
@@ -10726,6 +10727,9 @@ msgstr "没有其他可用的软件版本。"
10726
10727
  msgid "No package selected"
10727
10728
  msgstr "未选择任何包"
10728
10729
 
10730
+ msgid "No parameters to display."
10731
+ msgstr "无参数可显示。"
10732
+
10729
10733
  msgid "No password"
10730
10734
  msgstr "无密码"
10731
10735
 
@@ -11680,6 +11684,12 @@ msgstr "页面 {{ pageNo }} 正在加载…"
11680
11684
  msgid "Panel"
11681
11685
  msgstr "面板"
11682
11686
 
11687
+ msgid "Parameters"
11688
+ msgstr "Parameters"
11689
+
11690
+ msgid "Parameters used in the device will be displayed here"
11691
+ msgstr "设备中使用的参数将显示在此处。"
11692
+
11683
11693
  msgid "Parent group ID"
11684
11694
  msgstr "父组 ID"
11685
11695
 
@@ -10727,6 +10727,9 @@ msgstr "沒有其他可用的軟體版本。"
10727
10727
  msgid "No package selected"
10728
10728
  msgstr "未选择任何包"
10729
10729
 
10730
+ msgid "No parameters to display."
10731
+ msgstr "无参数可显示。"
10732
+
10730
10733
  msgid "No password"
10731
10734
  msgstr "无密码"
10732
10735
 
@@ -11681,6 +11684,12 @@ msgstr "页面 {{ pageNo }} 正在加载…"
11681
11684
  msgid "Panel"
11682
11685
  msgstr "面板"
11683
11686
 
11687
+ msgid "Parameters"
11688
+ msgstr "Parameters"
11689
+
11690
+ msgid "Parameters used in the device will be displayed here"
11691
+ msgstr "设备中使用的参数将显示在此处。"
11692
+
11684
11693
  msgid "Parent group ID"
11685
11694
  msgstr "父组 ID"
11686
11695
 
@@ -1 +1 @@
1
- function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new R(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===d)throw Error("Generator is already running");if(c===y){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=d;r=f(o,i,a);if("normal"===r.type){if(c=a.done?y:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=y,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function w(){}var e={},b=(i(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(F([]))),_=(b&&b!==t&&s.call(b,n)&&(e=b),w.prototype=m.prototype=Object.create(e));function E(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function x(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function F(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(_,"constructor",{value:g.prototype=w,configurable:!0}),l(w,"constructor",{value:g,configurable:!0}),g.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},E(x.prototype),i(x.prototype,r,function(){return this}),a.AsyncIterator=x,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new x(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=F,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,S(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}(()=>{function t(c,u,s,l,f,h,p,d,o){var y=this;this.downloadReportForDevice=function(t,e,r,n){e=_.get(e,"id",e),r=_(r).map(_.partial(y.createPairFromSeries,e)).value();return new y.Downloader(t,n,r).start()},this.downloadReportForDatapoints=function(e,t,r){var n=_(t).filter(function(t){return!0===t.__active}).map(y.getDpRequestParams).value();return n.length?o.current().then(function(t){return o.hasRole(t,"ROLE_MEASUREMENT_READ")?new y.Downloader(e,r,n).start():c.reject(new Error(h("Could not download the report. You need this global permission to download reports: Measurements Read.")))}):c.reject(new Error(h("At least 1 data point must be selected")))},this.createPairFromSeries=function(t,e){return{source:t,fragmentType:e}},this.getDpRequestParams=function(t){return{source:t.__target.id,valueFragmentType:t.fragment,valueFragmentSeries:t.series}},this.generateFileName=function(t,e){if(_.isEmpty(t.source&&e)||_.isEmpty(t.valueFragmentType||t.fragmentType))throw new Error("Unable to generate a file name for given data");var r=t.valueFragmentType?[t.valueFragmentType,t.valueFragmentSeries].join("."):t.fragmentType;return[t.source,r,e].join(".")},this.Downloader=function(r,n,t){var o=this,e=_.uniqBy(t,function(t){return JSON.stringify(t)});function i(){return(i=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){var n,o,e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=c.defer(),403!==r.status)t.next=14;else{if(r.data instanceof Blob)return t.next=5,d.detail(r.config.params.source);t.next=11}break;case 5:o=t.sent,(e=new FileReader).addEventListener("loadend",function(t){try{var e=JSON.parse(_.get(t,"srcElement.result"));n.resolve({type:"danger",text:p.getString('Could not download data for "{{name}}": access denied.',o.data),detailedData:e})}catch(t){n.resolve(a(r))}}),e.readAsText(r.data),t.next=12;break;case 11:n.resolve(a(r));case 12:t.next=15;break;case 14:n.resolve({type:"danger",text:h("An error occurred. Please try again later."),detailedData:r});case 15:return t.abrupt("return",n.promise);case 16:case"end":return t.stop()}},t)}))).apply(this,arguments)}function a(t){return{text:h("Access denied."),type:"danger",detailedData:t}}this.downloadReports=function(){var t=_(e).map(o.downloadReportForDpRequestParams).value();return c.all(t).then(o.onDownloads)},this.start=function(){return l({templateUrl:":::PLUGIN_PATH:::/ui/views/measurementsReport.html",title:h("Generating report"),controller:["$scope","$timeout",function(r,n){r.completed=0,r.total=e.length,r.reportFileName="report.zip",r.close=function(){var t,e;void 0!==window.navigator.msSaveBlob?(t=r.blob,window.navigator.msSaveBlob(t,r.reportFileName)):(e=r.url,n(function(){window.URL.revokeObjectURL(e)},5e3)),r.$close()},o.scope=r,o.downloadReports()}]})},this.downloadReportForDpRequestParams=function(e,t){t=o.getFilter(e,t);return u.list(t,r).then(function(t){return o.onDownload(e,t)}).catch(function(t){return o.onDownloadError(t)})},this.onDownload=function(t,e){return o.scope.completed+=1,e.name=y.generateFileName(t,r.name),e},this.onDownloadError=function(t){return t.async?(o.scope.completed+=1,c.resolve(null)):(o.displayError(t),c.resolve(void 0))},this.displayError=function(t){!function(){return i.apply(this,arguments)}(t).then(f.add)},this.onDownloads=function(t){var t=t.filter(function(t){return void 0!==t}),e=t.filter(_.identity),t=t.length-e.length;return 0<t&&(t=p.getPlural(t,"You will get a CSV/Excel file for 1 series via email.","You will get CSV/Excel files for {{$count}} series via email.",{}),f.success(t)),0===e.length?c.when():s.zipFiles(e).then(function(t){o.scope.blob=t,o.scope.url=window.URL.createObjectURL(t)})},this.getFilter=function(t,e){e=_.isArray(n)?n[e]:n;return _.merge({},e,t)}}}t.$inject=["$q","c8yMeasurements","c8yZip","c8yModal","c8yAlert","gettext","gettextCatalog","c8yInventory","c8yUser"],angular.module("c8y.ui").service("MeasurementsReportSvc",t)})();
1
+ function _regenerator(){var g,e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",t=e.toStringTag||"@@toStringTag";function n(e,r,t,n){var o,a,i,c,u,s,l,f,d,r=r&&r.prototype instanceof m?r:m,r=Object.create(r.prototype);return _regeneratorDefine2(r,"_invoke",(o=e,a=t,l=n||[],f=!1,d={p:s=0,n:0,v:g,a:p,f:p.bind(g,4),d:function(e,r){return i=e,c=0,u=g,d.n=r,v}},function(e,r,t){if(1<s)throw TypeError("Generator is already running");for(f&&1===r&&p(r,t),c=r,u=t;(y=c<2?g:u)||!f;){i||(c?c<3?(1<c&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(y=i[e=c?e:"next"]){if(!(y=y.call(i,u)))throw TypeError("iterator result is not an object");if(!y.done)return y;u=y.value,c<2&&(c=0)}else 1===c&&(y=i.return)&&y.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+e+"' method"),c=1);i=g}else if((y=(f=d.n<0)?u:o.call(a,d))!==v)break}catch(e){i=g,c=1,u=e}finally{s=1}}return{value:y,done:f}}),!0),r;function p(e,r){for(c=e,u=r,y=0;!f&&s&&!t&&y<l.length;y++){var t,n=l[y],o=d.p,a=n[2];3<e?(t=a===r)&&(u=n[(c=n[4])?5:c=3],n[4]=n[5]=g):n[0]<=o&&((t=e<2&&o<n[1])?(c=0,d.v=r,d.n=n[1]):o<a&&(t=e<3||n[0]>r||a<r)&&(n[4]=e,n[5]=r,d.n=a,c=0))}if(t||1<e)return v;throw f=!0,r}}var v={};function m(){}function o(){}function a(){}var y=Object.getPrototypeOf,e=[][r]?y(y([][r]())):(_regeneratorDefine2(y={},r,function(){return this}),y),i=a.prototype=m.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,_regeneratorDefine2(e,t,"GeneratorFunction")),e.prototype=Object.create(i),e}return _regeneratorDefine2(i,"constructor",o.prototype=a),_regeneratorDefine2(a,"constructor",o),_regeneratorDefine2(a,t,o.displayName="GeneratorFunction"),_regeneratorDefine2(i),_regeneratorDefine2(i,t,"Generator"),_regeneratorDefine2(i,r,function(){return this}),_regeneratorDefine2(i,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:c}})()}function _regeneratorDefine2(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,r,t,n){r?o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t:((n=function(r,t){_regeneratorDefine2(e,r,function(e){return this._invoke(r,t,e)})})("next",0),n("throw",1),n("return",2))})(e,r,t,n)}function asyncGeneratorStep(e,r,t,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void t(e)}c.done?r(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,i=arguments;return new Promise(function(r,t){var n=c.apply(e,i);function o(e){asyncGeneratorStep(n,r,t,o,a,"next",e)}function a(e){asyncGeneratorStep(n,r,t,o,a,"throw",e)}o(void 0)})}}(()=>{function e(c,u,s,l,f,d,p,g,o){var v=this;this.downloadReportForDevice=function(e,r,t,n){r=_.get(r,"id",r),t=_(t).map(_.partial(v.createPairFromSeries,r)).value();return new v.Downloader(e,n,t).start()},this.downloadReportForDatapoints=function(r,e,t){var n=_(e).filter(function(e){return!0===e.__active}).map(v.getDpRequestParams).value();return n.length?o.current().then(function(e){return o.hasRole(e,"ROLE_MEASUREMENT_READ")?new v.Downloader(r,t,n).start():c.reject(new Error(d("Could not download the report. You need this global permission to download reports: Measurements Read.")))}):c.reject(new Error(d("At least 1 data point must be selected")))},this.createPairFromSeries=function(e,r){return{source:e,fragmentType:r}},this.getDpRequestParams=function(e){return{source:e.__target.id,valueFragmentType:e.fragment,valueFragmentSeries:e.series}},this.generateFileName=function(e,r){if(_.isEmpty(e.source&&r)||_.isEmpty(e.valueFragmentType||e.fragmentType))throw new Error("Unable to generate a file name for given data");var t=e.valueFragmentType?[e.valueFragmentType,e.valueFragmentSeries].join("."):e.fragmentType;return[e.source,t,r].join(".")},this.Downloader=function(t,n,e){var o=this,r=_.uniqBy(e,function(e){return JSON.stringify(e)});function a(){return(a=_asyncToGenerator(_regenerator().m(function e(t){var n,o,r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(n=c.defer(),403!==t.status)e.n=4;else{if(t.data instanceof Blob)return e.n=1,g.detail(t.config.params.source);e.n=2}break;case 1:o=e.v,(r=new FileReader).addEventListener("loadend",function(e){try{var r=JSON.parse(_.get(e,"srcElement.result"));n.resolve({type:"danger",text:p.getString('Could not download data for "{{name}}": access denied.',o.data),detailedData:r})}catch(e){n.resolve(i(t))}}),r.readAsText(t.data),e.n=3;break;case 2:n.resolve(i(t));case 3:e.n=5;break;case 4:n.resolve({type:"danger",text:d("An error occurred. Please try again later."),detailedData:t});case 5:return e.a(2,n.promise)}},e)}))).apply(this,arguments)}function i(e){return{text:d("Access denied."),type:"danger",detailedData:e}}this.downloadReports=function(){var e=_(r).map(o.downloadReportForDpRequestParams).value();return c.all(e).then(o.onDownloads)},this.start=function(){return l({templateUrl:":::PLUGIN_PATH:::/ui/views/measurementsReport.html",title:d("Generating report"),controller:["$scope","$timeout",function(t,n){t.completed=0,t.total=r.length,t.reportFileName="report.zip",t.close=function(){var e,r;void 0!==window.navigator.msSaveBlob?(e=t.blob,window.navigator.msSaveBlob(e,t.reportFileName)):(r=t.url,n(function(){window.URL.revokeObjectURL(r)},5e3)),t.$close()},o.scope=t,o.downloadReports()}]})},this.downloadReportForDpRequestParams=function(r,e){e=o.getFilter(r,e);return u.list(e,t).then(function(e){return o.onDownload(r,e)}).catch(function(e){return o.onDownloadError(e)})},this.onDownload=function(e,r){return o.scope.completed+=1,r.name=v.generateFileName(e,t.name),r},this.onDownloadError=function(e){return e.async?(o.scope.completed+=1,c.resolve(null)):(o.displayError(e),c.resolve(void 0))},this.displayError=function(e){!function(){return a.apply(this,arguments)}(e).then(f.add)},this.onDownloads=function(e){var e=e.filter(function(e){return void 0!==e}),r=e.filter(_.identity),e=e.length-r.length;return 0<e&&(e=p.getPlural(e,"You will get a CSV/Excel file for 1 series via email.","You will get CSV/Excel files for {{$count}} series via email.",{}),f.success(e)),0===r.length?c.when():s.zipFiles(r).then(function(e){o.scope.blob=e,o.scope.url=window.URL.createObjectURL(e)})},this.getFilter=function(e,r){r=_.isArray(n)?n[r]:n;return _.merge({},r,e)}}}e.$inject=["$q","c8yMeasurements","c8yZip","c8yModal","c8yAlert","gettext","gettextCatalog","c8yInventory","c8yUser"],angular.module("c8y.ui").service("MeasurementsReportSvc",e)})();
@@ -1 +1 @@
1
- function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,f=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new P(n||[]);return f(e,"_invoke",{value:(o=t,i=r,a=n,c=p,function(t,e){if(c===h)throw Error("Generator is already running");if(c===v){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;n=l(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,d;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}(r,a);if(r){if(r===d)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===p)throw c=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=h;r=l(o,i,a);if("normal"===r.type){if(c=a.done?v:y,r.arg===d)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=v,a.method="throw",a.arg=r.arg)}})}),e}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var p="suspendedStart",y="suspendedYield",h="executing",v="completed",d={};function m(){}function g(){}function b(){}var e={},w=(i(e,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(L([]))),_=(w&&w!==t&&s.call(w,n)&&(e=w),b.prototype=m.prototype=Object.create(e));function x(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function O(a,c){var e;f(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=l(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return f(_,"constructor",{value:g.prototype=b,configurable:!0}),f(b,"constructor",{value:g,configurable:!0}),g.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},x(O.prototype),i(O.prototype,r,function(){return this}),a.AsyncIterator=O,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new O(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},x(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,E(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),d}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}function ownKeys(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{t.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yCanbusDevice";function t(t,a){e.$inject=["c8yDeviceDatabase","c8yDeviceControl","gettextCatalog","c8yDevices","c8yBase","c8yUser"];var c={label:a("CAN Bus"),fieldbusType:"canbus",serviceName:r};return t.getDeviceTypeProtocolProvider(c,e);function e(t,u,e,s,f,o){var r=_objectSpread(_objectSpread({},c),{},{discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{number:{label:a("Message ID"),useHex:!0,min:0,max:536870911},startBit:{max:63},noBits:{max:64},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,offset:{min:Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),max:Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1},options:{signed:!0,enumType:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CanDevice"],deviceConfiguration:{fragment:"c8y_CanConfiguration",icon:"share-alt"}});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(n().then(function(t){return t&&r}))},isAvailable:n,create:function(t,e){return i.apply(this,arguments)}};function n(){return t.isFeatureFieldbus4Available()}function i(){return(i=_asyncToGenerator(_regeneratorRuntime().mark(function t(o,i){var a,c;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,function(){return l.apply(this,arguments)}(o,i);case 2:return a=t.sent,t.t0=f,t.next=6,s.createConfirm(a);case 6:return t.t1=t.sent,c=t.t0.getResData.call(t.t0,t.t1),t.next=10,s.addChildDevice(o,c);case 10:return c.owner=o.owner,t.next=13,s.save(c);case 13:return t.abrupt("return",u.create((e=o,r=i.deviceType,n=c,{deviceId:e.id,description:'Added new child device to "'.concat(e.name,'" (ID: ').concat(e.id,")."),c8y_CanDevice:{id:n.id,name:n.name,type:"/inventory/managedObjects/".concat(r.id)}})));case 14:case"end":return t.stop()}var e,r,n},t)}))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){var n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.current();case 2:return n=t.sent,t.abrupt("return",{name:"".concat(e.name," - ").concat(r.deviceType.name),type:r.deviceType.name,c8y_CanDevice:{type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id,c8y_IsDevice:{}});case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}}}angular.module("c8y.canbus").provider(r,t)})();
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regenerator(){var v,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function n(e,t,r,n){var o,i,a,c,u,f,s,y,p,t=t&&t.prototype instanceof d?t:d,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(o=e,i=r,s=n||[],y=!1,p={p:f=0,n:0,v:v,a:l,f:l.bind(v,4),d:function(e,t){return a=e,c=0,u=v,p.n=t,b}},function(e,t,r){if(1<f)throw TypeError("Generator is already running");for(y&&1===t&&l(t,r),c=t,u=r;(m=c<2?v:u)||!y;){a||(c?c<3?(1<c&&(p.n=-1),l(c,u)):p.n=u:p.v=u);try{if(f=2,a){if(m=a[e=c?e:"next"]){if(!(m=m.call(a,u)))throw TypeError("iterator result is not an object");if(!m.done)return m;u=m.value,c<2&&(c=0)}else 1===c&&(m=a.return)&&m.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+e+"' method"),c=1);a=v}else if((m=(y=p.n<0)?u:o.call(i,p))!==b)break}catch(e){a=v,c=1,u=e}finally{f=1}}return{value:m,done:y}}),!0),t;function l(e,t){for(c=e,u=t,m=0;!y&&f&&!r&&m<s.length;m++){var r,n=s[m],o=p.p,i=n[2];3<e?(r=i===t)&&(u=n[(c=n[4])?5:c=3],n[4]=n[5]=v):n[0]<=o&&((r=e<2&&o<n[1])?(c=0,p.v=t,p.n=n[1]):o<i&&(r=e<3||n[0]>t||i<t)&&(n[4]=e,n[5]=t,p.n=i,c=0))}if(r||1<e)return b;throw y=!0,t}}var b={};function d(){}function o(){}function i(){}var m=Object.getPrototypeOf,e=[][t]?m(m([][t]())):(_regeneratorDefine2(m={},t,function(){return this}),m),a=i.prototype=d.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(a),e}return _regeneratorDefine2(a,"constructor",o.prototype=i),_regeneratorDefine2(i,"constructor",o),_regeneratorDefine2(i,r,o.displayName="GeneratorFunction"),_regeneratorDefine2(a),_regeneratorDefine2(a,r,"Generator"),_regeneratorDefine2(a,t,function(){return this}),_regeneratorDefine2(a,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:c}})()}function _regeneratorDefine2(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,t,r,n){t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:((n=function(t,r){_regeneratorDefine2(e,t,function(e){return this._invoke(t,r,e)})})("next",0),n("throw",1),n("return",2))})(e,t,r,n)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yCanbusDevice";function e(e,a){t.$inject=["c8yDeviceDatabase","c8yDeviceControl","gettextCatalog","c8yDevices","c8yBase","c8yUser"];var c={label:a("CAN Bus"),fieldbusType:"canbus",serviceName:r};return e.getDeviceTypeProtocolProvider(c,t);function t(e,f,t,s,y,o){var r=_objectSpread(_objectSpread({},c),{},{discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{number:{label:a("Message ID"),useHex:!0,min:0,max:536870911},startBit:{max:63},noBits:{max:64},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,offset:{min:Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),max:Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1},options:{signed:!0,enumType:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CanDevice"],deviceConfiguration:{fragment:"c8y_CanConfiguration",icon:"share-alt"}});return{registerFeaturesManifest:function(){e.registerFeaturesManifest(n().then(function(e){return e&&r}))},isAvailable:n,create:function(e,t){return i.apply(this,arguments)}};function n(){return e.isFeatureFieldbus4Available()}function i(){return(i=_asyncToGenerator(_regenerator().m(function e(o,i){var a,c,u;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,function(){return p.apply(this,arguments)}(o,i);case 1:return u=e.v,c=y,e.n=2,s.createConfirm(u);case 2:return u=e.v,a=c.getResData.call(c,u),e.n=3,s.addChildDevice(o,a);case 3:return a.owner=o.owner,e.n=4,s.save(a);case 4:return e.a(2,f.create((t=o,r=i.deviceType,n=a,{deviceId:t.id,description:'Added new child device to "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_CanDevice:{id:n.id,name:n.name,type:"/inventory/managedObjects/".concat(r.id)}})))}var t,r,n},e)}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regenerator().m(function e(t,r){var n;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.current();case 1:return n=e.v,e.a(2,{name:"".concat(t.name," - ").concat(r.deviceType.name),type:r.deviceType.name,c8y_CanDevice:{type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id,c8y_IsDevice:{}})}},e)}))).apply(this,arguments)}}}angular.module("c8y.canbus").provider(r,e)})();
@@ -1 +1 @@
1
- function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var s,a={},e=Object.prototype,u=e.hasOwnProperty,l=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(s){o=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i,o,a,c,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),r=new I(r||[]);return l(t,"_invoke",{value:(i=e,o=n,a=r,c=p,function(e,t){if(c===y)throw Error("Generator is already running");if(c===v){if("throw"===e)throw t;return{value:s,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var r=n.method,i=t.iterator[r];if(i===s)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;r=d(i,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,g;i=r.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,a);if(n){if(n===g)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===p)throw c=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;n=d(i,o,a);if("normal"===n.type){if(c=a.done?v:f,n.arg===g)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(c=v,a.method="throw",a.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var p="suspendedStart",f="suspendedYield",y="executing",v="completed",g={};function h(){}function m(){}function b(){}var t={},_=(o(t,r,function(){return this}),Object.getPrototypeOf),_=_&&_(_(O([]))),E=(_&&_!==e&&u.call(_,r)&&(t=_),b.prototype=h.prototype=Object.create(t));function w(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function S(a,c){var t;l(this,"_invoke",{value:function(n,r){function e(){return new c(function(e,t){!function t(e,n,r,i){var o,e=d(a[e],a,n);if("throw"!==e.type)return(n=(o=e.arg).value)&&"object"==_typeof(n)&&u.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)}):c.resolve(n).then(function(e){o.value=e,r(o)},function(e){return t("throw",e,r,i)});i(e.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function O(t){if(t||""===t){var n,e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(u.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=s,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return l(E,"constructor",{value:m.prototype=b,configurable:!0}),l(b,"constructor",{value:m,configurable:!0}),m.displayName=o(b,i,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,o(e,i,"GeneratorFunction")),e.prototype=Object.create(E),e},a.awrap=function(e){return{__await:e}},w(S.prototype),o(S.prototype,n,function(){return this}),a.AsyncIterator=S,a.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new S(c(e,t,n,r),i);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},w(E),o(E,i,"Generator"),o(E,r,function(){return this}),o(E,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=Object(e),r=[];for(t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=O,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=s)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return o.type="throw",o.arg=n,r.next=e,t&&(r.method="next",r.arg=s),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=u.call(i,"catchLoc"),c=u.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&u.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var o=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,r,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(n=i.completion).type&&(r=n.arg,R(i)),r}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=s),g}},a}function asyncGeneratorStep(e,t,n,r,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,i)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function i(e){asyncGeneratorStep(r,t,n,i,o,"next",e)}function o(e){asyncGeneratorStep(r,t,n,i,o,"throw",e)}i(void 0)})}}function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var i="c8yCanopenDevice";function e(e,t,n,m){r.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yModbusDevice","gettextCatalog","c8yInventory","c8yDevices","c8yBase","c8yUser","$q"];var b={label:m("CANopen"),fieldbusType:"canopen",serviceName:i};return e.getDeviceTypeProtocolProvider(b,r);function r(e,d,p,t,n,c,s,i,f){var r=s.createEnum(_.flatten([{name:"BOOLEAN",label:m("Boolean"),value:"boolean",edsValue:1,noBits:1},{name:"SIGNED_8",label:m("Signed (8-bits)"),value:"signed8",edsValue:2,noBits:8,signed:!0},{name:"SIGNED_16",label:m("Signed (16-bits)"),value:"signed16",edsValue:3,noBits:16,signed:!0},{name:"SIGNED_24",label:m("Signed (24-bits)"),value:"signed24",edsValue:16,noBits:24,signed:!0},{name:"SIGNED_32",label:m("Signed (32-bits)"),value:"signed32",edsValue:4,noBits:32,signed:!0},{name:"SIGNED_40",label:m("Signed (40-bits)"),value:"signed40",edsValue:18,noBits:40,signed:!0},{name:"SIGNED_48",label:m("Signed (48-bits)"),value:"signed48",edsValue:19,noBits:48,signed:!0},{name:"SIGNED_56",label:m("Signed (56-bits)"),value:"signed56",edsValue:20,noBits:56,signed:!0},{name:"SIGNED_64",label:m("Signed (64-bits)"),value:"signed64",edsValue:21,noBits:64,signed:!0},{name:"UNSIGNED_8",label:m("Unsigned (8-bits)"),value:"unsigned8",edsValue:5,noBits:8,signed:!1},{name:"UNSIGNED_16",label:m("Unsigned (16-bits)"),value:"unsigned16",edsValue:6,noBits:16,signed:!1},{name:"UNSIGNED_24",label:m("Unsigned (24-bits)"),value:"unsigned24",edsValue:22,noBits:24,signed:!1},{name:"UNSIGNED_32",label:m("Unsigned (32-bits)"),value:"unsigned32",edsValue:7,noBits:32,signed:!1},{name:"UNSIGNED_40",label:m("Unsigned (40-bits)"),value:"unsigned40",edsValue:24,noBits:40,signed:!1},{name:"UNSIGNED_48",label:m("Unsigned (48-bits)"),value:"unsigned48",edsValue:25,noBits:48,signed:!1},{name:"UNSIGNED_56",label:m("Unsigned (56-bits)"),value:"unsigned56",edsValue:26,noBits:56,signed:!1},{name:"UNSIGNED_64",label:m("Unsigned (64-bits)"),value:"unsigned64",edsValue:27,noBits:64,signed:!1},{name:"REAL_32",label:m("Real (32-bits)"),value:"real32",edsValue:8,noBits:32,decimalPlaces:null,baseValuesRange:{min:-3.4*Math.pow(10,38),max:3.4*Math.pow(10,38)}},{name:"REAL_64",label:m("Real (64-bits)"),value:"real64",edsValue:17,noBits:64,decimalPlaces:null,baseValuesRange:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE}}])),o=s.createEnum([{name:"READ_ONLY",label:m("Read-only"),value:"ro"},{name:"WRITE_ONLY",label:m("Write-only"),value:"wo"},{name:"READ_WRITE",label:m("Read-write"),value:"rw"},{name:"READ_WRITE_ON_PROCESS_INPUT",label:m("Read-write on process input"),value:"rwr"},{name:"READ_WRITE_ON_PROCESS_OUTPUT",label:m("Read-write on process output"),value:"rww"},{name:"CONSTANT",label:m("Constant"),value:"const"}]),a=_objectSpread(_objectSpread({},b),{},{type:"c8y_CANopenDeviceType",deviceType:!0,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:m("Variables"),noRegistersDefinedMessage:m("No variables defined."),elementTypeLabel:m("Variable"),newRegisterModalTitle:m("New variable"),editRegisterModalTitle:m('Edit variable: "{{name}}"'),addRegisterButtonLabel:m("Add variable"),unit:!0,validation:{invalidName:m("Name must be unique among variables."),invalidMeasurement:m("Selected measurement type and series are already used by another variable.")},index:{min:0,max:Math.pow(2,16)-1},subIndex:{min:0,max:Math.pow(2,8)-1},dataType:{choices:r},accessType:{choices:o},functionalities:{showStatus:{showIf:function(e){return _.includes([o.READ_ONLY,o.READ_WRITE,o.READ_WRITE_ON_PROCESS_INPUT,o.READ_WRITE_ON_PROCESS_OUTPUT,o.CONSTANT],_.get(e.meta,"accessType"))}},updateStatus:{showIf:function(e){return _.includes([o.READ_WRITE,o.READ_WRITE_ON_PROCESS_INPUT,o.READ_WRITE_ON_PROCESS_OUTPUT,o.WRITE_ONLY],_.get(e.meta,"accessType"))}},sendMeasurement:{showIf:u},raiseAlarm:{showIf:u,mask:!0},sendEvent:{showIf:u}}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CANopenDevice"],deviceConfiguration:{fragment:"c8y_CANopenConfiguration",icon:"cloud-network"},getRegisterSource:function(e){return{key:"c8y_CANopenSource",value:{index:e.index,subIndex:e.subIndex}}},customizeSmartRestTemplates:function(e){return h(e.responseTemplates,{msgId:201,condition:"$.c8y_SetRegister",pattern:["$.id","$.c8y_SetRegister.nodeId","$.c8y_SetRegister.index","$.c8y_SetRegister.subIndex","$.c8y_SetRegister.dataType","$.c8y_SetRegister.value"]}),h(e.responseTemplates,{msgId:202,condition:"$.c8y_CANopenAddDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenAddDevice.id","$.c8y_CANopenAddDevice.nodeId","$.c8y_CANopenAddDevice.type"]}),h(e.responseTemplates,{msgId:204,condition:"$.c8y_CANopenRemoveDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenDevice.nodeId"]}),e}});function u(e){return _.includes([o.READ_ONLY,o.READ_WRITE,o.READ_WRITE_ON_PROCESS_INPUT,o.READ_WRITE_ON_PROCESS_OUTPUT],_.get(e.meta,"accessType"))}return{registerFeaturesManifest:function(){e.registerFeaturesManifest(l().then(function(e){return e&&a}))},isAvailable:l,create:function(e,t){return y.apply(this,arguments)},updateElement:function(e,t,n){return g.apply(this,arguments)},onRemove:function(e,t){var n=t.id,r=t.name,t=t.nodeId;return d.create({deviceId:e.id,description:'Removed child device "'.concat(r,'" (ID: ').concat(n,")."),c8y_CANopenRemoveDevice:{id:n,name:r,nodeId:t}})}};function l(){return e.isFeatureFieldbus4Available()}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark(function e(r,i){var o,a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return v.apply(this,arguments)}(r,i);case 2:return o=e.sent,e.t0=s,e.next=6,c.createConfirm(o);case 6:return e.t1=e.sent,a=e.t0.getResData.call(e.t0,e.t1),e.next=10,c.addChildDevice(r,a);case 10:return a.owner=r.owner,e.next=13,c.save(a);case 13:return e.abrupt("return",d.create((t=i.deviceType,n=a,{deviceId:r.id,description:'Added child device "'.concat(n.name,'" (ID: ').concat(n.id,")."),c8y_CANopenAddDevice:{id:n.id,name:n.name,type:"/inventory/managedObjects/".concat(t.id),nodeId:n.c8y_CANopenDevice.nodeId}})));case 14:case"end":return e.stop()}var t,n},e)}))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,n){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.current();case 2:return r=e.sent,e.abrupt("return",{name:n.name,type:n.deviceType.name,c8y_CANopenDevice:{type:"/inventory/managedObjects/".concat(n.deviceType.id),nodeId:n.nodeId},c8y_SupportedOperations:["c8y_Command"],owner:r.id,c8y_IsDevice:{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(_regeneratorRuntime().mark(function e(a,c,s){var u,l;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(p.canUpdateElement(a,c)){e.next=2;break}return e.abrupt("return",f.reject());case 2:return o=i=r=n=void 0,n=(t={device:a,register:c,valueMap:s}).device,r=t.register,i=(t=t.valueMap).label||t.value,o=!t.label&&r.unit?" ".concat(r.unit):"",l={deviceId:n.id,description:'Change value of "'.concat(r.name,'" to ').concat(i).concat(o,"."),c8y_SetRegister:{nodeId:n.c8y_CANopenDevice.nodeId,index:r.index,subIndex:r.subIndex,dataType:r.dataType,value:t.value}},c.changePending=!0,u=p.getAlertMessagesFns(c,s),e.next=7,p.sendOperationAndGetResult(l,u);case 7:return(l=e.sent).status===d.status.SUCCESSFUL?(_.set(a,["c8y_RegisterStatus",c.name],s.value),c.changePending=!1):l.status===d.status.FAILED&&(c.changePending=!1),e.abrupt("return",l);case 10:case"end":return e.stop()}var t,n,r,i,o},e)}))).apply(this,arguments)}function h(e,t){var n=_.findIndex(e,{msgId:t.msgId});-1<n?e[n]=t:e.push(t)}}}angular.module("c8y.canopen").provider(i,e)})();
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regenerator(){var y,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",t=e.toStringTag||"@@toStringTag";function r(e,n,t,r){var i,a,o,s,c,u,d,l,p,n=n&&n.prototype instanceof _?n:_,n=Object.create(n.prototype);return _regeneratorDefine2(n,"_invoke",(i=e,a=t,d=r||[],l=!1,p={p:u=0,n:0,v:y,a:v,f:v.bind(y,4),d:function(e,n){return o=e,s=0,c=y,p.n=n,g}},function(e,n,t){if(1<u)throw TypeError("Generator is already running");for(l&&1===n&&v(n,t),s=n,c=t;(f=s<2?y:c)||!l;){o||(s?s<3?(1<s&&(p.n=-1),v(s,c)):p.n=c:p.v=c);try{if(u=2,o){if(f=o[e=s?e:"next"]){if(!(f=f.call(o,c)))throw TypeError("iterator result is not an object");if(!f.done)return f;c=f.value,s<2&&(s=0)}else 1===s&&(f=o.return)&&f.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+e+"' method"),s=1);o=y}else if((f=(l=p.n<0)?c:i.call(a,p))!==g)break}catch(e){o=y,s=1,c=e}finally{u=1}}return{value:f,done:l}}),!0),n;function v(e,n){for(s=e,c=n,f=0;!l&&u&&!t&&f<d.length;f++){var t,r=d[f],i=p.p,a=r[2];3<e?(t=a===n)&&(c=r[(s=r[4])?5:s=3],r[4]=r[5]=y):r[0]<=i&&((t=e<2&&i<r[1])?(s=0,p.v=n,p.n=r[1]):i<a&&(t=e<3||r[0]>n||a<n)&&(r[4]=e,r[5]=n,p.n=a,s=0))}if(t||1<e)return g;throw l=!0,n}}var g={};function _(){}function i(){}function a(){}var f=Object.getPrototypeOf,e=[][n]?f(f([][n]())):(_regeneratorDefine2(f={},n,function(){return this}),f),o=a.prototype=_.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,_regeneratorDefine2(e,t,"GeneratorFunction")),e.prototype=Object.create(o),e}return _regeneratorDefine2(o,"constructor",i.prototype=a),_regeneratorDefine2(a,"constructor",i),_regeneratorDefine2(a,t,i.displayName="GeneratorFunction"),_regeneratorDefine2(o),_regeneratorDefine2(o,t,"Generator"),_regeneratorDefine2(o,n,function(){return this}),_regeneratorDefine2(o,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:r,m:s}})()}function _regeneratorDefine2(e,n,t,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(_regeneratorDefine2=function(e,n,t,r){n?i?i(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:((r=function(n,t){_regeneratorDefine2(e,n,function(e){return this._invoke(n,t,e)})})("next",0),r("throw",1),r("return",2))})(e,n,t,r)}function asyncGeneratorStep(e,n,t,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void t(e)}s.done?n(c):Promise.resolve(c).then(r,i)}function _asyncToGenerator(s){return function(){var e=this,o=arguments;return new Promise(function(n,t){var r=s.apply(e,o);function i(e){asyncGeneratorStep(r,n,t,i,a,"next",e)}function a(e){asyncGeneratorStep(r,n,t,i,a,"throw",e)}i(void 0)})}}function ownKeys(n,e){var t,r=Object.keys(n);return Object.getOwnPropertySymbols&&(t=Object.getOwnPropertySymbols(n),e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.push.apply(r,t)),r}function _objectSpread(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(e){_defineProperty(n,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}return n}function _defineProperty(e,n,t){return(n=_toPropertyKey(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,n){if("object"!=_typeof(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);t=t.call(e,n||"default");if("object"!=_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var i="c8yCanopenDevice";function e(e,n,t,m){r.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yModbusDevice","gettextCatalog","c8yInventory","c8yDevices","c8yBase","c8yUser","$q"];var S={label:m("CANopen"),fieldbusType:"canopen",serviceName:i};return e.getDeviceTypeProtocolProvider(S,r);function r(e,l,p,n,t,c,u,i,v){var r=u.createEnum(_.flatten([{name:"BOOLEAN",label:m("Boolean"),value:"boolean",edsValue:1,noBits:1},{name:"SIGNED_8",label:m("Signed (8-bits)"),value:"signed8",edsValue:2,noBits:8,signed:!0},{name:"SIGNED_16",label:m("Signed (16-bits)"),value:"signed16",edsValue:3,noBits:16,signed:!0},{name:"SIGNED_24",label:m("Signed (24-bits)"),value:"signed24",edsValue:16,noBits:24,signed:!0},{name:"SIGNED_32",label:m("Signed (32-bits)"),value:"signed32",edsValue:4,noBits:32,signed:!0},{name:"SIGNED_40",label:m("Signed (40-bits)"),value:"signed40",edsValue:18,noBits:40,signed:!0},{name:"SIGNED_48",label:m("Signed (48-bits)"),value:"signed48",edsValue:19,noBits:48,signed:!0},{name:"SIGNED_56",label:m("Signed (56-bits)"),value:"signed56",edsValue:20,noBits:56,signed:!0},{name:"SIGNED_64",label:m("Signed (64-bits)"),value:"signed64",edsValue:21,noBits:64,signed:!0},{name:"UNSIGNED_8",label:m("Unsigned (8-bits)"),value:"unsigned8",edsValue:5,noBits:8,signed:!1},{name:"UNSIGNED_16",label:m("Unsigned (16-bits)"),value:"unsigned16",edsValue:6,noBits:16,signed:!1},{name:"UNSIGNED_24",label:m("Unsigned (24-bits)"),value:"unsigned24",edsValue:22,noBits:24,signed:!1},{name:"UNSIGNED_32",label:m("Unsigned (32-bits)"),value:"unsigned32",edsValue:7,noBits:32,signed:!1},{name:"UNSIGNED_40",label:m("Unsigned (40-bits)"),value:"unsigned40",edsValue:24,noBits:40,signed:!1},{name:"UNSIGNED_48",label:m("Unsigned (48-bits)"),value:"unsigned48",edsValue:25,noBits:48,signed:!1},{name:"UNSIGNED_56",label:m("Unsigned (56-bits)"),value:"unsigned56",edsValue:26,noBits:56,signed:!1},{name:"UNSIGNED_64",label:m("Unsigned (64-bits)"),value:"unsigned64",edsValue:27,noBits:64,signed:!1},{name:"REAL_32",label:m("Real (32-bits)"),value:"real32",edsValue:8,noBits:32,decimalPlaces:null,baseValuesRange:{min:-3.4*Math.pow(10,38),max:3.4*Math.pow(10,38)}},{name:"REAL_64",label:m("Real (64-bits)"),value:"real64",edsValue:17,noBits:64,decimalPlaces:null,baseValuesRange:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE}}])),a=u.createEnum([{name:"READ_ONLY",label:m("Read-only"),value:"ro"},{name:"WRITE_ONLY",label:m("Write-only"),value:"wo"},{name:"READ_WRITE",label:m("Read-write"),value:"rw"},{name:"READ_WRITE_ON_PROCESS_INPUT",label:m("Read-write on process input"),value:"rwr"},{name:"READ_WRITE_ON_PROCESS_OUTPUT",label:m("Read-write on process output"),value:"rww"},{name:"CONSTANT",label:m("Constant"),value:"const"}]),o=_objectSpread(_objectSpread({},S),{},{type:"c8y_CANopenDeviceType",deviceType:!0,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:m("Variables"),noRegistersDefinedMessage:m("No variables defined."),elementTypeLabel:m("Variable"),newRegisterModalTitle:m("New variable"),editRegisterModalTitle:m('Edit variable: "{{name}}"'),addRegisterButtonLabel:m("Add variable"),unit:!0,validation:{invalidName:m("Name must be unique among variables."),invalidMeasurement:m("Selected measurement type and series are already used by another variable.")},index:{min:0,max:Math.pow(2,16)-1},subIndex:{min:0,max:Math.pow(2,8)-1},dataType:{choices:r},accessType:{choices:a},functionalities:{showStatus:{showIf:function(e){return _.includes([a.READ_ONLY,a.READ_WRITE,a.READ_WRITE_ON_PROCESS_INPUT,a.READ_WRITE_ON_PROCESS_OUTPUT,a.CONSTANT],_.get(e.meta,"accessType"))}},updateStatus:{showIf:function(e){return _.includes([a.READ_WRITE,a.READ_WRITE_ON_PROCESS_INPUT,a.READ_WRITE_ON_PROCESS_OUTPUT,a.WRITE_ONLY],_.get(e.meta,"accessType"))}},sendMeasurement:{showIf:s},raiseAlarm:{showIf:s,mask:!0},sendEvent:{showIf:s}}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CANopenDevice"],deviceConfiguration:{fragment:"c8y_CANopenConfiguration",icon:"cloud-network"},getRegisterSource:function(e){return{key:"c8y_CANopenSource",value:{index:e.index,subIndex:e.subIndex}}},customizeSmartRestTemplates:function(e){return b(e.responseTemplates,{msgId:201,condition:"$.c8y_SetRegister",pattern:["$.id","$.c8y_SetRegister.nodeId","$.c8y_SetRegister.index","$.c8y_SetRegister.subIndex","$.c8y_SetRegister.dataType","$.c8y_SetRegister.value"]}),b(e.responseTemplates,{msgId:202,condition:"$.c8y_CANopenAddDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenAddDevice.id","$.c8y_CANopenAddDevice.nodeId","$.c8y_CANopenAddDevice.type"]}),b(e.responseTemplates,{msgId:204,condition:"$.c8y_CANopenRemoveDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenDevice.nodeId"]}),e}});function s(e){return _.includes([a.READ_ONLY,a.READ_WRITE,a.READ_WRITE_ON_PROCESS_INPUT,a.READ_WRITE_ON_PROCESS_OUTPUT],_.get(e.meta,"accessType"))}return{registerFeaturesManifest:function(){e.registerFeaturesManifest(d().then(function(e){return e&&o}))},isAvailable:d,create:function(e,n){return y.apply(this,arguments)},updateElement:function(e,n,t){return f.apply(this,arguments)},onRemove:function(e,n){var t=n.id,r=n.name,n=n.nodeId;return l.create({deviceId:e.id,description:'Removed child device "'.concat(r,'" (ID: ').concat(t,")."),c8y_CANopenRemoveDevice:{id:t,name:r,nodeId:n}})}};function d(){return e.isFeatureFieldbus4Available()}function y(){return(y=_asyncToGenerator(_regenerator().m(function e(r,i){var a,o,s;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,function(){return g.apply(this,arguments)}(r,i);case 1:return s=e.v,o=u,e.n=2,c.createConfirm(s);case 2:return s=e.v,a=o.getResData.call(o,s),e.n=3,c.addChildDevice(r,a);case 3:return a.owner=r.owner,e.n=4,c.save(a);case 4:return e.a(2,l.create((n=i.deviceType,t=a,{deviceId:r.id,description:'Added child device "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_CANopenAddDevice:{id:t.id,name:t.name,type:"/inventory/managedObjects/".concat(n.id),nodeId:t.c8y_CANopenDevice.nodeId}})))}var n,t},e)}))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(_regenerator().m(function e(n,t){var r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,i.current();case 1:return r=e.v,e.a(2,{name:t.name,type:t.deviceType.name,c8y_CANopenDevice:{type:"/inventory/managedObjects/".concat(t.deviceType.id),nodeId:t.nodeId},c8y_SupportedOperations:["c8y_Command"],owner:r.id,c8y_IsDevice:{}})}},e)}))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regenerator().m(function e(o,s,c){var u,d;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(p.canUpdateElement(o,s)){e.n=1;break}return e.a(2,v.reject());case 1:return a=i=r=t=void 0,t=(n={device:o,register:s,valueMap:c}).device,r=n.register,i=(n=n.valueMap).label||n.value,a=!n.label&&r.unit?" ".concat(r.unit):"",d={deviceId:t.id,description:'Change value of "'.concat(r.name,'" to ').concat(i).concat(a,"."),c8y_SetRegister:{nodeId:t.c8y_CANopenDevice.nodeId,index:r.index,subIndex:r.subIndex,dataType:r.dataType,value:n.value}},s.changePending=!0,u=p.getAlertMessagesFns(s,c),e.n=2,p.sendOperationAndGetResult(d,u);case 2:return(d=e.v).status===l.status.SUCCESSFUL?(_.set(o,["c8y_RegisterStatus",s.name],c.value),s.changePending=!1):d.status===l.status.FAILED&&(s.changePending=!1),e.a(2,d)}var n,t,r,i,a},e)}))).apply(this,arguments)}function b(e,n){var t=_.findIndex(e,{msgId:n.msgId});-1<t?e[t]=n:e.push(n)}}}angular.module("c8y.canopen").provider(i,e)})();
@@ -1 +1 @@
1
- function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},e=Object.prototype,s=e.hasOwnProperty,l=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(u){i=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o,i,a,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),n=new O(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=p,function(e,t){if(c===y)throw Error("Generator is already running");if(c===h){if("throw"===e)throw t;return{value:u,done:!0}}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,o=t.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=u,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===p)throw c=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=f(o,i,a);if("normal"===r.type){if(c=a.done?h:d,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=h,a.method="throw",a.arg=r.arg)}})}),t}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var p="suspendedStart",d="suspendedYield",y="executing",h="completed",v={};function m(){}function g(){}function b(){}var t={},_=(i(t,n,function(){return this}),Object.getPrototypeOf),_=_&&_(_(j([]))),w=(_&&_!==e&&s.call(_,n)&&(t=_),b.prototype=m.prototype=Object.create(t));function S(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function x(a,c){var t;l(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,o){var i,e=f(a[e],a,r);if("throw"!==e.type)return(r=(i=e.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):c.resolve(r).then(function(e){i.value=e,n(i)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function j(t){if(t||""===t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=u,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return l(w,"constructor",{value:g.prototype=b,configurable:!0}),l(b,"constructor",{value:g,configurable:!0}),g.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,i(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},S(x.prototype),i(x.prototype,r,function(){return this}),a.AsyncIterator=x,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new x(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},S(w),i(w,o,"Generator"),i(w,n,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=j,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,P(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var o="c8yModbusDevice";function e(e,t,r,E){n.$inject=["c8yDeviceDatabase","c8yDeviceControl","gettextCatalog","c8yInventory","c8yDevices","c8yAlert","c8yBase","c8yUser","$q"];var P={label:E("Modbus"),fieldbusType:"modbus",serviceName:o};return e.getDeviceTypeProtocolProvider(P,n);function n(l,f,s,e,u,o,p,i,d){var t=l.ElementType,y=t.DISCRETE_IO,h=t.REGISTER,n=_defineProperty(_defineProperty({},y.value,"c8y_CoilStatus"),h.value,"c8y_RegisterStatus"),r=_objectSpread(_objectSpread({},P),{},{discreteOutputs:{functionalities:{showStatus:!0,updateStatus:!0}},discreteInputs:{functionalities:{showStatus:!0,updateStatus:!1}},holdingRegisters:{number:!0,startBit:{max:15},noBits:{max:64,base:16},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0,littleEndian:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:{number:!0,startBit:{max:15},noBits:{max:64,base:16},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0,littleEndian:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},options:{serverTime:!0},deviceFragments:["c8y_ModbusDevice"],deviceConfiguration:{fragment:"c8y_ModbusConfiguration",icon:"microchip"},versions:[{number:5,checks:[function(e){return _.some(e.c8y_Registers,function(e){return 16<e.noBits})},function(e){return _.some(e.c8y_Registers,function(e){return!_.isUndefined(e.littleEndian)})}]}]});return{registerFeaturesManifest:function(){l.registerFeaturesManifest(a().then(function(e){return e&&r}))},isAvailable:a,create:function(e,t){return c.apply(this,arguments)},canUpdateElement:b,isElementChangePending:function(e){return e.changePending},getCurrentElementValue:m,getCurrentElementValueFormatted:function(e,t){e=m(e,t);t.meta.enumType&&(e=t.meta.enumValues[e].label);return e},updateElement:function(e,t,r){return g.apply(this,arguments)},getAlertMessagesFns:w,sendOperationAndGetResult:S};function a(){return l.isFeatureFieldbus4Available()}function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark(function e(o,i){var a,c;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return v.apply(this,arguments)}(o,i);case 2:return a=e.sent,e.t0=p,e.next=6,u.createConfirm(a);case 6:return e.t1=e.sent,c=e.t0.getResData.call(e.t0,e.t1),e.next=10,u.addChildDevice(o,c);case 10:return c.owner=o.owner,e.next=13,u.save(c);case 13:return e.abrupt("return",f.create((t=o,r=i.deviceType,n=c,{deviceId:t.id,description:'Added new child device to "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_ModbusDevice:{id:n.id,name:n.name,address:n.c8y_ModbusDevice.address,ipAddress:n.c8y_ModbusDevice.ipAddress,type:"/inventory/managedObjects/".concat(r.id),protocol:n.c8y_ModbusDevice.protocol}})));case 14:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.current();case 2:return n=e.sent,e.abrupt("return",{name:r.name,type:r.deviceType.name,c8y_ModbusDevice:{address:r.address,ipAddress:r.ipAddress,type:"/inventory/managedObjects/".concat(r.deviceType.id),protocol:r.protocol},owner:n.id,c8y_IsDevice:{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function m(e,t){var r=n[t.meta.type.value];return e&&e[r]&&parseFloat(e[r][t.name])}function g(){return(g=_asyncToGenerator(_regeneratorRuntime().mark(function e(i,a,c){var u,s;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(b(i,a))return e.next=3,l.getDeviceTypeFromDevice(i);e.next=12;break;case 3:return s=e.sent,s=((e,t,r,n)=>{var o,i,a,c,u=r.meta.type;return u===y?(a=r,c=n,{deviceId:(i=e).id,description:'Change status of "'.concat(a.name,'" to "').concat(c.label,'".'),c8y_SetCoil:{address:i.c8y_ModbusDevice.address,input:a.input,coil:a.number,value:c.value}}):u===h?(u=e,e=t,t=r,n=(r=n).label||r.value,o=!r.label&&t.unit?" ".concat(t.unit):"",n={deviceId:u.id,description:'Change value of "'.concat(t.name,'" to ').concat(n).concat(o,"."),c8y_SetRegister:{}},"opcua"===e.fieldbusType?n.c8y_SetRegister={address:u.c8y_OPCUADevice.browsePath,register:t.browsePath,value:r.value}:n.c8y_SetRegister={ipAddress:_.get(u,"c8y_ModbusDevice.ipAddress",""),address:u.c8y_ModbusDevice.address,input:t.input,register:t.number,startBit:t.startBit,noBits:t.noBits,value:r.value},n):void 0})(i,s,a,c),a.changePending=!0,u=w(a,c),e.next=9,S(s,u);case 9:return(s=e.sent).status===f.status.SUCCESSFUL?(t=i,n=c,o=void 0,(o=(r=a).meta.type)===y?_.set(t,["c8y_CoilStatus",r.name],n.value):o===h&&_.set(t,["c8y_RegisterStatus",r.name],n.value),a.changePending=!1):s.status===f.status.FAILED&&(a.changePending=!1),e.abrupt("return",s);case 12:return e.abrupt("return",d.reject());case 13:case"end":return e.stop()}var t,r,n,o},e)}))).apply(this,arguments)}function b(e,t){t=t.statusMapping;return!e.c8y_ModbusReadOnlyDevice&&t&&"write"===t.status}function w(e,t){function r(t){return function(e){return s.getString(t,_objectSpread(_objectSpread({},u),{},{operation:e}))}}var n,o,i,a,c=e.meta.type,u={name:e.name};c===y?(u.label=t.label,n=E("Status of {{name}} will be changed to {{label}}"),o=E("Status of {{name}} has been changed to {{label}}"),i=E("Failed to change status of {{name}} to {{label}}"),a=E('Failed to change status of {{name}} to {{label}} due to: "{{operation.failureReason | translate}}".')):c===h&&(u.value=t.label||t.value,u.unit=!t.label&&e.unit?" ".concat(e.unit):"",n=E("Value of {{name}} will be changed to {{value}}{{unit}}"),o=E("Value of {{name}} has been changed to {{value}}{{unit}}"),i=E("Failed to change value of {{name}} to {{value}}{{unit}}"),a=E('Failed to change value of {{name}} to {{value}}{{unit}} due to: "{{operation.failureReason | translate}}".'));return{onCreated:r(n),onSuccess:r(o),onFailure:r(i),onFailureWithReason:r(a)}}function S(e,t){return x.apply(this,arguments)}function x(){return(x=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.createWithNotifications(t);case 2:return(n=e.sent).created.then(function(){r.onCreated?o.success(r.onCreated(t)):o.success(s.getString('"{{description | translate}}" will be executed.',t))}),e.next=6,n.completed;case 6:return(n=e.sent).status===f.status.SUCCESSFUL?r.onSuccess?o.success(r.onSuccess(t)):o.success(s.getString('"{{description | translate}}" completed.',t)):n.status===f.status.FAILED&&(n.failureReason?r.onFailureWithReason?o.danger(r.onFailureWithReason(n)):o.danger(s.getString('"{{description | translate}}" failed due to: "{{failureReason | translate}}".',n)):r.onFailure?o.danger(r.onFailure(t)):o.danger(s.getString('"{{description | translate}}" failed.',t))),e.abrupt("return",n);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}}}angular.module("c8y.modbus").provider(o,e)})();
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regenerator(){var y,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var o,a,i,c,u,s,l,d,f,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(o=e,a=n,l=r||[],d=!1,f={p:s=0,n:0,v:y,a:p,f:p.bind(y,4),d:function(e,t){return i=e,c=0,u=y,f.n=t,v}},function(e,t,n){if(1<s)throw TypeError("Generator is already running");for(d&&1===t&&p(t,n),c=t,u=n;(m=c<2?y:u)||!d;){i||(c?c<3?(1<c&&(f.n=-1),p(c,u)):f.n=u:f.v=u);try{if(s=2,i){if(m=i[e=c?e:"next"]){if(!(m=m.call(i,u)))throw TypeError("iterator result is not an object");if(!m.done)return m;u=m.value,c<2&&(c=0)}else 1===c&&(m=i.return)&&m.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+e+"' method"),c=1);i=y}else if((m=(d=f.n<0)?u:o.call(a,f))!==v)break}catch(e){i=y,c=1,u=e}finally{s=1}}return{value:m,done:d}}),!0),t;function p(e,t){for(c=e,u=t,m=0;!d&&s&&!n&&m<l.length;m++){var n,r=l[m],o=f.p,a=r[2];3<e?(n=a===t)&&(u=r[(c=r[4])?5:c=3],r[4]=r[5]=y):r[0]<=o&&((n=e<2&&o<r[1])?(c=0,f.v=t,f.n=r[1]):o<a&&(n=e<3||r[0]>t||a<t)&&(r[4]=e,r[5]=t,f.n=a,c=0))}if(n||1<e)return v;throw d=!0,t}}var v={};function g(){}function o(){}function a(){}var m=Object.getPrototypeOf,e=[][t]?m(m([][t]())):(_regeneratorDefine2(m={},t,function(){return this}),m),i=a.prototype=g.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,_regeneratorDefine2(e,n,"GeneratorFunction")),e.prototype=Object.create(i),e}return _regeneratorDefine2(i,"constructor",o.prototype=a),_regeneratorDefine2(a,"constructor",o),_regeneratorDefine2(a,n,o.displayName="GeneratorFunction"),_regeneratorDefine2(i),_regeneratorDefine2(i,n,"Generator"),_regeneratorDefine2(i,t,function(){return this}),_regeneratorDefine2(i,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:r,m:c}})()}function _regeneratorDefine2(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,t,n,r){t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:((r=function(t,n){_regeneratorDefine2(e,t,function(e){return this._invoke(t,n,e)})})("next",0),r("throw",1),r("return",2))})(e,t,n,r)}function asyncGeneratorStep(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(c){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=c.apply(e,i);function o(e){asyncGeneratorStep(r,t,n,o,a,"next",e)}function a(e){asyncGeneratorStep(r,t,n,o,a,"throw",e)}o(void 0)})}}function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var o="c8yModbusDevice";function e(e,t,n,P){r.$inject=["c8yDeviceDatabase","c8yDeviceControl","gettextCatalog","c8yInventory","c8yDevices","c8yAlert","c8yBase","c8yUser","$q"];var O={label:P("Modbus"),fieldbusType:"modbus",serviceName:o};return e.getDeviceTypeProtocolProvider(O,r);function r(l,d,s,e,f,o,p,a,y){var t=l.ElementType,v=t.DISCRETE_IO,g=t.REGISTER,r=_defineProperty(_defineProperty({},v.value,"c8y_CoilStatus"),g.value,"c8y_RegisterStatus"),n=_objectSpread(_objectSpread({},O),{},{discreteOutputs:{functionalities:{showStatus:!0,updateStatus:!0}},discreteInputs:{functionalities:{showStatus:!0,updateStatus:!1}},holdingRegisters:{number:!0,startBit:{max:15},noBits:{max:64,base:16},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0,littleEndian:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:{number:!0,startBit:{max:15},noBits:{max:64,base:16},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0,littleEndian:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},options:{serverTime:!0},deviceFragments:["c8y_ModbusDevice"],deviceConfiguration:{fragment:"c8y_ModbusConfiguration",icon:"microchip"},versions:[{number:5,checks:[function(e){return _.some(e.c8y_Registers,function(e){return 16<e.noBits})},function(e){return _.some(e.c8y_Registers,function(e){return!_.isUndefined(e.littleEndian)})}]}]});return{registerFeaturesManifest:function(){l.registerFeaturesManifest(i().then(function(e){return e&&n}))},isAvailable:i,create:function(e,t){return c.apply(this,arguments)},canUpdateElement:h,isElementChangePending:function(e){return e.changePending},getCurrentElementValue:u,getCurrentElementValueFormatted:function(e,t){e=u(e,t);t.meta.enumType&&(e=t.meta.enumValues[e].label);return e},updateElement:function(e,t,n){return b.apply(this,arguments)},getAlertMessagesFns:S,sendOperationAndGetResult:D};function i(){return l.isFeatureFieldbus4Available()}function c(){return(c=_asyncToGenerator(_regenerator().m(function e(o,a){var i,c,u;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,function(){return m.apply(this,arguments)}(o,a);case 1:return u=e.v,c=p,e.n=2,f.createConfirm(u);case 2:return u=e.v,i=c.getResData.call(c,u),e.n=3,f.addChildDevice(o,i);case 3:return i.owner=o.owner,e.n=4,f.save(i);case 4:return e.a(2,d.create((t=o,n=a.deviceType,r=i,{deviceId:t.id,description:'Added new child device to "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_ModbusDevice:{id:r.id,name:r.name,address:r.c8y_ModbusDevice.address,ipAddress:r.c8y_ModbusDevice.ipAddress,type:"/inventory/managedObjects/".concat(n.id),protocol:r.c8y_ModbusDevice.protocol}})))}var t,n,r},e)}))).apply(this,arguments)}function m(){return(m=_asyncToGenerator(_regenerator().m(function e(t,n){var r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.current();case 1:return r=e.v,e.a(2,{name:n.name,type:n.deviceType.name,c8y_ModbusDevice:{address:n.address,ipAddress:n.ipAddress,type:"/inventory/managedObjects/".concat(n.deviceType.id),protocol:n.protocol},owner:r.id,c8y_IsDevice:{}})}},e)}))).apply(this,arguments)}function u(e,t){var n=r[t.meta.type.value];return e&&e[n]&&parseFloat(e[n][t.name])}function b(){return(b=_asyncToGenerator(_regenerator().m(function e(a,i,c){var u,s;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(h(a,i))return e.n=1,l.getDeviceTypeFromDevice(a);e.n=3;break;case 1:return s=e.v,s=((e,t,n,r)=>{var o,a,i,c,u=n.meta.type;return u===v?(i=n,c=r,{deviceId:(a=e).id,description:'Change status of "'.concat(i.name,'" to "').concat(c.label,'".'),c8y_SetCoil:{address:a.c8y_ModbusDevice.address,input:i.input,coil:i.number,value:c.value}}):u===g?(u=e,e=t,t=n,r=(n=r).label||n.value,o=!n.label&&t.unit?" ".concat(t.unit):"",r={deviceId:u.id,description:'Change value of "'.concat(t.name,'" to ').concat(r).concat(o,"."),c8y_SetRegister:{}},"opcua"===e.fieldbusType?r.c8y_SetRegister={address:u.c8y_OPCUADevice.browsePath,register:t.browsePath,value:n.value}:r.c8y_SetRegister={ipAddress:_.get(u,"c8y_ModbusDevice.ipAddress",""),address:u.c8y_ModbusDevice.address,input:t.input,register:t.number,startBit:t.startBit,noBits:t.noBits,value:n.value},r):void 0})(a,s,i,c),i.changePending=!0,u=S(i,c),e.n=2,D(s,u);case 2:return(s=e.v).status===d.status.SUCCESSFUL?(t=a,r=c,o=void 0,(o=(n=i).meta.type)===v?_.set(t,["c8y_CoilStatus",n.name],r.value):o===g&&_.set(t,["c8y_RegisterStatus",n.name],r.value),i.changePending=!1):s.status===d.status.FAILED&&(i.changePending=!1),e.a(2,s);case 3:return e.a(2,y.reject())}var t,n,r,o},e)}))).apply(this,arguments)}function h(e,t){t=t.statusMapping;return!e.c8y_ModbusReadOnlyDevice&&t&&"write"===t.status}function S(e,t){function n(t){return function(e){return s.getString(t,_objectSpread(_objectSpread({},u),{},{operation:e}))}}var r,o,a,i,c=e.meta.type,u={name:e.name};c===v?(u.label=t.label,r=P("Status of {{name}} will be changed to {{label}}"),o=P("Status of {{name}} has been changed to {{label}}"),a=P("Failed to change status of {{name}} to {{label}}"),i=P('Failed to change status of {{name}} to {{label}} due to: "{{operation.failureReason | translate}}".')):c===g&&(u.value=t.label||t.value,u.unit=!t.label&&e.unit?" ".concat(e.unit):"",r=P("Value of {{name}} will be changed to {{value}}{{unit}}"),o=P("Value of {{name}} has been changed to {{value}}{{unit}}"),a=P("Failed to change value of {{name}} to {{value}}{{unit}}"),i=P('Failed to change value of {{name}} to {{value}}{{unit}} due to: "{{operation.failureReason | translate}}".'));return{onCreated:n(r),onSuccess:n(o),onFailure:n(a),onFailureWithReason:n(i)}}function D(e,t){return w.apply(this,arguments)}function w(){return(w=_asyncToGenerator(_regenerator().m(function e(t,n){var r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,d.createWithNotifications(t);case 1:return(r=e.v).created.then(function(){n.onCreated?o.success(n.onCreated(t)):o.success(s.getString('"{{description | translate}}" will be executed.',t))}),e.n=2,r.completed;case 2:return(r=e.v).status===d.status.SUCCESSFUL?n.onSuccess?o.success(n.onSuccess(t)):o.success(s.getString('"{{description | translate}}" completed.',t)):r.status===d.status.FAILED&&(r.failureReason?n.onFailureWithReason?o.danger(n.onFailureWithReason(r)):o.danger(s.getString('"{{description | translate}}" failed due to: "{{failureReason | translate}}".',r)):n.onFailure?o.danger(n.onFailure(t)):o.danger(s.getString('"{{description | translate}}" failed.',t))),e.a(2,r)}},e)}))).apply(this,arguments)}}}angular.module("c8y.modbus").provider(o,e)})();
@@ -1 +1 @@
1
- function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},e=Object.prototype,s=e.hasOwnProperty,l=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(u){i=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o,i,a,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),n=new L(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=y,function(e,t){if(c===h)throw Error("Generator is already running");if(c===d){if("throw"===e)throw t;return{value:u,done:!0}}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,o=t.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=u,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===y)throw c=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=h;r=f(o,i,a);if("normal"===r.type){if(c=a.done?d:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=d,a.method="throw",a.arg=r.arg)}})}),t}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var y="suspendedStart",p="suspendedYield",h="executing",d="completed",v={};function m(){}function g(){}function b(){}var t={},w=(i(t,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(S([]))),O=(w&&w!==e&&s.call(w,n)&&(t=w),b.prototype=m.prototype=Object.create(t));function _(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function P(a,c){var t;l(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,o){var i,e=f(a[e],a,r);if("throw"!==e.type)return(r=(i=e.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):c.resolve(r).then(function(e){i.value=e,n(i)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function S(t){if(t||""===t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=u,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return l(O,"constructor",{value:g.prototype=b,configurable:!0}),l(b,"constructor",{value:g,configurable:!0}),g.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,i(e,o,"GeneratorFunction")),e.prototype=Object.create(O),e},a.awrap=function(e){return{__await:e}},_(P.prototype),i(P.prototype,r,function(){return this}),a.AsyncIterator=P,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new P(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},_(O),i(O,o,"Generator"),i(O,n,function(){return this}),i(O,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=S,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,x(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yOPCUADevice";function e(e,c){t.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yDevices","c8yBase","c8yUser","c8yTenant","$q"];var y={label:c("OPC UA legacy"),fieldbusType:"opcua",serviceName:r};return e.getDeviceTypeProtocolProvider(y,t);function t(t,u,s,l,o,r,n){var i=_objectSpread(_objectSpread({},y),{},{options:!1,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:c("Variables"),noRegistersDefinedMessage:c("No variables defined."),elementTypeLabel:c("Variable"),newRegisterModalTitle:c("New variable"),editRegisterModalTitle:c('Edit variable: "{{name}}"'),addRegisterButtonLabel:c("Add variable"),validation:{invalidName:c("Name must be unique among variables."),invalidMeasurement:c("Selected measurement type and series are already used by another variable.")},browsePath:!0,nodeType:!0,attributeType:!0,multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,deviceFragments:["c8y_OPCUADevice","c8y_OPCUAGateway"],deviceConfiguration:{fragment:"c8y_OPCUAGateway",icon:"cogs"}});return{registerFeaturesManifest:function(){t.registerFeaturesManifest((()=>{var e={isFeatureFieldbus4Subscribed:t.isFeatureFieldbus4Available(),isOpcuaLegacySubscribed:r.isSubscribed({name:"feature-opcua-legacy"})};return n.all(e).then(function(e){return e.isFeatureFieldbus4Subscribed&&e.isOpcuaLegacySubscribed})})().then(function(e){return e&&i}))},create:function(e,t){return a.apply(this,arguments)},isOpcua:function(e){return!!(e||{}).c8y_OPCUADevice}};function a(){return(a=_asyncToGenerator(_regeneratorRuntime().mark(function e(o,i){var a,c;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return f.apply(this,arguments)}(o,i);case 2:return a=e.sent,e.t0=l,e.next=6,s.createConfirm(a);case 6:return e.t1=e.sent,c=e.t0.getResData.call(e.t0,e.t1),e.next=10,s.addChildDevice(o,c);case 10:return c.owner=o.owner,e.next=13,s.save(c);case 13:return e.abrupt("return",u.create((t=o,r=i.deviceType,n=c,{deviceId:t.id,description:'Added new child device to "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_OPCUADevice:{id:n.id,name:n.name,browsePath:n.c8y_OPCUADevice.browsePath,type:"/inventory/managedObjects/".concat(r.id)}})));case 14:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.current();case 2:return n=e.sent,e.abrupt("return",{name:r.name,type:r.deviceType.name,c8y_OPCUADevice:{browsePath:r.directoryPath,type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}}}angular.module("c8y.opcua").provider(r,e)})();
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regenerator(){var d,e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",t=e.toStringTag||"@@toStringTag";function n(e,r,t,n){var o,i,a,c,u,s,f,y,p,r=r&&r.prototype instanceof v?r:v,r=Object.create(r.prototype);return _regeneratorDefine2(r,"_invoke",(o=e,i=t,f=n||[],y=!1,p={p:s=0,n:0,v:d,a:l,f:l.bind(d,4),d:function(e,r){return a=e,c=0,u=d,p.n=r,b}},function(e,r,t){if(1<s)throw TypeError("Generator is already running");for(y&&1===r&&l(r,t),c=r,u=t;(g=c<2?d:u)||!y;){a||(c?c<3?(1<c&&(p.n=-1),l(c,u)):p.n=u:p.v=u);try{if(s=2,a){if(g=a[e=c?e:"next"]){if(!(g=g.call(a,u)))throw TypeError("iterator result is not an object");if(!g.done)return g;u=g.value,c<2&&(c=0)}else 1===c&&(g=a.return)&&g.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+e+"' method"),c=1);a=d}else if((g=(y=p.n<0)?u:o.call(i,p))!==b)break}catch(e){a=d,c=1,u=e}finally{s=1}}return{value:g,done:y}}),!0),r;function l(e,r){for(c=e,u=r,g=0;!y&&s&&!t&&g<f.length;g++){var t,n=f[g],o=p.p,i=n[2];3<e?(t=i===r)&&(u=n[(c=n[4])?5:c=3],n[4]=n[5]=d):n[0]<=o&&((t=e<2&&o<n[1])?(c=0,p.v=r,p.n=n[1]):o<i&&(t=e<3||n[0]>r||i<r)&&(n[4]=e,n[5]=r,p.n=i,c=0))}if(t||1<e)return b;throw y=!0,r}}var b={};function v(){}function o(){}function i(){}var g=Object.getPrototypeOf,e=[][r]?g(g([][r]())):(_regeneratorDefine2(g={},r,function(){return this}),g),a=i.prototype=v.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,_regeneratorDefine2(e,t,"GeneratorFunction")),e.prototype=Object.create(a),e}return _regeneratorDefine2(a,"constructor",o.prototype=i),_regeneratorDefine2(i,"constructor",o),_regeneratorDefine2(i,t,o.displayName="GeneratorFunction"),_regeneratorDefine2(a),_regeneratorDefine2(a,t,"Generator"),_regeneratorDefine2(a,r,function(){return this}),_regeneratorDefine2(a,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:c}})()}function _regeneratorDefine2(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,r,t,n){r?o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t:((n=function(r,t){_regeneratorDefine2(e,r,function(e){return this._invoke(r,t,e)})})("next",0),n("throw",1),n("return",2))})(e,r,t,n)}function asyncGeneratorStep(e,r,t,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void t(e)}c.done?r(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(r,t){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,r,t,o,i,"next",e)}function i(e){asyncGeneratorStep(n,r,t,o,i,"throw",e)}o(void 0)})}}function ownKeys(r,e){var t,n=Object.keys(r);return Object.getOwnPropertySymbols&&(t=Object.getOwnPropertySymbols(r),e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.push.apply(n,t)),n}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(e){_defineProperty(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,r){if("object"!=_typeof(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);t=t.call(e,r||"default");if("object"!=_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var t="c8yOPCUADevice";function e(e,c){r.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yDevices","c8yBase","c8yUser","c8yTenant","$q"];var u={label:c("OPC UA legacy"),fieldbusType:"opcua",serviceName:t};return e.getDeviceTypeProtocolProvider(u,r);function r(r,s,f,y,o,t,n){var i=_objectSpread(_objectSpread({},u),{},{options:!1,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:c("Variables"),noRegistersDefinedMessage:c("No variables defined."),elementTypeLabel:c("Variable"),newRegisterModalTitle:c("New variable"),editRegisterModalTitle:c('Edit variable: "{{name}}"'),addRegisterButtonLabel:c("Add variable"),validation:{invalidName:c("Name must be unique among variables."),invalidMeasurement:c("Selected measurement type and series are already used by another variable.")},browsePath:!0,nodeType:!0,attributeType:!0,multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,deviceFragments:["c8y_OPCUADevice","c8y_OPCUAGateway"],deviceConfiguration:{fragment:"c8y_OPCUAGateway",icon:"cogs"}});return{registerFeaturesManifest:function(){r.registerFeaturesManifest((()=>{var e={isFeatureFieldbus4Subscribed:r.isFeatureFieldbus4Available(),isOpcuaLegacySubscribed:t.isSubscribed({name:"feature-opcua-legacy"})};return n.all(e).then(function(e){return e.isFeatureFieldbus4Subscribed&&e.isOpcuaLegacySubscribed})})().then(function(e){return e&&i}))},create:function(e,r){return a.apply(this,arguments)},isOpcua:function(e){return!!(e||{}).c8y_OPCUADevice}};function a(){return(a=_asyncToGenerator(_regenerator().m(function e(o,i){var a,c,u;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,function(){return p.apply(this,arguments)}(o,i);case 1:return u=e.v,c=y,e.n=2,f.createConfirm(u);case 2:return u=e.v,a=c.getResData.call(c,u),e.n=3,f.addChildDevice(o,a);case 3:return a.owner=o.owner,e.n=4,f.save(a);case 4:return e.a(2,s.create((r=o,t=i.deviceType,n=a,{deviceId:r.id,description:'Added new child device to "'.concat(r.name,'" (ID: ').concat(r.id,")."),c8y_OPCUADevice:{id:n.id,name:n.name,browsePath:n.c8y_OPCUADevice.browsePath,type:"/inventory/managedObjects/".concat(t.id)}})))}var r,t,n},e)}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regenerator().m(function e(r,t){var n;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.current();case 1:return n=e.v,e.a(2,{name:t.name,type:t.deviceType.name,c8y_OPCUADevice:{browsePath:t.directoryPath,type:"/inventory/managedObjects/".concat(t.deviceType.id)},owner:n.id})}},e)}))).apply(this,arguments)}}}angular.module("c8y.opcua").provider(t,e)})();