Hacked plot to work with new time conductor

This commit is contained in:
Henry 2016-07-08 19:25:42 -07:00
parent 15a608a861
commit 2a8a119b67
6 changed files with 31 additions and 18 deletions

View File

@ -101,7 +101,8 @@ define([
'./platform/entanglement/bundle', './platform/entanglement/bundle',
'./platform/search/bundle', './platform/search/bundle',
'./platform/status/bundle', './platform/status/bundle',
'./platform/commonUI/regions/bundle' './platform/commonUI/regions/bundle',
'./example/msl/bundle'
], function (Main, legacyRegistry) { ], function (Main, legacyRegistry) {
return { return {
legacyRegistry: legacyRegistry, legacyRegistry: legacyRegistry,

View File

@ -53,7 +53,7 @@ define([
"provides": "telemetryService", "provides": "telemetryService",
"implementation": ConductorTelemetryDecorator, "implementation": ConductorTelemetryDecorator,
"depends": [ "depends": [
"conductorService" "timeConductor"
] ]
} }
], ],

View File

@ -34,22 +34,21 @@ define(
* the service which exposes the global time conductor * the service which exposes the global time conductor
* @param {TelemetryService} telemetryService the decorated service * @param {TelemetryService} telemetryService the decorated service
*/ */
function ConductorTelemetryDecorator(conductorService, telemetryService) { function ConductorTelemetryDecorator(conductor, telemetryService) {
this.conductorService = conductorService; this.conductor = conductor;
this.telemetryService = telemetryService; this.telemetryService = telemetryService;
} }
ConductorTelemetryDecorator.prototype.amendRequests = function (requests) { ConductorTelemetryDecorator.prototype.amendRequests = function (requests) {
var conductor = this.conductorService.getConductor(), var conductor = this.conductor,
start = conductor.displayStart(), bounds = conductor.bounds(),
end = conductor.displayEnd(), start = bounds.start,
domain = conductor.domain(); end = bounds.end;
function amendRequest(request) { function amendRequest(request) {
request = request || {}; request = request || {};
request.start = start; request.start = start;
request.end = end; request.end = end;
request.domain = domain.key;
return request; return request;
} }

View File

@ -72,6 +72,7 @@ define([
"$scope", "$scope",
"telemetryFormatter", "telemetryFormatter",
"telemetryHandler", "telemetryHandler",
"timeConductor",
"throttle", "throttle",
"PLOT_FIXED_DURATION" "PLOT_FIXED_DURATION"
] ]

View File

@ -65,6 +65,7 @@ define(
$scope, $scope,
telemetryFormatter, telemetryFormatter,
telemetryHandler, telemetryHandler,
conductor,
throttle, throttle,
PLOT_FIXED_DURATION PLOT_FIXED_DURATION
) { ) {
@ -125,6 +126,7 @@ define(
duration = PLOT_FIXED_DURATION; duration = PLOT_FIXED_DURATION;
updater = new PlotUpdater(handle, domain, range, duration); updater = new PlotUpdater(handle, domain, range, duration);
lastDomain = domain; lastDomain = domain;
lastRange = range; lastRange = range;
@ -227,14 +229,21 @@ define(
} }
// Respond to a display bounds change (requery for data) // Respond to a display bounds change (requery for data)
function changeDisplayBounds(event, bounds) { function changeDisplayBounds(bounds) {
var domainAxis = $scope.axes[0]; //var domainAxis = $scope.axes[0];
domainAxis.chooseOption(bounds.domain); //domainAxis.chooseOption(bounds.domain);
updateDomainFormat(); //updateDomainFormat();
setBasePanZoom(bounds); setBasePanZoom(bounds);
// re-query historical. What do we do about ticks? Don't want
// to do a historical re-query on every tick. Need a
// forward-buffer I think...
// For now, if follow mode, don't requery
if (!conductor.follow()) {
requery(); requery();
} }
}
this.modeOptions = new PlotModeOptions([], subPlotFactory); this.modeOptions = new PlotModeOptions([], subPlotFactory);
this.updateValues = updateValues; this.updateValues = updateValues;
@ -262,7 +271,8 @@ define(
$scope.$watch('domainObject', subscribe); $scope.$watch('domainObject', subscribe);
// Respond to external bounds changes // Respond to external bounds changes
$scope.$on("telemetry:display:bounds", changeDisplayBounds); //$scope.$on("telemetry:display:bounds", changeDisplayBounds);
conductor.on('bounds', changeDisplayBounds);
// Unsubscribe when the plot is destroyed // Unsubscribe when the plot is destroyed
$scope.$on("$destroy", releaseSubscription); $scope.$on("$destroy", releaseSubscription);

View File

@ -164,9 +164,11 @@ define(
priorDomainDimensions = this.dimensions[0]; priorDomainDimensions = this.dimensions[0];
if (bufferArray.length > 0) { if (bufferArray.length > 0) {
if (!this.domainExtrema) {
this.domainExtrema = bufferArray.map(function (lineBuffer) { this.domainExtrema = bufferArray.map(function (lineBuffer) {
return lineBuffer.getDomainExtrema(); return lineBuffer.getDomainExtrema();
}).reduce(reduceExtrema); }).reduce(reduceExtrema);
}
this.rangeExtrema = bufferArray.map(function (lineBuffer) { this.rangeExtrema = bufferArray.map(function (lineBuffer) {
return lineBuffer.getRangeExtrema(); return lineBuffer.getRangeExtrema();