removed old ui src and moved new one to its location and builded ui for distribution

This commit is contained in:
ori agranat
2019-10-19 16:58:10 +03:00
parent 566a4e91d2
commit 5b66de7f8b
118 changed files with 1887 additions and 22509 deletions

View File

@@ -0,0 +1,281 @@
<template>
<div>
<div>
<v-row align="center">
<v-col :cols="3" class="colsClass">
<div style="padding-left:30px">
<CVselect v-if="isCameraNameEdit == false" name="Camera" v-model="currentCameraIndex" :list="cameraList" @input="handleInput('currentCamera',currentCameraIndex)"></CVselect>
<CVinput v-else name="Camera" v-model="newCameraName" @Enter="saveCameraNameChange" :errorMessage="checkCameraName"></CVinput>
</div>
</v-col>
<v-col :cols="1">
<CVicon color="#c5c5c5" v-if="isCameraNameEdit == false" hover text="edit" @click="toCameraNameChange" tooltip="Edit camera name"></CVicon>
<div v-else>
<CVicon color="#c5c5c5" style="display: inline-block;" hover text="save" @click="saveCameraNameChange" tooltip="Save Camera Name"></CVicon>
<CVicon color="error" style="display: inline-block;" hover text="close" @click="discardCameraNameChange" tooltip="Discard Changes"></CVicon>
</div>
</v-col>
<v-col :cols="3" class="colsClass">
<CVselect v-if="isPipelineEdit == false" name="Pipeline" :list="pipelineList" v-model="currentPipelineIndex" @input="handleInput('currentPipeline',currentPipelineIndex)"></CVselect>
<CVinput v-else name="Pipeline" v-model="newPipelineName" @Enter="savePipelineNameChange"></CVinput>
</v-col>
<v-col :cols="1" class="colsClass">
<v-menu v-if="isPipelineEdit == false" offset-y dark auto>
<template v-slot:activator="{ on }">
<v-icon color="white" v-on="on">menu</v-icon>
</template>
<v-list dense>
<v-list-item @click="toPipelineNameChange">
<v-list-item-title>
<CVicon color="#c5c5c5" :right="true" text="edit" tooltip="Edit pipeline name"></CVicon>
</v-list-item-title>
</v-list-item>
<v-list-item @click="handleInput('command','addNewPipeline')">
<v-list-item-title>
<CVicon color="#c5c5c5" :right="true" text="add" tooltip="Add new pipeline"></CVicon>
</v-list-item-title>
</v-list-item>
<v-list-item @click="handleInput('command','deleteCurrentPipeline')">
<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="duplicateDialog = true">
<v-list-item-title>
<CVicon color="#c5c5c5" :right="true" text="mdi-content-copy" tooltip="Duplicate pipeline"></CVicon>
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<div v-else>
<CVicon color="#c5c5c5" style="display: inline-block;" hover text="save" @click="savePipelineNameChange" tooltip="Save Pipeline Name"></CVicon>
<CVicon color="error" style="display: inline-block;" hover text="close" @click="discardPipelineNameChange" tooltip="Discard Changes"></CVicon>
</div>
</v-col>
</v-row>
</div>
<v-row>
<v-col cols="6" class="colsClass">
<v-tabs fixed-tabs background-color="#212121" dark height="48" 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>
</v-tabs>
<div style="padding-left:30px">
<component v-model="pipeline" :is="selectedComponent"></component>
</div>
</v-col>
<v-col cols="6" class="colsClass">
<div>
<v-tabs background-color="#212121" dark height="48" slider-color="#4baf62" centered style="padding-bottom:10px" v-model="isBinaryNumber" @change="handleInput('isBinary',pipeline.isBinary)">
<v-tab>Normal</v-tab>
<v-tab>Threshold</v-tab>
</v-tabs>
<div class="videoClass">
<img v-if="cameraList.length > 0" :src="steamAdress">
<span v-else>No Cameras Are connected</span>
<h5 id="Point">{{point}}</h5>
</div>
</div>
</v-col>
</v-row>
<!-- pipeline duplicate dialog -->
<v-dialog dark v-model="duplicateDialog" width="500" height="357" >
<v-card dark>
<v-card-title class="headline" primary-title>Duplicate Pipeline</v-card-title>
<v-card-text>
<CVselect name="Pipeline" :list="pipelineList" v-model="pipelineDuplicate.pipeline" @input="handleInput('currentPipeline',currentPipelineIndex)"></CVselect>
<v-checkbox dark :label="'To another camera'" v-model="pipelineDuplicate.anotherCamera"></v-checkbox>
<CVselect v-if="pipelineDuplicate.anotherCamera === true" name="Camera" v-model="pipelineDuplicate.camera" :list="cameraList"></CVselect>
</v-card-text>
<v-divider>
</v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="#4baf62" text @click="duplicatePipeline">Duplicate</v-btn>
<v-btn color="error" text @click="closeDuplicateDialog">Discard</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import InputTab from './CameraViewes/InputTab'
import ThresholdTab from './CameraViewes/ThresholdTab'
import ContoursTab from './CameraViewes/ContoursTab'
import OutputTab from './CameraViewes/OutputTab'
import CVselect from '../components/cv-select'
import CVicon from '../components/cv-icon'
import CVinput from '../components/cv-input'
export default {
name: 'CameraTab',
components:{
InputTab,
ThresholdTab,
ContoursTab,
OutputTab,
CVselect,
CVicon,
CVinput
},
methods:{
test(value){
console.log(value)
},
toCameraNameChange(){
this.newCameraName = this.cameraList[this.currentCameraIndex];
this.isCameraNameEdit = true;
},
saveCameraNameChange(){
if(this.cameraNameError === ""){
this.handleInput("changeCameraName",this.newCameraName);
this.discardCameraNameChange();
}
},
discardCameraNameChange(){
this.isCameraNameEdit = false;
this.newCameraName = "";
},
toPipelineNameChange(){
this.newPipelineName = this.pipelineList[this.currentPipelineIndex];
this.isPipelineEdit = true;
},
savePipelineNameChange(){
this.handleInput("changePipelineName",this.newPipelineName);
this.discardPipelineNameChange();
},
discardPipelineNameChange(){
this.isPipelineEdit = false;
this.newPipelineName = "";
},
duplicatePipeline(){
this.handleInput("dupicatePipeline",this.pipelineDuplicate);
this.closeDuplicateDialog();
},
closeDuplicateDialog(){
this.duplicateDialog = false;
this.pipelineDuplicate = {}
}
},
data() {
return {
selectedTab:0,
// camera edit variables
isCameraNameEdit:false,
newCameraName:"",
cameraNameError:"",
// pipeline edit variables
isPipelineEdit:false,
newPipelineName:"",
duplicateDialog:false,
pipelineDuplicate:{},
}
},
computed:{
checkCameraName(){
if(this.newCameraName !== this.cameraList[this.currentCameraIndex]){
for(let cam in this.cameraList){
if(this.newCameraName == this.cameraList[cam]){
return "Camera by that name already Exists"
}
}
}
return ""
},
isBinaryNumber:{
get(){
return this.pipeline.isBinary ? 1:0
},
set(value){
this.pipeline.isBinary = !!value;
}
},
selectedComponent:{
get(){
switch(this.selectedTab){
case 0:
return "InputTab";
case 1:
return "ThresholdTab";
case 2:
return "ContoursTab";
case 3:
return "OutputTab";
}
return "";
}
},
point:{
get:function(){
let p = this.$store.state.point.calculated;
let fps = this.$store.state.point.fps;
if(p !== undefined){
return ("Pitch: " + parseFloat(p['pitch']).toFixed(2) + " Yaw: " + parseFloat(p['yaw']).toFixed(2) + " FPS: " + fps.toFixed(2))
} else{
return undefined;
}
}
},
currentCameraIndex:{
get(){
return this.$store.state.currentCameraIndex;
},
set(value){
this.$store.commit('currentCameraIndex',value);
}
},
currentPipelineIndex:{
get(){
return this.$store.state.currentPipelineIndex;
},
set(value){
this.$store.commit('currentPipelineIndex',value);
}
},
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";
}
},
}
}
</script>
<style scoped>
.colsClass{
padding: 0 !important;
}
.videoClass{
text-align: center;
}
.videoClass img{
height: auto !important;
width: 70%;
vertical-align: middle;
}
#Point{
padding-top: 5px;
text-align: center;
color: #f4f4f4;
}
</style>

