mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-01 02:41:42 +00:00
Proper no target found fix, and snackbar error now showing
This commit is contained in:
@@ -21,8 +21,21 @@
|
||||
this.$emit('update');
|
||||
},
|
||||
takePoint() {
|
||||
this.handleInput('point', this.rawPoint);
|
||||
this.$emit('update');
|
||||
let hasNaN = false;
|
||||
console.log(this.rawPoint);
|
||||
for (let i = 0; i < this.rawPoint.length&&!hasNaN; i++) {
|
||||
hasNaN = !(this.rawPoint[i]||this.rawPoint[i]===0);
|
||||
}
|
||||
if(!hasNaN){//if array doesnt have undefined values
|
||||
console.log("sending points");
|
||||
this.handleInput('point', this.rawPoint);
|
||||
this.$emit('update');
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("sending error");
|
||||
this.$emit('snackbar');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<v-divider dark color="white"/>
|
||||
<CVselect name="Calibration Mode" v-model="value.calibrationMode" :list="['None','Single point','Dual point']"
|
||||
@input="handleData('calibrationMode')"/>
|
||||
<component :raw-point="rawPoint" :is="selectedComponent" @update="doUpdate"/>
|
||||
<component :raw-point="rawPoint" :is="selectedComponent" @update="doUpdate" @snackbar="snackbar=true"/>
|
||||
<v-snackbar :timeout="3000" v-model="snackbar" top color="error">
|
||||
<span style="color:#000">Points are too close</span>
|
||||
<span style="color:#000">{{getErrorMsg()}}</span>
|
||||
<v-btn color="black" text @click="snackbar = false">Close</v-btn>
|
||||
</v-snackbar>
|
||||
</div>
|
||||
@@ -40,6 +40,15 @@
|
||||
},
|
||||
doUpdate() {
|
||||
this.$emit('update')
|
||||
},
|
||||
getErrorMsg()
|
||||
{
|
||||
switch (this.value.calibrationMode) {
|
||||
case 1:
|
||||
return "No target found";
|
||||
case 2:
|
||||
return "Points are too close"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user