mirror of
https://github.com/nasa/openmct.git
synced 2025-01-20 03:36:44 +00:00
Merge branch 'master' of https://github.com/nasa/openmctweb into search
This commit is contained in:
commit
2a784115d5
@ -92,6 +92,7 @@
|
||||
</div>
|
||||
|
||||
<mct-chart draw="subplot.getDrawingObject()"
|
||||
ng-if="subplot.getTelemetryObjects().length > 0"
|
||||
ng-mousemove="subplot.hover($event)"
|
||||
mct-drag="subplot.continueDrag($event)"
|
||||
mct-drag-down="subplot.startDrag($event)"
|
||||
|
@ -29,6 +29,13 @@ define(
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var ZERO = function () { return 0; },
|
||||
EMPTY_SERIES = {
|
||||
getPointCount: ZERO,
|
||||
getDomainValue: ZERO,
|
||||
getRangeValue: ZERO
|
||||
};
|
||||
|
||||
/**
|
||||
* A telemetry capability provides a means of requesting telemetry
|
||||
* for a specific object, and for unwrapping the response (to get
|
||||
@ -102,7 +109,8 @@ define(
|
||||
// Pull out the relevant field from the larger,
|
||||
// structured response.
|
||||
function getRelevantResponse(response) {
|
||||
return ((response || {})[source] || {})[key] || {};
|
||||
return ((response || {})[source] || {})[key] ||
|
||||
EMPTY_SERIES;
|
||||
}
|
||||
|
||||
// Issue a request to the service
|
||||
@ -182,4 +190,4 @@ define(
|
||||
|
||||
return TelemetryCapability;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -118,6 +118,13 @@ define(
|
||||
|
||||
});
|
||||
|
||||
it("provides an empty series when telemetry is missing", function () {
|
||||
var series;
|
||||
mockTelemetryService.requestTelemetry.andReturn(mockPromise({}));
|
||||
telemetry.requestData({}).then(function (s) { series = s; });
|
||||
expect(series.getPointCount()).toEqual(0);
|
||||
});
|
||||
|
||||
it("provides telemetry metadata", function () {
|
||||
expect(telemetry.getMetadata()).toEqual({
|
||||
id: "testId", // from domain object
|
||||
@ -184,4 +191,4 @@ define(
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user