diff --git a/New client/chameleon-client/src/components/cv-range-slider.vue b/New client/chameleon-client/src/components/cv-range-slider.vue index e5f088847..470c58ae4 100644 --- a/New client/chameleon-client/src/components/cv-range-slider.vue +++ b/New client/chameleon-client/src/components/cv-range-slider.vue @@ -11,7 +11,7 @@ diff --git a/New client/chameleon-client/src/store.js b/New client/chameleon-client/src/store.js index 19db724d2..1b4c7e6a7 100644 --- a/New client/chameleon-client/src/store.js +++ b/New client/chameleon-client/src/store.js @@ -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:[], diff --git a/New client/chameleon-client/src/views/Camera.vue b/New client/chameleon-client/src/views/Camera.vue index 8a1f9e2a1..283fb3dfc 100644 --- a/New client/chameleon-client/src/views/Camera.vue +++ b/New client/chameleon-client/src/views/Camera.vue @@ -58,7 +58,7 @@
- + Normal Threshold @@ -91,7 +91,7 @@ import CVicon from '../components/cv-icon' CVicon }, methods:{ - test(value){ + test(value){ console.log(value) } }, diff --git a/New client/chameleon-client/src/views/CameraViewes/ContoursTab.vue b/New client/chameleon-client/src/views/CameraViewes/ContoursTab.vue index 4a30a3feb..f0b5fcc94 100644 --- a/New client/chameleon-client/src/views/CameraViewes/ContoursTab.vue +++ b/New client/chameleon-client/src/views/CameraViewes/ContoursTab.vue @@ -1,10 +1,10 @@ diff --git a/New client/chameleon-client/src/views/CameraViewes/InputTab.vue b/New client/chameleon-client/src/views/CameraViewes/InputTab.vue index 3462ed31a..6346a2656 100644 --- a/New client/chameleon-client/src/views/CameraViewes/InputTab.vue +++ b/New client/chameleon-client/src/views/CameraViewes/InputTab.vue @@ -1,8 +1,8 @@ diff --git a/New client/chameleon-client/src/views/CameraViewes/OutputTab.vue b/New client/chameleon-client/src/views/CameraViewes/OutputTab.vue index dcf9f7556..e1857dc9d 100644 --- a/New client/chameleon-client/src/views/CameraViewes/OutputTab.vue +++ b/New client/chameleon-client/src/views/CameraViewes/OutputTab.vue @@ -1,19 +1,23 @@ @@ -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; + } } } } diff --git a/New client/chameleon-client/src/views/CameraViewes/ThresholdTab.vue b/New client/chameleon-client/src/views/CameraViewes/ThresholdTab.vue index 4431a325a..856a17432 100644 --- a/New client/chameleon-client/src/views/CameraViewes/ThresholdTab.vue +++ b/New client/chameleon-client/src/views/CameraViewes/ThresholdTab.vue @@ -1,10 +1,10 @@