Time conductor Improvement 625 (#2432)

* when utc based time systems are switched, the bounds will stay the same

* inline check for utcBased time systems
This commit is contained in:
Deep Tailor 2019-07-25 10:08:57 -07:00 committed by Pegah Sarram
parent 7fe4a77c43
commit c760190a29
2 changed files with 10 additions and 2 deletions

View File

@ -167,6 +167,7 @@ export default {
this.xAxis.scale(this.xScale); this.xAxis.scale(this.xScale);
this.xAxis.tickFormat(utcMultiTimeFormat); this.xAxis.tickFormat(utcMultiTimeFormat);
this.axisElement.call(this.xAxis); this.axisElement.call(this.xAxis);
this.setScale();
}, },
getActiveFormatter() { getActiveFormatter() {
let timeSystem = this.openmct.time.timeSystem(); let timeSystem = this.openmct.time.timeSystem();

View File

@ -60,7 +60,6 @@ export default {
.filter(menuOption => menuOption.clock === (clock && clock.key)) .filter(menuOption => menuOption.clock === (clock && clock.key))
.map(menuOption => JSON.parse(JSON.stringify(this.openmct.time.timeSystems.get(menuOption.timeSystem)))); .map(menuOption => JSON.parse(JSON.stringify(this.openmct.time.timeSystems.get(menuOption.timeSystem))));
}, },
setTimeSystemFromView(timeSystem) { setTimeSystemFromView(timeSystem) {
if (timeSystem.key !== this.selectedTimeSystem.key) { if (timeSystem.key !== this.selectedTimeSystem.key) {
let activeClock = this.openmct.time.clock(); let activeClock = this.openmct.time.clock();
@ -69,7 +68,15 @@ export default {
timeSystem: timeSystem.key timeSystem: timeSystem.key
}); });
if (activeClock === undefined) { if (activeClock === undefined) {
this.openmct.time.timeSystem(timeSystem.key, configuration.bounds); let bounds;
if (this.selectedTimeSystem.isUTCBased && timeSystem.isUTCBased) {
bounds = this.openmct.time.bounds();
} else {
bounds = configuration.bounds;
}
this.openmct.time.timeSystem(timeSystem.key, bounds);
} else { } else {
this.openmct.time.timeSystem(timeSystem.key); this.openmct.time.timeSystem(timeSystem.key);
this.openmct.time.clockOffsets(configuration.clockOffsets); this.openmct.time.clockOffsets(configuration.clockOffsets);