mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
2 lines
61 KiB
JavaScript
2 lines
61 KiB
JavaScript
(function(e){function t(t){for(var n,r,o=t[0],l=t[1],c=t[2],d=0,p=[];d<o.length;d++)r=o[d],Object.prototype.hasOwnProperty.call(i,r)&&i[r]&&p.push(i[r][0]),i[r]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);u&&u(t);while(p.length)p.shift()();return s.push.apply(s,c||[]),a()}function a(){for(var e,t=0;t<s.length;t++){for(var a=s[t],n=!0,o=1;o<a.length;o++){var l=a[o];0!==i[l]&&(n=!1)}n&&(s.splice(t--,1),e=r(r.s=a[0]))}return e}var n={},i={app:0},s=[];function r(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=n,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],l=o.push.bind(o);o.push=t,o=o.slice();for(var c=0;c<o.length;c++)t(o[c]);var u=l;s.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"034f":function(e,t,a){"use strict";var n=a("8a23"),i=a.n(n);i.a},"0caf":function(e,t,a){"use strict";var n=a("5095"),i=a.n(n);i.a},1:function(e,t){},2:function(e,t){},2236:function(e,t,a){"use strict";var n=a("92cf"),i=a.n(n);i.a},"3f85":function(e){e.exports=JSON.parse('{"2020 Hex Goal":[[-19.625,0],[-9.819867,-17],[9.819867,-17],[19.625,0]],"2020 Loading Station":[[-3.54,5.5],[-3.54,-5.5],[3.54,-5.5],[3.54,5.5]],"2019 Dual Target":[[-7.75,3],[-7.75,-3],[7.75,-3],[7.75,3]]}')},5095:function(e,t,a){},"53f0":function(e,t,a){"use strict";var n=a("a405"),i=a.n(n);i.a},"56d7":function(e,t,a){"use strict";a.r(t);var n=a("2b0e"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-app",[n("v-app-bar",{attrs:{app:"",dense:"","clipped-left":"",dark:""}},[n("img",{staticClass:"imgClass",attrs:{src:a("cf05")}}),n("v-toolbar-title",{attrs:{id:"title"}},[e._v(" Chameleon Vision ")]),n("div",{staticClass:"flex-grow-1"}),n("v-toolbar-items",[n("v-tabs",{attrs:{"background-color":"#272727",dark:"",height:"48","slider-color":"#4baf62"}},[n("v-tab",{attrs:{to:"vision"}},[e._v(" Vision ")]),n("v-tab",{attrs:{to:"settings"}},[e._v(" Settings ")])],1)],1)],1),n("v-content",[n("v-container",{attrs:{fluid:"","fill-height":""}},[n("v-layout",[n("v-flex",[n("router-view",{on:{save:e.startTimer}}),n("v-snackbar",{attrs:{timeout:1e3,top:"",color:"#4baf62"},model:{value:e.saveSnackbar,callback:function(t){e.saveSnackbar=t},expression:"saveSnackbar"}},[n("div",{staticStyle:{"text-align":"center",width:"100%"}},[n("h4",[e._v("Saved All changes")])])]),e.isLogger?n("div",[n("keep-alive",[n("log-view",{staticClass:"loggerClass",attrs:{log:e.log}})],1)],1):e._e()],1)],1)],1)],1)],1)},s=[],r=a("e897"),o={name:"App",components:{logView:r["a"]},data:()=>({timer:void 0,isLogger:!1,log:""}),computed:{saveSnackbar:{get(){return this.$store.state.saveBar},set(e){this.$store.commit("saveBar",e)}}},created(){document.addEventListener("keydown",e=>{switch(e.key){case"`":this.isLogger=!this.isLogger;break;case"z":e.ctrlKey&&this.$store.getters.canUndo&&this.$store.dispatch("undo",{vm:this});break;case"y":e.ctrlKey&&this.$store.getters.canRedo&&this.$store.dispatch("redo",{vm:this});break}}),this.$options.sockets.onmessage=e=>{try{let t=this.$msgPack.decode(e.data);for(let e in t)t.hasOwnProperty(e)&&this.handleMessage(e,t[e])}catch(t){console.error("error: "+e.data+" , "+t)}}},methods:{handleMessage(e,t){if(this.$store.state.hasOwnProperty(e))this.$store.commit(e,t);else if(this.$store.state.pipeline.hasOwnProperty(e))this.$store.commit("mutatePipeline",{key:e,value:t});else switch(e){default:console.log(e+" : "+t)}},saveSettings(){clearInterval(this.timer),this.saveSnackbar=!0,this.handleInput("command","save")},startTimer(){void 0!==this.timer&&clearInterval(this.timer),this.timer=setInterval(this.saveSettings,4e3)},logMessage({message:e,level:t}){const a=["[31m","[32m","[33m","[34m"],n="[0m";this.log+=`${a[t]}${e}${n}\n`}}},l=o,c=(a("034f"),a("2877")),u=a("6544"),d=a.n(u),p=a("7496"),h=a("40dc"),m=a("a523"),v=a("a75b"),g=a("0e8f"),b=a("a722"),f=a("2db4"),k=a("71a3"),x=a("fe57"),C=a("2a7f"),V=Object(c["a"])(l,i,s,!1,null,null,null),$=V.exports;d()(V,{VApp:p["a"],VAppBar:h["a"],VContainer:m["a"],VContent:v["a"],VFlex:g["a"],VLayout:b["a"],VSnackbar:f["a"],VTab:k["a"],VTabs:x["a"],VToolbarItems:C["a"],VToolbarTitle:C["b"]});var y=a("8c4f"),w=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("camera-and-pipeline-select"),a("v-row",[a("v-col",{staticClass:"colsClass",attrs:{cols:"6"}},[e.$store.getters.currentPipelineIndex+1!==0?a("v-tabs",{attrs:{"fixed-tabs":"","background-color":"#212121",dark:"",height:"48","slider-color":"#4baf62"},model:{value:e.selectedTab,callback:function(t){e.selectedTab=t},expression:"selectedTab"}},[a("v-tab",[e._v("Input")]),a("v-tab",[e._v("Threshold")]),a("v-tab",[e._v("Contours")]),a("v-tab",[e._v("Output")]),a("v-tab",[e._v("3D")])],1):a("div",{staticStyle:{height:"48px"}}),a("div",{staticStyle:{"padding-left":"30px"}},[a("keep-alive",[a(e.selectedComponent,{ref:"component",tag:"component",on:{update:function(t){return e.$emit("save")}},model:{value:e.$store.getters.pipeline,callback:function(t){e.$set(e.$store.getters,"pipeline",t)},expression:"$store.getters.pipeline"}})],1)],1)],1),a("v-col",{staticClass:"colsClass",attrs:{cols:"6"}},[a("div",[e.$store.getters.currentPipelineIndex+1!==0?a("v-tabs",{staticStyle:{"padding-bottom":"10px"},attrs:{"background-color":"#212121",dark:"",height:"48","slider-color":"#4baf62",centered:""},on:{change:function(t){return e.handleInput("isBinary",e.$store.getters.pipeline.isBinary)}},model:{value:e.isBinaryNumber,callback:function(t){e.isBinaryNumber=t},expression:"isBinaryNumber"}},[a("v-tab",[e._v("Normal")]),a("v-tab",[e._v("Threshold")])],1):a("div",{staticStyle:{height:"58px"}}),a("div",{staticClass:"videoClass"},[a("v-row",{attrs:{align:"center"}},[a("cvImage",{attrs:{address:e.$store.getters.streamAddress,scale:75},on:{click:e.onImageClick}})],1),a("v-row",{attrs:{justify:"end"}},[a("span",{staticStyle:{"margin-right":"45px"}},[e._v("FPS:"+e._s(parseFloat(e.fps).toFixed(2)))])]),a("v-row",{attrs:{align:"center"}},[a("v-simple-table",{staticStyle:{"text-align":"center","background-color":"transparent",display:"block",margin:"auto"},attrs:{dense:"",dark:""},scopedSlots:e._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",{staticClass:"text-center"},[e._v(" Target ")]),a("th",{staticClass:"text-center"},[e._v(" Pitch ")]),a("th",{staticClass:"text-center"},[e._v(" Yaw ")]),a("th",{staticClass:"text-center"},[e._v(" Area ")])])]),a("tbody",e._l(e.$store.getters.targets,(function(t,n){return a("tr",{key:n},[a("td",[e._v(e._s(n))]),a("td",[e._v(e._s(parseFloat(t["pitch"]).toFixed(2)))]),a("td",[e._v(e._s(parseFloat(t["yaw"]).toFixed(2)))]),a("td",[e._v(e._s(parseFloat(t["area"]).toFixed(2)))])])})),0)]},proxy:!0}])})],1)],1)],1)])],1),a("v-snackbar",{attrs:{timeout:3e3,top:"",color:"error"},model:{value:e.snackbar,callback:function(t){e.snackbar=t},expression:"snackbar"}},[a("span",{staticStyle:{color:"#000"}},[e._v("Can not remove the only pipeline!")]),a("v-btn",{attrs:{color:"black",text:""},on:{click:function(t){e.snackbar=!1}}},[e._v(" Close ")])],1)],1)},S=[],_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{align:"center"}},[a("v-col",{attrs:{cols:3}},[a("div",{staticStyle:{"padding-left":"30px"}},[!1===e.isCameraNameEdit?a("CVselect",{attrs:{name:"Camera",list:e.$store.getters.cameraList},on:{input:function(t){return e.handleInput("currentCamera",e.currentCameraIndex)}},model:{value:e.currentCameraIndex,callback:function(t){e.currentCameraIndex=t},expression:"currentCameraIndex"}}):a("CVinput",{attrs:{name:"Camera","error-message":e.checkCameraName},on:{Enter:e.saveCameraNameChange},model:{value:e.newCameraName,callback:function(t){e.newCameraName=t},expression:"newCameraName"}})],1)]),a("v-col",{attrs:{cols:1}},[!1===e.isCameraNameEdit?a("CVicon",{attrs:{color:"#c5c5c5",hover:!0,text:"edit",tooltip:"Edit camera name"},on:{click:e.toCameraNameChange}}):a("div",[a("CVicon",{staticStyle:{display:"inline-block"},attrs:{color:"#c5c5c5",hover:!0,text:"save",tooltip:"Save Camera Name"},on:{click:e.saveCameraNameChange}}),a("CVicon",{staticStyle:{display:"inline-block"},attrs:{color:"error",hover:!0,text:"close",tooltip:"Discard Changes"},on:{click:e.discardCameraNameChange}})],1)],1),a("v-col",{attrs:{cols:3}},[a("CVselect",{attrs:{name:"Pipeline",list:["Driver Mode"].concat(e.$store.getters.pipelineList)},on:{input:function(t){return e.handleInput("currentPipeline",e.currentPipelineIndex-1)}},model:{value:e.currentPipelineIndex,callback:function(t){e.currentPipelineIndex=t},expression:"currentPipelineIndex"}})],1),0!==e.currentPipelineIndex?a("v-col",{attrs:{cols:1,md:"3"}},[a("v-menu",{attrs:{"offset-y":"",dark:"",auto:""},scopedSlots:e._u([{key:"activator",fn:function(t){var n=t.on;return[a("v-icon",e._g({attrs:{color:"white"}},n),[e._v(" menu ")])]}}],null,!1,3319052417)},[a("v-list",{attrs:{dense:""}},[a("v-list-item",{on:{click:e.toPipelineNameChange}},[a("v-list-item-title",[a("CVicon",{attrs:{color:"#c5c5c5",right:!0,text:"edit",tooltip:"Edit pipeline name"}})],1)],1),a("v-list-item",{on:{click:e.toCreatePipeline}},[a("v-list-item-title",[a("CVicon",{attrs:{color:"#c5c5c5",right:!0,text:"add",tooltip:"Add new pipeline"}})],1)],1),a("v-list-item",{on:{click:e.deleteCurrentPipeline}},[a("v-list-item-title",[a("CVicon",{attrs:{color:"red darken-2",right:!0,text:"delete",tooltip:"Delete pipeline"}})],1)],1),a("v-list-item",{on:{click:e.openDuplicateDialog}},[a("v-list-item-title",[a("CVicon",{attrs:{color:"#c5c5c5",right:!0,text:"mdi-content-copy",tooltip:"Duplicate pipeline"}})],1)],1)],1)],1)],1):e._e(),a("v-btn",{staticStyle:{position:"absolute",top:"5px",right:"0"},attrs:{tile:"",color:"#4baf62"},on:{click:function(t){return e.handleInput("command","save")}}},[a("v-icon",[e._v("save")]),e._v(" Save ")],1)],1),a("v-dialog",{attrs:{dark:"",width:"500",height:"357"},model:{value:e.duplicateDialog,callback:function(t){e.duplicateDialog=t},expression:"duplicateDialog"}},[a("v-card",{attrs:{dark:""}},[a("v-card-title",{staticClass:"headline",attrs:{"primary-title":""}},[e._v(" Duplicate Pipeline ")]),a("v-card-text",[a("CVselect",{attrs:{name:"Pipeline",list:e.$store.getters.pipelineList},model:{value:e.pipelineDuplicate.pipeline,callback:function(t){e.$set(e.pipelineDuplicate,"pipeline",t)},expression:"pipelineDuplicate.pipeline"}}),e.$store.getters.cameraList.length>1?a("v-checkbox",{attrs:{dark:"",label:"To another camera"},model:{value:e.anotherCamera,callback:function(t){e.anotherCamera=t},expression:"anotherCamera"}}):e._e(),!0===e.anotherCamera?a("CVselect",{attrs:{name:"Camera",list:e.$store.getters.cameraList},model:{value:e.pipelineDuplicate.camera,callback:function(t){e.$set(e.pipelineDuplicate,"camera",t)},expression:"pipelineDuplicate.camera"}}):e._e()],1),a("v-divider"),a("v-card-actions",[a("v-spacer"),a("v-btn",{attrs:{color:"#4baf62"},on:{click:e.duplicatePipeline}},[e._v(" Duplicate ")]),a("v-btn",{attrs:{color:"error"},on:{click:e.closeDuplicateDialog}},[e._v(" Cancel ")])],1)],1)],1),a("v-dialog",{attrs:{dark:"",width:"500",height:"357"},model:{value:e.namingDialog,callback:function(t){e.namingDialog=t},expression:"namingDialog"}},[a("v-card",{attrs:{dark:""}},[a("v-card-title",{staticClass:"headline",attrs:{"primary-title":""}},[e._v(" Pipeline Name ")]),a("v-card-text",[a("CVinput",{attrs:{name:"Pipeline","error-message":e.checkPipelineName},on:{Enter:e.savePipelineNameChange},model:{value:e.newPipelineName,callback:function(t){e.newPipelineName=t},expression:"newPipelineName"}})],1),a("v-divider"),a("v-card-actions",[a("v-spacer"),a("v-btn",{attrs:{color:"#4baf62",disabled:""!==e.checkPipelineName},on:{click:e.savePipelineNameChange}},[e._v(" Save ")]),a("v-btn",{attrs:{color:"error"},on:{click:e.discardPipelineNameChange}},[e._v(" Cancel ")])],1)],1)],1)],1)},P=[],I=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-tooltip",{attrs:{right:e.right,bottom:!e.right,"nudge-right":"10"},scopedSlots:e._u([{key:"activator",fn:function(t){var n=t.on;return[a("v-icon",e._g({class:e.hoverClass,attrs:{color:e.color},on:{click:e.handleClick}},n),[e._v(" "+e._s(e.text)+" ")])]}}])},[a("span",[e._v(e._s(e.tooltip))])])],1)},D=[],M={name:"Icon",props:["color","tooltip","text","right","hover"],data(){return{}},computed:{hoverClass:{get(){return void 0!==this.hover?"hover":""}}},methods:{handleClick(){this.$emit("click")}}},N=M,T=(a("2236"),a("132d")),L=a("3a2f"),F=Object(c["a"])(N,I,D,!1,null,"6fe754e4",null),B=F.exports;d()(F,{VIcon:T["a"],VTooltip:L["a"]});var O=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:3}},[a("span",[e._v(e._s(e.name))])]),a("v-col",{attrs:{cols:9}},[a("v-select",{attrs:{items:e.indexList,"item-text":"name","item-value":"index",dark:"",color:"#4baf62","item-color":"green",disabled:e.disabled},on:{change:function(t){return e.$emit("rollback",e.localValue)}},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)],1)],1)},E=[],R={name:"Select",props:["list","name","value","disabled"],data(){return{}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}},indexList(){let e=[];for(let t=0;t<this.list.length;t++)e.push({name:this.list[t],index:t});return e}}},A=R,j=a("62ad"),z=a("0fd9"),G=a("b974"),U=Object(c["a"])(A,O,E,!1,null,null,null),H=U.exports;d()(U,{VCol:j["a"],VRow:z["a"],VSelect:G["a"]});var W=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:3}},[a("span",[e._v(e._s(e.name))])]),a("v-col",{attrs:{cols:9}},[a("v-text-field",{attrs:{dark:"",dense:"",disabled:e.disabled,"error-messages":e.errorMessage},on:{keydown:e.handleKeyboard},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)],1)],1)},q=[],J={name:"Input",props:["name","value","disabled","errorMessage"],data(){return{}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{handleKeyboard(e){"Enter"===e.key&&this.$emit("Enter")}}},X=J,K=a("8654"),Y=Object(c["a"])(X,W,q,!1,null,"ed99264e",null),Z=Y.exports;d()(Y,{VCol:j["a"],VRow:z["a"],VTextField:K["a"]});var Q={name:"CameraAndPipelineSelect",components:{CVicon:B,CVselect:H,CVinput:Z},data:()=>({re:RegExp("^[A-Za-z0-9 \\-)(]*[A-Za-z0-9][A-Za-z0-9 \\-)(.]*$"),isCameraNameEdit:!1,newCameraName:"",cameraNameError:"",isPipelineNameEdit:!1,namingDialog:!1,newPipelineName:"",duplicateDialog:!1,anotherCamera:!1,pipelineDuplicate:{pipeline:void 0,camera:-1}}),computed:{checkCameraName(){if(this.newCameraName!==this.$store.getters.cameraList[this.currentCameraIndex]){if(!this.re.test(this.newCameraName))return"Camera name can only contain letters, numbers and spaces";for(let e in this.cameraList)if(this.cameraList.hasOwnProperty(e)&&this.newCameraName===this.cameraList[e])return"Camera by that name already Exists"}return""},checkPipelineName(){if(this.newPipelineName!==this.$store.getters.pipelineList[this.currentPipelineIndex-1]||!1===this.isPipelineNameEdit){if(!this.re.test(this.newPipelineName))return"Pipeline name can only contain letters, numbers, and spaces";for(let e in this.$store.getters.pipelineList)if(this.$store.getters.pipelineList.hasOwnProperty(e)&&this.newPipelineName===this.$store.getters.pipelineList[e])return"A pipeline with this name already exists"}return""},currentCameraIndex:{get(){return this.$store.getters.currentCameraIndex},set(e){this.$store.commit("currentPipelineIndex",e-1)}},currentPipelineIndex:{get(){return this.$store.getters.currentPipelineIndex+1},set(e){this.$store.commit("currentPipelineIndex",e-1)}}},methods:{toCameraNameChange(){this.newCameraName=this.$store.getters.cameraList[this.currentCameraIndex],this.isCameraNameEdit=!0},saveCameraNameChange(){""===this.checkCameraName&&(this.handleInput("changeCameraName",this.newCameraName),this.discardCameraNameChange())},discardCameraNameChange(){this.isCameraNameEdit=!1,this.newCameraName=""},toPipelineNameChange(){this.newPipelineName=this.$store.getters.pipelineList[this.currentPipelineIndex-1],this.isPipelineNameEdit=!0,this.namingDialog=!0},toCreatePipeline(){this.newPipelineName="New Pipeline",this.isPipelineNameEdit=!1,this.namingDialog=!0},openDuplicateDialog(){this.pipelineDuplicate={pipeline:this.currentPipelineIndex-1,camera:-1},this.duplicateDialog=!0},deleteCurrentPipeline(){this.$store.getters.pipelineList.length>1?this.handleInput("command","deleteCurrentPipeline"):this.snackbar=!0},savePipelineNameChange(){""===this.checkPipelineName&&(this.isPipelineNameEdit?this.handleInput("changePipelineName",this.newPipelineName):this.handleInput("addNewPipeline",this.newPipelineName),this.discardPipelineNameChange())},duplicatePipeline(){this.anotherCamera||(this.pipelineDuplicate.camera=-1),this.axios.post("http://"+this.$address+"/api/vision/duplicate",this.pipelineDuplicate),this.closeDuplicateDialog()},closeDuplicateDialog(){this.duplicateDialog=!1,this.pipelineDuplicate={pipeline:void 0,camera:-1}},discardPipelineNameChange(){this.namingDialog=!1,this.isPipelineNameEdit=!1,this.newPipelineName=""}}},ee=Q,te=a("8336"),ae=a("b0af"),ne=a("99d9"),ie=a("ac7c"),se=a("169a"),re=a("ce7e"),oe=a("8860"),le=a("da13"),ce=a("5d23"),ue=a("e449"),de=a("2fa4"),pe=Object(c["a"])(ee,_,P,!1,null,"05cf6d2f",null),he=pe.exports;d()(pe,{VBtn:te["a"],VCard:ae["a"],VCardActions:ne["a"],VCardText:ne["b"],VCardTitle:ne["c"],VCheckbox:ie["a"],VCol:j["a"],VDialog:se["a"],VDivider:re["a"],VIcon:T["a"],VList:oe["a"],VListItem:le["a"],VListItemTitle:ce["b"],VMenu:ue["a"],VRow:z["a"],VSpacer:de["a"]});var me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("img",{style:e.styleObject,attrs:{id:"CameraStream",src:e.address,crossorigin:"Anonymous",alt:""},on:{click:function(t){return e.$emit("click",t)}}})},ve=[],ge={name:"CvImage",props:["address","scale"],data:()=>({}),computed:{styleObject:{get(){return{width:this.scale+"%",height:this.scale+"%",display:"block",margin:"auto"}}}}},be=ge,fe=Object(c["a"])(be,me,ve,!1,null,null,null),ke=fe.exports,xe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVslider",{attrs:{name:"Exposure",min:0,max:100},on:{input:function(t){return e.handleData("exposure")},rollback:function(t){return e.rollback("exposure",t)}},model:{value:e.value.exposure,callback:function(t){e.$set(e.value,"exposure",t)},expression:"value.exposure"}}),a("CVslider",{attrs:{name:"Brightness",min:0,max:100},on:{input:function(t){return e.handleData("brightness")},rollback:function(t){return e.rollback("brightness",t)}},model:{value:e.value.brightness,callback:function(t){e.$set(e.value,"brightness",t)},expression:"value.brightness"}}),-1!==e.value.gain?a("CVslider",{attrs:{name:"Gain",min:0,max:100},on:{input:function(t){return e.handleData("gain")},rollback:function(t){return e.rollback("gain",t)}},model:{value:e.value.gain,callback:function(t){e.$set(e.value,"gain",t)},expression:"value.gain"}}):e._e(),a("CVselect",{attrs:{name:"Orientation",list:["Normal","90° CW","180°","90° CCW"]},on:{input:function(t){return e.handleData("rotationMode")},rollback:function(t){return function(t){return e.rollback("rotationMode",t)}}},model:{value:e.value.rotationMode,callback:function(t){e.$set(e.value,"rotationMode",t)},expression:"value.rotationMode"}}),a("CVselect",{attrs:{name:"Resolution",list:e.resolutionList},on:{input:function(t){return e.handleData("videoModeIndex")},rollback:function(t){return e.rollback("videoModeIndex",t)}},model:{value:e.value.videoModeIndex,callback:function(t){e.$set(e.value,"videoModeIndex",t)},expression:"value.videoModeIndex"}}),a("CVselect",{attrs:{name:"Stream Resolution",list:e.streamResolutionList},on:{input:function(t){return e.handleData("streamDivisor")},rollback:function(t){return e.rollback("streamDivisor",t)}},model:{value:e.value.streamDivisor,callback:function(t){e.$set(e.value,"streamDivisor",t)},expression:"value.streamDivisor"}})],1)},Ce=[],Ve=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",{attrs:{cols:10}},[a("v-slider",{staticClass:"align-center",attrs:{value:e.localValue,dark:"",max:e.max,min:e.min,"hide-details":"",color:"#4baf62",step:e.step},on:{start:function(t){e.isClicked=!0},end:function(t){e.isClicked=!1},change:e.handleclick,input:e.handleInput,mousedown:function(t){return e.$emit("rollback",e.localValue)}},scopedSlots:e._u([{key:"append",fn:function(){return[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"50px"},attrs:{dark:"",max:e.max,min:e.min,value:e.localValue,"hide-details":"","single-line":"",type:"number",step:e.step},on:{input:e.handleChange,focus:function(t){e.isFocused=!0},blur:function(t){e.isFocused=!1}}})]},proxy:!0}])})],1)],1)],1)},$e=[],ye={name:"Slider",props:["min","max","name","value","step"],data(){return{isFocused:!1,isClicked:!1}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{handleChange(e){this.isFocused&&(this.localValue=parseFloat(e),this.$emit("rollback",this.localValue))},handleInput(e){!this.isFocused&&this.isClicked&&(this.localValue=e)},handleclick(e){this.isFocused||(this.localValue=e)}}},we=ye,Se=a("ba0d"),_e=Object(c["a"])(we,Ve,$e,!1,null,"00e91572",null),Pe=_e.exports;d()(_e,{VCol:j["a"],VRow:z["a"],VSlider:Se["a"],VTextField:K["a"]});var Ie={name:"Input",components:{CVslider:Pe,CVselect:H},props:["value"],data(){return{}},computed:{resolutionList:{get(){let e=[];for(let t of this.$store.state.resolutionList)e.push(`${t["width"]} X ${t["height"]} at ${t["fps"]} FPS, ${t["pixelFormat"]}`);return e}},streamResolutionList:{get(){let e=this.$store.state.resolutionList[this.value.videoModeIndex],t=[];t.push(`${Math.floor(e["width"])} X ${Math.floor(e["height"])}`);for(let a=2;a<=6;a+=2)t.push(`${Math.floor(e["width"]/a)} X ${Math.floor(e["height"]/a)}`);return t}}},methods:{}},De=Ie,Me=Object(c["a"])(De,xe,Ce,!1,null,"9b6cfbc6",null),Ne=Me.exports,Te=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVrangeSlider",{attrs:{name:"Hue",min:0,max:180},on:{input:function(t){return e.handleData("hue")},rollback:function(t){return e.rollback("hue",t)}},model:{value:e.value.hue,callback:function(t){e.$set(e.value,"hue",t)},expression:"value.hue"}}),a("CVrangeSlider",{attrs:{name:"Saturation",min:0,max:255},on:{input:function(t){return e.handleData("saturation")},rollback:function(t){return e.rollback("saturation",t)}},model:{value:e.value.saturation,callback:function(t){e.$set(e.value,"saturation",t)},expression:"value.saturation"}}),a("CVrangeSlider",{attrs:{name:"Value",min:0,max:255},on:{input:function(t){return e.handleData("value")},rollback:function(t){return e.rollback("value",t)}},model:{value:e.value.value,callback:function(t){e.$set(e.value,"value",t)},expression:"value.value"}}),a("v-divider",{staticStyle:{"margin-top":"5px"},attrs:{color:"darkgray "}}),a("v-btn",{staticStyle:{margin:"20px"},attrs:{color:"#4baf62",small:""},on:{click:function(t){return e.setFunction(1)}}},[a("v-icon",[e._v("colorize")]),e._v(" Eye drop ")],1),a("v-btn",{staticStyle:{margin:"20px"},attrs:{color:"#4baf62",small:""},on:{click:function(t){return e.setFunction(2)}}},[a("v-icon",[e._v("add")]),e._v(" Expand Selection ")],1),a("v-btn",{staticStyle:{margin:"20px"},attrs:{color:"#4baf62",small:""},on:{click:function(t){return e.setFunction(3)}}},[a("v-icon",[e._v("remove")]),e._v(" Shrink Selection ")],1),a("v-divider",{attrs:{color:"darkgray "}}),a("CVswitch",{attrs:{name:"Erode"},on:{input:function(t){return e.handleData("erode")},rollback:function(t){return e.rollback("erode",t)}},model:{value:e.value.erode,callback:function(t){e.$set(e.value,"erode",t)},expression:"value.erode"}}),a("CVswitch",{attrs:{name:"Dilate"},on:{input:function(t){return e.handleData("dilate")},rollback:function(t){return e.rollback("dilate",t)}},model:{value:e.value.dilate,callback:function(t){e.$set(e.value,"dilate",t)},expression:"value.dilate"}})],1)},Le=[],Fe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",{attrs:{cols:10}},[a("v-range-slider",{staticClass:"align-center",attrs:{value:e.localValue,max:e.max,min:e.min,"hide-details":"",dark:"",color:"#4baf62",step:e.step},on:{input:e.handleInput,mousedown:function(t){return e.$emit("rollback",e.localValue)}},scopedSlots:e._u([{key:"prepend",fn:function(){return[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"50px"},attrs:{dark:"",value:e.localValue[0],max:e.max,min:e.min,"hide-details":"","single-line":"",type:"number",step:e.step},on:{input:e.handleChange,focus:function(t){e.prependFocused=!0},blur:function(t){e.prependFocused=!1}}})]},proxy:!0},{key:"append",fn:function(){return[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"50px"},attrs:{dark:"",value:e.localValue[1],max:e.max,min:e.min,"hide-details":"","single-line":"",type:"number",step:e.step},on:{input:e.handleChange,focus:function(t){e.appendFocused=!0},blur:function(t){e.appendFocused=!1}}})]},proxy:!0}])})],1)],1)],1)},Be=[],Oe={name:"RangeSlider",props:["name","min","max","value","step"],data(){return{prependFocused:!1,appendFocused:!1}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{handleChange(e){let t=0;!1===this.prependFocused&&!0===this.appendFocused&&(t=1),(this.prependFocused||this.appendFocused)&&(this.$set(this.localValue,t,e),this.$emit("rollback",this.localValue))},handleInput(e){this.prependFocused&&this.appendFocused||(this.localValue=e)}}},Ee=Oe,Re=a("5963"),Ae=Object(c["a"])(Ee,Fe,Be,!1,null,"04bfafa7",null),je=Ae.exports;d()(Ae,{VCol:j["a"],VRangeSlider:Re["a"],VRow:z["a"],VTextField:K["a"]});var ze=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",[a("v-switch",{attrs:{dark:"",disabled:e.disabled,color:"#4baf62"},on:{change:function(t){return e.$emit("rollback",e.localValue)}},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)],1)],1)},Ge=[],Ue={name:"CVSwitch",props:["name","value","disabled"],data(){return{}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}}},He=Ue,We=a("b73d"),qe=Object(c["a"])(He,ze,Ge,!1,null,"a0489bb0",null),Je=qe.exports;d()(qe,{VCol:j["a"],VRow:z["a"],VSwitch:We["a"]});var Xe={name:"Threshold",components:{CVrangeSlider:je,CVswitch:Je},props:["value"],data(){return{currentFunction:void 0,colorPicker:void 0,currentBinaryState:0}},computed:{pipeline:{get(){return this.$store.state.pipeline}},driverState:{get(){return this.$store.state.driverMode},set(e){this.$store.commit("driverMode",e)}}},mounted:function(){const e=this;this.colorPicker=a("b3e4").default,this.$nextTick(()=>{e.colorPicker.initColorPicker()})},methods:{onClick(e){if(void 0!==this.currentFunction){let t=this.colorPicker.colorPickerClick(e,this.currentFunction,[[this.value.hue[0],this.value.saturation[0],this.value.value[0]],[this.value.hue[1],this.value.saturation[1],this.value.value[1]]]);this.currentFunction=void 0,this.value.hue=[t[0][0],t[1][0]],this.value.saturation=[t[0][1],t[1][1]],this.value.value=[t[0][2],t[1][2]],this.value.isBinary=this.currentBinaryState;let a=this.$msgPack.encode({hue:this.value.hue,saturation:this.value.saturation,value:this.value.value,isBinary:this.value.isBinary});this.$socket.send(a),this.$emit("update")}},setFunction(e){switch(this.currentBinaryState=this.value.isBinary,!0===this.currentBinaryState&&(this.value.isBinary=!1,this.handleData("isBinary")),e){case 0:this.currentFunction=void 0;break;case 1:this.currentFunction=this.colorPicker.eyeDrop;break;case 2:this.currentFunction=this.colorPicker.expand;break;case 3:this.currentFunction=this.colorPicker.shrink;break}}}},Ke=Xe,Ye=Object(c["a"])(Ke,Te,Le,!1,null,"1be4044e",null),Ze=Ye.exports;d()(Ye,{VBtn:te["a"],VDivider:re["a"],VIcon:T["a"]});var Qe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVrangeSlider",{attrs:{name:"Area",min:0,max:100,step:.1},on:{input:function(t){return e.handleData("area")},rollback:function(t){return e.rollback("area",t)}},model:{value:e.value.area,callback:function(t){e.$set(e.value,"area",t)},expression:"value.area"}}),a("CVrangeSlider",{attrs:{name:"Ratio (W/H)",min:0,max:100,step:.1},on:{input:function(t){return e.handleData("ratio")},rollback:function(t){return e.rollback("ratio",t)}},model:{value:e.value.ratio,callback:function(t){e.$set(e.value,"ratio",t)},expression:"value.ratio"}}),a("CVrangeSlider",{attrs:{name:"Extent",min:0,max:100},on:{input:function(t){return e.handleData("extent")},rollback:function(t){return e.rollback("extent",t)}},model:{value:e.value.extent,callback:function(t){e.$set(e.value,"extent",t)},expression:"value.extent"}}),a("CVslider",{attrs:{name:"Speckle Rejection",min:0,max:100},on:{input:function(t){return e.handleData("speckle")},rollback:function(t){return e.rollback("speckle",t)}},model:{value:e.value.speckle,callback:function(t){e.$set(e.value,"speckle",t)},expression:"value.speckle"}}),a("CVselect",{attrs:{name:"Target Group",list:["Single","Dual"]},on:{input:function(t){return e.handleData("targetGroup")},rollback:function(t){return e.rollback("targetGroup",t)}},model:{value:e.value.targetGroup,callback:function(t){e.$set(e.value,"targetGroup",t)},expression:"value.targetGroup"}}),a("CVselect",{attrs:{name:"Target Intersection",list:["None","Up","Down","Left","Right"],disabled:e.isDisabled},on:{input:function(t){return e.handleData("targetIntersection")},rollback:function(t){return e.rollback("targetIntersection",t)}},model:{value:e.value.targetIntersection,callback:function(t){e.$set(e.value,"targetIntersection",t)},expression:"value.targetIntersection"}})],1)},et=[],tt={name:"Contours",components:{CVrangeSlider:je,CVselect:H,CVslider:Pe},props:["value"],data(){return{}},computed:{isDisabled(){return 0===this.value.targetGroup}},methods:{}},at=tt,nt=Object(c["a"])(at,Qe,et,!1,null,"5a4d1bb2",null),it=nt.exports,st=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVselect",{attrs:{name:"Sort Mode",list:["Largest","Smallest","Highest","Lowest","Rightmost","Leftmost","Centermost"]},on:{input:function(t){return e.handleData("sortMode")},rollback:function(t){return e.rollback("sortMode",e.e)}},model:{value:e.value.sortMode,callback:function(t){e.$set(e.value,"sortMode",t)},expression:"value.sortMode"}}),a("CVselect",{attrs:{name:"Target Region",list:["Center","Top","Bottom","Left","Right"]},on:{input:function(t){return e.handleData("targetRegion")},rollback:function(t){return e.rollback("targetRegion",t)}},model:{value:e.value.targetRegion,callback:function(t){e.$set(e.value,"targetRegion",t)},expression:"value.targetRegion"}}),a("CVselect",{attrs:{name:"Target Orientation",list:["Portrait","Landscape"]},on:{input:function(t){return e.handleData("targetOrientation")},rollback:function(t){return e.rollback("targetOrientation",t)}},model:{value:e.value.targetOrientation,callback:function(t){e.$set(e.value,"targetOrientation",t)},expression:"value.targetOrientation"}}),a("CVswitch",{attrs:{name:"Output multiple"},on:{input:function(t){return e.handleData("multiple")},rollback:function(t){return e.rollback("multiple",t)}},model:{value:e.value.multiple,callback:function(t){e.$set(e.value,"multiple",t)},expression:"value.multiple"}}),a("span",[e._v("Calibrate:")]),a("v-divider",{attrs:{dark:"",color:"white"}}),a("CVselect",{attrs:{name:"Calibration Mode",list:["None","Single point","Dual point"]},on:{input:function(t){return e.handleData("calibrationMode")},rollback:function(t){return e.rollback("calibrationMode",t)}},model:{value:e.value.calibrationMode,callback:function(t){e.$set(e.value,"calibrationMode",t)},expression:"value.calibrationMode"}}),a(e.selectedComponent,{tag:"component",attrs:{"raw-point":e.rawPoint},on:{update:e.doUpdate,snackbar:e.showSnackbar}}),a("v-snackbar",{attrs:{timeout:3e3,top:"",color:"error"},model:{value:e.snackbar,callback:function(t){e.snackbar=t},expression:"snackbar"}},[a("span",{staticStyle:{color:"#000"}},[e._v(e._s(e.snackbarText))]),a("v-btn",{attrs:{color:"black",text:""},on:{click:function(t){e.snackbar=!1}}},[e._v(" Close ")])],1)],1)},rt=[],ot=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{align:"center",justify:"start"}},[a("v-col",{staticStyle:{"padding-right":"0"},attrs:{cols:3}},[a("v-btn",{attrs:{small:"",color:"#4baf62"},on:{click:e.takePointA}},[e._v(" Take Point A ")])],1),a("v-col",{staticStyle:{"margin-left":"0"},attrs:{cols:3}},[a("v-btn",{attrs:{small:"",color:"#4baf62"},on:{click:e.takePointB}},[e._v(" Take Point B ")])],1),a("v-col",[a("v-btn",{attrs:{small:"",color:"yellow darken-3"},on:{click:e.clearSlope}},[e._v(" Clear All Points ")])],1)],1)],1)},lt=[],ct={name:"DualCalibration",props:["rawPoint"],data(){return{pointA:void 0,pointB:void 0}},methods:{takePointA(){this.pointA=this.rawPoint,this.calcSlope()},takePointB(){this.pointB=this.rawPoint,this.calcSlope()},calcSlope(){if(void 0!==this.pointA&&void 0!==this.pointB){let e=(this.pointB[1]-this.pointA[1])/(this.pointB[0]-this.pointA[0]),t=this.pointA[1]-e*this.pointA[0];!1===isNaN(e)&&!1===isNaN(t)?this.sendSlope(e,t,!0):this.$emit("snackbar","Points are too close"),this.pointA=void 0,this.pointB=void 0}},sendSlope(e,t){this.handleInput("dualTargetCalibrationM",e),this.handleInput("dualTargetCalibrationB",t),this.$emit("update")},clearSlope(){this.sendSlope(1,0,!1),this.pointA=void 0,this.pointB=void 0}}},ut=ct,dt=Object(c["a"])(ut,ot,lt,!1,null,"a8fb6d90",null),pt=dt.exports;d()(dt,{VBtn:te["a"],VCol:j["a"],VRow:z["a"]});var ht=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{align:"center",justify:"start"}},[a("v-col",{staticStyle:{"padding-right":"0"},attrs:{cols:3}},[a("v-btn",{attrs:{small:"",color:"#4baf62"},on:{click:e.takePoint}},[e._v(" Take Point ")])],1),a("v-col",[a("v-btn",{attrs:{small:"",color:"yellow darken-3"},on:{click:e.clearPoint}},[e._v(" Clear Point ")])],1)],1)],1)},mt=[],vt={name:"SingleCalibration",props:["rawPoint"],methods:{clearPoint(){this.handleInput("point",[]),this.$emit("update")},takePoint(){this.rawPoint[0]&&this.rawPoint[1]?(this.handleInput("point",this.rawPoint),this.$emit("update")):this.$emit("snackbar","No target found")}}},gt=vt,bt=Object(c["a"])(gt,ht,mt,!1,null,"36969f41",null),ft=bt.exports;d()(bt,{VBtn:te["a"],VCol:j["a"],VRow:z["a"]});var kt={name:"Output",components:{CVselect:H,CVswitch:Je,SingleCalibration:ft,DualCalibration:pt},props:["value"],data(){return{snackbar:!1,snackbarText:""}},computed:{selectedComponent:{get(){switch(this.value.calibrationMode){case 0:return"";case 1:return"SingleCalibration";case 2:return"DualCalibration"}return""}},rawPoint:{get(){return this.$store.state.point.rawPoint}}},methods:{doUpdate(){this.$emit("update")},showSnackbar(e){this.snackbarText=e,this.snackbar=!0}}},xt=kt,Ct=Object(c["a"])(xt,st,rt,!1,null,"2b548d74",null),Vt=Ct.exports;d()(Ct,{VBtn:te["a"],VDivider:re["a"],VSnackbar:f["a"]});var $t=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{align:"center",justify:"start",dense:""}},[a("v-col",{attrs:{cols:6}},[a("CVswitch",{attrs:{disabled:e.allow3D,name:"Enable 3D"},on:{input:function(t){return e.handleData("is3D")},rollback:function(t){return e.rollback("is3D",t)}},model:{value:e.value.is3D,callback:function(t){e.$set(e.value,"is3D",t)},expression:"value.is3D"}})],1),a("v-col",[a("input",{ref:"file",staticStyle:{display:"none"},attrs:{type:"file",accept:".csv"},on:{change:e.readFile}}),a("v-btn",{attrs:{small:""},on:{click:function(t){return e.$refs.file.click()}}},[a("v-icon",[e._v("mdi-upload")]),e._v(" upload model ")],1)],1)],1),a("CVslider",{attrs:{name:"Contour simplification",min:0,max:100},on:{input:function(t){return e.handleData("accuracy")},rollback:function(t){return e.rollback("accuracy",t)}},model:{value:e.value.accuracy,callback:function(t){e.$set(e.value,"accuracy",t)},expression:"value.accuracy"}}),a("v-row",[a("v-col",[a("mini-map",{staticClass:"miniMapClass",attrs:{targets:e.targets,"horizontal-f-o-v":e.horizontalFOV}})],1),a("v-col",[a("v-select",{attrs:{items:e.FRCtargets,"item-text":"name","item-value":"data",dark:"",color:"#4baf62","item-color":"green"},model:{value:e.selectedModel,callback:function(t){e.selectedModel=t},expression:"selectedModel"}}),null!==e.selectedModel?a("v-btn",{attrs:{small:""},on:{click:e.uploadPremade}},[e._v(" Upload Premade ")]):e._e()],1)],1),a("v-snackbar",{attrs:{top:"",color:e.snackbar.color},model:{value:e.snack,callback:function(t){e.snack=t},expression:"snack"}},[a("span",[e._v(e._s(e.snackbar.text))])])],1)},yt=[],wt=a("369b"),St=a.n(wt),_t=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{staticStyle:{width:"400px"},attrs:{align:"center"}},[a("canvas",{attrs:{id:"canvasId",width:"800",height:"800"}})]),a("v-row",{staticStyle:{width:"400px"},attrs:{align:"center"}},[a("v-simple-table",{staticStyle:{"text-align":"center","background-color":"transparent",display:"block",margin:"auto"},attrs:{dense:"",dark:""},scopedSlots:e._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",{staticClass:"text-center"},[e._v(" Target ")]),a("th",{staticClass:"text-center"},[e._v(" X ")]),a("th",{staticClass:"text-center"},[e._v(" Y ")]),a("th",{staticClass:"text-center"},[e._v(" Angle ")])])]),a("tbody",e._l(e.targets,(function(t,n){return a("tr",{key:n},[a("td",[e._v(e._s(n))]),a("td",[e._v(e._s(t.pose.translation.x.toFixed(2)))]),a("td",[e._v(e._s(t.pose.translation.y.toFixed(2)))]),a("td",[e._v(e._s(t.pose.rotation.radians.toFixed(2)))])])})),0)]},proxy:!0}])})],1)],1)},Pt=[],It={name:"MiniMap",props:{targets:Array,horizontalFOV:Number},data(){return{ctx:void 0,canvas:void 0,x:0,y:0,targetWidth:40,targetHeight:6}},computed:{hLen:{get(){return 150*Math.tan(this.horizontalFOV/2*Math.PI/180)}}},watch:{targets:{deep:!0,handler(){this.draw()}},horizontalFOV(){this.draw()}},mounted:function(){const e=document.getElementById("canvasId"),t=e.getContext("2d");this.canvas=e,this.ctx=t,this.grad=this.ctx.createLinearGradient(400,800,400,600),this.grad.addColorStop(0,"rgb(119,119,119)"),this.grad.addColorStop(.05,"rgba(14,92,22,0.96)"),this.grad.addColorStop(.8,"rgba(43,43,43,0.48)"),this.ctx.font="26px Arial",this.ctx.strokeStyle="whitesmoke",this.ctx.lineWidth=2,this.$nextTick((function(){this.drawPlayer()}))},methods:{draw(){this.clearBoard(),this.drawPlayer();for(let e in this.targets)this.drawTarget(e,this.targets[e].pose)},drawTarget(e,t){let a=800-160*t.translation.x,n=400-160*t.translation.y;this.ctx.save(),this.ctx.beginPath(),this.ctx.translate(n+this.targetWidth/2,a+this.targetHeight/2),this.ctx.rotate(-1*t.rotation.radians),this.ctx.rect(-this.targetWidth/2,-this.targetHeight/2,this.targetWidth,this.targetHeight),this.ctx.fillStyle="#01a209",this.ctx.fill(),this.ctx.restore(),this.ctx.fillStyle="whitesmoke",this.ctx.beginPath(),this.ctx.arc(n+this.targetWidth/2,a+this.targetHeight/2,3,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.fillText(e,n-30,a-5)},drawPlayer(){this.ctx.beginPath(),this.ctx.moveTo(400,820),this.ctx.lineTo(400+this.hLen,650),this.ctx.lineTo(400-this.hLen,650),this.ctx.closePath(),this.ctx.fillStyle=this.grad,this.ctx.fill(),this.ctx.beginPath(),this.ctx.moveTo(400,820),this.ctx.lineTo(400+this.hLen,650),this.ctx.stroke(),this.ctx.moveTo(400,820),this.ctx.lineTo(400-this.hLen,650),this.ctx.stroke()},clearBoard(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}}},Dt=It,Mt=(a("53f0"),a("1f4f")),Nt=Object(c["a"])(Dt,_t,Pt,!1,null,"7cadfa0d",null),Tt=Nt.exports;d()(Nt,{VRow:z["a"],VSimpleTable:Mt["a"]});var Lt=a("3f85"),Ft={name:"SolvePNP",components:{CVswitch:Je,CVslider:Pe,miniMap:Tt},props:["value"],data(){return{is3D:!1,selectedModel:null,FRCtargets:null,snackbar:{color:"success",text:""},snack:!1}},computed:{targets:{get(){return this.$store.state.point.targets}},horizontalFOV:{get(){let e=this.$store.state.cameraSettings.resolution,t=this.$store.state.cameraSettings.fov,a=this.$store.state.resolutionList[e],n=t*(Math.PI/180),i=Math.hypot(a.width,a.height);return 2*Math.atan(Math.tan(n/2)*(a.width/i))*(180/Math.PI)}},allow3D:{get(){let e=this.$store.state.resolutionList[this.$store.state.pipeline.videoModeIndex];for(let t of this.$store.state.cameraSettings.calibration)if(e.width===t.width&&e.height===t.height)return!1;return!0}}},mounted(){let e=[];for(let t in Lt)Lt.hasOwnProperty(t)&&e.push({name:t,data:Lt[t]});this.FRCtargets=e},methods:{readFile(e){let t=e.target.files[0];St.a.parse(t,{complete:this.onParse,skipEmptyLines:!0})},onParse(e){if(e.data.length>0){let t=[];for(let a of e.data){let e=[];if(e.push(Number(a[0])),e.push(Number(a[1])),isNaN(e[0])||isNaN(e[1]))return this.snackbar={color:"error",text:"Error: cvs did parse correctly"},void(this.snack=!0);t.push(e)}this.uploadModel(t)}else this.snackbar={color:"error",text:"Error: cvs did not contain any data"},this.snack=!0},uploadPremade(){this.uploadModel(this.selectedModel)},uploadModel(e){this.axios.post("http://"+this.$address+"/api/vision/pnpModel",e).then(()=>{this.snackbar={color:"success",text:"File uploaded successfully"},this.snack=!0}).catch(()=>{this.snackbar={color:"error",text:"An error occurred"},this.snack=!0})}}},Bt=Ft,Ot=(a("0caf"),Object(c["a"])(Bt,$t,yt,!1,null,"383a7992",null)),Et=Ot.exports;d()(Ot,{VBtn:te["a"],VCol:j["a"],VIcon:T["a"],VRow:z["a"],VSelect:G["a"],VSnackbar:f["a"]});var Rt={name:"CameraTab",components:{CameraAndPipelineSelect:he,cvImage:ke,InputTab:Ne,ThresholdTab:Ze,ContoursTab:it,OutputTab:Vt,pnpTab:Et},data(){return{selectedTab:0,snackbar:!1}},computed:{isBinaryNumber:{get(){return this.$store.getters.pipeline.isBinary?1:0},set(e){this.$store.commit("isBinary",!!e)}},selectedComponent:{get(){return this.$store.getters.currentPipelineIndex+1===0?"InputTab":["InputTab","ThresholdTab","ContoursTab","OutputTab","pnpTab"][this.selectedTab]}},fps:{get(){return this.$store.state.point.fps}}},methods:{onImageClick(e){1===this.selectedTab&&this.$refs.component.onClick(e)}}},At=Rt,jt=(a("6838"),Object(c["a"])(At,w,S,!1,null,"9e4d1488",null)),zt=jt.exports;d()(jt,{VBtn:te["a"],VCol:j["a"],VRow:z["a"],VSimpleTable:Mt["a"],VSnackbar:f["a"],VTab:k["a"],VTabs:x["a"]});var Gt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",[a("v-col",{staticClass:"colsClass",attrs:{cols:"6"}},[a("v-tabs",{attrs:{"background-color":"#212121",dark:"","fixed-tabs":"",height:"50","slider-color":"#4baf62"},model:{value:e.selectedTab,callback:function(t){e.selectedTab=t},expression:"selectedTab"}},[a("v-tab",{attrs:{to:""}},[e._v(" General ")]),a("v-tab",{attrs:{to:""}},[e._v(" Cameras ")])],1),a("div",{staticStyle:{"padding-left":"30px"}},[a(e.selectedComponent,{tag:"component",on:{update:function(t){return e.$emit("save")}}})],1)],1),a("v-col",{directives:[{name:"show",rawName:"v-show",value:1===e.selectedTab,expression:"selectedTab === 1"}],staticClass:"colsClass"},[a("div",{staticClass:"videoClass"},[a("cvImage",{attrs:{address:e.$store.getters.streamAddress,scale:75}})],1)])],1)],1)},Ut=[],Ht=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticStyle:{"margin-top":"15px"}},[a("span",[e._v("General Settings:")]),a("v-divider",{attrs:{color:"white"}})],1),a("CVnumberinput",{attrs:{name:"Team Number"},model:{value:e.settings.teamNumber,callback:function(t){e.$set(e.settings,"teamNumber",t)},expression:"settings.teamNumber"}}),a("CVradio",{attrs:{list:["DHCP","Static"]},model:{value:e.settings.connectionType,callback:function(t){e.$set(e.settings,"connectionType",t)},expression:"settings.connectionType"}}),a("v-divider",{attrs:{color:"white"}}),a("CVinput",{attrs:{name:"IP",disabled:e.isDisabled},model:{value:e.settings.ip,callback:function(t){e.$set(e.settings,"ip",t)},expression:"settings.ip"}}),a("CVinput",{attrs:{name:"NetMask",disabled:e.isDisabled},model:{value:e.settings.netmask,callback:function(t){e.$set(e.settings,"netmask",t)},expression:"settings.netmask"}}),a("CVinput",{attrs:{name:"Gateway",disabled:e.isDisabled},model:{value:e.settings.gateway,callback:function(t){e.$set(e.settings,"gateway",t)},expression:"settings.gateway"}}),a("v-divider",{attrs:{color:"white"}}),a("CVinput",{attrs:{name:"Hostname"},model:{value:e.settings.hostname,callback:function(t){e.$set(e.settings,"hostname",t)},expression:"settings.hostname"}}),a("v-btn",{staticStyle:{"margin-top":"10px"},attrs:{small:"",color:"#4baf62"},on:{click:e.sendGeneralSettings}},[e._v(" Save General Settings ")]),a("div",{staticStyle:{"margin-top":"20px"}},[a("span",[e._v("Install or Update:")]),a("v-divider",{attrs:{color:"white"}})],1),e.isLoading?a("div",{staticStyle:{"text-align":"center","margin-top":"20px"}},[a("v-progress-circular",{attrs:{color:"white",indeterminate:!0,size:"32",width:"4"}}),a("br"),a("span",[e._v("Please wait this may take a while")])],1):a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:3}},[a("span",[e._v("Choose a newer version: ")])]),a("v-col",{attrs:{cols:6}},[a("v-file-input",{attrs:{accept:".jar",dark:""},model:{value:e.file,callback:function(t){e.file=t},expression:"file"}})],1)],1),a("v-btn",{attrs:{small:""},on:{click:e.installOrUpdate}},[e._v(" "+e._s(e.fileUploadText)+" ")])],1),a("v-snackbar",{attrs:{top:"",color:e.snackbar.color},model:{value:e.snack,callback:function(t){e.snack=t},expression:"snack"}},[a("span",[e._v(e._s(e.snackbar.text))])])],1)},Wt=[],qt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"70px"},attrs:{dark:"","hide-details":"","single-line":"",type:"number",step:e.step},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)],1)],1)},Jt=[],Xt={name:"NumberInput",props:["name","value","step"],data(){return{}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",parseFloat(e))}}}},Kt=Xt,Yt=Object(c["a"])(Kt,qt,Jt,!1,null,"e1e3b060",null),Zt=Yt.exports;d()(Yt,{VCol:j["a"],VRow:z["a"],VTextField:K["a"]});var Qt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-radio-group",{attrs:{row:"",dark:"",mandatory:!0},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}},e._l(e.list,(function(e,t){return a("v-radio",{key:t,attrs:{color:"#4baf62",label:e,value:t}})})),1)],1)},ea=[],ta={name:"Radio",props:["value","list"],data(){return{}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}}},aa=ta,na=a("67b6"),ia=a("43a6"),sa=Object(c["a"])(aa,Qt,ea,!1,null,"558219e5",null),ra=sa.exports;d()(sa,{VRadio:na["a"],VRadioGroup:ia["a"]});var oa={name:"General",components:{CVnumberinput:Zt,CVradio:ra,CVinput:Z},data(){return{file:void 0,snackbar:{color:"success",text:""},snack:!1,isLoading:!1}},computed:{fileUploadText(){return void 0!==this.file?"Update and run at startup":"Run current version at startup"},isDisabled(){return 0===this.settings.connectionType},settings:{get(){return this.$store.state.settings}}},methods:{sendGeneralSettings(){const e=this;this.axios.post("http://"+this.$address+"/api/settings/general",this.settings).then((function(t){200===t.status&&(e.snackbar={color:"success",text:"Save successful, Please restart for changes to take action"},e.snack=!0)}),(function(t){e.snackbar={color:"error",text:t.response.data},e.snack=!0}))},installOrUpdate(){let e=new FormData;e.append("file",this.file),void 0!==this.file&&(this.isLoading=!0),this.axios.post("http://"+this.$address+"/api/install",e,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{this.snackbar={color:"success",text:"Installation successful"},this.isLoading=!1,this.snack=!0}).catch(e=>{this.snackbar={color:"error",text:e.response.data},this.isLoading=!1,this.snack=!0})}}},la=oa,ca=a("23a7"),ua=a("490a"),da=Object(c["a"])(la,Ht,Wt,!1,null,"0b11438f",null),pa=da.exports;d()(da,{VBtn:te["a"],VCol:j["a"],VDivider:re["a"],VFileInput:ca["a"],VProgressCircular:ua["a"],VRow:z["a"],VSnackbar:f["a"]});var ha=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",[n("CVselect",{attrs:{name:"Camera",list:e.$store.getters.cameraList},on:{input:function(t){return e.handleInput("currentCamera",e.currentCameraIndex)}},model:{value:e.currentCameraIndex,callback:function(t){e.currentCameraIndex=t},expression:"currentCameraIndex"}}),n("CVnumberinput",{attrs:{name:"Diagonal FOV"},model:{value:e.cameraSettings.fov,callback:function(t){e.$set(e.cameraSettings,"fov",t)},expression:"cameraSettings.fov"}}),n("br"),n("CVnumberinput",{attrs:{name:"Camera pitch",step:.01},model:{value:e.cameraSettings.tilt,callback:function(t){e.$set(e.cameraSettings,"tilt",t)},expression:"cameraSettings.tilt"}}),n("br"),n("v-btn",{staticStyle:{"margin-top":"10px"},attrs:{small:"",color:"#4baf62"},on:{click:e.sendCameraSettings}},[e._v(" Save Camera Settings ")])],1),n("div",{staticStyle:{"margin-top":"15px"}},[n("span",[e._v("3D Calibration")]),n("v-divider",{staticStyle:{"margin-bottom":"10px"},attrs:{color:"white"}}),n("v-row",[n("v-col",[n("CVselect",{attrs:{name:"Resolution",list:e.stringResolutionList},model:{value:e.resolutionIndex,callback:function(t){e.resolutionIndex=t},expression:"resolutionIndex"}})],1),n("v-col",[n("CVnumberinput",{attrs:{name:"Square Size (in)"},model:{value:e.squareSize,callback:function(t){e.squareSize=t},expression:"squareSize"}})],1)],1),n("v-row",[n("v-col",[n("v-btn",{attrs:{small:"",color:e.calibrationModeButton.color,disabled:e.checkResolution},on:{click:e.sendCalibrationMode}},[e._v(" "+e._s(e.calibrationModeButton.text)+" ")])],1),n("v-col",[n("v-btn",{attrs:{small:"",color:e.cancellationModeButton.color,disabled:e.checkCancellation},on:{click:e.sendCalibrationFinish}},[e._v(" "+e._s(e.cancellationModeButton.text)+" ")])],1),n("v-col",[n("v-btn",{attrs:{color:"whitesmoke",small:""},on:{click:e.downloadBoard}},[e._v(" Download Checkerboard ")]),n("a",{ref:"calibrationFile",staticStyle:{color:"black","text-decoration":"none",display:"none"},attrs:{href:a("66a3"),download:"Calibration Board.png"}})],1)],1),e.isCalibrating?n("v-row",[n("v-col",[n("span",[e._v("Snapshot Amount: "+e._s(e.snapshotAmount))])])],1):e._e(),e.isCalibrating?n("div",[n("v-checkbox",{attrs:{label:"Advanced Menu",dark:""},model:{value:e.isAdvanced,callback:function(t){e.isAdvanced=t},expression:"isAdvanced"}}),e.isAdvanced?n("div",[n("CVslider",{attrs:{name:"Exposure",min:0,max:100},on:{input:function(t){return e.handleInput("exposure",t)}},model:{value:e.$store.getters.pipeline.exposure,callback:function(t){e.$set(e.$store.getters.pipeline,"exposure",t)},expression:"$store.getters.pipeline.exposure"}}),n("CVslider",{attrs:{name:"Brightness",min:0,max:100},on:{input:function(t){return e.handleInput("brightness",t)}},model:{value:e.$store.getters.pipeline.brightness,callback:function(t){e.$set(e.$store.getters.pipeline,"brightness",t)},expression:"$store.getters.pipeline.brightness"}}),-1!==e.$store.getters.pipeline.gain?n("CVslider",{attrs:{name:"Gain",min:0,max:100},on:{input:function(t){return e.handleInput("gain",t)}},model:{value:e.$store.getters.pipeline.gain,callback:function(t){e.$set(e.$store.getters.pipeline,"gain",t)},expression:"$store.getters.pipeline.gain"}}):e._e(),n("CVselect",{attrs:{name:"FPS",list:e.stringFpsList},on:{input:e.changeFps},model:{value:e.$store.getters.pipeline.videoModeIndex,callback:function(t){e.$set(e.$store.getters.pipeline,"videoModeIndex",t)},expression:"$store.getters.pipeline.videoModeIndex"}})],1):e._e()],1):e._e()],1),n("v-snackbar",{attrs:{top:"",color:e.snackbar.color},model:{value:e.snack,callback:function(t){e.snack=t},expression:"snack"}},[n("span",[e._v(e._s(e.snackbar.text))])])],1)},ma=[],va={name:"CameraSettings",components:{CVselect:H,CVnumberinput:Zt,CVslider:Pe},data(){return{isCalibrating:!1,resolutionIndex:void 0,calibrationModeButton:{text:"Start Calibration",color:"green"},cancellationModeButton:{text:"Cancel Calibration",color:"red"},snackbar:{color:"success",text:""},squareSize:1,snapshotAmount:0,hasEnough:!1,snack:!1,isAdvanced:!1}},computed:{checkResolution(){return void 0===this.resolutionIndex},checkCancellation(){return!this.isCalibrating&&(this.checkResolution,!0)},currentCameraIndex:{get(){return this.$store.state.currentCameraIndex},set(e){this.$store.commit("currentCameraIndex",e)}},filteredResolutionList:{get(){let e=[];for(let t in this.$store.state.resolutionList)if(this.$store.state.resolutionList.hasOwnProperty(t)){let a=JSON.parse(JSON.stringify(this.$store.state.resolutionList[t]));e.some(e=>e.width===a.width&&e.height===a.height)||(a["actualIndex"]=parseInt(t),e.push(a))}return e}},filteredFpsList(){let e=this.$store.state.resolutionList[this.resolutionIndex],t=[];for(let a in this.$store.state.resolutionList)if(this.$store.state.resolutionList.hasOwnProperty(a)){let n=JSON.parse(JSON.stringify(this.$store.state.resolutionList[a]));t.some(e=>e["fps"]===n["fps"])||n.width===e.width&&n.height===e.height&&(n["actualIndex"]=parseInt(a),t.push(n))}return t},stringFpsList(){let e=[];for(let t of this.filteredFpsList)e.push(t["fps"]);return e},stringResolutionList:{get(){let e=[];for(let t of this.filteredResolutionList)e.push(`${t["width"]} X ${t["height"]}`);return e}},cameraSettings:{get(){return this.$store.getters.cameraSettings},set(e){this.$store.commit("cameraSettings",e)}}},methods:{downloadBoard(){this.axios.get("http://"+this.$address+a("66a3"),{responseType:"blob"}).then(e=>{a("aeb1")(e.data,"Calibration Board","image/png")})},changeFps(){this.handleInput("videoModeIndex",this.filteredFpsList[this.$store.getters.pipeline["videoModeIndex"]]["actualIndex"])},sendCameraSettings(){const e=this;this.axios.post("http://"+this.$address+"/api/settings/camera",this.cameraSettings).then((function(t){200===t.status&&(e.$store.state.saveBar=!0)}))},sendCalibrationMode(){const e=this;let t={},a="/api/settings/";!0===e.isCalibrating?a+="snapshot":(a+="startCalibration",t["resolution"]=this.filteredResolutionList[this.resolutionIndex].actualIndex,t["squareSize"]=this.squareSize,e.hasEnough=!1),this.axios.post("http://"+this.$address+a,t).then((function(t){200===t.status&&(e.isCalibrating?(e.snapshotAmount=t.data["snapshotCount"],e.hasEnough=t.data["hasEnough"],!0===e.hasEnough&&(e.cancellationModeButton.text="Finish Calibration",e.cancellationModeButton.color="green")):(e.calibrationModeButton.text="Take Snapshot",e.isCalibrating=!0))}))},sendCalibrationFinish(){const e=this;let t="/api/settings/endCalibration",a={};a["squareSize"]=this.squareSize,e.axios.post("http://"+this.$address+t,a).then(t=>{200===t.status&&(e.snackbar={color:"success",text:"calibration successful. \naccuracy: "+t.data["accuracy"].toFixed(5)},e.snack=!0),e.isCalibrating=!1,e.hasEnough=!1,e.snapshotAmount=0,e.calibrationModeButton.text="Start Calibration",e.cancellationModeButton.text="Cancel Calibration",e.cancellationModeButton.color="red"}).catch(()=>{e.snackbar={color:"error",text:"calibration failed"},e.snack=!0,e.isCalibrating=!1,e.hasEnough=!1,e.snapshotAmount=0,e.calibrationModeButton.text="Start Calibration",e.cancellationModeButton.text="Cancel Calibration",e.cancellationModeButton.color="red"})}}},ga=va,ba=Object(c["a"])(ga,ha,ma,!1,null,"555527e6",null),fa=ba.exports;d()(ba,{VBtn:te["a"],VCheckbox:ie["a"],VCol:j["a"],VDivider:re["a"],VRow:z["a"],VSnackbar:f["a"]});var ka={name:"SettingsTab",components:{cvImage:ke,General:pa,Cameras:fa},data(){return{selectedTab:0,tabList:[pa,fa]}},computed:{selectedComponent:{get(){return this.tabList[this.selectedTab]}}}},xa=ka,Ca=(a("a65f"),Object(c["a"])(xa,Gt,Ut,!1,null,"4625d12f",null)),Va=Ca.exports;d()(Ca,{VCol:j["a"],VRow:z["a"],VTab:k["a"],VTabs:x["a"]}),n["default"].use(y["a"]);var $a=new y["a"]({base:"/",routes:[{path:"/",redirect:"/vision"},{path:"/vision",name:"Vision",component:zt},{path:"/settings",name:"Settings",component:Va}]}),ya=a("2f62"),wa={state:{exposure:0,brightness:0,gain:0,rotationMode:0,hue:[0,15],saturation:[0,15],value:[0,25],erode:!1,dilate:!1,area:[0,12],ratio:[0,12],extent:[0,12],speckle:5,targetGrouping:0,targetIntersection:0,sortMode:0,multiple:!1,isBinary:0,calibrationMode:0,videoModeIndex:0,streamDivisor:0,is3D:!1,targetRegion:0,targetOrientation:1},mutations:{isBinary:(e,t)=>{e.isBinary=t},mutatePipeline:(e,{key:t,value:a})=>{n["default"].set(e,t,a)}},actions:{},getters:{pipeline:e=>e}},Sa={state:{teamNumber:1577,connectionType:0,ip:"",gateway:"",netmask:"",hostname:"chameleon-vision"}},_a={state:{calibration:[],fov:0,resolution:0,streamDivisor:0,tilt:0},getters:{cameraSettings:e=>e}},Pa={state:{done:[],undone:[],newMutation:!0},mutations:{updatePipeline:(e,t)=>{e.done.push(t),e.newMutation&&(e.undone=[])},addUndone:(e,t)=>{e.undone.push(t)},removeLastDone:e=>{e.done.pop()},removeLastUnDone:e=>{e.undone.pop()},updateStatus:(e,t)=>{e.newMutation=t}},actions:{undo:(e,{vm:t})=>{let a=e.getters.lastDone;e.commit("removeLastDone"),e.commit("updateStatus",!1);for(let n in a)a.hasOwnProperty(n)&&(e.commit("addUndone",{[n]:e.getters["pipeline"][n]}),e.commit("mutatePipeline",{key:n,value:a[n]}),t.handleInput(n,a[n]));e.commit("updateStatus",!0)},redo:(e,{vm:t})=>{let a=e.getters.lastUnDone;e.commit("removeLastUnDone"),e.commit("updateStatus",!1);for(let n in a)a.hasOwnProperty(n)&&(e.commit("mutatePipeline",{key:n,value:a[n]}),t.handleInput(n,a[n]));e.commit("updateStatus",!0)}},getters:{lastDone:e=>e.done[e.done.length-1],lastUnDone:e=>e.undone[e.undone.length-1],canUndo:e=>e.done.length,canRedo:e=>e.undone.length}};n["default"].use(ya["a"]);const Ia=e=>(t,a)=>{n["default"].set(t,e,a)};var Da=new ya["a"].Store({modules:{pipeline:wa,settings:Sa,cameraSettings:_a,undoRedo:Pa},state:{resolutionList:[],port:1181,currentCameraIndex:0,currentPipelineIndex:0,cameraList:[],pipelineList:[],point:{},saveBar:!1},mutations:{settings:Ia("settings"),pipeline:Ia("pipeline"),cameraSettings:Ia("cameraSettings"),resolutionList:Ia("resolutionList"),port:Ia("port"),currentCameraIndex:Ia("currentCameraIndex"),currentPipelineIndex:Ia("currentPipelineIndex"),cameraList:Ia("cameraList"),pipelineList:Ia("pipelineList"),point:Ia("point"),driverMode:Ia("driverMode"),saveBar:Ia("saveBar")},getters:{streamAddress:e=>"http://"+location.hostname+":"+e.port+"/stream.mjpg",targets:e=>e.point["targets"],cameraList:e=>e.cameraList,pipelineList:e=>e.pipelineList,currentCameraIndex:e=>e.currentCameraIndex,currentPipelineIndex:e=>e.currentPipelineIndex}}),Ma=(a("5363"),a("d1e7"),a("f309"));n["default"].use(Ma["a"]);var Na=new Ma["a"]({icons:{}}),Ta=a("7d47"),La=a.n(Ta),Fa=a("bc3a"),Ba=a.n(Fa),Oa=a("a7fe"),Ea=a.n(Oa),Ra=a("b408"),Aa=a.n(Ra);const ja={methods:{handleInput(e,t){let a=this.$msgPack.encode({[e]:t});this.$socket.send(a)},handleData(e){this.handleInput(e,this.value[e]),this.$emit("update")},rollback(e,t){this.$store.commit("updatePipeline",{[e]:t})}}};n["default"].config.productionTip=!1,n["default"].prototype.$address=location.host;const za="ws://"+n["default"].prototype.$address+"/websocket",Ga=new WebSocket(za);Ga.binaryType="arraybuffer",n["default"].use(Aa.a,za,{WebSocket:Ga}),n["default"].use(Ea.a,Ba.a),n["default"].prototype.$msgPack=La()(!0),n["default"].mixin(ja),new n["default"]({router:$a,store:Da,vuetify:Na,render:e=>e($)}).$mount("#app")},"66a3":function(e,t,a){e.exports=a.p+"img/chessboard.f921ac6e.png"},6838:function(e,t,a){"use strict";var n=a("a6bd"),i=a.n(n);i.a},"8a23":function(e,t,a){},"92cf":function(e,t,a){},a009:function(e,t,a){},a405:function(e,t,a){},a65f:function(e,t,a){"use strict";var n=a("a009"),i=a.n(n);i.a},a6bd:function(e,t,a){},b3e4:function(e,t,a){"use strict";a.r(t);var n=void 0,i=void 0;function s(){n=document.createElement("canvas"),i=document.getElementById("CameraStream"),n.width=i.width,n.height=i.height}function r(e,t,a){let s=i.getBoundingClientRect(),r=Math.round(e.clientX-s.left),o=Math.round(e.clientY-s.top),l=n.getContext("2d");l.drawImage(i,0,0,i.width,i.height);let c=l.getImageData(r,o,1,1).data;if(void 0!==t)return t(c,a)}function o(e){let t=u(e),a=p([t,t.slice(0)]);return a}function l(e,t){let a=u(e),n=p([[].concat(a),a]);return d(t.concat(n))}function c(e,t){let a=u(e),n=p([[].concat(a),a]);return h(t,n[0])||h(t,n[1]),t}function u(e){let t=e[0],a=e[1],n=e[2];t/=255,a/=255,n/=255;let i=Math.min(t,Math.min(a,n)),s=Math.max(t,Math.max(a,n)),r=t===i?a-n:n===i?t-a:n-t,o=t===i?3:n===i?1:5,l=30*(o-r/(s-i)),c=255*(s-i)/s,u=255*s;return isNaN(l)&&(l=0),isNaN(c)&&(c=0),isNaN(u)&&(u=0),[Math.round(l),Math.round(c),Math.round(u)]}function d(e){let t=[[],[]];for(var a=0;a<3;a++){t[0][a]=e[0][a],t[1][a]=e[0][a];for(var n=e.length-1;n>=0;n--)t[0][a]=Math.min(e[n][a],t[0][a]),t[1][a]=Math.max(e[n][a],t[1][a])}return t}function p(e){let t=[[],[]];for(let a=0;a<3;a++)t[0][a]=Math.max(0,e[0][a]-10),t[1][a]=Math.min(255,e[1][a]+10);return t[1][0]=Math.min(180,t[1][0]),t}function h(e,t){let a=!0;for(let n=0;n<t.length&&a;n++)e[0][n]<=t[n]<=e[1][n]||(a=!1);if(a)for(let n=0;n<t.length;n++)t[n]-e[0][n]<e[1][n]-t[n]?e[0][n]=Math.min(e[0][n]+10,e[1][n]):e[1][n]=Math.max(e[1][n]-10,e[0][n]);return a}t["default"]={initColorPicker:s,colorPickerClick:r,eyeDrop:o,expand:l,shrink:c}},cf05:function(e,t,a){e.exports=a.p+"img/logo.e82307fd.png"}});
|
||
//# sourceMappingURL=app.2e103153.js.map
|