release 1.5.01.3
This commit is contained in:
parent
24d470438b
commit
33936eb5aa
@ -14,7 +14,7 @@ System.register("chunks:///_virtual/DescriptionManager.ts",["./rollupPluginModLo
|
||||
|
||||
System.register("chunks:///_virtual/equipmentListSwitch.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(t){var i,e,n,o,s,r,a,u,p,c;return{setters:[function(t){i=t.applyDecoratedDescriptor,e=t.inheritsLoose,n=t.initializerDefineProperty,o=t.assertThisInitialized},function(t){s=t.cclegacy,r=t._decorator,a=t.Node,u=t.Vec3,p=t.tween,c=t.Component}],execute:function(){var l,h,f,m,g,w,P;s._RF.push({},"41a9dZz2mVOFoYwOsk9H98q","equipmentListSwitch",void 0);var q=r.ccclass,L=r.property;t("equipmentListSwitch",(l=q("equipmentListSwitch"),h=L(a),l((g=i((m=function(t){function i(){for(var i,e=arguments.length,s=new Array(e),r=0;r<e;r++)s[r]=arguments[r];return i=t.call.apply(t,[this].concat(s))||this,n(i,"equipmentList",g,o(i)),n(i,"offsetX",w,o(i)),n(i,"animationDuration",P,o(i)),i.openPos=new u,i.closedPos=new u,i.isOnToggle=!1,i}e(i,t);var s=i.prototype;return s.start=function(){this.openPos=this.equipmentList.getPosition().clone(),this.closedPos=new u(this.openPos.x-this.offsetX,this.openPos.y,this.openPos.z),this.equipmentList.setPosition(this.closedPos)},s.stopTween=function(){p(this.equipmentList).stop()},s.equipmentSwitch=function(){this.stopTween(),this.isOnToggle?(this.isOnToggle=!1,p(this.equipmentList).to(this.animationDuration,{position:this.closedPos}).start()):(this.isOnToggle=!0,p(this.equipmentList).to(this.animationDuration,{position:this.openPos}).start())},i}(c)).prototype,"equipmentList",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),w=i(m.prototype,"offsetX",[L],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 250}}),P=i(m.prototype,"animationDuration",[L],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return.3}}),f=m))||f));s._RF.pop()}}}));
|
||||
|
||||
System.register("chunks:///_virtual/EquipmentManager.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(t){var e,n,r,i,a,s,o,c,u,l;return{setters:[function(t){e=t.applyDecoratedDescriptor,n=t.inheritsLoose,r=t.initializerDefineProperty,i=t.assertThisInitialized,a=t.createClass,s=t.asyncToGenerator,o=t.regeneratorRuntime},function(t){c=t.cclegacy,u=t._decorator,l=t.Component}],execute:function(){var p,h,d,f;c._RF.push({},"bdf50LzsO9GkrF5oSw4uDK/","EquipmentManager",void 0);var v=u.ccclass,m=u.property;t("EquipmentManager",v("EquipmentManager")(((f=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return e=t.call.apply(t,[this].concat(a))||this,r(e,"apiUrl",d,i(e)),e._dataList=[],e.totalCount=0,e._intervalId=null,e.initialDataPromise=void 0,e}n(e,t);var c=e.prototype;return c.onLoad=function(){var t=this;e.instance=this,this.initialDataPromise=this.loadItems(),this._intervalId=window.setInterval((function(){t.loadItems()}),1e4)},c.loadItems=function(){var t=s(o().mark((function t(){var e,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.apiUrl);case 3:return e=t.sent,t.next=6,e.json();case 6:(n=t.sent)&&n.items&&Array.isArray(n.items)?(this._dataList=n.items,this.totalCount=this._dataList.length,console.log("Данные оборудования обновлены:",this._dataList),this.node.emit("data-updated")):console.error("Некорректный формат данных",n),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),console.error("Ошибка при загрузке данных:",t.t0);case 13:case"end":return t.stop()}}),t,this,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),c.getDataList=function(){var t=s(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._dataList);case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),c.onDestroy=function(){null!==this._intervalId&&(window.clearInterval(this._intervalId),this._intervalId=null)},a(e,[{key:"dataList",get:function(){return this._dataList}}]),e}(l)).instance=void 0,d=e((h=f).prototype,"apiUrl",[m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"http://http://192.168.0.219:3030/api/v2/sensors"}}),p=h))||p);c._RF.pop()}}}));
|
||||
System.register("chunks:///_virtual/EquipmentManager.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(t){var e,n,r,i,a,s,o,c,u,l;return{setters:[function(t){e=t.applyDecoratedDescriptor,n=t.inheritsLoose,r=t.initializerDefineProperty,i=t.assertThisInitialized,a=t.createClass,s=t.asyncToGenerator,o=t.regeneratorRuntime},function(t){c=t.cclegacy,u=t._decorator,l=t.Component}],execute:function(){var p,h,d,f;c._RF.push({},"bdf50LzsO9GkrF5oSw4uDK/","EquipmentManager",void 0);var v=u.ccclass,m=u.property;t("EquipmentManager",v("EquipmentManager")(((f=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return e=t.call.apply(t,[this].concat(a))||this,r(e,"apiUrl",d,i(e)),e._dataList=[],e.totalCount=0,e._intervalId=null,e.initialDataPromise=void 0,e}n(e,t);var c=e.prototype;return c.onLoad=function(){var t=this;e.instance=this,this.initialDataPromise=this.loadItems(),this._intervalId=window.setInterval((function(){t.loadItems()}),1e4)},c.loadItems=function(){var t=s(o().mark((function t(){var e,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.apiUrl);case 3:return e=t.sent,t.next=6,e.json();case 6:(n=t.sent)&&n.items&&Array.isArray(n.items)?(this._dataList=n.items,this.totalCount=this._dataList.length,console.log("Данные оборудования обновлены:",this._dataList),this.node.emit("data-updated")):console.error("Некорректный формат данных",n),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),console.error("Ошибка при загрузке данных:",t.t0);case 13:case"end":return t.stop()}}),t,this,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),c.getDataList=function(){var t=s(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._dataList);case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),c.onDestroy=function(){null!==this._intervalId&&(window.clearInterval(this._intervalId),this._intervalId=null)},a(e,[{key:"dataList",get:function(){return this._dataList}}]),e}(l)).instance=void 0,d=e((h=f).prototype,"apiUrl",[m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"http://192.168.0.219:3030/api/v2/sensors"}}),p=h))||p);c._RF.pop()}}}));
|
||||
|
||||
System.register("chunks:///_virtual/ErrorButtonStatus.ts",["./rollupPluginModLoBabelHelpers.js","cc","./ErrorManager.ts","./ErrorItemData.ts"],(function(t){var r,e,n,i,o,a,u,s,l,c,p,b,f,m;return{setters:[function(t){r=t.applyDecoratedDescriptor,e=t.inheritsLoose,n=t.initializerDefineProperty,i=t.assertThisInitialized},function(t){o=t.cclegacy,a=t._decorator,u=t.Sprite,s=t.Button,l=t.Label,c=t.Node,p=t.Color,b=t.Component},function(t){f=t.ErrorManager},function(t){m=t.ErrorItemData}],execute:function(){var d,h,g,y,v,E,w,S,L,z,B;o._RF.push({},"af3d5cvwX9AKr0RbFp1/e0G","ErrorButtonStatus",void 0);var D=a.ccclass,C=a.property;t("ErrorButtonStatus",(d=D("ErrorButtonStatus"),h=C(u),g=C(s),y=C(l),v=C(c),d((S=r((w=function(t){function r(){for(var r,e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,n(r,"sprite",S,i(r)),n(r,"button",L,i(r)),n(r,"label",z,i(r)),n(r,"equipmentList",B,i(r)),r}e(r,t);var o=r.prototype;return o.start=function(){f.instance.node.on("errors-updated",this.updateStatus,this),this.updateStatus()},o.updateStatus=function(){var t=f.instance.getErrorList(),r=Object.keys(t.apiErrors).reduce((function(r,e){return r+t.apiErrors[e].map((function(t){var r=new m;return r.sensorName=e,r.alarmCode=t.alarmCode,r.description=t.description,r.timestamp=t.timestamp,r})).length}),0);r>0?(this.sprite.color=new p(255,0,0),this.button.interactable=!0,this.label.string="аварий: "+r):(this.sprite.color=new p(128,128,128,0),this.button.interactable=!1,this.label.string="",this.equipmentList.active=!1)},r}(b)).prototype,"sprite",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),L=r(w.prototype,"button",[g],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),z=r(w.prototype,"label",[y],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),B=r(w.prototype,"equipmentList",[v],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),E=w))||E));o._RF.pop()}}}));
|
||||
|
||||
@ -28,7 +28,7 @@ System.register("chunks:///_virtual/ErrorLazyLoadList.ts",["./rollupPluginModLoB
|
||||
|
||||
System.register("chunks:///_virtual/ErrorManager.ts",["./rollupPluginModLoBabelHelpers.js","cc","./EquipmentManager.ts","./ErrorsStore.ts"],(function(r){var t,e,n,o,i,s,a,u,c,d,h,l,f;return{setters:[function(r){t=r.applyDecoratedDescriptor,e=r.inheritsLoose,n=r.initializerDefineProperty,o=r.assertThisInitialized,i=r.asyncToGenerator,s=r.regeneratorRuntime},function(r){a=r.cclegacy,u=r._decorator,c=r.Node,d=r.AudioSource,h=r.Component},function(r){l=r.EquipmentManager},function(r){f=r.ErrorsStore}],execute:function(){var p,E,g,m,b,v,A,y;a._RF.push({},"e1d6eobzoNDs75XDl50wZhA","ErrorManager",void 0);var I=u.ccclass,S=u.property;r("ErrorManager",(p=I("ErrorManager"),E=S(c),g=S(d),p(((y=function(r){function t(){for(var t,e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return t=r.call.apply(r,[this].concat(i))||this,n(t,"errorListNode",v,o(t)),n(t,"soundEnabled",A,o(t)),t.currentErrors=[],t.errorItems=[],t.disabledAlerts=[],t.errorsStore=f.instance,t}e(t,r);var a=t.prototype;return a.onLoad=function(){t.instance=this,this.node.on("touchstart",this.disableSoundAlert,this)},a.start=function(){var r=this;l.instance&&(l.instance.node.on("data-updated",this.checkErrors,this),this.schedule(this.checkErrors,5)),this.schedule((function(){r.fetchApiErrors()}),10)},a.getErrorList=function(){return{equipmentErrors:this.errorItems,apiErrors:this.errorsStore.getApiErrors()}},a.checkErrors=function(){var r=this,t=l.instance.dataList,e=!1,n=[].concat(this.currentErrors);this.currentErrors=this.currentErrors.filter((function(r){return t.some((function(t){return t.tag===r&&2===t.value}))})),n.length!==this.currentErrors.length&&(this.errorItems=this.errorItems.filter((function(r){return t.some((function(t){return t.tag===r.tag&&2===t.value}))})),e=!0),t.forEach((function(t){2===t.value&&-1===r.currentErrors.indexOf(t.tag)&&(r.currentErrors.push(t.tag),r.errorItems.push(t),r.addErrorToUI(t),e=!0,r.soundEnabled&&r.disabledAlerts.indexOf(t.tag))})),e&&this.node.emit("errors-updated"),this.fetchApiErrors()},a.fetchApiErrors=function(){var r=i(s().mark((function r(){return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.errorsStore.fetchApiErrors();case 2:this.node.emit("errors-updated");case 3:case"end":return r.stop()}}),r,this)})));return function(){return r.apply(this,arguments)}}(),a.addErrorToUI=function(r){},a.disableSoundAlert=function(){this.soundEnabled=!1},a.disableAlertForError=function(r){-1===this.disabledAlerts.indexOf(r)&&this.disabledAlerts.push(r)},a.confirmError=function(r){this.currentErrors=this.currentErrors.filter((function(t){return t!==r})),this.errorItems=this.errorItems.filter((function(t){return t.tag!==r})),this.node.emit("errors-updated")},t}(h)).instance=void 0,v=t((b=y).prototype,"errorListNode",[E],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),A=t(b.prototype,"soundEnabled",[g],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),m=b))||m));a._RF.pop()}}}));
|
||||
|
||||
System.register("chunks:///_virtual/ErrorsStore.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(r){var e,t,n,s,o;return{setters:[function(r){e=r.createClass,t=r.asyncToGenerator,n=r.regeneratorRuntime},function(r){s=r.cclegacy,o=r._decorator}],execute:function(){var c,a;s._RF.push({},"c223eUBBj5G06wOn++quNUD","ErrorsStore",void 0);var i=o.ccclass;o.property,r("ErrorsStore",i("ErrorsStore")(((a=function(){function r(){this.apiErrors={}}var s=r.prototype;return s.fetchApiErrors=function(){var r=t(n().mark((function r(){var e,t;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,fetch("http://http://192.168.0.219:3030/api/v2/errors");case 3:if(!(e=r.sent).ok){r.next=11;break}return r.next=7,e.json();case 7:t=r.sent,this.apiErrors=t,r.next=12;break;case 11:console.error("Ошибка при получении ошибок с API, статус:",e.status);case 12:r.next=17;break;case 14:r.prev=14,r.t0=r.catch(0),console.error("Ошибка запроса ошибок с API:",r.t0);case 17:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(){return r.apply(this,arguments)}}(),s.getApiErrors=function(){return this.apiErrors},e(r,null,[{key:"instance",get:function(){return r._instance||(r._instance=new r),r._instance}}]),r}())._instance=void 0,c=a))||c);s._RF.pop()}}}));
|
||||
System.register("chunks:///_virtual/ErrorsStore.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(r){var e,t,n,s,o;return{setters:[function(r){e=r.createClass,t=r.asyncToGenerator,n=r.regeneratorRuntime},function(r){s=r.cclegacy,o=r._decorator}],execute:function(){var c,a;s._RF.push({},"c223eUBBj5G06wOn++quNUD","ErrorsStore",void 0);var i=o.ccclass;o.property,r("ErrorsStore",i("ErrorsStore")(((a=function(){function r(){this.apiErrors={}}var s=r.prototype;return s.fetchApiErrors=function(){var r=t(n().mark((function r(){var e,t;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,fetch("http://192.168.0.219:3030/api/v2/errors");case 3:if(!(e=r.sent).ok){r.next=11;break}return r.next=7,e.json();case 7:t=r.sent,this.apiErrors=t,r.next=12;break;case 11:console.error("Ошибка при получении ошибок с API, статус:",e.status);case 12:r.next=17;break;case 14:r.prev=14,r.t0=r.catch(0),console.error("Ошибка запроса ошибок с API:",r.t0);case 17:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(){return r.apply(this,arguments)}}(),s.getApiErrors=function(){return this.apiErrors},e(r,null,[{key:"instance",get:function(){return r._instance||(r._instance=new r),r._instance}}]),r}())._instance=void 0,c=a))||c);s._RF.pop()}}}));
|
||||
|
||||
System.register("chunks:///_virtual/FirstPersonController.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(e){var t,o,i,n,s,r,a,l,h,c,u,p,_,d;return{setters:[function(e){t=e.applyDecoratedDescriptor,o=e.inheritsLoose,i=e.initializerDefineProperty,n=e.assertThisInitialized},function(e){s=e.cclegacy,r=e._decorator,a=e.Node,l=e.Vec3,h=e.input,c=e.Input,u=e.KeyCode,p=e.Quat,_=e.NodeSpace,d=e.Component}],execute:function(){var m,v,E,f,y,S,M,D,b,g;s._RF.push({},"5d80eQJlnxA9ooItxxIqddm","FirstPersonController",void 0);var w=r.ccclass,K=r.property;e("FirstPersonController",(m=w("FirstPersonController"),v=K({type:a}),m((y=t((f=function(e){function t(){for(var t,o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return t=e.call.apply(e,[this].concat(s))||this,i(t,"camera",y,n(t)),i(t,"moveSpeed",S,n(t)),i(t,"lookSpeed",M,n(t)),i(t,"speedStep",D,n(t)),i(t,"minSpeed",b,n(t)),i(t,"maxSpeed",g,n(t)),t._moveDirection=new l,t._eulerAngles=new l,t._isLeftMousePressed=!1,t._lastEmittedPosition=new l,t}o(t,e);var s=t.prototype;return s.onLoad=function(){h.on(c.EventType.KEY_DOWN,this._onKeyDown,this),h.on(c.EventType.KEY_UP,this._onKeyUp,this),h.on(c.EventType.MOUSE_DOWN,this._onMouseDown,this),h.on(c.EventType.MOUSE_UP,this._onMouseUp,this),h.on(c.EventType.MOUSE_MOVE,this._onMouseMove,this),h.on(c.EventType.MOUSE_WHEEL,this._onMouseWheel,this),this._eulerAngles=this.node.eulerAngles.clone(),this._lastEmittedPosition=this.node.getPosition().clone()},s.onDestroy=function(){h.off(c.EventType.KEY_DOWN,this._onKeyDown,this),h.off(c.EventType.KEY_UP,this._onKeyUp,this),h.off(c.EventType.MOUSE_DOWN,this._onMouseDown,this),h.off(c.EventType.MOUSE_UP,this._onMouseUp,this),h.off(c.EventType.MOUSE_MOVE,this._onMouseMove,this),h.off(c.EventType.MOUSE_WHEEL,this._onMouseWheel,this)},s._onKeyDown=function(e){switch(e.keyCode){case u.KEY_W:this._moveDirection.z=1;break;case u.KEY_S:this._moveDirection.z=-1;break;case u.KEY_A:this._moveDirection.x=-1;break;case u.KEY_D:this._moveDirection.x=1;break;case u.KEY_Q:this._moveDirection.y=-1;break;case u.KEY_E:this._moveDirection.y=1}},s._onKeyUp=function(e){switch(e.keyCode){case u.KEY_W:case u.KEY_S:this._moveDirection.z=0;break;case u.KEY_A:case u.KEY_D:this._moveDirection.x=0;break;case u.KEY_Q:case u.KEY_E:this._moveDirection.y=0}},s._onMouseDown=function(e){0===e.getButton()&&(this._isLeftMousePressed=!0)},s._onMouseUp=function(e){0===e.getButton()&&(this._isLeftMousePressed=!1)},s._onMouseMove=function(e){if(this._isLeftMousePressed){this._eulerAngles.y-=e.movementX*this.lookSpeed,this._eulerAngles.x-=e.movementY*this.lookSpeed,this._eulerAngles.x=Math.max(-89,Math.min(89,this._eulerAngles.x));var t=new p;p.fromEuler(t,this._eulerAngles.x,this._eulerAngles.y,0),this.node.setRotation(t),this.camera&&this.camera.setRotation(p.IDENTITY)}},s._onMouseWheel=function(e){e.getScrollY()>0?this.moveSpeed=Math.min(this.moveSpeed+this.speedStep,this.maxSpeed):e.getScrollY()<0&&(this.moveSpeed=Math.max(this.moveSpeed-this.speedStep,this.minSpeed)),console.log("Current move speed: "+this.moveSpeed)},s.update=function(e){var t=l.transformQuat(new l,l.FORWARD,this.node.worldRotation),o=l.transformQuat(new l,l.RIGHT,this.node.worldRotation),i=new l;l.scaleAndAdd(i,i,t,this._moveDirection.z*this.moveSpeed*e),l.scaleAndAdd(i,i,o,this._moveDirection.x*this.moveSpeed*e),l.scaleAndAdd(i,i,l.UP,this._moveDirection.y*this.moveSpeed*e),this.node.translate(i,_.WORLD);var n=this.node.getPosition();l.distance(n,this._lastEmittedPosition)>.1&&(this.node.emit("moved"),this._lastEmittedPosition=n.clone())},t}(d)).prototype,"camera",[v],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),S=t(f.prototype,"moveSpeed",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 5}}),M=t(f.prototype,"lookSpeed",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return.1}}),D=t(f.prototype,"speedStep",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),b=t(f.prototype,"minSpeed",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),g=t(f.prototype,"maxSpeed",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 20}}),E=f))||E));s._RF.pop()}}}));
|
||||
|
||||
@ -54,7 +54,7 @@ System.register("chunks:///_virtual/SensorDescriptionField.ts",["cc"],(function(
|
||||
|
||||
System.register("chunks:///_virtual/SensorDetailManager.ts",["./rollupPluginModLoBabelHelpers.js","cc","./SensorDetailStore.ts","./ErrorLazyLoadList.ts"],(function(e){var n,t,s,o,a,i;return{setters:[function(e){n=e.inheritsLoose},function(e){t=e.cclegacy,s=e._decorator,o=e.Component},function(e){a=e.SensorDetailStore},function(e){i=e.ErrorLazyLoadList}],execute:function(){var r;t._RF.push({},"a0091NqlExPUrb+f5xP0/Gf","SensorDetailManager",void 0);var c=s.ccclass;e("SensorDetailManager",c("SensorDetailManager")(r=function(e){function t(){for(var n,t=arguments.length,s=new Array(t),o=0;o<t;o++)s[o]=arguments[o];return(n=e.call.apply(e,[this].concat(s))||this).currentSensorName="",n}n(t,e);var s=t.prototype;return s.onLoad=function(){var e=this.node.scene.getChildByName("EquipmentManager");e&&e.on("showSensorDetails",this.onShowSensorDetails,this)},s.onShowSensorDetails=function(e){var n;this.currentSensorName===e&&"details"===(null==(n=i.instance)?void 0:n.mode)||(this.currentSensorName=e,this.unschedule(this.updateSensorDetails),a.getInstance().fetchSensorDetails(e).then((function(e){e&&i.instance&&i.instance.showSensorDetails(e)})),this.node.active&&this.schedule(this.updateSensorDetails,5),this.node.active=!0)},s.onEnable=function(){this.currentSensorName&&(this.unschedule(this.updateSensorDetails),this.schedule(this.updateSensorDetails,5))},s.onDisable=function(){this.unschedule(this.updateSensorDetails)},s.updateSensorDetails=function(){this.currentSensorName&&a.getInstance().fetchSensorDetails(this.currentSensorName).then((function(e){e&&i.instance&&"details"===i.instance.mode&&i.instance.showSensorDetails(e)}))},t}(o))||r);t._RF.pop()}}}));
|
||||
|
||||
System.register("chunks:///_virtual/SensorDetailStore.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(e){var r,t,n,s,o,a;return{setters:[function(e){r=e.inheritsLoose,t=e.asyncToGenerator,n=e.regeneratorRuntime},function(e){s=e.cclegacy,o=e._decorator,a=e.Component}],execute:function(){var i,c;s._RF.push({},"0b4098z0xFHGY/qLrEzsi+7","SensorDetailStore",void 0);var u=o.ccclass;e("SensorDetailStore",u("SensorDetailStore")(((c=function(e){function s(){for(var r,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return(r=e.call.apply(e,[this].concat(n))||this).currentSensorName="",r.currentDetails=null,r}r(s,e),s.getInstance=function(){return s._instance||(s._instance=new s),s._instance};var o=s.prototype;return o.onLoad=function(){s._instance=this},o.fetchSensorDetails=function(){var e=t(n().mark((function e(r){var t,s,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",null);case 2:return this.currentSensorName=r,e.prev=3,e.next=6,fetch("http://http://192.168.0.219:3030/api/v2/sensor-details",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sensorName:r})});case 6:if((t=e.sent).ok){e.next=10;break}return console.error("[SensorDetailStore] Ошибка ответа от сервера: "+t.status),e.abrupt("return",null);case 10:return e.next=12,t.json();case 12:if(!((s=e.sent)&&s.description&&s.description.fields)){e.next=19;break}return o={sensorName:s.name,fields:s.description.fields},this.currentDetails=o,e.abrupt("return",o);case 19:return console.error("[SensorDetailStore] Неверный формат данных:",s),e.abrupt("return",null);case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(3),console.error("[SensorDetailStore] Не удалось загрузить данные датчика:",e.t0),e.abrupt("return",null);case 27:case"end":return e.stop()}}),e,this,[[3,23]])})));return function(r){return e.apply(this,arguments)}}(),o.getCurrentDetails=function(){return this.currentDetails},s}(a))._instance=null,i=c))||i);s._RF.pop()}}}));
|
||||
System.register("chunks:///_virtual/SensorDetailStore.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(e){var r,t,n,s,o,a;return{setters:[function(e){r=e.inheritsLoose,t=e.asyncToGenerator,n=e.regeneratorRuntime},function(e){s=e.cclegacy,o=e._decorator,a=e.Component}],execute:function(){var i,c;s._RF.push({},"0b4098z0xFHGY/qLrEzsi+7","SensorDetailStore",void 0);var u=o.ccclass;e("SensorDetailStore",u("SensorDetailStore")(((c=function(e){function s(){for(var r,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return(r=e.call.apply(e,[this].concat(n))||this).currentSensorName="",r.currentDetails=null,r}r(s,e),s.getInstance=function(){return s._instance||(s._instance=new s),s._instance};var o=s.prototype;return o.onLoad=function(){s._instance=this},o.fetchSensorDetails=function(){var e=t(n().mark((function e(r){var t,s,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",null);case 2:return this.currentSensorName=r,e.prev=3,e.next=6,fetch("http://192.168.0.219:3030/api/v2/sensor-details",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sensorName:r})});case 6:if((t=e.sent).ok){e.next=10;break}return console.error("[SensorDetailStore] Ошибка ответа от сервера: "+t.status),e.abrupt("return",null);case 10:return e.next=12,t.json();case 12:if(!((s=e.sent)&&s.description&&s.description.fields)){e.next=19;break}return o={sensorName:s.name,fields:s.description.fields},this.currentDetails=o,e.abrupt("return",o);case 19:return console.error("[SensorDetailStore] Неверный формат данных:",s),e.abrupt("return",null);case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(3),console.error("[SensorDetailStore] Не удалось загрузить данные датчика:",e.t0),e.abrupt("return",null);case 27:case"end":return e.stop()}}),e,this,[[3,23]])})));return function(r){return e.apply(this,arguments)}}(),o.getCurrentDetails=function(){return this.currentDetails},s}(a))._instance=null,i=c))||i);s._RF.pop()}}}));
|
||||
|
||||
System.register("chunks:///_virtual/SensorFieldItem.ts",["./rollupPluginModLoBabelHelpers.js","cc"],(function(e){var i,t,n,r,a,l,o,s;return{setters:[function(e){i=e.applyDecoratedDescriptor,t=e.inheritsLoose,n=e.initializerDefineProperty,r=e.assertThisInitialized},function(e){a=e.cclegacy,l=e._decorator,o=e.Label,s=e.Component}],execute:function(){var u,c,p,b,L,d,h,f,m,g,v;a._RF.push({},"c1a39jwEUpIVIaHl1hL0Vwq","SensorFieldItem",void 0);var y=l.ccclass,w=l.property;e("SensorFieldItem",(u=y("SensorFieldItem"),c=w(o),p=w(o),b=w(o),L=w(o),u((f=i((h=function(e){function i(){for(var i,t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return i=e.call.apply(e,[this].concat(a))||this,n(i,"nameLabel",f,r(i)),n(i,"valueLabel",m,r(i)),n(i,"unitLabel",g,r(i)),n(i,"descriptionLabel",v,r(i)),i}return t(i,e),i.prototype.setData=function(e){this.nameLabel&&(this.nameLabel.string=e.name),this.valueLabel&&(this.valueLabel.string=String(e.value)),this.unitLabel&&(this.unitLabel.string=e.unit),this.descriptionLabel&&(e.description&&""!==e.description.trim()?(this.descriptionLabel.string=e.description,this.descriptionLabel.node.active=!0):this.descriptionLabel.node.active=!1)},i}(s)).prototype,"nameLabel",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),m=i(h.prototype,"valueLabel",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),g=i(h.prototype,"unitLabel",[b],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),v=i(h.prototype,"descriptionLabel",[L],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),d=h))||d));a._RF.pop()}}}));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user