[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

@ -82,7 +82,7 @@ define(
lastRange,
lastDomain,
handle;
var conductor = openmct.conductor;
var timeAPI = openmct.time;
// Populate the scope with axis information (specifically, options
// available for each axis.)
@ -185,7 +185,7 @@ define(
function changeTimeOfInterest(timeOfInterest) {
if (timeOfInterest !== undefined) {
var bounds = conductor.bounds();
var bounds = timeAPI.bounds();
var range = bounds.end - bounds.start;
$scope.toiPerc = ((timeOfInterest - bounds.start) / range) * 100;
$scope.toiPinned = true;
@ -208,8 +208,8 @@ define(
);
replot();
changeTimeOfInterest(conductor.timeOfInterest());
conductor.on("timeOfInterest", changeTimeOfInterest);
changeTimeOfInterest(timeAPI.timeOfInterest());
timeAPI.on("timeOfInterest", changeTimeOfInterest);
}
// Release the current subscription (called when scope is destroyed)
@ -218,7 +218,7 @@ define(
handle.unsubscribe();
handle = undefined;
}
conductor.off("timeOfInterest", changeTimeOfInterest);
timeAPI.off("timeOfInterest", changeTimeOfInterest);
}
function requery() {
@ -262,7 +262,7 @@ define(
requery();
}
self.setUnsynchedStatus($scope.domainObject, follow && self.isZoomed());
changeTimeOfInterest(conductor.timeOfInterest());
changeTimeOfInterest(timeAPI.timeOfInterest());
}
this.modeOptions = new PlotModeOptions([], subPlotFactory);
@ -286,11 +286,11 @@ define(
];
//Are some initialized bounds defined?
var bounds = conductor.bounds();
var bounds = timeAPI.bounds();
if (bounds &&
bounds.start !== undefined &&
bounds.end !== undefined) {
changeDisplayBounds(undefined, conductor.bounds(), conductor.follow());
changeDisplayBounds(undefined, timeAPI.bounds(), timeAPI.clock() !== undefined);
}
// Watch for changes to the selected axis