[Time Conductor] Using new API

This commit is contained in:
Henry 2016-10-22 13:09:05 -07:00
parent 843c678b0b
commit 482eb4a5e8
6 changed files with 20 additions and 19 deletions

View File

@ -29,8 +29,8 @@ define(
* labelled 'ticks'. It requires 'start' and 'end' integer values to
* be specified as attributes.
*/
function TimeOfInterestController($scope, conductor, formatService) {
this.conductor = conductor;
function TimeOfInterestController($scope, openmct, formatService) {
this.conductor = openmct.conductor;
this.formatService = formatService;
this.format = undefined;
this.toiText = undefined;
@ -43,11 +43,11 @@ define(
this[key] = TimeOfInterestController.prototype[key].bind(this);
}.bind(this));
conductor.on('timeOfInterest', this.changeTimeOfInterest);
conductor.on('timeSystem', this.changeTimeSystem);
if (conductor.timeSystem()) {
this.changeTimeSystem(conductor.timeSystem());
var toi = conductor.timeOfInterest();
this.conductor.on('timeOfInterest', this.changeTimeOfInterest);
this.conductor.on('timeSystem', this.changeTimeSystem);
if (this.conductor.timeSystem()) {
this.changeTimeSystem(this.conductor.timeSystem());
var toi = this.conductor.timeOfInterest();
if (toi) {
this.changeTimeOfInterest(toi);
}

View File

@ -69,7 +69,7 @@ define(
telemetryHandler,
throttle,
PLOT_FIXED_DURATION,
conductor
openmct
) {
var self = this,
plotTelemetryFormatter =
@ -82,6 +82,7 @@ define(
lastRange,
lastDomain,
handle;
var conductor = openmct.conductor;
// Populate the scope with axis information (specifically, options
// available for each axis.)

View File

@ -36,7 +36,7 @@ define(
* @param telemetryFormatter
* @constructor
*/
function HistoricalTableController($scope, telemetryHandler, telemetryFormatter, $timeout, conductor) {
function HistoricalTableController($scope, telemetryHandler, telemetryFormatter, $timeout, openmct) {
var self = this;
this.$timeout = $timeout;
@ -49,7 +49,7 @@ define(
}
});
TableController.call(this, $scope, telemetryHandler, telemetryFormatter, conductor);
TableController.call(this, $scope, telemetryHandler, telemetryFormatter, openmct);
}
HistoricalTableController.prototype = Object.create(TableController.prototype);

View File

@ -12,7 +12,7 @@ define(
* @param element
* @constructor
*/
function MCTTableController($scope, $timeout, element, exportService, formatService, conductor) {
function MCTTableController($scope, $timeout, element, exportService, formatService, openmct) {
var self = this;
this.$scope = $scope;
@ -24,7 +24,7 @@ define(
this.resultsHeader = this.element.find('.mct-table>thead').first();
this.sizingTableBody = this.element.find('.sizing-table>tbody').first();
this.$scope.sizingRow = {};
this.conductor = conductor;
this.conductor = openmct.conductor;
this.toiFormatter = undefined;
this.formatService = formatService;
@ -118,8 +118,8 @@ define(
this.conductor.on('bounds', this.changeBounds);
// If time system defined, set initially
if (conductor.timeSystem()) {
this.changeTimeSystem(conductor.timeSystem());
if (this.conductor.timeSystem()) {
this.changeTimeSystem(this.conductor.timeSystem());
}
}
}.bind(this));

View File

@ -44,7 +44,7 @@ define(
$scope,
telemetryHandler,
telemetryFormatter,
conductor
openmct
) {
var self = this;
@ -55,7 +55,7 @@ define(
this.table = new TableConfiguration($scope.domainObject,
telemetryFormatter);
this.changeListeners = [];
this.conductor = conductor;
this.conductor = openmct.conductor;
$scope.rows = [];
@ -73,8 +73,8 @@ define(
this.sortByTimeSystem = this.sortByTimeSystem.bind(this);
conductor.on('timeSystem', this.sortByTimeSystem);
conductor.off('timeSystem', this.sortByTimeSystem);
this.conductor.on('timeSystem', this.sortByTimeSystem);
this.conductor.off('timeSystem', this.sortByTimeSystem);
}
TelemetryTableController.prototype.sortByTimeSystem = function (timeSystem) {

View File

@ -87,7 +87,7 @@ define(
'$element',
'exportService',
'formatService',
'timeConductor',
'openmct',
MCTTableController
],
controllerAs: "table",