[Plot] Follow universal time controller

Follow displayable area of universal time controller,
WTD-1515
This commit is contained in:
Victor Woeltjen
2015-09-04 13:57:26 -07:00
parent 3ce40ab870
commit c2985d61b7
3 changed files with 51 additions and 8 deletions

View File

@ -138,6 +138,16 @@ define(
}
}
// Change the displayable bounds
function setBasePanZoom(event, bounds) {
var start = bounds.start,
end = bounds.end;
if (updater) {
updater.setDomainBounds(start, end);
self.update();
}
}
// Create a new subscription; telemetrySubscriber gets
// to do the meaningful work here.
function subscribe(domainObject) {
@ -172,11 +182,14 @@ define(
this.scheduleUpdate = throttle(function () {
self.modeOptions.getModeHandler().getSubPlots()
.forEach(updateSubplot);
});
}, 50);
// Subscribe to telemetry when a domain object becomes available
$scope.$watch('domainObject', subscribe);
// Respond to external bounds changes
$scope.$on("telemetry:display:bounds", setBasePanZoom);
// Unsubscribe when the plot is destroyed
$scope.$on("$destroy", releaseSubscription);