mirror of
https://github.com/nasa/openmct.git
synced 2025-03-10 14:34:08 +00:00
Improved support from plot
This commit is contained in:
parent
5b2eb72b16
commit
aa4a5e56f9
3
main.js
3
main.js
@ -103,7 +103,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,
|
||||||
|
@ -39,21 +39,26 @@ define(
|
|||||||
function ConductorTelemetryDecorator(conductor, telemetryService) {
|
function ConductorTelemetryDecorator(conductor, telemetryService) {
|
||||||
this.conductor = conductor;
|
this.conductor = conductor;
|
||||||
this.telemetryService = telemetryService;
|
this.telemetryService = telemetryService;
|
||||||
|
|
||||||
|
this.amendRequests = ConductorTelemetryDecorator.prototype.amendRequests.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
function amendRequest(request, bounds, timeSystem) {
|
||||||
|
request = request || {};
|
||||||
|
request.start = bounds.start;
|
||||||
|
request.end = bounds.end;
|
||||||
|
request.domain = timeSystem.metadata.key;
|
||||||
|
|
||||||
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConductorTelemetryDecorator.prototype.amendRequests = function (requests) {
|
ConductorTelemetryDecorator.prototype.amendRequests = function (requests) {
|
||||||
var bounds = this.conductor.bounds(),
|
var bounds = this.conductor.bounds(),
|
||||||
timeSystem = this.conductor.timeSystem();
|
timeSystem = this.conductor.timeSystem();
|
||||||
|
|
||||||
function amendRequest(request) {
|
return (requests || []).map(function (request) {
|
||||||
request = request || {};
|
return amendRequest(request, bounds, timeSystem);
|
||||||
request.start = bounds.start;
|
});
|
||||||
request.end = bounds.end;
|
|
||||||
request.domain = timeSystem.metadata.key;
|
|
||||||
return request;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (requests || []).map(amendRequest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) {
|
ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) {
|
||||||
@ -62,8 +67,19 @@ define(
|
|||||||
};
|
};
|
||||||
|
|
||||||
ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) {
|
ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) {
|
||||||
return this.telemetryService
|
var unsubscribeFunc = this.telemetryService.subscribe(callback, this.amendRequests(requests)),
|
||||||
.subscribe(callback, requests);
|
conductor = this.conductor,
|
||||||
|
self = this;
|
||||||
|
|
||||||
|
function amendRequests() {
|
||||||
|
return self.amendRequests(requests);
|
||||||
|
}
|
||||||
|
|
||||||
|
conductor.on('bounds', amendRequests);
|
||||||
|
return function() {
|
||||||
|
unsubscribeFunc();
|
||||||
|
conductor.off('bounds', amendRequests);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return ConductorTelemetryDecorator;
|
return ConductorTelemetryDecorator;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user