Merge branch 'master' into updated-checklists

This commit is contained in:
Shefali Joshi
2020-05-18 12:12:26 -07:00
committed by GitHub
6 changed files with 65 additions and 19 deletions

4
API.md
View File

@ -427,8 +427,8 @@ Each telemetry value description has an object defining hints. Keys in this thi
Known hints: Known hints:
* `domain`: Indicates that the value represents the "input" of a datum. Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first. * `domain`: Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first.
* `range`: Indicates that the value is the "output" of a datum. Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values. * `range`: Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values.
* `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available. * `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available.
##### The Time Conductor and Telemetry ##### The Time Conductor and Telemetry

View File

@ -50,7 +50,8 @@ define([
values: [ values: [
{ {
key: "name", key: "name",
name: "Name" name: "Name",
format: "string"
}, },
{ {
key: "utc", key: "utc",

View File

@ -70,15 +70,18 @@ export default class ConditionClass extends EventEmitter {
return; return;
} }
this.criteria.forEach(criterion => { if (this.isTelemetryUsed(datum.id)) {
if (this.isAnyOrAllTelemetry(criterion)) {
criterion.getResult(datum, this.conditionManager.telemetryObjects);
} else {
criterion.getResult(datum);
}
});
this.result = evaluateResults(this.criteria.map(criterion => criterion.result), this.trigger); this.criteria.forEach(criterion => {
if (this.isAnyOrAllTelemetry(criterion)) {
criterion.getResult(datum, this.conditionManager.telemetryObjects);
} else {
criterion.getResult(datum);
}
});
this.result = evaluateResults(this.criteria.map(criterion => criterion.result), this.trigger);
}
} }
isAnyOrAllTelemetry(criterion) { isAnyOrAllTelemetry(criterion) {

View File

@ -47,17 +47,24 @@ describe("The condition", function () {
name: "Test Object", name: "Test Object",
telemetry: { telemetry: {
values: [{ values: [{
key: "some-key", key: "value",
name: "Some attribute", name: "Value",
hints: {
range: 2
}
},
{
key: "utc",
name: "Time",
format: "utc",
hints: { hints: {
domain: 1 domain: 1
} }
}, { }, {
key: "some-other-key", key: "testSource",
name: "Another attribute", source: "value",
hints: { name: "Test",
range: 1 format: "string"
}
}] }]
} }
}; };
@ -136,4 +143,38 @@ describe("The condition", function () {
expect(result).toBeTrue(); expect(result).toBeTrue();
expect(conditionObj.criteria.length).toEqual(0); expect(conditionObj.criteria.length).toEqual(0);
}); });
it("gets the result of a condition when new telemetry data is received", function () {
conditionObj.getResult({
value: '0',
utc: 'Hi',
id: testTelemetryObject.identifier.key
});
expect(conditionObj.result).toBeTrue();
});
it("gets the result of a condition when new telemetry data is received", function () {
conditionObj.getResult({
value: '1',
utc: 'Hi',
id: testTelemetryObject.identifier.key
});
expect(conditionObj.result).toBeFalse();
});
it("keeps the old result new telemetry data is not used by it", function () {
conditionObj.getResult({
value: '0',
utc: 'Hi',
id: testTelemetryObject.identifier.key
});
expect(conditionObj.result).toBeTrue();
conditionObj.getResult({
value: '1',
utc: 'Hi',
id: '1234'
});
expect(conditionObj.result).toBeTrue();
});
}); });

View File

@ -172,6 +172,7 @@ export default {
&& this.embed.bounds.end !== bounds.end; && this.embed.bounds.end !== bounds.end;
const isFixedTimespanMode = !this.openmct.time.clock(); const isFixedTimespanMode = !this.openmct.time.clock();
this.openmct.time.stopClock();
window.location.href = link; window.location.href = link;
let message = ''; let message = '';

View File

@ -325,7 +325,7 @@ define([
} else { } else {
// A history entry is created by startMarquee, need to remove // A history entry is created by startMarquee, need to remove
// if marquee zoom doesn't occur. // if marquee zoom doesn't occur.
this.back(); this.plotHistory.pop();
} }
this.$scope.rectangles = []; this.$scope.rectangles = [];
this.marquee = undefined; this.marquee = undefined;