View File

@@ -0,0 +1,40 @@
<template>
<div>
<CVrangeSlider v-model="value.area" name="Area" :min="0" :max="100" :step="0.1" @input="handleInput('area',value.area)"></CVrangeSlider>
<CVrangeSlider v-model="value.ratio" name="Ratio (W/H)" :min="0" :max="100" :step="0.1" @input="handleInput('ratio',value.ratio)"></CVrangeSlider>
<CVrangeSlider v-model="value.extent" name="Extent" :min="0" :max="100" @input="handleInput('extent',value.extent)"></CVrangeSlider>
<CVselect name="Target Group" :list="['Single','Dual']" v-model="value.targetGroup" @input="handleInput('targetGroup',value.targetGroup)"></CVselect>
<CVselect name="Target Intersection" :list="['None','Up','Down','Left','Right']" :disabled="isDisabled" v-model="value.targetIntersection" @input="handleInput('targetIntersection',value.targetIntersection)"></CVselect>
</div>
</template>
<script>
import CVrangeSlider from '../../components/cv-range-slider'
import CVselect from '../../components/cv-select'
export default {
name: 'Contours',
props:['value'],
components:{
CVrangeSlider,
CVselect
},
data() {
return {
}
},
computed:{
isDisabled(){
if(this.value.targetGroup === 0){
return true;
}
return false;
}
},
}
</script>
<style lang="" scoped>
</style>

