mirror of
https://github.com/nasa/openmct.git
synced 2025-03-11 23:14:16 +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/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,
|
||||||
|
@ -53,7 +53,7 @@ define([
|
|||||||
"provides": "telemetryService",
|
"provides": "telemetryService",
|
||||||
"implementation": ConductorTelemetryDecorator,
|
"implementation": ConductorTelemetryDecorator,
|
||||||
"depends": [
|
"depends": [
|
||||||
"conductorService"
|
"timeConductor"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ define([
|
|||||||
"$scope",
|
"$scope",
|
||||||
"telemetryFormatter",
|
"telemetryFormatter",
|
||||||
"telemetryHandler",
|
"telemetryHandler",
|
||||||
|
"timeConductor",
|
||||||
"throttle",
|
"throttle",
|
||||||
"PLOT_FIXED_DURATION"
|
"PLOT_FIXED_DURATION"
|
||||||
]
|
]
|
||||||
|
@ -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,13 +229,20 @@ 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);
|
||||||
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);
|
this.modeOptions = new PlotModeOptions([], subPlotFactory);
|
||||||
@ -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);
|
||||||
|
@ -164,9 +164,11 @@ define(
|
|||||||
priorDomainDimensions = this.dimensions[0];
|
priorDomainDimensions = this.dimensions[0];
|
||||||
|
|
||||||
if (bufferArray.length > 0) {
|
if (bufferArray.length > 0) {
|
||||||
this.domainExtrema = bufferArray.map(function (lineBuffer) {
|
if (!this.domainExtrema) {
|
||||||
return lineBuffer.getDomainExtrema();
|
this.domainExtrema = bufferArray.map(function (lineBuffer) {
|
||||||
}).reduce(reduceExtrema);
|
return lineBuffer.getDomainExtrema();
|
||||||
|
}).reduce(reduceExtrema);
|
||||||
|
}
|
||||||
|
|
||||||
this.rangeExtrema = bufferArray.map(function (lineBuffer) {
|
this.rangeExtrema = bufferArray.map(function (lineBuffer) {
|
||||||
return lineBuffer.getRangeExtrema();
|
return lineBuffer.getRangeExtrema();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user