Wait for bounds change to reset telemetry collection data (#6857)

* Reset and re-request telemetry only after receiving bounds following a mode change

* Don't check for tick - just in case the mode is set without bounds

* Use the imagery view timeContext to get related telemetry.

---------

Co-authored-by: Khalid Adil <khalidadil29@gmail.com>
This commit is contained in:
Shefali Joshi
2023-07-31 11:15:08 -07:00
committed by GitHub
parent 50559ac502
commit f705bf9a61
4 changed files with 42 additions and 29 deletions

View File

@ -204,7 +204,8 @@ export default class TelemetryAPI {
*/
standardizeRequestOptions(options = {}) {
if (!Object.hasOwn(options, 'start')) {
if (options.timeContext?.getBounds()) {
const bounds = options.timeContext?.getBounds();
if (bounds?.start) {
options.start = options.timeContext.getBounds().start;
} else {
options.start = this.openmct.time.getBounds().start;
@ -212,7 +213,8 @@ export default class TelemetryAPI {
}
if (!Object.hasOwn(options, 'end')) {
if (options.timeContext?.getBounds()) {
const bounds = options.timeContext?.getBounds();
if (bounds?.end) {
options.end = options.timeContext.getBounds().end;
} else {
options.end = this.openmct.time.getBounds().end;