[Time API] Modified public Time API to support registration of time systems and clocks, setting of active clock, simplification of clocks and time systems, setting of offsets(deltas) and other changes as per #1265 and #1474. Refactoring of UI code to support changes.

This commit is contained in:
Henry
2017-04-14 17:06:46 -07:00
parent fd3312734c
commit f17417a541
43 changed files with 1287 additions and 1800 deletions

View File

@@ -64,9 +64,12 @@ define(
$scope.rows = [];
this.table = new TableConfiguration($scope.domainObject,
openmct);
this.lastBounds = this.openmct.conductor.bounds();
this.lastBounds = this.openmct.time.bounds();
this.lastRequestTime = 0;
this.telemetry = new TelemetryCollection();
if (this.lastBounds) {
this.telemetry.bounds(this.lastBounds);
}
/*
* Create a new format object from legacy object, and replace it
@@ -95,7 +98,7 @@ define(
this.registerChangeListeners();
}.bind(this));
this.setScroll(this.openmct.conductor.follow());
this.setScroll(this.openmct.time.clock() !== undefined);
this.$scope.$on("$destroy", this.destroy);
}
@@ -120,9 +123,9 @@ define(
var sortColumn;
scope.defaultSort = undefined;
if (timeSystem) {
if (timeSystem !== undefined) {
this.table.columns.forEach(function (column) {
if (column.getKey() === timeSystem.metadata.key) {
if (column.getKey() === timeSystem.key) {
sortColumn = column;
}
});
@@ -151,9 +154,9 @@ define(
}.bind(this)
);
this.openmct.conductor.on('timeSystem', this.sortByTimeSystem);
this.openmct.conductor.on('bounds', this.changeBounds);
this.openmct.conductor.on('follow', this.setScroll);
this.openmct.time.on('timeSystem', this.sortByTimeSystem);
this.openmct.time.on('bounds', this.changeBounds);
this.openmct.time.on('follow', this.setScroll);
this.telemetry.on('added', this.addRowsToTable);
this.telemetry.on('discarded', this.removeRowsFromTable);
@@ -187,12 +190,7 @@ define(
* will be removed from the table.
* @param {openmct.TimeConductorBounds~TimeConductorBounds} bounds
*/
TelemetryTableController.prototype.changeBounds = function (bounds) {
var follow = this.openmct.conductor.follow();
var isTick = follow &&
bounds.start !== this.lastBounds.start &&
bounds.end !== this.lastBounds.end;
TelemetryTableController.prototype.changeBounds = function (bounds, isTick) {
if (isTick) {
this.telemetry.bounds(bounds);
} else {
@@ -207,9 +205,9 @@ define(
*/
TelemetryTableController.prototype.destroy = function () {
this.openmct.conductor.off('timeSystem', this.sortByTimeSystem);
this.openmct.conductor.off('bounds', this.changeBounds);
this.openmct.conductor.off('follow', this.setScroll);
this.openmct.time.off('timeSystem', this.sortByTimeSystem);
this.openmct.time.off('bounds', this.changeBounds);
this.openmct.time.off('follow', this.setScroll);
this.subscriptions.forEach(function (subscription) {
subscription();
@@ -260,8 +258,8 @@ define(
// if data matches selected time system
this.telemetry.sort(undefined);
var timeSystem = this.openmct.conductor.timeSystem();
if (timeSystem) {
var timeSystem = this.openmct.time.timeSystem();
if (timeSystem !== undefined) {
this.sortByTimeSystem(timeSystem);
}
@@ -278,7 +276,7 @@ define(
TelemetryTableController.prototype.getHistoricalData = function (objects) {
var self = this;
var openmct = this.openmct;
var bounds = openmct.conductor.bounds();
var bounds = openmct.time.bounds();
var scope = this.$scope;
var rowData = [];
var processedObjects = 0;
@@ -432,7 +430,7 @@ define(
var scope = this.$scope;
this.telemetry.clear();
this.telemetry.bounds(this.openmct.conductor.bounds());
this.telemetry.bounds(this.openmct.time.bounds());
this.$scope.loading = true;