Skip to content

Commit

Permalink
update frontend to handle confidence cutoff
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Feb 14, 2024
1 parent 8f4a835 commit dadaddd
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions dvl-a50/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ <h1>DVL Configuration</h1>
<br />
<v-row>
<v-col>
<v-card height="650">
<v-card height="650" width="300">
<h2>Settings</h2>
<v-switch v-model="this.enabled" inset :label="`Enable DVL driver`" @change="setDvlEnabled($event)"></v-switch>
<v-switch v-model="this.rangefinder" inset :label="`Send range data through MAVLink`" @change="setDvlAsRangefinder($event)"></v-switch>
<v-switch v-model="this.rangefinder" inset :label="`Send range data through MAVLink`" @change="setDvlAsRangefinder"></v-switch>
<label for="confidence-cutoff">Confidence Cutoff:</label>
<v-slider id="confidence-cutoff" @change="setConfidenceCutoff" v-model="confidenceCutoff" :min="0" :max="100" :step="1">
<template #prepend>
<span>{{ confidenceCutoff }}</span>
</template>
</v-slider>
<h2>Status</h2>
<div>
<textarea readonly style="width:100%;"
Expand Down Expand Up @@ -130,10 +136,17 @@ <h2>Water Linked DVL Configuration Page</h2>
orientationOptions: {
"Downwards (LED pointing forward)": 1,
"Forward (Experimental)": 2,
}
},
confidenceCutoff: 10,
}
},
methods: {
setConfidenceCutoff(value) {
const request = new XMLHttpRequest();
request.timeout = 800;
request.open('GET', 'cutoff/' + value, true);
request.send();
},
updateDvlStatus() {
axios.get('/get_status', { timeout: 1000 })
.then((response) => {
Expand All @@ -148,11 +161,12 @@ <h2>Water Linked DVL Configuration Page</h2>
}
this.rangefinder = data.rangefinder
this.messageToSend = data.messageToSend
this.hostname = data.hostname
this.hostname = data.hostname
this.messageToSend = data.should_send
if (this.newHostname == null) {
this.newHostname = data.hostname
}
this.confidenceCutoff = data.confidence_cutoff
})
.catch((error) => {
this.status = `Unable to talk to DVL service: ${error}`
Expand Down

0 comments on commit dadaddd

Please sign in to comment.