@c8y/ng1-modules 1019.24.6 → 1020.0.4
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.
- package/NOTICES +8357 -6666
- package/app-logs/app-logs.service.js +1 -1
- package/asset-notes/assetNotes.component.js +1 -1
- package/assetPropertyWidget/main.controller.js +1 -1
- package/cell-id-information-activator/cell-id-information-activator.config.js +1 -1
- package/cell-id-information-activator/cell-id-information-activator.service.js +1 -1
- package/cell-id-usage-statistics/cell-id-usage-statistics.component.js +1 -1
- package/cell-id-usage-statistics/cell-id-usage-statistics.service.js +1 -1
- package/commandTemplates/controllers/commandTemplates.js +1 -1
- package/commandTemplates/views/commandTemplates.html +83 -41
- package/core/core/services/alarms.js +1 -1
- package/core/core/services/application.js +1 -1
- package/core/core/services/auth.js +1 -1
- package/core/core/services/base.js +1 -1
- package/core/core/services/deviceShell.js +1 -1
- package/core/core/services/devices.js +1 -1
- package/core/core/services/dynamicGroups.js +1 -1
- package/core/core/services/geo.js +1 -1
- package/core/core/services/groups.js +1 -1
- package/core/core/services/inventory.js +1 -1
- package/core/core/services/kpi.js +1 -1
- package/core/core/services/measurements.js +1 -1
- package/core/core/services/settings.js +1 -1
- package/core/core/services/tenant.js +1 -1
- package/core/core/services/user.js +1 -1
- package/core/core/services/util.js +1 -1
- package/core/locales/de.po +553 -306
- package/core/locales/en.po +69 -0
- package/core/locales/es.po +562 -314
- package/core/locales/fr.po +560 -313
- package/core/locales/ja_JP.po +587 -299
- package/core/locales/ko.po +334 -327
- package/core/locales/nl.po +636 -389
- package/core/locales/pl.po +558 -310
- package/core/locales/pt_BR.po +575 -328
- package/core/locales/ru.po +21 -320
- package/core/locales/zh_CN.po +330 -323
- package/core/locales/zh_TW.po +330 -323
- package/core/ui/components/passwordStrengthChecklist.html +1 -1
- package/core/ui/configurable-device-list-columns/configurable-columns.service.js +1 -1
- package/core/ui/configurable-device-list-columns/modal-columns-configure.component.js +1 -1
- package/core/ui/controllers/deviceList.js +1 -1
- package/core/ui/controllers/eventList.js +1 -1
- package/core/ui/csvExporter/csvExporter.controller.js +1 -1
- package/core/ui/directives/alarmList.js +1 -1
- package/core/ui/directives/map.js +1 -1
- package/core/ui/directives/map2.js +1 -1
- package/core/ui/operations/operations-timeline.html +24 -10
- package/core/ui/properties/lastDeviceMessage.computedProperty.js +1 -1
- package/core/ui/schemaForm/schemaForm.component.js +1 -1
- package/core/ui/services/deviceListColumns.js +1 -1
- package/core/ui/services/measurementsReport.js +1 -1
- package/core/ui/user/editUser.directive.html +2 -0
- package/core/ui/views/eventList.html +3 -1
- package/dataBroker/connectors/connectors.html +1 -0
- package/dataBroker/connectorsAlarms/connectorAlarms.component.js +1 -1
- package/device-protocol-actility/actility-device.provider.js +1 -1
- package/device-protocol-canbus/canbus-device.provider.js +1 -1
- package/device-protocol-canopen/canopen-device.provider.js +1 -1
- package/device-protocol-deviceDatabase4/device-type-protocol-base.provider.js +1 -1
- package/device-protocol-lora/lora-device.provider.js +1 -1
- package/device-protocol-lpwan/lpwan-device.provider.js +1 -1
- package/device-protocol-modbus/modbus-device.provider.js +1 -1
- package/device-protocol-opcua/opcua-device.provider.js +1 -1
- package/device-protocol-profibus/profibus-device.provider.js +1 -1
- package/device-protocol-sigfox/sigfox-device.provider.js +1 -1
- package/device-protocol-snmp/snmp-device.provider.js +1 -1
- package/device-protocols/device-protocol-import-button.component.js +1 -1
- package/deviceDatabase4/detail/device-type-detail.component.js +1 -1
- package/deviceDatabase4/device-database.service.js +1 -1
- package/deviceDatabase4/device-type-list.component.js +1 -1
- package/deviceDatabase4/modals/configure-discrete-io.component.js +1 -1
- package/deviceDatabase4/modals/configure-register.component.js +1 -1
- package/deviceDatabase4/modals/import-device-type.component.js +1 -1
- package/deviceDatabase4/unique.directive.js +1 -1
- package/deviceDetail/cumulocity.json +0 -1
- package/deviceSelector/controllers/deviceSelectorComboCtrl.js +1 -1
- package/deviceStatusWidget/deviceStatus.component.js +1 -1
- package/deviceStatusWidget/ownerStatus.component.js +1 -1
- package/devicemanagement-availability/controllers/availability.js +1 -1
- package/devicemanagement-availability/views/detail.html +2 -2
- package/devicemanagement-eventList/controllers/eventList.js +1 -1
- package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +1 -1
- package/enterpriseEdition/sslCertificate/manageCertificateForm.html +1 -1
- package/eventList/eventList.controller.js +1 -1
- package/generic-ui/generic-ui-inventory-property.component.js +1 -1
- package/groupsHierarchy/controllers/groupsListCtrl.js +1 -1
- package/kpi/controllers/pieChart.js +1 -1
- package/measurements/fragmentChart/fragmentChart.component.js +1 -1
- package/modbusConfiguration4/fieldbus-config.component.js +1 -1
- package/modbusConfiguration4/fieldbus-device-list.component.js +1 -1
- package/modbusWidget4/modbus-widget.service.js +1 -1
- package/modbusWidget4/widget-config.component.js +1 -1
- package/modbusWidget4/widget.component.js +1 -1
- package/package.json +5 -5
- package/remoteAccess/remoteAccess.service.js +1 -1
- package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +1 -1
- package/roles/detail/roleDetailInventory.html +33 -14
- package/scada/mapping.directive.js +1 -1
- package/simulators/simulatorsUi.provider.js +1 -1
- package/smartRestEditor/views/list.html +1 -0
- package/smartRules/directives/smartRuleParamInputKpi.js +1 -1
- package/smartRules/list/smartRulesList.html +25 -0
- package/smartRules/views/edit.html +95 -27
- package/smartRules/views/list.html +39 -5
- package/tenantStatistics/tenant-statistics.component.js +1 -1
- package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
- package/users/userListView/userListView.component.js +1 -1
- package/users/userListView/userListView.html +1 -0
- package/users/userRemovalModal/userRemovalModal.component.html +1 -0
- package/alarmAssets/cumulocity.json +0 -14
- package/alarmAssets/img/all-critical-alarms-widget-pr.png +0 -0
- package/alarmAssets/index.js +0 -1
- package/alarmAssets/views/component.html +0 -8
- package/alarms/cumulocity.json +0 -21
- package/alarms/img/alarm-list-widget-pr.png +0 -0
- package/alarms/index.js +0 -1
- package/alarms/index.mock.js +0 -1
- package/alarms/severity.directive.js +0 -1
- package/alarms/severity.html +0 -13
- package/alarms/styles.css +0 -3
- package/alarms/widget-config.controller.js +0 -1
- package/alarms/widget-config.html +0 -116
- package/alarms/widget.config.js +0 -1
- package/alarms/widget.controller.js +0 -1
- package/alarms/widget.html +0 -15
- package/alarms/widget.module.js +0 -1
- package/alarms/widget.module.mock.js +0 -1
- package/cockpit-alarmRecent/cumulocity.json +0 -18
- package/cockpit-alarmRecent/img/recent-alarms-widget-pr.png +0 -0
- package/cockpit-alarmRecent/index.js +0 -1
- package/cockpit-alarmRecent/views/component.html +0 -7
- package/devicemanagement-aclManagement/controllers/aclManagementCtrl.js +0 -1
- package/devicemanagement-aclManagement/cumulocity.json +0 -21
- package/devicemanagement-aclManagement/index.js +0 -1
- package/devicemanagement-aclManagement/views/index.html +0 -207
- package/devicemanagement-alarmList/controllers/alarmList.js +0 -1
- package/devicemanagement-alarmList/cumulocity.json +0 -24
- package/devicemanagement-alarmList/gallery/alarms.png +0 -0
- package/devicemanagement-alarmList/index.js +0 -1
- package/devicemanagement-alarmList/views/index.html +0 -155
- package/devicemanagement-tracking/controllers/config.js +0 -1
- package/devicemanagement-tracking/controllers/tracking.js +0 -1
- package/devicemanagement-tracking/cumulocity.json +0 -19
- package/devicemanagement-tracking/index.js +0 -1
- package/devicemanagement-tracking/views/index.html +0 -103
- package/devicemanagement-vendMeDeviceControl/controllers/vendMeDeviceControl.js +0 -1
- package/devicemanagement-vendMeDeviceControl/cumulocity.json +0 -18
- package/devicemanagement-vendMeDeviceControl/index.js +0 -1
- package/devicemanagement-vendMeDeviceControl/views/index.html +0 -229
|
@@ -76,7 +76,9 @@
|
|
|
76
76
|
<c8y-refresh-btn></c8y-refresh-btn>
|
|
77
77
|
</c8y-ui-action-bar-set>
|
|
78
78
|
|
|
79
|
-
<c8y-breadcrumbs-set
|
|
79
|
+
<c8y-breadcrumbs-set
|
|
80
|
+
ng-if="!$parent.child.templateUrl && !hideHeaderActions && ctrl.showOverviewBreadcrumbs"
|
|
81
|
+
>
|
|
80
82
|
<c8y-breadcrumbs-item
|
|
81
83
|
icon="c8y-events"
|
|
82
84
|
label="{{ 'Events' | translate }}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:
|
|
1
|
+
"use strict";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 _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),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.")}!function(){function e(e,n,t,r,o){var i=this,c=(_.assign(i,{$onInit:function(){var e=_.reverse(_.cloneDeep(r.severityList));i.severities=_.map(e,function(e){return new c(e)}),o.getConnector(i.connectorId).then(function(e){i.connector=e}),t.list({type:"c8y_DataBroker"}).then(s).then(a)},realtime:!0,icon:r.icon,refresh:function(){e.$broadcast("alarmListRefresh")},isRefreshing:function(){return _.some(i.severities,"refreshing")}}),function(){return _createClass(function e(t){_classCallCheck(this,e),this.pActive=new WeakMap,this.pFilters=new WeakMap,this.name=t,this.active=!1,this.filters={}},[{key:"active",get:function(){return this.pActive.get(this)},set:function(e){this.pActive.set(this,e)}},{key:"toggleActive",value:function(){this.active=!this.active}},{key:"filters",get:function(){return this.pFilters.get(this)},set:function(e){this.pFilters.set(this,e)}}])}());function s(e){return _.map(e,function(e){return e.id})}function a(t){_.each(i.severities,function(e){e.filters={severity:e.name,sources:t,displayFilter:function(e){return _.isUndefined(e.connectorId)||e.connectorId===n.connectorId},resolved:!1},e.active=!0}),_.set(i,"options.sources",t)}}e.$inject=["$scope","$routeParams","c8yInventory","c8yAlarms","dataBrokerConnectorsSvc"],angular.module("c8y.dataBroker").component("c8yDataBrokerConnectorAlarms",{templateUrl:":::PLUGIN_PATH:::/connectorsAlarms/connectorAlarms.html",controllerAs:"vm",controller:e,bindings:{connectorId:"<id"}})}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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:
|
|
1
|
+
"use strict";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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yActilityDevice";function e(e,s){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var l={label:s("LoRa"),fieldbusType:"actility",serviceName:r};return e.getDeviceTypeProtocolProvider(l,t);function t(e,t,r){var n={name:"actility"},i={name:"loriot-agent"},o=[t.MessageIdSources.FPORT,t.MessageIdSources.PAYLOAD],a=_objectSpread(_objectSpread({},l),{},{type:"c8y_ActilityDeviceType",noNewProtocolInstances:!0,configuration:{messageIdConfiguration:o},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:s("Values"),noRegistersDefinedMessage:s("No values defined."),newRegisterModalTitle:s("New value"),editRegisterModalTitle:s('Edit value: "{{name}}"'),addRegisterButtonLabel:s("Add value"),validation:{invalidName:s("Name must be unique among values."),invalidMeasurement:s("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:s("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(u().then(function(e){return e&&a}))},isSubscribed:u};function u(){return e.all([r.isSubscribed(n),r.isSubscribed(i)]).then(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];return t||e})}}}angular.module("c8y.actility").provider(r,e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 new 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 new 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 new 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:String(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(){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});case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}}}angular.module("c8y.canbus").provider(r,t)}();
|
|
1
|
+
"use strict";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.")}!function(){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});case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}}}angular.module("c8y.canbus").provider(r,t)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 new 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 new 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 new 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:String(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.")}!function(){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});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,t=t.valueMap,i=t.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
|
+
"use strict";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.")}!function(){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});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,t=t.valueMap,i=t.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 +1 @@
|
|
|
1
|
-
"use strict";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 ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}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:
|
|
1
|
+
"use strict";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 ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}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(){function e(r,e,c){return{getDeviceTypeProtocolProvider:function(t,e){return{initUi:function(){!function(){var e={id:t.fieldbusType,name:t.label,service:t.serviceName};r.register(e)}()},$get:function(n,i){return["$injector","c8yBase","c8yInventory","c8yDeviceDatabase",function(e,t,r,o){return _objectSpread({flow:_.constant(["c8yDeviceTypeCreateStep"]),list:function(){return o.getAvailableDeviceTypes({fieldbusType:n.fieldbusType})},showIf:function(){return o.isDeviceTypeSupportedAsync({fieldbusType:n.fieldbusType})},detailPath:function(e){e=t.getId(e);return"/deviceprotocols/".concat(n.fieldbusType,"/:id").replace(/:id$/,e)},getName:function(e){return e.name},listRowInfoComponent:"c8yDeviceTypeRowInfo",getListActions:function(){return[{label:c("Export"),icon:"download",execute:function(e){return o.exportDeviceTypeAndSaveAs(e.data)}}]},remove:r.remove},e.invoke(i))}]}(t,e)}},$get:function(){}}}e.$inject=["c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"],angular.module("c8y.deviceProtocolForDeviceDatabase4").provider("c8yDeviceTypeProtocolBase",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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:
|
|
1
|
+
"use strict";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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yLoraDevice";function e(e,u){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var s={label:u("LoRa"),fieldbusType:"lora",serviceName:r};return e.getDeviceTypeProtocolProvider(s,t);function t(e,t,r){var n={name:"loriot-agent"},o=[t.MessageIdSources.FPORT,t.MessageIdSources.PAYLOAD],i=_objectSpread(_objectSpread({},s),{},{type:"c8y_LoraDeviceType",configuration:{messageIdConfiguration:o},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:u("Values"),noRegistersDefinedMessage:u("No values defined."),newRegisterModalTitle:u("New value"),editRegisterModalTitle:u('Edit value: "{{name}}"'),addRegisterButtonLabel:u("Add value"),validation:{invalidName:u("Name must be unique among values."),invalidMeasurement:u("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:u("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(a().then(function(e){return e&&i}))},isSubscribed:a};function a(){return e.all([r.isSubscribed({name:"actility"}),r.isSubscribed(n)]).then(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];return t||e})}}}angular.module("c8y.lora").provider(r,e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){var t;if(e)return"string"==typeof e?_arrayLikeToArray(e,r):"Map"===(t="Object"===(t=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,a,c=[],u=!0,y=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(e){y=!0,o=e}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(y)throw o}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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:
|
|
1
|
+
"use strict";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 _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){var t;if(e)return"string"==typeof e?_arrayLikeToArray(e,r):"Map"===(t="Object"===(t=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,a,c=[],u=!0,y=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(e){y=!0,o=e}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(y)throw o}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var n="c8yLpwanDevice";function e(e,r){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var u={label:r("LPWAN"),fieldbusType:"lpwan",serviceName:n};return e.getDeviceTypeProtocolProvider(u,t);function t(e,r,t){var n={name:"loriot-agent"},o={name:"sigfox-agent"},i={name:"actility"},a=_objectSpread(_objectSpread({},u),{},{type:"c8y_LpwanDeviceType",noNewProtocolInstances:!0});return{registerFeaturesManifest:function(){r.registerFeaturesManifest(c().then(function(e){return e&&a}))},isSubscribed:c};function c(){return e.all([t.isSubscribed(i),t.isSubscribed(n),t.isSubscribed(o)]).then(function(e){var e=_slicedToArray(e,3),r=e[0],t=e[1],e=e[2];return r||t||e})}}}angular.module("c8y.lpwan").provider(n,e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 new 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={},w=(i(t,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(j([]))),_=(w&&w!==e&&s.call(w,n)&&(t=w),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(_,"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(_),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(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"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 new 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 new 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:String(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(){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});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=function(e,t,r,n){var o,i=r.meta.type;if(i===y)return function(e,t,r){return{deviceId:e.id,description:'Change status of "'.concat(t.name,'" to "').concat(r.label,'".'),c8y_SetCoil:{address:e.c8y_ModbusDevice.address,input:t.input,coil:t.number,value:r.value}}}(e,r,n);if(i===h)return i=e,e=t,t=r,n=(r=n).label||r.value,o=!r.label&&t.unit?" ".concat(t.unit):"",n={deviceId:i.id,description:'Change value of "'.concat(t.name,'" to ').concat(n).concat(o,"."),c8y_SetRegister:{}},"opcua"===e.fieldbusType?n.c8y_SetRegister={address:i.c8y_OPCUADevice.browsePath,register:t.browsePath,value:r.value}:n.c8y_SetRegister={ipAddress:_.get(i,"c8y_ModbusDevice.ipAddress",""),address:i.c8y_ModbusDevice.address,input:t.input,register:t.number,startBit:t.startBit,noBits:t.noBits,value:r.value},n}(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
|
+
"use strict";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={},w=(i(t,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(j([]))),_=(w&&w!==e&&s.call(w,n)&&(t=w),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(_,"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(_),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(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"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.")}!function(){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});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=function(e,t,r,n){var o,i=r.meta.type;if(i===y)return function(e,t,r){return{deviceId:e.id,description:'Change status of "'.concat(t.name,'" to "').concat(r.label,'".'),c8y_SetCoil:{address:e.c8y_ModbusDevice.address,input:t.input,coil:t.number,value:r.value}}}(e,r,n);if(i===h)return i=e,e=t,t=r,n=(r=n).label||r.value,o=!r.label&&t.unit?" ".concat(t.unit):"",n={deviceId:i.id,description:'Change value of "'.concat(t.name,'" to ').concat(n).concat(o,"."),c8y_SetRegister:{}},"opcua"===e.fieldbusType?n.c8y_SetRegister={address:i.c8y_OPCUADevice.browsePath,register:t.browsePath,value:r.value}:n.c8y_SetRegister={ipAddress:_.get(i,"c8y_ModbusDevice.ipAddress",""),address:i.c8y_ModbusDevice.address,input:t.input,register:t.number,startBit:t.startBit,noBits:t.noBits,value:r.value},n}(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 +1 @@
|
|
|
1
|
-
"use strict";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 new 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 new 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 new 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:String(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(){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(function(){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
|
+
"use strict";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.")}!function(){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(function(){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 +1 @@
|
|
|
1
|
-
"use strict";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 g?t:g,t=Object.create(t.prototype),n=new E(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=p,function(e,t){if(c===h)throw new 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===p)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:y,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 p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function g(){}function m(){}function b(){}var t={},w=(i(t,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(L([]))),_=(w&&w!==e&&s.call(w,n)&&(t=w),b.prototype=g.prototype=Object.create(t));function P(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 O(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 j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(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(_,"constructor",{value:m.prototype=b,configurable:!0}),l(b,"constructor",{value:m,configurable:!0}),m.displayName=i(b,o,"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,i(e,o,"GeneratorFunction")),e.prototype=Object.create(_),e},a.awrap=function(e){return{__await:e}},P(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()})},P(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"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=L,E.prototype={constructor:E,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(j),!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 new 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),j(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,j(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(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:String(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(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var o="c8yProfibusDevice";function e(e,t,r,c){n.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yModbusDevice","gettextCatalog","c8yDevices","c8yBase","c8yUser","$q"];var h={label:c("Profibus"),fieldbusType:"profibus",serviceName:o};return e.getDeviceTypeProtocolProvider(h,n);function n(e,f,p,t,u,s,i,y){var r=_objectSpread(_objectSpread({},h),{},{discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:c("Registers"),noRegistersDefinedMessage:c("No registers defined."),elementTypeLabel:c("Register"),newRegisterModalTitle:c("New register"),editRegisterModalTitle:c('Edit register: "{{name}}"'),addRegisterButtonLabel:c("Add register"),validation:{invalidName:c("Name must be unique among registers."),invalidMeasurement:c("Selected measurement type and series are already used by another register.")},number:!0,startBit:{max:63},noBits:{max:64},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0},functionalities:{readWriteMutex:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_ProfibusDevice"],deviceConfiguration:{fragment:"c8y_ProfibusConfiguration",icon:"bios"}});return{registerFeaturesManifest:function(){e.registerFeaturesManifest(n().then(function(e){return e&&r}))},updateElement:function(e,t,r){return a.apply(this,arguments)},isAvailable:n,create:function(e,t){return o.apply(this,arguments)}};function n(){return e.isFeatureFieldbus4Available()}function o(){return(o=_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 l.apply(this,arguments)}(i);case 2:return a=e.sent,e.t0=s,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=c,n=i.deviceType,{deviceId:t.id,description:'Added new child device to "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_ProfibusDevice:{id:r.id,name:r.name,type:"/inventory/managedObjects/".concat(n.id)}})));case 14:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n,o;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.name,n=t.deviceType,e.next=3,i.current();case 3:return o=e.sent,e.abrupt("return",{name:r,type:n.name,c8y_ProfibusDevice:{type:"/inventory/managedObjects/".concat(n.id)},owner:o.id});case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function a(){return(a=_asyncToGenerator(_regeneratorRuntime().mark(function e(a,c,u){var s,l;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(p.canUpdateElement(a,c))return i=o=n=r=void 0,r=(t={device:a,register:c,valueMap:u}).device,n=t.register,t=t.valueMap,o=t.label||t.value,i=!t.label&&n.unit?" ".concat(n.unit):"",l={deviceId:r.id,description:'Change value of "'.concat(n.name,'" to ').concat(o).concat(i,"."),c8y_SetRegister:{address:r.c8y_RegisterStatus.ProfibusSlave_Address,register:n.number,startBit:n.startBit,noBits:n.noBits,value:t.value}},c.changePending=!0,s=p.getAlertMessagesFns(c,u),e.next=6,p.sendOperationAndGetResult(l,s);e.next=9;break;case 6:return(l=e.sent).status===f.status.SUCCESSFUL?(_.set(a,["c8y_RegisterStatus",c.name],u.value),c.changePending=!1):l.status===f.status.FAILED&&(c.changePending=!1),e.abrupt("return",l);case 9:return e.abrupt("return",y.reject());case 10:case"end":return e.stop()}var t,r,n,o,i},e)}))).apply(this,arguments)}}}angular.module("c8y.profibus").provider(o,e)}();
|
|
1
|
+
"use strict";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 g?t:g,t=Object.create(t.prototype),n=new E(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=p,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===p)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:y,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 p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function g(){}function m(){}function b(){}var t={},w=(i(t,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(L([]))),_=(w&&w!==e&&s.call(w,n)&&(t=w),b.prototype=g.prototype=Object.create(t));function P(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 O(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 j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(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(_,"constructor",{value:m.prototype=b,configurable:!0}),l(b,"constructor",{value:m,configurable:!0}),m.displayName=i(b,o,"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,i(e,o,"GeneratorFunction")),e.prototype=Object.create(_),e},a.awrap=function(e){return{__await:e}},P(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()})},P(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"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=L,E.prototype={constructor:E,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(j),!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),j(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,j(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(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.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var o="c8yProfibusDevice";function e(e,t,r,c){n.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yModbusDevice","gettextCatalog","c8yDevices","c8yBase","c8yUser","$q"];var h={label:c("Profibus"),fieldbusType:"profibus",serviceName:o};return e.getDeviceTypeProtocolProvider(h,n);function n(e,f,p,t,u,s,i,y){var r=_objectSpread(_objectSpread({},h),{},{discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:c("Registers"),noRegistersDefinedMessage:c("No registers defined."),elementTypeLabel:c("Register"),newRegisterModalTitle:c("New register"),editRegisterModalTitle:c('Edit register: "{{name}}"'),addRegisterButtonLabel:c("Add register"),validation:{invalidName:c("Name must be unique among registers."),invalidMeasurement:c("Selected measurement type and series are already used by another register.")},number:!0,startBit:{max:63},noBits:{max:64},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,options:{signed:!0,enumType:!0},functionalities:{readWriteMutex:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_ProfibusDevice"],deviceConfiguration:{fragment:"c8y_ProfibusConfiguration",icon:"bios"}});return{registerFeaturesManifest:function(){e.registerFeaturesManifest(n().then(function(e){return e&&r}))},updateElement:function(e,t,r){return a.apply(this,arguments)},isAvailable:n,create:function(e,t){return o.apply(this,arguments)}};function n(){return e.isFeatureFieldbus4Available()}function o(){return(o=_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 l.apply(this,arguments)}(i);case 2:return a=e.sent,e.t0=s,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=c,n=i.deviceType,{deviceId:t.id,description:'Added new child device to "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_ProfibusDevice:{id:r.id,name:r.name,type:"/inventory/managedObjects/".concat(n.id)}})));case 14:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n,o;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.name,n=t.deviceType,e.next=3,i.current();case 3:return o=e.sent,e.abrupt("return",{name:r,type:n.name,c8y_ProfibusDevice:{type:"/inventory/managedObjects/".concat(n.id)},owner:o.id});case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function a(){return(a=_asyncToGenerator(_regeneratorRuntime().mark(function e(a,c,u){var s,l;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(p.canUpdateElement(a,c))return i=o=n=r=void 0,r=(t={device:a,register:c,valueMap:u}).device,n=t.register,t=t.valueMap,o=t.label||t.value,i=!t.label&&n.unit?" ".concat(n.unit):"",l={deviceId:r.id,description:'Change value of "'.concat(n.name,'" to ').concat(o).concat(i,"."),c8y_SetRegister:{address:r.c8y_RegisterStatus.ProfibusSlave_Address,register:n.number,startBit:n.startBit,noBits:n.noBits,value:t.value}},c.changePending=!0,s=p.getAlertMessagesFns(c,u),e.next=6,p.sendOperationAndGetResult(l,s);e.next=9;break;case 6:return(l=e.sent).status===f.status.SUCCESSFUL?(_.set(a,["c8y_RegisterStatus",c.name],u.value),c.changePending=!1):l.status===f.status.FAILED&&(c.changePending=!1),e.abrupt("return",l);case 9:return e.abrupt("return",y.reject());case 10:case"end":return e.stop()}var t,r,n,o,i},e)}))).apply(this,arguments)}}}angular.module("c8y.profibus").provider(o,e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 ownKeys(t,e){var r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}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:
|
|
1
|
+
"use strict";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 ownKeys(t,e){var r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}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(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var n="c8ySigfoxDevice";function e(e,t,r,s){i.$inject=["c8yDeviceDatabase","c8yTenant"];var a={label:s("Sigfox"),fieldbusType:"sigfox",serviceName:n};return e.getDeviceTypeProtocolProvider(a,i);function i(e,t){var r={name:"sigfox-agent"},i=[e.MessageIdSources.PAYLOAD],n=_objectSpread(_objectSpread({},a),{},{type:"c8y_SigfoxDeviceType",configuration:{messageIdConfiguration:i},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:s("Values"),noRegistersDefinedMessage:s("No values defined."),newRegisterModalTitle:s("New value"),editRegisterModalTitle:s('Edit value: "{{name}}"'),addRegisterButtonLabel:s("Add value"),validation:{invalidName:s("Name must be unique among values."),invalidMeasurement:s("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:s("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){e.registerFeaturesManifest(o().then(function(e){return e&&n}))},isSubscribed:o};function o(){return t.isSubscribed(r)}}}angular.module("c8y.sigfox").provider(n,e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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 N(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=p,function(e,t){if(c===h)throw new 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===p)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:y,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 p="suspendedStart",y="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(x([]))),_=(w&&w!==e&&s.call(w,n)&&(t=w),b.prototype=m.prototype=Object.create(t));function P(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function S(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 O(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 E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(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(_,"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(_),e},a.awrap=function(e){return{__await:e}},P(S.prototype),i(S.prototype,r,function(){return this}),a.AsyncIterator=S,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new S(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},P(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"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=x,N.prototype={constructor:N,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(E),!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 new 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),E(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,E(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(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:String(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(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8ySNMPDevice";function e(e,g){t.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yTenant","c8yDevices","c8yBase","c8yUser","$q"];var b={label:g("SNMP"),fieldbusType:"snmp",serviceName:r};return e.getDeviceTypeProtocolProvider(b,t);function t(t,u,r,s,l,o,n){var i={name:"snmp-mib-parser"},a=_objectSpread(_objectSpread({},b),{},{options:!1,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:g("Components"),noRegistersDefinedMessage:g("No components defined."),elementTypeLabel:g("Component"),newRegisterModalTitle:g("New component"),editRegisterModalTitle:g('Edit component: "{{name}}"'),addRegisterButtonLabel:g("Add component"),validation:{invalidName:g("Name must be unique among components.")},description:!0,oid:!0,functionalities:{raiseAlarm:!0,sendMeasurement:!0,sendEvent:!0}},deviceFragments:["c8y_SNMPDevice","c8y_SNMPGateway"],deviceConfiguration:{fragment:"c8y_SNMPGateway",icon:"cogs"}}),e=l.createEnum([{value:0,label:g("Version 1"),name:"VERSION_1"},{value:1,label:g("Version 2c"),name:"VERSION_2C"},{value:3,name:"VERSION_3",label:g("Version 3")}]),c=l.createEnum([{value:1,name:"NOAUTH_NOPRIV",label:g("NOAUTH_NOPRIV")},{value:2,name:"AUTH_NOPRIV",label:g("AUTH_NOPRIV")},{value:3,name:"AUTH_PRIV",label:g("AUTH_PRIV")}]),f=l.createEnum([{value:1,name:"MD5",label:g("MD5")},{value:2,name:"SHA",label:g("SHA")}]);return{registerFeaturesManifest:function(){t.registerFeaturesManifest(p().then(function(e){return e&&a}))},isSubscribed:p,create:function(e,t){return y.apply(this,arguments)},update:function(e,t){return h.apply(this,arguments)},isSNMP:function(e){return!!(e||{}).c8y_SNMPDevice},snmpVersions:e,snmpAuthPrivProtocols:l.createEnum([{value:1,name:"DES",label:g("DES")},{value:2,name:"AES128",label:g("AES128")},{value:3,name:"AES192",label:g("AES192")},{value:4,name:"AES256",label:g("AES256")}]),snmpAuthProtocols:f,snmpSecurityLevels:c};function p(){var e={isFeatureFieldbus4Available:t.isFeatureFieldbus4Available(),isSubscribed:r.isSubscribed(i)};return n.all(e).then(function(e){return e.isFeatureFieldbus4Available&&e.isSubscribed})}function y(){return(y=_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,d(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_SNMPDevice:m(r,n)})));case 14:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function e(o,i){var a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(o,i);case 2:return(a=e.sent).id=i.id,a.owner=o.owner,e.next=7,s.update(a);case 7:return e.abrupt("return",u.create((t=o,r=i.deviceType,n=a,{deviceId:t.id,description:'Updated child device of "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_SNMPDevice:m(r,n)})));case 8:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function d(){return v.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,o.current();case 2:return n=e.sent,e.abrupt("return",{name:r.name,type:r.deviceType.name,c8y_SNMPDevice:{ipAddress:r.ipAddress,port:r.port,version:r.version,auth:(t=r.auth,_.pick(t,["username","privPassword","authPassword","authProtocol","privProtocol","securityLevel","engineId"])),type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id});case 4:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function m(e,t){return{id:t.id,name:t.name,ipAddress:t.c8y_SNMPDevice.ipAddress,port:t.c8y_SNMPDevice.port,version:t.c8y_SNMPDevice.version,auth:t.c8y_SNMPDevice.auth,type:"/inventory/managedObjects/".concat(e.id)}}}}angular.module("c8y.snmp").provider(r,e)}();
|
|
1
|
+
"use strict";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 N(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=p,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===p)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:y,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 p="suspendedStart",y="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(x([]))),_=(w&&w!==e&&s.call(w,n)&&(t=w),b.prototype=m.prototype=Object.create(t));function P(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function S(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 O(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 E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(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(_,"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(_),e},a.awrap=function(e){return{__await:e}},P(S.prototype),i(S.prototype,r,function(){return this}),a.AsyncIterator=S,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new S(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},P(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"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=x,N.prototype={constructor:N,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(E),!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),E(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,E(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(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.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8ySNMPDevice";function e(e,g){t.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yTenant","c8yDevices","c8yBase","c8yUser","$q"];var b={label:g("SNMP"),fieldbusType:"snmp",serviceName:r};return e.getDeviceTypeProtocolProvider(b,t);function t(t,u,r,s,l,o,n){var i={name:"snmp-mib-parser"},a=_objectSpread(_objectSpread({},b),{},{options:!1,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:g("Components"),noRegistersDefinedMessage:g("No components defined."),elementTypeLabel:g("Component"),newRegisterModalTitle:g("New component"),editRegisterModalTitle:g('Edit component: "{{name}}"'),addRegisterButtonLabel:g("Add component"),validation:{invalidName:g("Name must be unique among components.")},description:!0,oid:!0,functionalities:{raiseAlarm:!0,sendMeasurement:!0,sendEvent:!0}},deviceFragments:["c8y_SNMPDevice","c8y_SNMPGateway"],deviceConfiguration:{fragment:"c8y_SNMPGateway",icon:"cogs"}}),e=l.createEnum([{value:0,label:g("Version 1"),name:"VERSION_1"},{value:1,label:g("Version 2c"),name:"VERSION_2C"},{value:3,name:"VERSION_3",label:g("Version 3")}]),c=l.createEnum([{value:1,name:"NOAUTH_NOPRIV",label:g("NOAUTH_NOPRIV")},{value:2,name:"AUTH_NOPRIV",label:g("AUTH_NOPRIV")},{value:3,name:"AUTH_PRIV",label:g("AUTH_PRIV")}]),f=l.createEnum([{value:1,name:"MD5",label:g("MD5")},{value:2,name:"SHA",label:g("SHA")}]);return{registerFeaturesManifest:function(){t.registerFeaturesManifest(p().then(function(e){return e&&a}))},isSubscribed:p,create:function(e,t){return y.apply(this,arguments)},update:function(e,t){return h.apply(this,arguments)},isSNMP:function(e){return!!(e||{}).c8y_SNMPDevice},snmpVersions:e,snmpAuthPrivProtocols:l.createEnum([{value:1,name:"DES",label:g("DES")},{value:2,name:"AES128",label:g("AES128")},{value:3,name:"AES192",label:g("AES192")},{value:4,name:"AES256",label:g("AES256")}]),snmpAuthProtocols:f,snmpSecurityLevels:c};function p(){var e={isFeatureFieldbus4Available:t.isFeatureFieldbus4Available(),isSubscribed:r.isSubscribed(i)};return n.all(e).then(function(e){return e.isFeatureFieldbus4Available&&e.isSubscribed})}function y(){return(y=_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,d(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_SNMPDevice:m(r,n)})));case 14:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function e(o,i){var a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(o,i);case 2:return(a=e.sent).id=i.id,a.owner=o.owner,e.next=7,s.update(a);case 7:return e.abrupt("return",u.create((t=o,r=i.deviceType,n=a,{deviceId:t.id,description:'Updated child device of "'.concat(t.name,'" (ID: ').concat(t.id,")."),c8y_SNMPDevice:m(r,n)})));case 8:case"end":return e.stop()}var t,r,n},e)}))).apply(this,arguments)}function d(){return v.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,o.current();case 2:return n=e.sent,e.abrupt("return",{name:r.name,type:r.deviceType.name,c8y_SNMPDevice:{ipAddress:r.ipAddress,port:r.port,version:r.version,auth:(t=r.auth,_.pick(t,["username","privPassword","authPassword","authProtocol","privProtocol","securityLevel","engineId"])),type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id});case 4:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function m(e,t){return{id:t.id,name:t.name,ipAddress:t.c8y_SNMPDevice.ipAddress,port:t.c8y_SNMPDevice.port,version:t.c8y_SNMPDevice.version,auth:t.c8y_SNMPDevice.auth,type:"/inventory/managedObjects/".concat(e.id)}}}}angular.module("c8y.snmp").provider(r,e)}();
|