Skip to content

Commit c27b379

Browse files
committed
[Time Conductor] Removed caching of UTC Time System defaults which was causing gaps in plots. Fixes nasa#1434
1 parent 4d6a0d4 commit c27b379

File tree

2 files changed

+11
-27
lines changed

2 files changed

+11
-27
lines changed

platform/features/conductor/utcTimeSystem/src/UTCTimeSystem.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ define([
4848

4949
this.fmts = ['utc'];
5050
this.sources = [new LocalClock($timeout, DEFAULT_PERIOD)];
51-
this.defaultValues = undefined;
5251
}
5352

5453
UTCTimeSystem.prototype = Object.create(TimeSystem.prototype);
@@ -65,25 +64,18 @@ define([
6564
return this.sources;
6665
};
6766

68-
UTCTimeSystem.prototype.defaults = function (defaults) {
69-
if (arguments.length > 0) {
70-
this.defaultValues = defaults;
71-
}
67+
UTCTimeSystem.prototype.defaults = function () {
68+
var now = Math.ceil(Date.now() / 1000) * 1000;
69+
var ONE_MINUTE = 60 * 1 * 1000;
70+
var FIFTY_YEARS = 50 * 365 * 24 * 60 * 60 * 1000;
7271

73-
if (this.defaultValues === undefined) {
74-
var now = Math.ceil(Date.now() / 1000) * 1000;
75-
var ONE_MINUTE = 60 * 1 * 1000;
76-
var FIFTY_YEARS = 50 * 365 * 24 * 60 * 60 * 1000;
77-
78-
this.defaultValues = {
79-
key: 'utc-default',
80-
name: 'UTC time system defaults',
81-
deltas: {start: FIFTEEN_MINUTES, end: 0},
82-
bounds: {start: now - FIFTEEN_MINUTES, end: now},
83-
zoom: {min: FIFTY_YEARS, max: ONE_MINUTE}
84-
};
85-
}
86-
return this.defaultValues;
72+
return {
73+
key: 'utc-default',
74+
name: 'UTC time system defaults',
75+
deltas: {start: FIFTEEN_MINUTES, end: 0},
76+
bounds: {start: now - FIFTEEN_MINUTES, end: now},
77+
zoom: {min: FIFTY_YEARS, max: ONE_MINUTE}
78+
};
8779
};
8880

8981
return UTCTimeSystem;

src/plugins/plugins.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ define([
6868
return ts.metadata.key === options.defaultTimeSystem;
6969
});
7070
if (timeSystem !== undefined) {
71-
defaults = timeSystem.defaults();
72-
73-
if (options.defaultTimespan !== undefined) {
74-
defaults.deltas.start = options.defaultTimespan;
75-
defaults.bounds.start = defaults.bounds.end - options.defaultTimespan;
76-
timeSystem.defaults(defaults);
77-
}
78-
7971
openmct.conductor.timeSystem(timeSystem, defaults.bounds);
8072
}
8173
}

0 commit comments

Comments
 (0)