Merge branch 'ui-integration' of https://gitlab.com/chameleon-vision/Chameleon-Vision into ui-integration

# Conflicts:
#	New client/chameleon-client/src/views/CameraViewes/ContoursTab.vue
#	New client/chameleon-client/src/views/CameraViewes/InputTab.vue
#	New client/chameleon-client/src/views/CameraViewes/OutputTab.vue
#	New client/chameleon-client/src/views/CameraViewes/ThresholdTab.vue
This commit is contained in:
Omer
2019-10-12 03:43:44 +03:00
4 changed files with 70 additions and 22 deletions

View File

@@ -11,7 +11,7 @@
</template>
<template v-slot:append>
<v-text-field :value="localValue[1]" @input="handleChange" @focus="appendFocused = true" @blur="appendFocused = false" class="mt-0 pt-0" hide-details single-line type="number" style="width: 50px" :step="step"></v-text-field>
<v-text-field :value="localValue[1]" @input="handleChange" @focus="appendFocused = true" @blur="appendFocused = false" class="mt-0 pt-0" hide-details single-line type="number" style="width: 50px" :step="step"></v-text-field>
</template>
</v-range-slider>
</v-col>

View File

@@ -11,20 +11,21 @@ export default new Vuex.Store({
state: {
settings:{},
pipeline:{
Exposure:0,
Brightness:0,
Orientation:0,
Hue:[0,15],
Saturation:[0,15],
Value:[0,25],
Erode:false,
Dilate:false,
Area:[0,12],
Ratio:[0,12],
Extent:[0,12],
TargetGrouping:0,
TargetIntersection:0,
SortMode:0
exposure:0,
brightness:0,
orientation:0,
hue:[0,15],
saturation:[0,15],
value:[0,25],
erode:false,
dilate:false,
area:[0,12],
ratio:[0,12],
extent:[0,12],
targetGrouping:0,
targetIntersection:0,
sortMode:0,
isBinary:0
},
cameraSettings:{},
resolutionList:[],

View File

@@ -58,7 +58,7 @@
</v-col>
<v-col cols="6" class="colsClass">
<div>
<v-tabs background-color="#212121" dark height="50" slider-color="#4baf62" centered style="padding-bottom:10px">
<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)">
<v-tab>Normal</v-tab>
<v-tab>Threshold</v-tab>
</v-tabs>
@@ -91,7 +91,7 @@ import CVicon from '../components/cv-icon'
CVicon
},
methods:{
test(value){
test(value){
console.log(value)
}
},

View File

@@ -1,19 +1,23 @@
<template>
<div>
<CVselect name="SortMode" v-model="value.SortMode" :list="['Largest','Smallest','Highest','Lowest','Rightmost','Leftmost','Centermost']" @input="handleInput('sortMode',value.SortMode)"></CVselect>
<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">Take Point A</v-btn>
<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">Take Point B</v-btn>
<v-btn small color="#4baf62" @click="takePointB">Take Point B</v-btn>
</v-col>
<v-col>
<v-btn small color="yellow darken-3">Clear All Points</v-btn>
<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>
@@ -25,9 +29,52 @@ import CVselect from '../../components/cv-select'
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.raw;
}
}
}
}