Skip to content

Commit

Permalink
Issue #9 Fix search groups
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmas committed Oct 14, 2023
1 parent f067694 commit d7f2771
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/hud/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ function doSearch (str) {
idList.push(results[i].satId);
}

const dispGroup = new SatGroup('idList', idList);
const dispGroup = new SatGroup('search-results', 'Search Results', 'idList', idList);
dispGroup.reload();
lastResultGroup = dispGroup;

app.groups.selectGroup(dispGroup);
Expand Down
15 changes: 10 additions & 5 deletions src/viewer/orbit-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,19 @@ function draw (pMatrix, camMatrix) { // lol what do I do here
if (app.groups.selectedGroup) {
gl.uniform4fv(pathShader.uColor, groupColor);
const satellites = app.groups.selectedGroup.sats;
satellites.forEach((id) => {
gl.bindBuffer(gl.ARRAY_BUFFER, glBuffers[id]);
gl.vertexAttribPointer(pathShader.aPos, 3, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.LINE_STRIP, 0, NUM_SEGS + 1);
satellites.forEach((satellite) => {
const id = satellite.satId;
if (glBuffers[id]) {
gl.bindBuffer(gl.ARRAY_BUFFER, glBuffers[id]);
gl.vertexAttribPointer(pathShader.aPos, 3, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.LINE_STRIP, 0, NUM_SEGS + 1);
} else {
logger.warn(`glBuffers[${id}] is undefined`);
}
});
}

// gl.depthMask(true);
// gl.depthMask(true);
gl.disable(gl.BLEND);
}

Expand Down
4 changes: 4 additions & 0 deletions src/viewer/sat-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class SatGroups {
return this.groups[groupId];
}

getSelectedGroup () {
return this.selectedGroup;
}

reloadGroups () {
const keys = Object.keys(this.groups);
for (let i = 0; i < keys.length; i++) {
Expand Down

0 comments on commit d7f2771

Please sign in to comment.