Skip to content

Commit

Permalink
[Time Conductor] Using new API
Browse files Browse the repository at this point in the history
  • Loading branch information
akhenry committed Oct 22, 2016
1 parent 843c678 commit 482eb4a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion platform/features/plot/src/PlotController.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ define(
telemetryHandler,
throttle,
PLOT_FIXED_DURATION,
conductor
openmct
) {
var self = this,
plotTelemetryFormatter =
Expand All @@ -82,6 +82,7 @@ define(
lastRange,
lastDomain,
handle;
var conductor = openmct.conductor;

// Populate the scope with axis information (specifically, options
// available for each axis.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions platform/features/table/src/controllers/MCTTableController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ define(
$scope,
telemetryHandler,
telemetryFormatter,
conductor
openmct
) {
var self = this;

Expand All @@ -55,7 +55,7 @@ define(
this.table = new TableConfiguration($scope.domainObject,
telemetryFormatter);
this.changeListeners = [];
this.conductor = conductor;
this.conductor = openmct.conductor;

$scope.rows = [];

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion platform/features/table/src/directives/MCTTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ define(
'$element',
'exportService',
'formatService',
'timeConductor',
'openmct',
MCTTableController
],
controllerAs: "table",
Expand Down

0 comments on commit 482eb4a

Please sign in to comment.