UNPKG

awv3

Version:
1 lines 2.06 kB
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}exports.__esModule=!0;var _map=require("babel-runtime/core-js/map"),_map2=_interopRequireDefault(_map),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2),_events=require("../core/events"),_events2=_interopRequireDefault(_events),_helpers=require("../core/helpers"),_class=function(e){function t(){var r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];(0,_classCallCheck3["default"])(this,t);var s=(0,_possibleConstructorReturn3["default"])(this,e.call(this));return s.id=(0,_helpers.guid)(),s.alive=!1,s.options=r,s.socket=void 0,s.tasks=new _map2["default"],s.url=void 0,s}return(0,_inherits3["default"])(t,e),t.prototype.execute=function(e,t){return this.request({command:"Execute",task:e},t)},t.prototype.result=function(e,t){return this.request({command:"Execute",task:"RETURN "+e},t).then(function(e){return e.results})},t.prototype.setVerboseLevel=function(e){return this.request({command:"Execute",task:"CADH_SetVerboseLevel("+(e||16391)+");"})},t.prototype.log=function(){return this.request({command:"Execute",task:"RETURN CADH_GetVerboseFileContent();"}).then(function(e){return e.firstResult})},t.prototype.resetLog=function(){return this.request({command:"Execute",task:"CADH_ResetVerboseFile();"})},t.prototype.getState=function(){return this.request({command:"StoreState"}).then(function(e){return e.firstResult})},t.prototype.setState=function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];return this.request({command:"LoadState",data:e,recalc:!1,updateGraphics:t})},t.prototype.recalc=function(){return this.request({command:"Recalc"})},t}(_events2["default"]);exports["default"]=_class;