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 Oct 11, 2024
1 parent dbdb04a commit 5f497aa
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions dvl-a50/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ <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-btn id="btn-load-dvl" type="button" class="btn btn-primary" @click="loadParams('dvl');">Load parameters for DVL</v-btn>
<v-btn id="btn-load-dvl-gps" type="button" class="btn btn-primary" @click="loadParams('dvl_gps');">Load parameters for DVL+GPS</v-btn>
<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 @@ -133,10 +139,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 @@ -156,6 +169,7 @@ <h2>Water Linked DVL Configuration Page</h2>
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 5f497aa

Please sign in to comment.