[Plot] Initially establish bounds

Initially establish domain bounds with time controller,
WTD-1515
This commit is contained in:
Victor Woeltjen 2015-09-04 15:31:47 -07:00
parent c58ffb4a52
commit b66759e519
3 changed files with 21 additions and 16 deletions

View File

@ -92,6 +92,8 @@ define(
conductorScope.$watch('conductor.outer[1]', updateConductorOuter);
conductorScope.$watch('conductor.inner[0]', updateConductorInner);
conductorScope.$watch('conductor.inner[1]', updateConductorInner);
repScope.$on('telemetry:view', updateConductorInner);
}
// Handle a specific representation of a specific domain object

View File

@ -95,6 +95,17 @@ define(
}
}
// Change the displayable bounds
function setBasePanZoom(unused, bounds) {
var start = bounds.start,
end = bounds.end;
if (updater) {
updater.setDomainBounds(start, end);
self.update();
}
lastBounds = bounds;
}
// Reinstantiate the plot updater (e.g. because we have a
// new subscription.) This will clear the plot.
function recreateUpdater() {
@ -108,6 +119,10 @@ define(
handle,
($scope.axes[1].active || {}).key
);
// Keep any externally-provided bounds
if (lastBounds) {
setBasePanZoom({}, lastBounds);
}
}
// Handle new telemetry data in this plot
@ -139,17 +154,6 @@ define(
}
}
// Change the displayable bounds
function setBasePanZoom(unused, bounds) {
var start = bounds.start,
end = bounds.end;
if (updater) {
updater.setDomainBounds(start, end);
self.update();
}
lastBounds = bounds;
}
// Create a new subscription; telemetrySubscriber gets
// to do the meaningful work here.
function subscribe(domainObject) {
@ -182,10 +186,6 @@ define(
if (handle) {
recreateUpdater();
requestTelemetry();
// Keep any externally-provided bounds
if (lastBounds) {
setBasePanZoom({}, lastBounds);
}
}
}
@ -210,6 +210,8 @@ 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

@ -307,7 +307,8 @@ define(
// Suppress follow behavior if we have windowed in on the past
this.hasSpecificDomainBounds = true;
this.following = end >= this.domainExtrema[1];
this.following =
!this.domainExtrema || (end >= this.domainExtrema[1]);
};
/**