Skip to content

Commit

Permalink
Merge pull request #6 from ISSUIUC/feature/homecoord-options
Browse files Browse the repository at this point in the history
Added form options for gps coords
  • Loading branch information
ary-dz authored Mar 3, 2023
2 parents f40e942 + 47c2127 commit 20304ae
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.DS_Store
node_modules/
# build/*.js
# build/*.js.map
# build/Satellite
# build/Terrain
build/*.js
build/*.js.map
build/Satellite
build/Terrain
.vs/
!*.html
!*.css
Expand Down
14 changes: 14 additions & 0 deletions build/homecoords.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
<h1>
Set Home Coordinates
</h1>
<table>
<tr>
<td><label id="opt" class="label1" for="OptDrop">Options: </label></td>
<td>
<select id="OptDrop" name="OptDrop">
<option value="0">Select Location</option>
<option value="talbot">Talbot</option>
<option value="qcrc">QCRC</option>
<option value="michiana">Michiana</option>
<option value="irec">IREC</option>
</select>
</td>
</tr>
</table>
<table>
<tr>
<td>
Expand Down
19 changes: 19 additions & 0 deletions src/homecoords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@ let submit_button = <HTMLButtonElement>document.getElementById("submit");
let lat_input = <HTMLInputElement>document.getElementById("lat");
let long_input = <HTMLInputElement>document.getElementById("long");
let alt_input = <HTMLInputElement>document.getElementById("alt");
let optdrop = <HTMLSelectElement>document.getElementById("OptDrop");

let coord_dict: { [key: string]: number[] } = {
'talbot': [40.1119, -88.2282, 0],
'qcrc': [41.488167, -89.500778, 0],
'michiana': [41.774273, -86.572435, 0],
'irec': [32.990, -106.9754, 0]
}

submit_button.addEventListener("click", () => {
ipcRenderer.send('homecoords', parseFloat(lat_input.value), parseFloat(long_input.value), parseFloat(alt_input.value));
// call_sign_input.value = "";
});

optdrop.addEventListener("change", () => {
let opt = optdrop.options[optdrop.selectedIndex].value;
// alert(opt);
if (opt === "0") {
return;
}
lat_input.value = coord_dict[opt][0].toString();
long_input.value = coord_dict[opt][1].toString();
alt_input.value = coord_dict[opt][2].toString();
});
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,10 @@ export function demo() {
LSM_IMU_az: val * rand,
// gps_lat: 40.1119 + val / 1000, //Talbot Lat
// gps_long: -88.2282 + rand / 1000, //Talbot Long
gps_lat: 41.488167 + val / 1000, //QCRC
gps_long: -89.500778 + rand / 1000, //QCRC
// gps_lat: 41.488167 + val / 1000, //QCRC
// gps_long: -89.500778 + rand / 1000, //QCRC
gps_lat: 41.774273 + val / 1000, // Michiana
gps_long: -86.572435 + rand / 1000, // Michiana
// gps_lat: 32.990 + val / 1000, //IREC
// gps_long: -106.9754 + rand / 1000, //IREC
// gps_lat: 0,
Expand Down

0 comments on commit 20304ae

Please sign in to comment.