Do not respond to bounds tick changes (#3106)

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
Andrew Henry
2020-06-23 13:14:17 -07:00
committed by GitHub
parent 0399766ccd
commit 31ac67b393

View File

@ -24,7 +24,7 @@ import {
setAllSearchParams setAllSearchParams
} from 'utils/openmctLocation'; } from 'utils/openmctLocation';
const TIME_EVENTS = ['bounds', 'timeSystem', 'clock', 'clockOffsets']; const TIME_EVENTS = ['timeSystem', 'clock', 'clockOffsets'];
const SEARCH_MODE = 'tc.mode'; const SEARCH_MODE = 'tc.mode';
const SEARCH_TIME_SYSTEM = 'tc.timeSystem'; const SEARCH_TIME_SYSTEM = 'tc.timeSystem';
const SEARCH_START_BOUND = 'tc.startBound'; const SEARCH_START_BOUND = 'tc.startBound';
@ -42,6 +42,7 @@ export default class URLTimeSettingsSynchronizer {
this.destroy = this.destroy.bind(this); this.destroy = this.destroy.bind(this);
this.updateTimeSettings = this.updateTimeSettings.bind(this); this.updateTimeSettings = this.updateTimeSettings.bind(this);
this.setUrlFromTimeApi = this.setUrlFromTimeApi.bind(this); this.setUrlFromTimeApi = this.setUrlFromTimeApi.bind(this);
this.updateBounds = this.updateBounds.bind(this);
openmct.on('start', this.initialize); openmct.on('start', this.initialize);
openmct.on('destroy', this.destroy); openmct.on('destroy', this.destroy);
@ -54,7 +55,7 @@ export default class URLTimeSettingsSynchronizer {
TIME_EVENTS.forEach(event => { TIME_EVENTS.forEach(event => {
this.openmct.time.on(event, this.setUrlFromTimeApi); this.openmct.time.on(event, this.setUrlFromTimeApi);
}); });
this.openmct.time.on('bounds', this.updateBounds);
} }
destroy() { destroy() {
@ -65,6 +66,7 @@ export default class URLTimeSettingsSynchronizer {
TIME_EVENTS.forEach(event => { TIME_EVENTS.forEach(event => {
this.openmct.time.off(event, this.setUrlFromTimeApi); this.openmct.time.off(event, this.setUrlFromTimeApi);
}); });
this.openmct.time.on('bounds', this.updateBounds);
} }
updateTimeSettings() { updateTimeSettings() {
@ -72,7 +74,6 @@ export default class URLTimeSettingsSynchronizer {
if (!this.isUrlUpdateInProgress) { if (!this.isUrlUpdateInProgress) {
let timeParameters = this.parseParametersFromUrl(); let timeParameters = this.parseParametersFromUrl();
if (this.areTimeParametersValid(timeParameters)) { if (this.areTimeParametersValid(timeParameters)) {
this.setTimeApiFromUrl(timeParameters); this.setTimeApiFromUrl(timeParameters);
} else { } else {
@ -138,6 +139,12 @@ export default class URLTimeSettingsSynchronizer {
} }
} }
updateBounds(bounds, isTick) {
if (!isTick) {
this.setUrlFromTimeApi();
}
}
setUrlFromTimeApi() { setUrlFromTimeApi() {
let searchParams = getAllSearchParams(); let searchParams = getAllSearchParams();
let clock = this.openmct.time.clock(); let clock = this.openmct.time.clock();