Merge remote-tracking branch 'github-open/open229b' into open-master

This commit is contained in:
Pete Richards 2015-11-06 09:54:42 -08:00
commit 639546bf86
4 changed files with 19 additions and 11 deletions

View File

@ -102,7 +102,7 @@ define(
function updateDomain(value) {
var newDomain = conductor.domain(value);
conductorScope.parameters.format = newDomain.format;
repScope.$broadcast('telemetry:display:bounds', bounds());
broadcastBounds();
}
// telemetry domain metadata -> option for a select control
@ -139,8 +139,6 @@ define(
.$watch('ngModel.conductor.inner.end', updateConductorInner);
conductorScope
.$watch('ngModel.domain', updateDomain);
repScope.$on('telemetry:view', updateConductorInner);
};
ConductorRepresenter.prototype.conductorScope = function (s) {

View File

@ -245,9 +245,6 @@ define(
// Unsubscribe when the plot is destroyed
$scope.$on("$destroy", releaseSubscription);
// Notify any external observers that a new telemetry view is here
$scope.$emit("telemetry:view");
}
/**

View File

@ -39,6 +39,7 @@ define(
*/
function TelemetryHandle($q, subscription) {
var seriesMap = {},
active = true,
self = Object.create(subscription);
// Request a telemetry series for this specific object
@ -50,7 +51,7 @@ define(
// Store it for subsequent lookup
seriesMap[id] = series;
// Notify callback of new series data, if there is one
if (callback) {
if (callback && active) {
callback(telemetryObject, series);
}
// Pass it along for promise-chaining
@ -61,6 +62,10 @@ define(
return telemetry.requestData(request).then(receiveSeries);
}
self.unsubscribe = function () {
active = false;
return subscription.unsubscribe();
};
/**
* Get the most recently obtained telemetry data series associated

View File

@ -85,10 +85,18 @@ define(
it("exposes subscription API", function () {
// Should still expose methods from the provided subscription
expect(handle.unsubscribe)
.toBe(mockSubscription.unsubscribe);
expect(handle.getTelemetryObjects)
.toBe(mockSubscription.getTelemetryObjects);
// (though these may have been wrapped)
expect(mockSubscription.getTelemetryObjects)
.not.toHaveBeenCalled();
handle.getTelemetryObjects();
expect(mockSubscription.getTelemetryObjects)
.toHaveBeenCalled();
expect(mockSubscription.unsubscribe)
.not.toHaveBeenCalled();
handle.unsubscribe();
expect(mockSubscription.unsubscribe)
.toHaveBeenCalled();
});
it("provides an interface for historical requests", function () {