[Plot] Fix wiring on plot updater

Fix usages of the plot updater, introduced to track real-time
telemetry to remove the need to cache values elsewhere. This
allows memory usage to be decreased for WTD-751.
This commit is contained in:
Victor Woeltjen 2015-01-29 11:22:31 -08:00
parent 57f20ba110
commit 5e2e0b4116
5 changed files with 12 additions and 7 deletions

View File

@ -21,7 +21,7 @@
{ {
"key": "PlotController", "key": "PlotController",
"implementation": "PlotController.js", "implementation": "PlotController.js",
"depends": [ "$scope", "telemetryFormatter" ] "depends": [ "$scope", "telemetryFormatter", "telemetrySubscriber" ]
} }
] ]
} }

View File

@ -113,7 +113,7 @@
</div> </div>
<span class="t-wait-spinner loading" ng-show="plot.isRequestPending"> <span class="t-wait-spinner loading" ng-show="plot.isRequestPending()">
</span> </span>
</div> </div>
<div ng-if="$last" class="gl-plot-axis-area gl-plot-x"> <div ng-if="$last" class="gl-plot-axis-area gl-plot-x">

View File

@ -78,7 +78,10 @@ define(
} }
function updateValues() { function updateValues() {
modeOptions.getModeHandler().plotTelemetry(updater); if (updater) {
updater.update();
modeOptions.getModeHandler().plotTelemetry(updater);
}
update(); update();
} }
@ -92,8 +95,10 @@ define(
domainObject, domainObject,
updateValues updateValues
); );
setupAxes(subscription.getMetadata()); if (subscription) {
recreateUpdater(); setupAxes(subscription.getMetadata());
recreateUpdater();
}
} }
$scope.$watch('domainObject', subscribe); $scope.$watch('domainObject', subscribe);

View File

@ -38,7 +38,7 @@ define(
return { return {
buffer: buf, buffer: buf,
color: PlotPalette.getFloatColor(i), color: PlotPalette.getFloatColor(i),
points: buf.length / 2 points: prepared.getLength(i)
}; };
}); });

View File

@ -35,7 +35,7 @@ define(
subplot.getDrawingObject().lines = [{ subplot.getDrawingObject().lines = [{
buffer: buffer, buffer: buffer,
color: PlotPalette.getFloatColor(0), color: PlotPalette.getFloatColor(0),
points: buffer.length / 2 points: prepared.getLength(index)
}]; }];
subplot.update(); subplot.update();