Files
PhotonVision/New client/chameleon-client/src/views/Camera.vue

181 lines
6.7 KiB
Vue
Raw Normal View History

2019-09-20 20:56:24 +03:00
<template>
<div>
2019-09-28 18:27:17 +03:00
<div>
<v-row align="center">
<v-col :cols="3" class="colsClass">
<div style="padding-left:30px">
2019-10-02 22:07:04 +03:00
<CVselect name="Camera" v-model="currentCameraIndex" :list="cameraList"></CVselect>
2019-09-28 18:27:17 +03:00
</div>
</v-col>
2019-10-02 00:14:37 +03:00
<v-col :cols="1">
2019-10-10 22:40:51 +03:00
<CVicon color="#c5c5c5" hover text="edit" @click="test" tooltip="Edit camera name"></CVicon>
2019-10-02 00:14:37 +03:00
</v-col>
2019-09-28 18:27:17 +03:00
<v-col :cols="3" class="colsClass">
2019-10-02 22:07:04 +03:00
<CVselect name="Pipeline" :list="pipelineList" v-model="currentPipelineIndex"></CVselect>
2019-09-28 18:27:17 +03:00
</v-col>
2019-10-02 00:14:37 +03:00
<v-col :cols="1" class="colsClass">
<v-menu offset-y dark auto>
<template v-slot:activator="{ on }">
<v-icon color="white" @click="test" v-on="on">menu</v-icon>
</template>
<v-list dense>
<v-list-item @click="test">
<v-list-item-title>
2019-10-10 22:40:51 +03:00
<CVicon color="#c5c5c5" :right="true" text="edit" tooltip="Edit pipeline name"></CVicon>
2019-10-02 00:14:37 +03:00
</v-list-item-title>
</v-list-item>
<v-list-item @click="test">
<v-list-item-title>
2019-10-10 22:40:51 +03:00
<CVicon color="#c5c5c5" :right="true" text="add" tooltip="Add new pipeline"></CVicon>
2019-10-02 00:14:37 +03:00
</v-list-item-title>
</v-list-item>
<v-list-item @click="test">
<v-list-item-title>
<CVicon color="red darken-2" :right="true" text="delete" tooltip="Delete pipeline"></CVicon>
</v-list-item-title>
</v-list-item>
<v-list-item @click="test">
<v-list-item-title>
2019-10-10 22:40:51 +03:00
<CVicon color="#c5c5c5" :right="true" text="mdi-content-copy" tooltip="Duplicate pipeline"></CVicon>
2019-10-02 00:14:37 +03:00
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
2019-09-28 18:27:17 +03:00
</v-col>
</v-row>
</div>
<v-row>
2019-09-20 20:56:24 +03:00
<v-col cols="6" class="colsClass">
2019-09-22 00:14:12 +03:00
<v-tabs fixed-tabs background-color="#212121" dark height="50" slider-color="#4baf62" v-model="selectedTab">
<v-tab>Input</v-tab>
<v-tab>Threshold</v-tab>
<v-tab>Contours</v-tab>
<v-tab>Output</v-tab>
2019-09-20 20:56:24 +03:00
</v-tabs>
<div style="padding-left:30px">
2019-09-28 18:27:17 +03:00
<component v-model="pipeline" :is="selectedComponent"></component>
2019-09-20 20:56:24 +03:00
</div>
</v-col>
2019-09-28 18:27:17 +03:00
<v-col cols="6" class="colsClass">
2019-09-22 00:14:12 +03:00
<div>
<v-tabs background-color="#212121" dark height="50" slider-color="#4baf62" centered style="padding-bottom:10px" v-model="pipeline.isBinary" @change="handleInput('isBinary',pipeline.isBinary)">
2019-09-28 18:27:17 +03:00
<v-tab>Normal</v-tab>
<v-tab>Threshold</v-tab>
</v-tabs>
2019-10-02 23:37:35 +03:00
<div class="videoClass">
2019-10-10 22:40:51 +03:00
<img v-if="cameraList.length > 0" :src="steamAdress">
<span v-else>No Cameras Are connected</span>
2019-10-02 23:37:35 +03:00
</div>
2019-10-02 22:07:04 +03:00
<h5 id="Point">{{point}}</h5>
2019-09-22 00:14:12 +03:00
</div>
2019-09-20 20:56:24 +03:00
</v-col>
</v-row>
</div>
</template>
<script>
2019-09-22 00:14:12 +03:00
import InputTab from './CameraViewes/InputTab'
import ThresholdTab from './CameraViewes/ThresholdTab'
import ContoursTab from './CameraViewes/ContoursTab'
import OutputTab from './CameraViewes/OutputTab'
2019-09-28 18:27:17 +03:00
import CVselect from '../components/cv-select'
2019-10-02 00:14:37 +03:00
import CVicon from '../components/cv-icon'
2019-09-20 20:56:24 +03:00
export default {
2019-09-22 00:14:12 +03:00
name: 'CameraTab',
components:{
InputTab,
ThresholdTab,
ContoursTab,
2019-09-28 18:27:17 +03:00
OutputTab,
2019-10-02 00:14:37 +03:00
CVselect,
CVicon
2019-09-28 18:27:17 +03:00
},
methods:{
test(value){
2019-10-11 01:18:14 +03:00
console.log(value)
}
2019-09-22 00:14:12 +03:00
},
2019-09-20 20:56:24 +03:00
data() {
return {
2019-09-22 00:14:12 +03:00
selectedTab:0,
}
},
computed:{
2019-10-10 22:40:51 +03:00
selectedComponent:{
get(){
switch(this.selectedTab){
case 0:
return "InputTab";
case 1:
return "ThresholdTab";
case 2:
return "ContoursTab";
case 3:
return "OutputTab";
}
2019-10-10 23:58:27 +03:00
return "";
2019-09-22 00:14:12 +03:00
}
2019-10-02 22:07:04 +03:00
},
point:{
get:function(){
let p = this.$store.state.point.calulated;
if(p !== undefined){
return ("Pitch: " + parseFloat(p['pitch']).toFixed(2) + " Yaw: " + parseFloat(p['yaw']).toFixed(2) + " FPS: " + parseFloat(p['fps']).toFixed(2))
} else{
return undefined;
}
}
},
currentCameraIndex:{
get(){
return this.$store.state.currentCameraIndex;
}
},
currentPipelineIndex:{
get(){
return this.$store.state.currentPipelineIndex;
}
},
cameraList:{
get(){
return this.$store.state.cameraList;
}
},
pipelineList:{
get(){
return this.$store.state.pipelinelist;
}
},
pipeline:{
get(){
return this.$store.state.pipeline;
}
},
steamAdress: {
get: function(){
return "http://"+location.hostname + ":"+ this.$store.state.port +"/stream.mjpg";
}
},
2019-09-20 20:56:24 +03:00
}
}
</script>
<style scoped>
.colsClass{
padding: 0 !important;
}
.videoClass{
2019-10-02 23:37:35 +03:00
text-align: center;
}
.videoClass img{
height: auto !important;
width: 75%;
vertical-align: middle;
2019-09-20 20:56:24 +03:00
}
2019-09-22 00:14:12 +03:00
#Point{
padding-top: 5px;
text-align: center;
color: #f4f4f4;
}
2019-09-20 20:56:24 +03:00
</style>