mirror of
https://github.com/nasa/openmct.git
synced 2025-03-10 22:43:55 +00:00
Hacked plot to work with new time conductor
This commit is contained in:
parent
15a608a861
commit
2a8a119b67
3
main.js
3
main.js
@ -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,
|
||||
|
@ -53,7 +53,7 @@ define([
|
||||
"provides": "telemetryService",
|
||||
"implementation": ConductorTelemetryDecorator,
|
||||
"depends": [
|
||||
"conductorService"
|
||||
"timeConductor"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@ define([
|
||||
"$scope",
|
||||
"telemetryFormatter",
|
||||
"telemetryHandler",
|
||||
"timeConductor",
|
||||
"throttle",
|
||||
"PLOT_FIXED_DURATION"
|
||||
]
|
||||
|
@ -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,13 +229,20 @@ 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);
|
||||
requery();
|
||||
|
||||
// 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);
|
||||
@ -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);
|
||||
|
@ -164,9 +164,11 @@ define(
|
||||
priorDomainDimensions = this.dimensions[0];
|
||||
|
||||
if (bufferArray.length > 0) {
|
||||
this.domainExtrema = bufferArray.map(function (lineBuffer) {
|
||||
return lineBuffer.getDomainExtrema();
|
||||
}).reduce(reduceExtrema);
|
||||
if (!this.domainExtrema) {
|
||||
this.domainExtrema = bufferArray.map(function (lineBuffer) {
|
||||
return lineBuffer.getDomainExtrema();
|
||||
}).reduce(reduceExtrema);
|
||||
}
|
||||
|
||||
this.rangeExtrema = bufferArray.map(function (lineBuffer) {
|
||||
return lineBuffer.getRangeExtrema();
|
||||
|
Loading…
x
Reference in New Issue
Block a user