2 lines
No EOL
15 KiB
JavaScript
2 lines
No EOL
15 KiB
JavaScript
webpackJsonp([1],{"5JaW":function(t,e){},"6bvb":function(t,e){},"6uTY":function(t,e){},HaXl:function(t,e){},NHnr:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("7+uW"),a={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",t._l(t.list,function(e,s){return i("v-alert",{key:s,attrs:{icon:"info",id:s,color:e.type,value:"true",transition:"slide-y-transition"},on:{click:t.deleteNotes}},[t._v("\n "+t._s(e.msg)+" \n ")])}))},staticRenderFns:[]};var n=i("VU/8")({data:function(){return{list:[]}},sockets:{notifications:function(t){this.list.push(t)}},methods:{deleteNotes:function(t){var e=t.target.parentElement.id;this.list=this.list.filter(function(t,i){return e!=i})}}},a,!1,function(t){i("6bvb")},null,null).exports,o={props:["tcpState","serialState"],data:function(){return{output:""}},sockets:{consoleIn:function(t){if(!0===this.tcpState){var e=document.createElement("div");e.textContent=t;document.getElementById("console-input").prepend(e)}}},methods:{consoleOut:function(){""!==this.output&&(this.$socket.emit("console-out",this.output.replace(/\s/g,"")),this.output="")}}},r={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-layout",{attrs:{row:"",wrap:""}},[i("v-flex",{attrs:{"d-flex":"",xs12:""}},[i("div",{staticClass:"ui fluid consoleMes",attrs:{id:"console-input"}})]),t._v(" "),i("v-flex",{attrs:{"d-flex":"",xs12:""}},[i("v-text-field",{attrs:{disabled:!t.tcpState,label:"Envoi Message Console"},on:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key))return null;t.consoleOut(e)}},model:{value:t.output,callback:function(e){t.output=e},expression:"output"}}),t._v(" "),i("v-btn",{attrs:{disabled:!t.tcpState,icon:"",color:"primary",dark:""},on:{click:t.consoleOut}},[i("v-icon",[t._v("send")])],1)],1)],1)],1)},staticRenderFns:[]};var c=i("VU/8")(o,r,!1,function(t){i("pSDN")},null,null).exports,l={data:function(){return{keyup:!1,keydown:!1,keyleft:!1,keyright:!1}},mounted:function(){var t=this;window.addEventListener("keydown",function(e){37==e.keyCode&&(t.keyleft=!0),38==e.keyCode&&(t.keyup=!0),39==e.keyCode&&(t.keyright=!0),40==e.keyCode&&(t.keydown=!0)}),window.addEventListener("keyup",function(e){37==e.keyCode&&(t.keyleft=!1),38==e.keyCode&&(t.keyup=!1),39==e.keyCode&&(t.keyright=!1),40==e.keyCode&&(t.keydown=!1)})},watch:{keyup:function(){!0===this.keyup?this.$socket.emit("MOVEFORWARD"):this.$socket.emit("MOVESTOP")},keyleft:function(){!0===this.keyleft?this.$socket.emit("MOVERIGHT"):this.$socket.emit("MOVESTOP")},keydown:function(){!0===this.keydown?this.$socket.emit("MOVEBACK"):this.$socket.emit("MOVESTOP")},keyright:function(){!0===this.keyright?this.$socket.emit("MOVELEFT"):this.$socket.emit("MOVESTOP")}}},d={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"command"},[e("img",{staticClass:"direction",class:{touched:this.keyup},attrs:{id:"up",src:"/static/arrow-up.svg"}}),this._v(" "),e("div",[e("img",{staticClass:"direction",class:{touched:this.keyleft},attrs:{id:"left",src:"/static/arrow-left.svg"}}),this._v(" "),e("img",{staticClass:"direction",class:{touched:this.keydown},attrs:{id:"down",src:"/static/arrow-down.svg"}}),this._v(" "),e("img",{staticClass:"direction",class:{touched:this.keyright},attrs:{id:"right",src:"/static/arrow-right.svg"}})])])},staticRenderFns:[]};var u=i("VU/8")(l,d,!1,function(t){i("SkP1")},null,null).exports,v={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-footer",{staticClass:"pa-3",attrs:{color:"pink darken-3"}},[i("div",{staticStyle:{color:"white"}},[t._v("L.Senaneuch")]),t._v(" "),i("v-spacer"),t._v(" "),i("img",{staticClass:"logo-vue",attrs:{src:"static/logo.png",alt:"logo-vue"}}),t._v(" "),i("img",{staticClass:"logo-vue",attrs:{src:"static/logo-node.png",alt:"logo-node"}}),t._v(" "),i("v-spacer"),t._v(" "),i("div",{staticStyle:{color:"white"}},[t._v("© INSA - Toulouse "+t._s((new Date).getFullYear()))])],1)},staticRenderFns:[]};var p=i("VU/8")(null,v,!1,function(t){i("6uTY")},null,null).exports,h={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"led",class:{light:this.ledOn}})},staticRenderFns:[]};var f={components:{Voyant:i("VU/8")({props:["ledOn"],data:function(){return{light:!1}}},h,!1,function(t){i("SDLs")},null,null).exports},props:["tcpState","serialState"],data:function(){return{robotRun:!1,battery:0,batterie_src:""}},sockets:{BAT:function(t){this.battery=parseInt(t)},robotState:function(t){}},watch:{battery:function(){switch(this.battery){case 0:this.batterie_src="static/battery_low_white.svg";break;case 1:this.batterie_src="static/battery_medium_white.svg";break;case 2:this.batterie_src="static/battery_full_white.svg";break;default:this.batterie_src=""}}},methods:{tcpManageRq:function(){0==this.tcpState?(this.$socket.emit("askConnection"),console.log("demande de connection")):this.$socket.emit("askDisconnection")},manageSerial:function(){this.tcpState&&this.$socket.emit("openSerial",!this.serialState)},runWithWDRq:function(){},runWithoutWDRq:function(){},idleDumby:function(){},manageCamera:function(){},arenaDetectionRq:function(){}}},m={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-toolbar",{attrs:{dark:"",color:"pink darken-3"}},[i("v-toolbar-title",{staticClass:"white-text hidden-sm-and-down"},[t._v("Dumby User Interface")]),t._v(" "),i("v-menu",{attrs:{"nudge-width":100}},[i("img",{staticClass:"logo",attrs:{slot:"activator",id:"logo-connection",src:"static/logo_connection.svg"},slot:"activator"}),t._v(" "),i("v-list",[i("v-list-tile",{on:{click:t.tcpManageRq}},[i("v-list-tile-title",[t.tcpState?i("div",[t._v("Deconnection au Superviseur")]):i("div",[t._v("Connexion au Superviseur")])])],1),t._v(" "),i("v-list-tile",{staticClass:"hidden-sm-and-up",attrs:{disabled:!t.tcpState},on:{click:t.manageSerial}},[i("v-list-tile-title",[t.serialState?i("div",[t._v(" Deconnexion au Robot ")]):i("div",[t._v(" Connexion au Robot")])])],1)],1)],1),t._v(" "),i("v-menu",{staticClass:"hidden-sm-and-up",attrs:{"nudge-width":100}},[i("img",{staticClass:"logo",attrs:{slot:"activator",id:"logo-robot",src:"static/logo_dumby_white.svg"},slot:"activator"}),t._v(" "),i("v-list",[i("v-list-tile",{attrs:{disabled:!t.serialState},on:{click:t.runWithWDRq}},[i("v-list-tile-title",[t._v("Demarrer avec Watchdog")])],1),t._v(" "),i("v-list-tile",{attrs:{disabled:!t.serialState},on:{click:t.runWithoutWDRq}},[i("v-list-tile-title",[t._v(" Demarrer Sans Watchdog")])],1),t._v(" "),i("v-list-tile",{attrs:{disabled:!t.serialState},on:{click:t.idleDumby}},[i("v-list-tile-title",[t._v(" Stoper le robot")])],1)],1)],1),t._v(" "),i("v-menu",{staticClass:"hidden-sm-and-up",attrs:{"nudge-width":100}},[i("v-icon",{staticClass:"logo",attrs:{slot:"activator"},slot:"activator"},[t._v("camera_alt ")]),t._v(" "),i("v-list",[i("v-list-tile",{attrs:{disabled:!t.tcpState},on:{click:t.manageCamera}},[i("v-list-tile-title",[t._v("Activer / Désactiver Camera")])],1),t._v(" "),i("v-list-tile",{attrs:{disabled:!t.tcpState},on:{click:t.arenaDetectionRq}},[i("v-list-tile-title",[t._v("Detection Arene")])],1)],1)],1),t._v(" "),i("v-spacer"),t._v(" "),i("v-tooltip",[i("Voyant",{attrs:{slot:"activator",id:"led-connection",ledOn:t.tcpState},slot:"activator"}),t._v(" "),i("span",[t._v("Etat de connection au Superviseur")])],1),t._v(" "),i("v-tooltip",[i("img",{attrs:{slot:"activator",id:"logo-battery",src:t.batterie_src,alt:""},slot:"activator"}),t._v(" "),i("span",[t._v("Niveau de batterie")])])],1)},staticRenderFns:[]};var _,k=i("VU/8")(f,m,!1,function(t){i("5JaW")},null,null).exports,g=i("bOdI"),b=i.n(g),y={props:["tcpState"],data:function(){return{source:"/static/neige.jpg",fps:1,cameraActive:!1,positionState:!1,detectionMode:!1,positionMode:!1,robot:{x:-1,y:-1},cursor:{x:null,y:null}}},methods:(_={hexToBase64:function(t){return btoa(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")))},manageCamera:function(){!0===this.tcpState&&this.$socket.emit("camera",!this.cameraActive)},askArena:function(){!0===this.cameraActive&&this.$socket.emit("arena","ask"),this.detectionMode=!0},displayPos:function(){!0===this.cameraActive&&(this.$socket.emit("displayPos",!positionMode),this.positionMode=!this.positionMode)},confirmArena:function(){!0===this.cameraActive&&(this.$socket.emit("arena","ok"),this.detectionMode=!1)},infirmArena:function(){!0===this.cameraActive&&(this.$socket.emit("arena","nok"),this.detectionMode=!1)}},b()(_,"displayPos",function(){!0===this.cameraActive&&(this.$socket.emit("displayPos",!this.positionMode),this.positionMode=!this.positionMode)}),b()(_,"sendPos",function(t){if(!0===this.positionMode){var e=document.getElementById("video").getBoundingClientRect(),i=t.pageX-e.x|0,s=t.pageY-e.y;this.cursor.x=parseInt(480/e.width*i),this.cursor.y=parseInt(360/e.height*s),this.$socket.emit("sendPos",this.cursor)}}),_),sockets:{IMG:function(t){if(this.cameraActive){this.source="data:image/jpeg;base64,",this.source+=this.hexToBase64(t),this.fps++}},POS:function(t){var e=t.substr(11);e=e.split(";");var i=Number(e[0]),s=e[1].split("|"),a={x:i,y:s=Number(s[0])};this.robot=a},cameraState:function(t){this.cameraActive=t},detectionError:function(){this.detectionMode=!1}},mounted:function(){setInterval(function(){document.getElementById("fps").innerText=this.fps+" fps",this.fps=0}.bind(this),1e3)},watch:{tcpState:function(){0==this.tcpState&&(this.cameraActive=!1,this.source="/static/neige.jpg")}}},S={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-card",[i("img",{attrs:{draggable:"false",id:"video",src:t.source,alt:"Flux Video"},on:{click:t.sendPos}}),t._v(" "),i("p",{attrs:{id:"fps"}}),t._v(" "),i("v-card-actions",[t.detectionMode?i("div",[i("v-btn",{attrs:{disabled:!t.cameraActive,flat:"",color:"orange"},on:{click:t.confirmArena}},[t._v("L'arene me plait")]),t._v(" "),i("v-btn",{attrs:{disabled:!t.cameraActive,flat:"",color:"orange"},on:{click:t.infirmArena}},[t._v("L'arene ne me plait pas")])],1):i("div",[i("v-btn",{attrs:{disabled:!t.tcpState,flat:"",color:"orange"},on:{click:t.manageCamera}},[t.cameraActive?i("div",[t._v("Désactiver Camera")]):i("div",[t._v("Activer Camera")])]),t._v(" "),i("v-btn",{attrs:{disabled:!t.cameraActive,flat:"",color:"orange"},on:{click:t.askArena}},[t._v("Detection Arene")]),t._v(" "),i("v-btn",{attrs:{disabled:!t.cameraActive,flat:"",color:"orange"},on:{click:t.displayPos}},[t.positionMode?i("div",[t._v("Ne plus afficher la position")]):i("div",[t._v("Afficher la position")])])],1),t._v(" "),t.positionMode?i("div",{staticClass:"subheadingfont position_place"},[t.positionMode?i("span",[t._v(" Position : "+t._s(t.robot.x)+", "+t._s(t.robot.y))]):t._e()]):t._e(),t._v(" "),t.positionMode&&null!==this.cursor.x?i("div",{staticClass:"subheadingfont position_place"},[i("span",[t._v(" Ordre : "+t._s(t.cursor.x)+", "+t._s(t.cursor.y))])]):t._e()])],1)},staticRenderFns:[]};var C={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"loading"},[e("v-progress-circular",{attrs:{indeterminate:"",size:70,width:7,color:"purple"}}),this._v(" "),e("h1",[this._v("Non Connecté ! Veuillez vérifier que le serveur node a bien été lancé. Puis rafraichissez la page !")])],1)},staticRenderFns:[]};var w={components:{Controller:u},data:function(){return{dumbyStarted:!1}},props:["tcpState","serialState"],methods:{manageSerial:function(t){this.tcpState?this.$socket.emit("openSerial",!this.serialState):this.serialState=!1,void 0!==t&&(this.serialState=t)},startWithWD:function(){this.$socket.emit("startWithWD")},startWithoutWD:function(){this.$socket.emit("startWitouthWD")},stopIdle:function(){this.$socket.emit("idle")}},sockets:{dumbyStart:function(t){!0===this.serialState?this.dumbyStarted=t:this.dumbyStarted=!1},lostSerial:function(){this.dumbyStarted=!1,this.serialState=!1}},watch:{serialState:function(){!1===this.serialState&&(this.dumbyStarted=!1,this.manageSerial(!1))}}},x={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-card",{attrs:{color:"grey lighten-4",flat:""}},[i("v-card-title",{staticClass:"title hidden-xs",attrs:{primary:""}},[i("div",{staticClass:"center"},[i("h3",{staticClass:"display-1 mb-0"},[t._v("Robot Dashboard")]),t._v(" "),i("div",{staticClass:"title"},[t._v("\n Demande d'ouverture du serial port "),i("v-btn",{attrs:{slot:"activator",disabled:!t.tcpState,color:"primary",flat:""},on:{click:t.manageSerial},slot:"activator"},[t.serialState?i("div",[t._v("Fermeture Serial")]):i("div",[t._v("Ouverture Serial")])])],1),t._v(" "),i("div",{staticClass:"title"},[t._v("\n Faire changer le robot d'état\n "),i("v-menu",{attrs:{disabled:!t.serialState,"offset-y":""}},[i("v-btn",{attrs:{slot:"activator",disabled:!t.serialState,color:"primary",flat:""},slot:"activator"},[t._v("RUN ou IDLE")]),t._v(" "),i("v-list",[i("v-list-tile",{on:{click:t.startWithWD}},[i("v-list-tile-title",[t._v(" Demarer avec watchdog ")])],1),t._v(" "),i("v-list-tile",{on:{click:t.startWithoutWD}},[i("v-list-tile-title",[t._v(" Demarer sans watchdog ")])],1),t._v(" "),i("v-list-tile",{on:{click:t.stopIdle}},[i("v-list-tile-title",[t._v(" Robot à l'état IDLE ")])],1)],1)],1)],1)])]),t._v(" "),t.dumbyStarted?i("Controller"):t._e()],1)},staticRenderFns:[]};var D={name:"App",data:function(){return{wsConnected:!1,tcpConnected:!1,serialOpened:!1}},components:{NotesList:n,Console:c,Controller:u,Navbar:k,FooterBar:p,Video:i("VU/8")(y,S,!1,function(t){i("i/ws")},null,null).exports,Loading:i("VU/8")(null,C,!1,function(t){i("RBpr")},null,null).exports,Dashboard:i("VU/8")(w,x,!1,function(t){i("kGHt")},null,null).exports},sockets:{connect:function(){return this.wsConnected=!0},disconnect:function(){this.wsConnected=!1,this.tcpConnected=!1,this.tcpSerial=!1},superViseurConnection:function(t){"boolean"==typeof t&&(this.tcpConnected=t),!1===t&&(this.serialOpened=!1)},serialOpen:function(t){"boolean"==typeof t&&(this.serialOpened=t)}}},$={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"app"}},[t.wsConnected?i("v-app",[i("NotesList",{staticClass:"notif"}),t._v(" "),i("v-container",{attrs:{"grid-list-md":""}},[i("Navbar",{attrs:{tcpState:t.tcpConnected,serialState:t.serialOpened}}),t._v(" "),i("v-layout",{attrs:{row:"",wrap:""}},[i("v-flex",{attrs:{"d-flex":"",xs12:"",sm6:"",md6:""}},[i("Video",{attrs:{tcpState:t.tcpConnected}})],1),t._v(" "),i("v-flex",{attrs:{"d-flex":"",xs12:"",sm6:"",md6:""}},[i("v-layout",{attrs:{row:"",wrap:"",xs12:""}},[i("v-flex",{attrs:{"d-flex":""}},[i("Dashboard",{attrs:{tcpState:t.tcpConnected,serialState:t.serialOpened}})],1)],1)],1),t._v(" "),i("v-flex",{staticClass:"hidden-sm-and-down",attrs:{"d-flex":"",xs12:"",sm12:"",md12:""}},[i("Console",{attrs:{tcpState:t.tcpConnected,serialState:t.serialOpened}})],1)],1),t._v(" "),i("FooterBar")],1)],1):i("v-app",[i("Loading",{staticClass:"center"})],1)],1)},staticRenderFns:[]};var A=i("VU/8")(D,$,!1,function(t){i("HaXl")},null,null).exports,M=i("hMcO"),E=i.n(M),O=i("3EgV"),R=i.n(O);s.a.config.productionTip=!1,s.a.use(R.a),s.a.use(E.a,location.toString()),new s.a({el:"#app",components:{App:A},template:"<App/>"})},RBpr:function(t,e){},SDLs:function(t,e){},SkP1:function(t,e){},"i/ws":function(t,e){},kGHt:function(t,e){},pSDN:function(t,e){}},["NHnr"]);
|
|
//# sourceMappingURL=app.29d7c2a7593408c61110.js.map
|