View File

@@ -0,0 +1,34 @@
<template>
<div>
<CVslider name="Exposure" v-model="value.exposure" :min="0" :max="100" @input="handleInput('exposure',value.exposure)"></CVslider>
<CVslider name="Brightness" v-model="value.brightness" :min="0" :max="100" @input="handleInput('brightness',value.brightness)"></CVslider>
<CVselect name="Orientation" v-model="value.orientation" :list="['Normal','Inverted']" @input="handleInput('orientation',value.orientation)"></CVselect>
</div>
</template>
<script>
import CVslider from '../../components/cv-slider'
import CVselect from '../../components/cv-select'
export default {
name: 'Input',
props:['value'],
components:{
CVslider,
CVselect,
},
data() {
return {
t:0,
a:1
}
},
methods:{
},
computed:{}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,84 @@
<template>
<div>
<CVselect name="SortMode" v-model="value.sortMode" :list="['Largest','Smallest','Highest','Lowest','Rightmost','Leftmost','Closest']" @input="handleInput('sortMode',value.sortMode)"></CVselect>
<span>Calibrate:</span><v-divider dark color="white"></v-divider>
<v-row align="center" justify="start">
<v-col style="padding-right:0px" :cols="3">
<v-btn small color="#4baf62" @click="takePointA">Take Point A</v-btn>
</v-col>
<v-col style="margin-left:0px" :cols="3">
<v-btn small color="#4baf62" @click="takePointB">Take Point B</v-btn>
</v-col>
<v-col>
<v-btn small @click="clearSlope" color="yellow darken-3">Clear All Points</v-btn>
</v-col>
</v-row>
<v-snackbar :timeout="3000" v-model="snackbar" top color="error">
<span style="color:#000">Points are too close</span>
<v-btn color="black" text @click="snackbar = false">Close</v-btn>
</v-snackbar>
</div>
</template>
<script>
import CVselect from '../../components/cv-select'
export default {
name: 'Output',
props:['value'],
components:{
CVselect
},
methods:{
takePointA(){
this.pointA = this.rawPoint;
this.calcSlope();
},
takePointB(){
this.pointB = this.rawPoint;
this.calcSlope();
},
calcSlope(){
if(this.pointA !== undefined && this.pointB !== undefined){
let m = (this.pointB[1] - this.pointA[1]) / (this.pointB[0] - this.pointA[0]);
let b = this.pointA[1] - (m * this.pointA[0]);
if(isNaN(m) === false && isNaN(b) === false){
this.sendSlope(m,b,true);
} else {
this.snackbar = true;
}
this.pointA = undefined;
this.pointB = undefined;
}
},
sendSlope(m,b,valid){
this.handleInput('m',m);
this.handleInput('b',b);
this.handleInput('isCalibrated',valid);
},
clearSlope(){
this.sendSlope(1,0,false);
this.pointA = undefined;
this.pointB = undefined;
}
},
data() {
return {
snackbar: false,
pointA: undefined,
pointB: undefined
}
},
computed:{
rawPoint:{
get(){
return this.$store.state.point.rawPoint;
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,34 @@
<template>
<div>
<CVrangeSlider v-model="value.hue" name="Hue" :min="0" :max="180" @input="handleInput('hue',value.hue)"></CVrangeSlider>
<CVrangeSlider v-model="value.saturation" name="Saturation" :min="0" :max="255" @input="handleInput('saturation',value.saturation)"></CVrangeSlider>
<CVrangeSlider v-model="value.value" name="Value" :min="0" :max="255" @input="handleInput('value',value.value)"></CVrangeSlider>
<CVswitch v-model="value.erode" name="Erode" @input="handleInput('erode',value.erode)"></CVswitch>
<CVswitch v-model="value.dilate" name="Dilate" @input="handleInput('dilate',value.dilate)"></CVswitch>
</div>
</template>
<script>
import CVrangeSlider from '../../components/cv-range-slider'
import CVswitch from '../../components/cv-switch'
export default {
name: 'Threshold',
props:['value'],
components:{
CVrangeSlider,
CVswitch
},
data() {
return {
}
},
computed:{
},
methods:{
}
}
</script>
<style lang="" scoped>
</style>

View File

@@ -0,0 +1,67 @@
<template>
<div>
<v-row align="center">
<v-col cols="6" class="colsClass">
<v-tabs fixed-tabs background-color="#212121" dark height="50" slider-color="#4baf62" v-model="selectedTab">
<v-tab to="">General</v-tab>
<v-tab to="">Cameras</v-tab>
</v-tabs>
<div style="padding-left:30px">
<component :is="selectedComponent"></component>
</div>
</v-col>
<v-col v-show="selectedTab === 1" class="colsClass">
<div class="videoClass">
<img :src="steamAdress">
</div>
</v-col>
</v-row>
</div>
</template>
<script>
import General from './SettingsViewes/General'
import Cameras from './SettingsViewes/Cameras'
export default {
name: 'SettingsTab',
components:{
General,
Cameras,
},
data() {
return {
selectedTab:0,
}
},
computed:{
selectedComponent(){
switch(this.selectedTab){
case 0:
return "General";
case 1:
return "Cameras";
}
},
steamAdress: {
get: function(){
return "http://"+location.hostname + ":"+ this.$store.state.port +"/stream.mjpg";
}
},
}
}
</script>
<style scoped>
.videoClass{
text-align: center;
}
.videoClass img{
height: auto !important;
width: 75%;
vertical-align: middle;
}
.colsClass{
padding: 0 !important;
}
</style>

View File

@@ -0,0 +1,69 @@
<template>
<div>
<CVselect name="Camera" :list="cameraList" v-model="currentCameraIndex"></CVselect>
<CVselect name="Resulotion" v-model="cameraSettings.resolution" :list="resolutionList"></CVselect>
<CVselect name="Stream Resulotion" v-model="cameraSettings.streamDivisor" :list="['1:1','1:2','1:4','1:6']"></CVselect>
<CVnumberinput name="Diagonal FOV" v-model="cameraSettings.fov" ></CVnumberinput>
<v-btn style="margin-top:10px" small color="#4baf62" @click="sendCameraSettings">Save Camera Settings</v-btn>
</div>
</template>
<script>
import CVselect from '../../components/cv-select'
import CVnumberinput from '../../components/cv-number-input'
export default {
name: 'CameraSettings',
components:{
CVselect,
CVnumberinput
},
data() {
return {
}
},
methods:{
sendCameraSettings(){
this.handleInput('cameraSettings',this.cameraSettings);
},
},
computed:{
currentCameraIndex:{
get(){
return this.$store.state.currentCameraIndex;
},
set(value){
this.$store.commit('currentCameraIndex',value);
}
},
cameraList:{
get(){
return this.$store.state.cameraList;
},
set(value){
this.$store.commit('cameraList',value);
}
},
resolutionList:{
get(){
return this.$store.state.resolutionList;
}
},
cameraSettings:{
get(){
return this.$store.state.cameraSettings;
},
set(value){
this.$store.commit('cameraSettings',value);
}
},
}
}
</script>
<style lang="" scoped>
</style>

View File

@@ -0,0 +1,53 @@
<template>
<div>
<CVnumberinput v-model="settings.teamNumber" name="Team Number"></CVnumberinput>
<CVradio v-model="settings.connectionType" :list="['DHCP','Static']"></CVradio>
<v-divider color="white"></v-divider>
<CVinput name="IP" v-model="settings.ip" :disabled="isDisabled"></CVinput>
<CVinput name="NetMask" v-model="settings.netmask" :disabled="isDisabled"></CVinput>
<CVinput name="Gateway" v-model="settings.gateway" :disabled="isDisabled"></CVinput>
<v-divider color="white"></v-divider>
<CVinput name="Hostname" v-model="settings.hostname"></CVinput>
<v-btn style="margin-top:10px" small color="#4baf62" @click="sendGeneralSettings">Save General Settings</v-btn>
</div>
</template>
<script>
import CVnumberinput from '../../components/cv-number-input'
import CVradio from '../../components/cv-radio'
import CVinput from '../../components/cv-input'
export default {
name: 'General',
components:{
CVnumberinput,
CVradio,
CVinput
},
data() {
return {
}
},
methods:{
sendGeneralSettings(){
this.handleInput('generalSettings',this.settings);
}
},
computed:{
isDisabled(){
if(this.settings.connectionType === 0){
return true;
}
return false;
},
settings:{
get(){
return this.$store.state.settings;
}
}
}
}
</script>
<style lang="" scoped>
</style>