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/search/bundle',
'./platform/status/bundle',
'./platform/commonUI/regions/bundle'
'./platform/commonUI/regions/bundle',
'./example/msl/bundle'
], function (Main, legacyRegistry) {
return {
legacyRegistry: legacyRegistry,

View File

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

View File

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

View File

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

View File

@ -65,6 +65,7 @@ define(
$scope,
telemetryFormatter,
telemetryHandler,
conductor,
throttle,
PLOT_FIXED_DURATION
) {
@ -125,6 +126,7 @@ define(
duration = PLOT_FIXED_DURATION;
updater = new PlotUpdater(handle, domain, range, duration);
lastDomain = domain;
lastRange = range;
@ -227,14 +229,21 @@ define(
}
// Respond to a display bounds change (requery for data)
function changeDisplayBounds(event, bounds) {
var domainAxis = $scope.axes[0];
function changeDisplayBounds(bounds) {
//var domainAxis = $scope.axes[0];
domainAxis.chooseOption(bounds.domain);
updateDomainFormat();
//domainAxis.chooseOption(bounds.domain);
//updateDomainFormat();
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();
}
}
this.modeOptions = new PlotModeOptions([], subPlotFactory);
this.updateValues = updateValues;
@ -262,7 +271,8 @@ define(
$scope.$watch('domainObject', subscribe);
// 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
$scope.$on("$destroy", releaseSubscription);

View File

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