[Time Conductor] Misc. bug fixes, additional documentation for conductor elements, moved and renamed LAD tick source

This commit is contained in:
Henry
2017-04-29 16:02:25 -07:00
parent 6628f93823
commit 31897ec520
10 changed files with 176 additions and 97 deletions

View File

@ -22,7 +22,10 @@
define(['EventEmitter'], function (EventEmitter) {
/**
* @implements TickSource
* A {@link openmct.TimeAPI.Clock} that updates the temporal bounds of the
* application based on UTC time values provided by a ticking local clock,
* with the periodicity specified.
* @param {number} period The periodicity with which the clock should tick
* @constructor
*/
function LocalClock(period) {
@ -33,7 +36,6 @@ define(['EventEmitter'], function (EventEmitter) {
*/
this.key = 'local';
this.cssClass = 'icon-clock';
this.label = 'Local Clock';
this.name = 'Local Clock';
this.description = "Updates every second, providing UTC timestamps from " +
"user's local computer.";
@ -62,6 +64,9 @@ define(['EventEmitter'], function (EventEmitter) {
}
};
/**
* @private
*/
LocalClock.prototype.tick = function () {
var now = Date.now();
this.emit("tick", now);
@ -102,6 +107,9 @@ define(['EventEmitter'], function (EventEmitter) {
return result;
};
/**
* @returns {number} The last value provided for a clock tick
*/
LocalClock.prototype.currentValue = function () {
return this.lastTick;
};

View File

@ -22,24 +22,21 @@
define([], function () {
/**
* This time system supports UTC dates and provides a ticking clock source.
* This time system supports UTC dates.
* @implements TimeSystem
* @constructor
*/
function UTCTimeSystem() {
/**
* Some metadata, which will be used to identify the time system in
* Metadata used to identify the time system in
* the UI
* @type {{key: string, name: string, cssClass: string}}
*/
this.key = 'utc';
this.name = 'UTC';
this.cssClass = 'icon-clock';
this.timeFormat = 'utc';
this.durationFormat = 'duration';
this.isUTCBased = true;
}

View File

@ -27,7 +27,10 @@ define([
UTCTimeSystem,
LocalClock
) {
var ONE_DAY = 24 * 60 * 60 * 1000;
/**
* Install a time system that supports UTC times. It also installs a local
* clock source that ticks every 100ms, providing UTC times.
*/
return function () {
return function (openmct) {
var timeSystem = new UTCTimeSystem();