Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/open933' into open933-frontend-b
Browse files Browse the repository at this point in the history
# Conflicts:
#	platform/features/conductor-v2/res/sass/time-conductor.scss
#	platform/features/conductor/res/sass/time-conductor.scss
  • Loading branch information
charlesh88 committed Jul 21, 2016
2 parents da7c636 + e6d8944 commit a10ded2
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 12 deletions.
2 changes: 2 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ define([
'./platform/features/pages/bundle',
'./platform/features/plot/bundle',
'./platform/features/timeline/bundle',
//'./platform/features/conductor/bundle',
'./platform/features/conductor-v2/bundle',
'./platform/features/conductor-v2-compatibility/bundle',
'./platform/features/table/bundle',
'./platform/forms/bundle',
'./platform/identity/bundle',
Expand Down
55 changes: 55 additions & 0 deletions platform/features/conductor-v2-compatibility/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

define([
"./src/ConductorTelemetryDecorator",
"./src/ConductorRepresenter",
'legacyRegistry'
], function (
ConductorTelemetryDecorator,
ConductorRepresenter,
legacyRegistry
) {

legacyRegistry.register("platform/features/conductor-v2-compatibility", {
"extensions": {
"representers": [
{
"implementation": ConductorRepresenter,
"depends": [
"timeConductor"
]
}
],
"components": [
{
"type": "decorator",
"provides": "telemetryService",
"implementation": ConductorTelemetryDecorator,
"depends": [
"timeConductor"
]
}
]
}
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

define(
[],
function () {

function ConductorRepresenter(
conductor,
scope,
element
) {
this.conductor = conductor;
this.scope = scope;
this.element = element;

this.boundsListener = this.boundsListener.bind(this);
this.timeSystemListener = this.timeSystemListener.bind(this);
}

ConductorRepresenter.prototype.boundsListener = function (bounds) {
this.scope.$broadcast('telemetry:display:bounds', {
start: bounds.start,
end: bounds.end,
domain: this.conductor.timeSystem().metadata.key
}, this.conductor.follow());
};

ConductorRepresenter.prototype.timeSystemListener = function (timeSystem) {
var bounds = this.conductor.bounds();
this.scope.$broadcast('telemetry:display:bounds', {
start: bounds.start,
end: bounds.end,
domain: timeSystem.metadata.key
});
};

// Handle a specific representation of a specific domain object
ConductorRepresenter.prototype.represent = function represent(representation) {
if (representation.key === 'browse-object') {
this.destroy();

this.conductor.on("bounds", this.boundsListener);
this.conductor.on("timeSystem", this.timeSystemListener);
}
};

ConductorRepresenter.prototype.destroy = function destroy() {
this.conductor.off("bounds", this.boundsListener);
this.conductor.off("timeSystem", this.timeSystemListener);
};

return ConductorRepresenter;
}
);

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

define(
function () {

/**
* Decorates the `telemetryService` such that requests are
* mediated by the time conductor. This is a modified version of the
* decorator used in the old TimeConductor that integrates with the
* new TimeConductor API.
*
* @constructor
* @memberof platform/features/conductor
* @implements {TelemetryService}
* @param {platform/features/conductor.TimeConductor} conductor
* the service which exposes the global time conductor
* @param {TelemetryService} telemetryService the decorated service
*/
function ConductorTelemetryDecorator(conductor, telemetryService) {
this.conductor = conductor;
this.telemetryService = telemetryService;
}

ConductorTelemetryDecorator.prototype.amendRequests = function (requests) {
var bounds = this.conductor.bounds(),
timeSystem = this.conductor.timeSystem();

function amendRequest(request) {
request = request || {};
request.start = bounds.start;
request.end = bounds.end;
request.domain = timeSystem.metadata.key;
return request;
}

return (requests || []).map(amendRequest);
};

ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) {
return this.telemetryService
.requestTelemetry(this.amendRequests(requests));
};

ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) {
return this.telemetryService
.subscribe(callback, requests);
};

return ConductorTelemetryDecorator;
}
);
19 changes: 12 additions & 7 deletions platform/features/plot/src/PlotController.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,18 @@ define(
}

// Respond to a display bounds change (requery for data)
function changeDisplayBounds(event, bounds) {
var domainAxis = $scope.axes[0];

domainAxis.chooseOption(bounds.domain);
updateDomainFormat();
setBasePanZoom(bounds);
requery();
function changeDisplayBounds(event, bounds, follow) {
//'hack' for follow mode
if (follow === true){
setBasePanZoom(bounds);
} else {
var domainAxis = $scope.axes[0];

domainAxis.chooseOption(bounds.domain);
updateDomainFormat();
setBasePanZoom(bounds);
requery();
}
}

this.modeOptions = new PlotModeOptions([], subPlotFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@ define(
this.$scope.loading = false;
};

/**
* @private
*/
HistoricalTableController.prototype.registerChangeListeners = function () {
TableController.prototype.registerChangeListeners.call(this);
//Change of bounds in time conductor
this.changeListeners.push(this.$scope.$on('telemetry:display:bounds',
this.boundsChange.bind(this))
);
};

/**
* @private
*/
HistoricalTableController.prototype.boundsChange = function (event, bounds, follow) {
// If in follow mode, don't bother re-subscribing, data will be
// received from existing subscription.
if (follow!==true) {
this.subscribe();
}
};

/**
* Processes an array of objects, formatting the telemetry available
* for them and setting it on scope when done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ define(
}
})
);

//Change of bounds in time conductor
this.changeListeners.push(this.$scope.$on('telemetry:display:bounds',
this.subscribe.bind(this))
);
};

/**
Expand Down

0 comments on commit a10ded2

Please sign in to comment.