-
+
Calibrate:
- Take Point A
+ Take Point A
- Take Point B
+ Take Point B
- Clear All Points
+ Clear All Points
+
+ Points are too close
+ Close
+
@@ -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 @@