From fcd073c0102849bc273418c05642f4618a7d215f Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 16 Sep 2015 11:05:41 -0700 Subject: [PATCH] [Time Conductor] Tweak plot requery Tweak approach to requerying in plot, and track pending state so there is a visual indication that plotted data may be incomplete during panning with time conductor. WTD-1515 --- platform/features/plot/src/PlotController.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/platform/features/plot/src/PlotController.js b/platform/features/plot/src/PlotController.js index 47cf1f31c6..5555d93659 100644 --- a/platform/features/plot/src/PlotController.js +++ b/platform/features/plot/src/PlotController.js @@ -128,6 +128,7 @@ define( // Handle new telemetry data in this plot function updateValues() { + self.pending = false; if (handle) { setupModes(handle.getTelemetryObjects()); } @@ -143,6 +144,7 @@ define( // Display new historical data as it becomes available function addHistoricalData(domainObject, series) { + self.pending = false; updater.addHistorical(domainObject, series); self.modeOptions.getModeHandler().plotTelemetry(updater); self.update(); @@ -184,14 +186,16 @@ define( // Respond to a display bounds change (requery for data) function changeDisplayBounds(event, bounds) { + self.pending = true; + releaseSubscription(); + throttledRequery(); setBasePanZoom(bounds); - if (handle) { - recreateUpdater(); - throttledRequery(); - } } - throttledRequery = throttle(requestTelemetry, 250); + // Reestablish/reissue request for telemetry + throttledRequery = throttle(function () { + subscribe($scope.domainObject); + }, 250); this.modeOptions = new PlotModeOptions([], subPlotFactory); this.updateValues = updateValues; @@ -202,6 +206,8 @@ define( .forEach(updateSubplot); }); + self.pending = true; + // Subscribe to telemetry when a domain object becomes available $scope.$watch('domainObject', subscribe); @@ -308,7 +314,7 @@ define( PlotController.prototype.isRequestPending = function () { // Placeholder; this should reflect request state // when requesting historical telemetry - return false; + return this.pending; }; return PlotController;