mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
Do not respond to bounds tick changes (#3106)
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
@ -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();
|
||||||
|
Reference in New Issue
Block a user