added is calibrated bool to calib method

This commit is contained in:
ori agranat
2019-09-19 23:27:21 +03:00
parent 28f22511d4
commit 2966f8ccfc
19 changed files with 17 additions and 30 deletions

View File

@@ -44,7 +44,7 @@ import chrange from './ch-range.vue'
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);
this.sendSlope(m,b,true);
} else{
this.$Message.error("Point A and B are to close apart");
}
@@ -53,13 +53,14 @@ import chrange from './ch-range.vue'
}
},
clearPoints:function(){
this.sendSlope(1,0);
this.sendSlope(1,0,false);
this.pointA = undefined;
this.pointB = undefined;
},
sendSlope(m,b){
sendSlope(m,b,valid){
this.$socket.sendObj({'M':m});
this.$socket.sendObj({'B':b});
this.$socket.sendObj({'is_calibrated':valid});
}
},
computed: {